/* Profile hub. Palette: the same validated reference instance as Mission Control and systems-from-scratch.
   Section accents use categorical slots 1-3 (validated all-pairs in both modes); every accent is paired with a text label. */
:root {
  color-scheme: light;
  --surface-0: #f4f4f2; --surface-1: #fcfcfb; --surface-2: #efeeea; --line: #e2e1dc;
  --text-primary: #0b0b0b; --text-secondary: #52514e; --text-muted: #77766f;
  --blue: #2a78d6; --orange: #eb6834; --aqua: #1baf7a;
  --good: #0ca30c; --good-ink: #006300; --info-ink: #1c5cab;
  --accent: #2a78d6; --accent-ink: #1c5cab; --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 4px 16px rgba(11, 11, 11, .05);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-0: #121211; --surface-1: #1a1a19; --surface-2: #262624; --line: #33332f;
    --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #8f8e86;
    --blue: #3987e5; --orange: #d95926; --aqua: #199e70;
    --good: #0ca30c; --good-ink: #4cc34c; --info-ink: #9ec5f4;
    --accent: #3987e5; --accent-ink: #9ec5f4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
.sec-ios { --sec: var(--blue); } .sec-systems { --sec: var(--aqua); } .sec-ai { --sec: var(--orange); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--surface-0); color: var(--text-primary);
       font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
code { font: .88em ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
pre code { background: none; padding: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-secondary); } .small { font-size: 13px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 0 0 6px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--surface-1); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--surface-0) 88%, transparent);
       backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text-primary); text-decoration: none; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
        color: var(--on-accent); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.nav nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav nav a { color: var(--text-secondary); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.nav nav a:hover, .nav nav a[aria-current="page"] { color: var(--text-primary); background: var(--surface-2); }

/* hero & stats */
.hero { padding: 64px 0 28px; max-width: 820px; }
.hero h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; letter-spacing: -.025em; margin: 0 0 14px; }
.lede { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.45; margin: 0 0 12px; color: var(--text-primary); }
.sub { color: var(--text-secondary); margin: 0 0 22px; max-width: 760px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
       background: var(--surface-1); color: var(--text-primary); text-decoration: none; font-size: 14px; font-weight: 550; line-height: 1.2; }
.btn:hover { border-color: var(--accent); color: var(--text-primary); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); color: var(--on-accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; margin: 24px 0 6px; }
.stat { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-secondary); font-size: 14px; }
.small-stats .stat b { font-size: 26px; }
.asof { margin: 6px 0 0; }

/* sections */
.section { padding: 44px 0 8px; }
.section-head { margin-bottom: 18px; max-width: 760px; }
.section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; letter-spacing: -.01em; margin: 0 0 4px; }
.section-head p { margin: 0; }
.swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--sec, var(--accent)); flex: none; }

/* featured */
.features { display: grid; gap: 16px; }
.feature { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center;
           background: var(--surface-1); border: 1px solid var(--line); border-left: 4px solid var(--sec); border-radius: var(--radius);
           padding: 22px 24px; box-shadow: var(--shadow); }
.feature:not(:has(.feature-shots)) { grid-template-columns: 1fr; }
.feature h3 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.01em; }
.feature h3 a { color: var(--text-primary); text-decoration: none; } .feature h3 a:hover { text-decoration: underline; }
.feature p { margin: 0 0 10px; color: var(--text-secondary); }
.metric-line { font-weight: 600; color: var(--text-primary) !important; font-variant-numeric: tabular-nums; }
.feature-shots { display: flex; gap: 10px; justify-content: flex-end; }
.feature-shots img { width: auto; max-height: 250px; max-width: 46%; border-radius: 14px; border: 1px solid var(--line); }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; padding: 18px; } .feature-shots { justify-content: flex-start; }
  .wrap { padding: 0 16px; } .hero { padding-top: 40px; } .stat b { font-size: 28px; } }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--surface-1); border: 1px solid var(--line); border-top: 3px solid var(--sec);
        border-radius: var(--radius); overflow: hidden; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--sec); transform: translateY(-1px); }
.card-main { display: block; padding: 16px 18px 6px; color: inherit; text-decoration: none; flex: 1; }
.card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.card h3 { font-size: 17px; margin: 0; line-height: 1.25; }
.kind { margin: 2px 0 0; font-size: 13px; color: var(--text-secondary); }
.tagline { margin: 0 0 8px; font-size: 15px; }
.hl { margin: 0 0 6px; font-size: 13.5px; color: var(--text-secondary); }
.card-foot { padding: 8px 18px 16px; display: grid; gap: 10px; }
.icon { width: 48px; height: 48px; border-radius: 11px; flex: none; border: 1px solid var(--line); object-fit: cover; }
.icon.big { width: 84px; height: 84px; border-radius: 19px; }
.icon.mono { display: inline-grid; place-items: center; font-weight: 700; font-size: 16px; color: var(--text-primary);
             background: color-mix(in srgb, var(--sec, var(--accent)) 16%, var(--surface-1)); }
