/* aleemont.dev
   Same base as blog.aleemont.dev: Inter, stone neutrals, light/dark, little motion.
   Differences: a slightly wider column for diagrams, an orange accent instead of
   blue, and monospace for dates, stacks and the diagrams. */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #fafaf9;
  --fg: #1c1917;
  --muted: #6b6560;
  --border: #e7e5e4;
  --surface: #f0efed;
  --accent: #c2410c;
  --accent-soft: #fff1e6;
  --heat-0: #e7e5e4;
  --heat-1: #fdba74;
  --heat-2: #fb923c;
  --heat-3: #ea580c;
  --heat-4: #9a3412;
  --bar: #a8a29e;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f11;
  --fg: #ececee;
  --muted: #9a9aa2;
  --border: #25252a;
  --surface: #1a1a1f;
  --accent: #fb923c;
  --accent-soft: #2a170b;
  --heat-0: #222227;
  --heat-1: #7c2d12;
  --heat-2: #c2410c;
  --heat-3: #f97316;
  --heat-4: #fdba74;
  --bar: #5c5c66;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f11;
    --fg: #ececee;
    --muted: #9a9aa2;
    --border: #25252a;
    --surface: #1a1a1f;
    --accent: #fb923c;
    --accent-soft: #2a170b;
    --heat-0: #222227;
    --heat-1: #7c2d12;
    --heat-2: #c2410c;
    --heat-3: #f97316;
    --heat-4: #fdba74;
    --bar: #5c5c66;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.7 var(--font);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 0.25rem; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; text-wrap: balance; }
p, li { text-wrap: pretty; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.ic { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }
.skip { position: absolute; left: 1rem; top: -3rem; padding: 0.4rem 0.7rem; background: var(--fg); color: var(--bg); border-radius: 0.4rem; }
.skip:focus { top: 1rem; }

/* Header: name, three links, language and theme */
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 1rem; margin-bottom: 3.5rem; }
.brand { color: var(--fg); font-weight: 650; letter-spacing: -0.02em; text-decoration: none; margin-right: auto; }
.nav { display: flex; gap: 1rem; font-size: 0.9375rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 0.5rem 0; }
.nav a:hover { color: var(--fg); }
.actions { display: flex; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0;
  border: 0; border-radius: 0.6rem; background: none; color: var(--muted); cursor: pointer;
  text-decoration: none; font: 600 0.75rem/1 var(--mono);
}
.icon-btn:hover { background: var(--surface); color: var(--fg); }
.icon-btn .ic { width: 1.2rem; height: 1.2rem; }
.theme-toggle .ic:first-child { display: none; }
:root[data-theme="dark"] .theme-toggle .ic:first-child { display: block; }
:root[data-theme="dark"] .theme-toggle .ic:last-child { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ic:first-child { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ic:last-child { display: none; }
}
@media (scripting: none) { .theme-toggle { display: none; } }

/* Intro */
h1 { font-size: 2.25rem; margin: 0; }
.role { color: var(--muted); margin: 0.15rem 0 1.75rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 1.5rem; }
.contact-links a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0; color: var(--fg); text-decoration: none; }
.contact-links a:hover { color: var(--accent); }
.contact-links .ic { color: var(--muted); }

/* Sections */
section { margin-top: 4rem; }
section.intro { margin-top: 0; }
h2 { font-size: 1.35rem; margin: 0 0 1.25rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.1rem; }
.subtitle { color: var(--muted); font-weight: 400; letter-spacing: 0; }
.stack, .when, .fsm-label, .tl-label { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }
.stack { margin-bottom: 0.4rem; }
.links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.links a, .links span { padding: 0.3rem 0; }

/* Featured projects */
.project { margin-bottom: 3rem; }
.project h3 { font-size: 1.35rem; margin: 0 0 0.6rem; }
.project h3 a { color: var(--fg); text-decoration: none; }
.project h3 a:hover { color: var(--accent); }
.project h3 .subtitle { font-size: 1.0625rem; margin-left: 0.25rem; }

/* Other projects */
.list-title { margin: 2.5rem 0 0.5rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 1rem 0; border-top: 1px solid var(--border); }
.list li:last-child { border-bottom: 1px solid var(--border); }
.list p { margin: 0 0 0.35rem; }
.list .stack { margin: 0; }
.list-head .subtitle { margin-left: 0.25rem; }

/* Dated rows: experience, education, posts, documents */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.rows li:last-child { border-bottom: 1px solid var(--border); }
.rows p { margin: 0; }
.row-text { color: var(--muted); font-size: 0.9688rem; }
.when { padding-top: 0.2rem; font-variant-numeric: tabular-nums; }
.posts a { color: var(--fg); font-weight: 500; text-decoration: none; }
.posts a:hover { color: var(--accent); }
.row-head a { color: var(--fg); font-weight: 600; text-decoration: none; }
.row-head a:hover { color: var(--accent); }

