/* Layout: a drawing sheet. Hero with a live Mach 2.5 airfoil sketch and a title block, then ruled sections with a narrow label column and a wide content column. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --fg: #12202e;
  --muted: #55657a;
  --rule: #c9d2de;
  --accent: #1d4ed8;
  --accent-soft: #dbe5fb;
  --on-accent: #ffffff;
  --display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1520; --surface: #142030; --fg: #e6edf6; --muted: #92a3b8;
    --rule: #2a3a4f; --accent: #7aa2ff; --accent-soft: #1d2f55; --on-accent: #0d1520;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1520; --surface: #142030; --fg: #e6edf6; --muted: #92a3b8;
  --rule: #2a3a4f; --accent: #7aa2ff; --accent-soft: #1d2f55; --on-accent: #0d1520;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--fg);
  font: 400 16px/1.65 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 1080px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.label { font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* nav */
nav { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; padding-block: 20px; border-bottom: 1px solid var(--rule); }
nav .mark { font: 600 17px var(--display); text-decoration: none; color: var(--fg); }
nav ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
nav ul a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav ul a:hover { color: var(--accent); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px 48px; align-items: center; padding-block: 56px 40px; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 700; }
.hero .role { margin: 20px 0 0; font-size: 19px; max-width: 34ch; }
.hero .intro { margin: 16px 0 0; color: var(--muted); max-width: 52ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 4px; font-weight: 500; font-size: 15px; text-decoration: none; border: 1px solid var(--accent); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { color: var(--accent); }
.btn:hover { opacity: 0.88; }
.sketch { color: var(--fg); min-width: 0; }
.sketch svg { width: 100%; height: auto; display: block; }
.sketch .mach { stroke: var(--accent); stroke-width: 1.2; opacity: 0.55; fill: none; }
.sketch .body { fill: var(--accent-soft); stroke: var(--fg); stroke-width: 1.6; stroke-linejoin: round; }
.sketch .axis { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 4 4; }
.sketch text { fill: var(--muted); font: 500 10px var(--mono); letter-spacing: 0.06em; }
.sketch .flow { stroke: var(--muted); stroke-width: 1; fill: none; opacity: 0.6; }

.titleblock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); background: var(--surface); margin-bottom: 8px; }
.titleblock div { padding: 12px 16px; border-right: 1px solid var(--rule); min-width: 0; }
.titleblock div:last-child { border-right: 0; }
.titleblock b { display: block; font: 500 15px var(--body); margin-top: 2px; overflow-wrap: anywhere; }

/* sections */
section { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px 48px; padding-block: 56px; border-top: 1px solid var(--rule); }
section > header h2 { font-size: 15px; font-family: var(--mono); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.content { min-width: 0; }

/* experience */
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; padding-bottom: 32px; }
.job + .job { padding-top: 32px; border-top: 1px solid var(--rule); }
.job:last-child { padding-bottom: 0; }
.job h3 { font-size: 22px; }
.job .org { color: var(--muted); }
.job .when { font: 400 13px var(--mono); color: var(--muted); white-space: nowrap; }
.job ul { grid-column: 1 / -1; margin: 12px 0 0; padding-left: 1.1em; max-width: 72ch; }
.job li { margin-bottom: 6px; }
.job li::marker { color: var(--accent); }

/* projects */
.project { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 32px; padding-bottom: 48px; }
.project + .project { padding-top: 48px; border-top: 1px solid var(--rule); }
.project:last-child { padding-bottom: 0; }
.project h3 { font-size: 26px; margin-top: 6px; }
.project p { margin: 12px 0 0; max-width: 60ch; }
.project p.sub { color: var(--muted); }
.project figure { margin: 0; min-width: 0; }
.project figure img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); background: var(--surface); }
.project figcaption { font: 400 12px/1.5 var(--mono); color: var(--muted); margin-top: 8px; }
.gallery { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; align-items: start; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 20px; }
.stat { background: var(--surface); border: 1px solid var(--rule); padding: 12px 14px; min-width: 0; }
.stat b { display: block; font: 600 24px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 16px 0 0; }
.tags li { font: 400 12px var(--mono); padding: 3px 9px; border: 1px solid var(--rule); border-radius: 99px; color: var(--muted); }
.tablewrap { overflow-x: auto; margin-top: 20px; border: 1px solid var(--rule); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font: 400 13px var(--mono); font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; }
tr:last-child td { border-bottom: 0; }

.minor { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.minor article { background: var(--surface); border: 1px solid var(--rule); padding: 20px; min-width: 0; }
.minor h3 { font-size: 19px; margin: 6px 0 8px; }
.minor p { margin: 0; font-size: 15px; color: var(--muted); }
.projects-more { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--rule); }

/* skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 32px; }
.skills h3 { font: 500 13px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.skills p { margin: 0; }

.edu { display: grid; gap: 12px; }
.edu div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.edu b { font-weight: 600; }
.edu span { color: var(--muted); }

.contact p { margin: 0 0 12px; max-width: 52ch; }
.contact .big { font: 600 clamp(22px, 4vw, 34px) var(--display); overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; }
footer { border-top: 1px solid var(--rule); padding-block: 24px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 40px 28px; }
  section { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: 40px; }
  .project { grid-template-columns: minmax(0, 1fr); }
  .titleblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .titleblock div:nth-child(2) { border-right: 0; }
  .titleblock div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .job { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .mach { stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.6s ease-out forwards; }
  .mach.u { animation-delay: .15s; } .mach.l { animation-delay: .3s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.job { padding-bottom: 20px; }
.job + .job { padding-top: 20px; }
.tools { margin: 16px 0 0; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tools .label { margin-right: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 8px 12px; }
.skip:focus { left: 16px; top: 8px; z-index: 20; }

.code { margin: 14px 0 0; font-size: 14px; }
.minor .code { margin-top: 12px; }