.icon.mono.big { font-size: 28px; }

/* chips & links */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 99px;
        background: var(--surface-2); color: var(--text-secondary); border: 1px solid transparent; line-height: 1.6; text-decoration: none; }
.chip.link { color: var(--text-primary); border-color: var(--line); background: var(--surface-1); }
.chip.link::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--sec); }
.chip.link:hover { border-color: var(--sec); }
.chip.status { color: var(--text-primary); background: var(--surface-1); border-color: var(--line); font-weight: 550; }
.chip.status .dot { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 99px; font-size: 10px; color: #fff; background: var(--text-muted); }
.chip.lv-good .dot { background: var(--good); }
.chip.lv-info .dot { background: var(--accent); }
.muted-chip { font-style: italic; }
.links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.links .btn { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.big-links { margin: 16px 0 4px; } .big-links .btn { padding: 8px 14px; font-size: 14px; }

/* systems sublist */
details.sub { margin-top: 14px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; }
details.sub summary { cursor: pointer; font-weight: 600; }
.sublist { columns: 3 220px; padding: 0; margin: 10px 0 0; list-style: none; }
.sublist li { break-inside: avoid; padding: 3px 0; font-size: 14px; }

/* how */
.how .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 14px; }
.how .cols > div { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.how h3 { margin: 0 0 6px; font-size: 16px; } .how p { margin: 0; color: var(--text-secondary); font-size: 15px; }
.how > p { margin-top: 16px; }

/* work page */
.work, .about, .note, .notes-page { max-width: 860px; padding: 36px 0 24px; }
.crumbs { font-size: 14px; margin: 0 0 14px; }
.work-head { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.work h1, .about h1, .note h1, .notes-page h1 { font-size: clamp(28px, 4.5vw, 40px); line-height: 1.12; letter-spacing: -.02em; margin: 0; }
.work section, .about section { margin-top: 30px; }
.work h2, .about h2 { font-size: 20px; margin: 0 0 10px; }
.found { padding-left: 20px; } .found li { margin-bottom: 8px; }
.gallery { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.gallery img { width: 220px; flex: none; border-radius: 18px; border: 1px solid var(--line); scroll-snap-align: start; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }

/* about & skills */
.md p, .md li { max-width: 72ch; }
.md h2 { font-size: 20px; margin: 28px 0 8px; }
.md blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--text-secondary); }
.divider { margin-top: 40px !important; padding-top: 24px; border-top: 1px solid var(--line); font-size: 24px !important; }
.table-wrap { overflow-x: auto; }
table.skills { width: 100%; border-collapse: collapse; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.skills th, table.skills td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
table.skills thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); background: var(--surface-2); }
table.skills tbody th { font-weight: 550; width: 44%; }
table.skills td .chip { margin: 0 4px 4px 0; }
table.skills tr:last-child > * { border-bottom: 0; }

/* notes */
.notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.notes li { background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.notes.long li { display: block; } .notes.long p { margin: 4px 0 0; color: var(--text-secondary); }
.notes.long .small { margin-left: 10px; }
.draft-banner { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.note .md { margin-top: 18px; } .note .md img { border-radius: 10px; }

/* footer */
.foot { margin-top: 56px; border-top: 1px solid var(--line); padding: 26px 0 40px; font-size: 14px; }
.foot p { margin: 0 0 8px; max-width: 80ch; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card { transition: none; } .card:hover { transform: none; } }
@media print { .nav, .foot, .cta, .links { display: none; } body { background: #fff; } }

/* systems areas */
.track { margin-top: 22px; }
.track:first-of-type { margin-top: 6px; }
.track-title { font-size: 17px; margin: 0 0 4px; display: flex; align-items: baseline; gap: 8px; }
.track-blurb { margin: 0 0 12px; font-size: 14.5px; }
.brands { font-size: 14px; margin-top: -2px !important; }
.brands a { font-weight: 550; }
.tracklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 18px; }
.tracklist h3 { font-size: 15px; margin: 0 0 6px; }
.tracklist .sublist { columns: auto; margin: 0; }
.tracklist .sublist li { padding: 4px 0; }

/* narrow phones: keep the nav on one row and the stats two-up */
@media (max-width: 520px) {
  .nav nav { gap: 0; margin: 0 -7px; }
  .nav nav a { padding: 6px 7px; font-size: 13px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 24px; }
  .stat span { font-size: 13px; }
}