/* Diagrams */
.diagram { margin: 1.5rem 0 1.25rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: 0.75rem; }
.diagram figcaption, .chart-note { margin-top: 0.9rem; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.fsm { display: grid; gap: 0.75rem; }
.fsm-phase { display: grid; grid-template-columns: 5rem 1fr; gap: 0.75rem; align-items: start; }
.fsm-label { margin: 0.3rem 0 0; }
.fsm-states { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; margin: 0; padding: 0; }
.fsm-states li { display: inline-flex; gap: 0.4rem; font: 0.75rem/1 var(--mono); padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 0.35rem; }
.fsm-n { color: var(--muted); }
.fsm-states li.key { border-color: var(--accent); background: var(--accent-soft); }
.fsm-states li.key .fsm-n { color: var(--accent); }

.frame { display: flex; font: 0.75rem/1 var(--mono); border: 1px solid var(--border); border-radius: 0.4rem; overflow: hidden; margin-bottom: 0.5rem; }
.frame span { padding: 0.6rem 0.55rem; white-space: nowrap; }
.f-hdr { background: var(--accent-soft); border-right: 1px solid var(--border); }
.f-pay { flex: 1; text-align: center; color: var(--muted); }
.f-crc { background: var(--surface); border-left: 1px solid var(--border); }
.tl-label { margin: 0.75rem 0 0.35rem; }
.tl-row { display: flex; flex-wrap: wrap; gap: 3px; }
.tl-row span { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 0.35rem; font: 0.75rem/1 var(--mono); border-radius: 0.3rem; }
.tl-row .d { background: var(--fg); color: var(--bg); }
.tl-row .a { color: var(--muted); border: 1px dashed var(--bar); }
.tl-row .lost { background: none; color: var(--muted); border: 1px dashed var(--muted); text-decoration: line-through; }
.tl-row .sack { background: var(--accent-soft); color: var(--fg); border: 1px solid var(--accent); }
.tl-row .re { background: var(--accent); color: var(--bg); }

/* Activity heatmap */
.activity { margin: 0; }
.heatmap-scroll { overflow-x: auto; scrollbar-width: thin; }
.heatmap { display: block; width: 100%; min-width: 38rem; height: auto; }
.heatmap rect:hover { stroke: var(--fg); stroke-width: 1.5; }
.hm-month { font: 10px var(--mono); fill: var(--muted); }
.heatmap .l0 { fill: var(--heat-0); }
.heatmap .l1 { fill: var(--heat-1); }
.heatmap .l2 { fill: var(--heat-2); }
.heatmap .l3 { fill: var(--heat-3); }
.heatmap .l4 { fill: var(--heat-4); }
.activity figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.9375rem; }

/* Project pages */
.case h1 { margin-top: 0.5rem; }
.case h2 { margin-top: 2.5rem; padding-top: 0; border-top: 0; }
.case .stack { margin-bottom: 1.5rem; }
.back { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.back:hover { color: var(--fg); }
.facts { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9375rem; }
.facts th, .facts td { text-align: left; padding: 0.45rem 0; border-top: 1px solid var(--border); vertical-align: top; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 1px solid var(--border); }
.facts th { width: 9rem; font: 0.8125rem var(--mono); color: var(--muted); font-weight: 400; padding-top: 0.6rem; }
.next { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Bar chart */
.chart { margin: 1.5rem 0; padding: 1.25rem; border: 1px solid var(--border); border-radius: 0.75rem; }
.chart-title { font-weight: 600; font-size: 0.9375rem; margin-bottom: 1rem; }
.bars { display: grid; gap: 0.7rem; }
.bar-row { display: grid; grid-template-columns: minmax(0, 14rem) 1fr 3.75rem; gap: 0.8rem; align-items: center; font-size: 0.875rem; }
.bar-label { color: var(--muted); }
.bar-row.hl .bar-label { color: var(--fg); }
.bar-track { height: 0.75rem; background: var(--surface); border-radius: 0 4px 4px 0; }
.bar { display: block; height: 100%; width: var(--w); background: var(--bar); border-radius: 0 4px 4px 0; }
.bar-row.hl .bar { background: var(--accent); }
.bar-value { font: 0.8125rem var(--mono); text-align: right; font-variant-numeric: tabular-nums; }

/* Contact and footer */
#contact p { margin-bottom: 0.5rem; }
.site-footer { margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.875rem; }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

@media (max-width: 34rem) {
  body { padding: 1rem 1rem 2.5rem; }
  .site-header { margin-bottom: 2.5rem; }
  .nav { order: 3; width: 100%; }
  h1 { font-size: 1.9rem; }
  .rows li { grid-template-columns: 1fr; gap: 0.1rem; }
  .fsm-phase { grid-template-columns: 1fr; gap: 0.35rem; }
  .fsm-label { margin: 0; }
  .bar-row { grid-template-columns: 1fr 3.5rem; row-gap: 0.25rem; }
  .bar-label { grid-column: 1 / -1; }
  .diagram, .chart { padding: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  main { animation: rise 0.35s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
  a, .icon-btn { transition: color 0.15s, background-color 0.15s; }
  .bar { transform-origin: left; animation: grow 0.6s ease-out both; }
  @keyframes grow { from { transform: scaleX(0); } }
  body { transition: background-color 0.25s, color 0.25s; }
}
@media (forced-colors: active) {
  .heatmap rect { stroke: CanvasText; }
  .bar { background: Highlight; }
}

/* Photos */
.photo { margin: 1.5rem 0 1.25rem; }
.photo img { display: block; width: 100%; height: auto; border-radius: 0.75rem; background: var(--surface); }
.photo figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.8125rem; }

.hw.with-photo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.5rem; align-items: start; margin: 1.5rem 0; }
.hw.with-photo .photo, .hw.with-photo .facts { margin: 0; }
@media (max-width: 34rem) { .hw.with-photo { grid-template-columns: 1fr; } }
.gallery { margin: 1.5rem 0 1.25rem; }
.gallery-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.75rem; }
.gallery img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0.75rem; background: var(--surface); }
.gallery figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.8125rem; }
.photo.banner img { max-height: 44rem; object-fit: cover; }
.photo.portrait { max-width: 26rem; margin-left: auto; margin-right: auto; }
.hw .photo.portrait { max-width: none; }
