/* Editorial direction (spec D-7): warm paper, deep ink, one amber accent, serif display + sans body. */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f7f3ec;
  --bg-elev: #fffdf9;
  --ink: #1a1a1f;
  --ink-2: #4a4a52;
  --muted: #6f6e76;
  --rule: #e2dbcf;
  /* accent: neon cyan (S-21); the light theme uses a deeper ink for text contrast on paper */
  --accent: #14b8d4;
  --accent-ink: #0b7d92;
  --accent-soft: #d5f0f5;
  --focus: #2a63c8;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141317; --bg-elev: #1c1b21; --ink: #ece7de; --ink-2: #b9b3a8; --muted: #8f8a81; --rule: #2c2a32;
    --accent: #38d6e8; --accent-ink: #7fe4f0; --accent-soft: #10262b; --focus: #8ab4ff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141317; --bg-elev: #1c1b21; --ink: #ece7de; --ink-2: #b9b3a8; --muted: #8f8a81; --rule: #2c2a32;
  --accent: #38d6e8; --accent-ink: #7fe4f0; --accent-soft: #10262b; --focus: #8ab4ff; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 7vw, 5rem); font-variation-settings: "opsz" 144, "SOFT" 30; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: var(--gutter); }

/* header / nav */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.nav { max-width: var(--max); margin: 0 auto; padding: .75rem var(--gutter); display: flex; align-items: center; gap: 1rem; }
.brand { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); color: var(--ink); padding: .4rem .8rem; border-radius: 999px; font: inherit; cursor: pointer; }
.nav-list { display: flex; align-items: center; gap: 1.25rem; }
.nav-list a { color: var(--ink-2); text-decoration: none; font-size: .95rem; padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav-list a:hover, .nav-list a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-resume { font-weight: 600; }
.theme-toggle { width: 2.25rem; height: 2.25rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg-elev); cursor: pointer; display: grid; place-items: center; }
.theme-icon { width: 1rem; height: 1rem; border-radius: 50%; background: var(--ink); box-shadow: inset -.35rem -.2rem 0 0 var(--bg-elev); }
:root[data-theme="dark"] .theme-icon { box-shadow: none; background: var(--accent); }
@media (max-width: 719px) {
  .nav-toggle { display: inline-block; }
  .nav-list { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: flex-start; gap: 0; background: var(--bg-elev); border-bottom: 1px solid var(--rule); padding: .5rem var(--gutter) 1rem; }
  .nav-list.open { display: flex; }
  .nav-list li { width: 100%; }
  .nav-list a { display: block; padding: .6rem 0; }
}

/* layout */
.section, .hero, .site-footer { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
.section { border-top: 1px solid var(--rule); }
.eyebrow { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.45rem); color: var(--ink-2); max-width: 36ch; font-family: var(--serif); font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.btn { display: inline-block; padding: .7rem 1.2rem; border-radius: 999px; border: 1px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; background: transparent; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #1a1a1f; }
.soon { display: inline-block; padding: .7rem 1.2rem; border-radius: 999px; border: 1px dashed var(--rule); color: var(--muted); font-size: .95rem; }

/* hero */
.hero { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; min-height: 70vh; }
.hero-figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); border: 1px solid var(--rule); }
.hero-figure img { aspect-ratio: 1 / 1.08; object-fit: cover; width: 100%; }
@media (max-width: 719px) { .hero { grid-template-columns: 1fr; min-height: 0; } }

/* about */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.about-copy { font-size: 1.2rem; max-width: 60ch; }
.about-figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); }
.about-figure img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.contact-strip { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; }
@media (max-width: 719px) { .about-grid { grid-template-columns: 1fr; } }

/* experience timeline */
.timeline { display: grid; gap: 2rem; }
.entry { display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem; position: relative; }
.entry-when { color: var(--muted); font-size: .95rem; padding-top: .35rem; }
.entry-body { border-left: 2px solid var(--rule); padding-left: 1.5rem; }
.entry-body summary { list-style: none; cursor: pointer; display: grid; gap: .15rem; }
.entry-body summary::-webkit-details-marker { display: none; }
.entry-body summary::before { content: ""; position: absolute; left: 12.5rem; margin-top: .55rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.entry-employer { font-family: var(--serif); font-size: 1.5rem; }
.entry-employer a { color: var(--ink); text-decoration: none; }
.entry-employer a:hover { color: var(--accent-ink); text-decoration: underline; }
.entry-title { font-weight: 600; }
.entry-loc { color: var(--muted); font-size: .95rem; }
.entry-summary { margin-top: .75rem; color: var(--ink-2); }
.highlights { margin-top: .75rem; display: grid; gap: .5rem; }
.highlights li { position: relative; padding-left: 1.1rem; }
.highlights li::before { content: "\25AA"; position: absolute; left: 0; color: var(--accent); }
.highlights li.sub { margin-left: 1.25rem; }
.highlights li.sub::before { content: "\25E6"; }
.hl-link { white-space: nowrap; font-size: .92rem; }
@media (max-width: 719px) {
  .entry { grid-template-columns: 1fr; gap: .25rem; }
  .entry-body { border-left: 0; padding-left: 0; }
  .entry-body summary::before { display: none; }
}

/* projects — bento (S-13). Cards speak through their visual; text is title / tagline / one line / tags. */
.section-projects { --cyan: #38d6e8; --cyan-ink: #9fe8f2; --stage: #0b0c10; --stage-2: #15171d; --stage-rule: #262932; --stage-ink: #ece7de; --stage-muted: #8b8f99; }
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.pcard { position: relative; background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: border-color .35s ease, transform .35s ease, box-shadow .35s ease; }
.pcard:hover, .pcard:focus-within { border-color: color-mix(in srgb, var(--ink) 28%, var(--rule)); }
.pcard-flagship { grid-column: 1 / 3; grid-row: 1 / 3; background: var(--stage); border-color: var(--stage-rule); color: var(--stage-ink); }
.pcard-flagship:hover, .pcard-flagship:focus-within { border-color: color-mix(in srgb, var(--cyan) 35%, var(--stage-rule)); }
.pcard-featured { grid-column: 3; grid-row: 1; }
.bento > .pcard:nth-child(3) { grid-column: 3; grid-row: 2; }
.pcard-figure { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--bg); }
.pcard-figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.pcard:hover .pcard-figure img { transform: scale(1.025); }
.pcard-featured .pcard-figure { aspect-ratio: 16 / 9; }
.pcard-wordmark { display: flex; align-items: center; justify-content: center; background: var(--accent-soft); }
.pcard-wordmark span { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: .1em; color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pcard-wordmark { background: var(--bg); } }
:root[data-theme="dark"] .pcard-wordmark { background: var(--bg); }
.pcard-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.pcard-flagship .pcard-body { flex: 0 0 auto; padding: 1.25rem 1.5rem 1.5rem; }   /* the stage takes the slack */
.pcard-head h3 { margin: 0; font-size: 1.3rem; }
.pcard-flagship .pcard-head h3 { font-size: clamp(1.9rem, 3vw, 2.4rem); letter-spacing: .02em; }
.pcard-hit { all: unset; cursor: pointer; color: inherit; font: inherit; }
.pcard-hit::after { content: ""; position: absolute; inset: 0; }
.pcard-hit:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--radius); }
.pcard-tagline { margin: .15rem 0 0; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pcard-flagship .pcard-tagline { color: var(--cyan-ink); }
.pcard-blurb { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.5; max-width: 52ch; }
.pcard-flagship .pcard-blurb { color: #b9b3a8; }
.pcard-tool .pcard-blurb { font-size: .9rem; }
.pcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.pcard-metric { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; letter-spacing: .01em; color: var(--ink); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li, .chip { font-size: .8rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink-2); }
.chips-sm li { font-size: .72rem; padding: .18rem .55rem; }
.pcard-flagship .chips li { background: var(--stage-2); border-color: var(--stage-rule); color: #b9b3a8; }
.pcard-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: .5rem; margin: auto 0 0; padding-top: .5rem; }
.btn-sm { padding: .5rem .95rem; font-size: .86rem; }
.btn-sm span, .btn span { display: inline-block; transition: transform .25s ease; }
.btn:hover span { transform: translateX(3px); }
.soon-sm { padding: .5rem .95rem; font-size: .86rem; }
.pcard-flagship .btn { border-color: #3a3e49; color: var(--stage-ink); }
.pcard-flagship .btn:hover { background: var(--stage-ink); color: var(--stage); }
/* the flagship card is always dark, so its primary button is the light "ink on stage" version of the others, and
   hovers to the accent exactly like every other primary button (S-22) */
.pcard-flagship .btn-primary { background: var(--stage-ink); border-color: var(--stage-ink); color: var(--stage); }
.pcard-flagship .btn-primary:hover { background: var(--cyan); border-color: var(--cyan); color: #06171a; }
.pcard-flagship .pcard-metric { color: var(--stage-ink); }
/* reveal: only once JS is present, so the cards never stay hidden without it */
.js .pcard { opacity: 0; transform: translateY(14px); transition: opacity .6s ease calc(var(--i, 0) * 70ms), transform .6s cubic-bezier(.2,.7,.2,1) calc(var(--i, 0) * 70ms), border-color .35s ease; }
.js .pcard.in { opacity: 1; transform: none; }
.bento > .pcard:nth-child(2) { --i: 1; } .bento > .pcard:nth-child(3) { --i: 2; } .bento > .pcard:nth-child(4) { --i: 3; }
.bento > .pcard:nth-child(5) { --i: 4; } .bento > .pcard:nth-child(6) { --i: 5; } .bento > .pcard:nth-child(n+7) { --i: 6; }
@media (prefers-reduced-motion: reduce) { .js .pcard { opacity: 1; transform: none; } }

/* the flagship stage: live 3D robot, clean near-black background, a few system readouts */
.robot-stage { position: relative; flex: 1; min-height: 26rem; overflow: hidden; background:
  radial-gradient(ellipse 60% 55% at 50% 58%, rgba(56, 214, 232, calc(.16 * var(--wake, 0))) 0%, rgba(56, 214, 232, 0) 70%),
  linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px) 0 0 / 100% 3rem,
  linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px) 0 0 / 3rem 100%,
  radial-gradient(ellipse 80% 70% at 50% 50%, #14161c 0%, var(--stage) 100%); }
.robot-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 90% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.55) 100%); }
.robot-canvas, .robot-poster { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.robot-poster { object-fit: contain; padding: 4%; opacity: .5; filter: saturate(.7) brightness(.85); transition: opacity .8s ease; }
.robot-stage[data-state="ready"] .robot-poster { opacity: 0; }
.robot-stage[data-state="fallback"] .robot-poster { opacity: 1; filter: none; }
.readouts { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; z-index: 2; }
.readouts li { position: absolute; display: grid; gap: .1rem; padding: .45rem .6rem; border: 1px solid rgba(56, 214, 232, .22); border-radius: 8px; background: rgba(11, 12, 16, .62); backdrop-filter: blur(4px); font-family: var(--sans); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--stage-muted);
  opacity: calc((var(--wake, 0) - var(--at, .5)) / .3); transform: translateY(calc((1 - var(--wake, 0)) * 6px)); transition: opacity .2s linear; }
.readouts strong { font-weight: 600; color: var(--cyan-ink); display: flex; align-items: center; gap: .4rem; }
.readouts strong::before { content: ""; width: .38rem; height: .38rem; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px rgba(56, 214, 232, .8); }
.readouts li:nth-child(1) { left: 1rem; top: 1rem; --at: .45; }
.readouts li:nth-child(2) { right: 1rem; top: 1rem; --at: .55; }
.readouts li:nth-child(3) { left: 1rem; top: 55%; --at: .62; }
.readouts li:nth-child(4) { right: 1rem; top: 55%; --at: .70; }
.readouts li:nth-child(5) { right: 1rem; bottom: 1rem; --at: .78; }
.robot-stage[data-state="fallback"] .readouts li { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .readouts li { transition: none; } }

/* quick view */
.qv { width: min(58rem, calc(100% - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); margin: auto; padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-elev); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; }
.qv::backdrop { background: rgba(10, 10, 14, .62); backdrop-filter: blur(4px); }
/* minmax(0, 1fr) rows + min-height: 0 on the body: the row is capped by the dialog's max-height and the body scrolls */
.qv-inner { position: relative; display: grid; grid-template-columns: 5fr 7fr; grid-template-rows: minmax(0, 1fr); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); }
.qv-figure { margin: 0; background: var(--bg); border-right: 1px solid var(--rule); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qv-figure img { width: 100%; height: 100%; object-fit: cover; }
.qv-figure-robot { background: #0b0c10; }
.qv-figure-robot img { object-fit: contain; padding: 6%; }
.qv-body { padding: 1.75rem 2rem 1.75rem; min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; gap: .6rem; align-content: start; }
.qv-figure { min-height: 0; }
.qv-body h3 { margin: 0; font-size: 2rem; }
.qv-body h4 { margin: .75rem 0 0; font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.qv-overview { color: var(--ink-2); margin: 0; }
.qv-facts { margin: .5rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem 1.25rem; }
.qv-facts dt { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.qv-facts dd { margin: .15rem 0 0; color: var(--ink); font-size: .95rem; }
.qv-metric { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.qv .highlights { margin-top: .25rem; font-size: .95rem; }
.qv-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.qv-close { position: absolute; top: .6rem; right: .6rem; z-index: 2; width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg-elev); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.qv-close:hover { background: var(--ink); color: var(--bg); }
.qv-open { overflow: hidden; }

/* case-study pages */
.case-back { color: var(--muted); text-decoration: none; }
.case-back:hover { color: var(--ink); }
.case-head .actions { margin-top: 1.25rem; }
.case-figure { margin: 2.5rem 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); background: var(--bg-elev); }
.case-figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.case-figure-robot { background: #0b0c10; }
.case-figure-robot img { object-fit: contain; aspect-ratio: 16 / 9; padding: 2% 0; }
.case-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.case-main h2 { font-size: 1.5rem; margin-top: 1.5rem; }
.case-main h2:first-child { margin-top: 0; }
.case-overview { color: var(--ink-2); font-size: 1.1rem; max-width: 60ch; }
.case-aside { position: sticky; top: 5rem; display: grid; gap: 1rem; background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem; }
.case-aside .qv-facts { margin: 0; grid-template-columns: 1fr; }

@media (max-width: 1023px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcard-flagship { grid-column: 1 / -1; grid-row: auto; }
  .pcard-featured { grid-column: 1 / -1; grid-row: auto; display: grid; grid-template-columns: 1.1fr 1fr; }
  .pcard-featured .pcard-figure { aspect-ratio: auto; height: 100%; border-bottom: 0; border-right: 1px solid var(--rule); }
  .bento > .pcard:nth-child(3) { grid-column: auto; grid-row: auto; }
  .robot-stage { min-height: 24rem; }
  .readouts li:nth-child(3), .readouts li:nth-child(4) { top: auto; bottom: 1rem; }
  .readouts li:nth-child(5) { display: none; }
  .case-grid { grid-template-columns: 1fr; }
  .case-aside { position: static; }
}
@media (max-width: 719px) {
  .bento { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .pcard-featured { display: flex; }
  .pcard-featured .pcard-figure { aspect-ratio: 16 / 9; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); }
  .robot-stage { min-height: 19rem; }
  .readouts li:nth-child(3), .readouts li:nth-child(4) { display: none; }
  .readouts li:nth-child(1), .readouts li:nth-child(2) { top: auto; bottom: 1rem; }   /* keep the head clear */
  .qv { width: 100%; max-width: 100%; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .qv-inner { grid-template-columns: 1fr; grid-template-rows: auto 1fr; max-height: none; height: 100%; }
  .qv-figure { aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--rule); }
  .qv-body { padding: 1.25rem 1.25rem 2rem; }
  .qv-body h3 { font-size: 1.6rem; }
}

/* skills (S-19): group panels of logo pills + a sticky "skill in context" panel */
.skills-explorer { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1.5rem; align-items: start; }
.skills-groups { display: grid; gap: .9rem; }
.skill-group { background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.15rem 1.15rem; }
.skill-group-head { display: flex; align-items: center; gap: .85rem; margin-bottom: .9rem; }
.skill-group-head h3 { margin: 0; font-size: 1.35rem; }
.skill-group-icon { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--g, var(--accent)) 16%, transparent); border: 1px solid color-mix(in srgb, var(--g, var(--accent)) 35%, transparent); }
.skill-group-desc { margin: .1rem 0 0; font-size: .82rem; color: var(--muted); }
/* skill tiles (S-22 reference): rounded rectangles, logo in a fixed slot, only the border changes when selected */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .6rem; }
.tiles li { display: contents; }
.skill-group[data-group="programming"] { --g: #e2a04a; }
.skill-group[data-group="frontend-ui"] { --g: #5fb8e6; }
.skill-group[data-group="backend-apis"] { --g: #7ac97a; }
.skill-group[data-group="data-infrastructure"] { --g: #e0705a; }
.skill-group[data-group="machine-learning-research"] { --g: #c08bea; }
.skill-group[data-group="ai-automation"] { --g: #6cc7c0; }
.skill-group[data-group="financial-industry-knowledge"] { --g: #e6c15a; }
.skill-group[data-group="communication-leadership"] { --g: #e88bb0; }
.skill-group[data-group="product-entrepreneurship"] { --g: #8fa6ff; }
.ico { width: 1.05rem; height: 1.05rem; flex: none; display: inline-block; vertical-align: middle; }
.ico-generic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--g, var(--accent)); }
.ico-group { width: 1.35rem; height: 1.35rem; }
.ico-mono { width: 1.05rem; height: 1.05rem; border-radius: 4px; background: var(--g, var(--accent)); color: #101114; font-size: .62rem; font-weight: 700; display: inline-grid; place-items: center; }
.chip { display: flex; align-items: center; gap: .8rem; width: 100%; font: inherit; font-size: .95rem; padding: .8rem .95rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); text-align: left; cursor: pointer; box-shadow: none; transition: border-color .2s ease, background .2s ease; }
.chip .ico { width: 1.4rem; height: 1.4rem; }
.chip > span:last-child { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.chip .ico-mono { font-size: .8rem; }
.chip:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--rule)); }
/* selected: the border turns accent and the tile tints; nothing outside the tile (no ring, no glow) */
.chip[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.chip:focus { outline: none; }
.chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.evidence { position: sticky; top: 5rem; background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem 1.35rem 1.35rem; }
.evidence-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.evidence-title { margin: 0; font-size: 1.45rem; }
.evidence-kicker { font-family: var(--sans); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0; }
.evidence-kicker-accent { color: var(--accent-ink); }
.evidence-kicker-accent::before { content: ""; display: inline-block; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); margin-right: .45rem; vertical-align: middle; }
.evidence-empty { color: var(--muted); margin: 0; }
.evidence-body { display: grid; gap: 1rem; }
.evidence-skill { display: flex; align-items: center; gap: .9rem; }
.evidence-skill .evidence-icon { width: 3.4rem; height: 3.4rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--bg); display: grid; place-items: center; }
.evidence-skill .evidence-icon .ico { width: 1.6rem; height: 1.6rem; }
.evidence-skill .evidence-icon .ico-mono { font-size: .95rem; }
.evidence-skill strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; line-height: 1.15; }
.evidence-group { display: inline-block; margin-top: .3rem; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--rule)); border-radius: 999px; padding: .15rem .6rem; }
.evidence-featured-wrap, .evidence-other-wrap { display: grid; gap: .6rem; }
.evidence-featured { display: grid; grid-template-columns: 5.5rem 1fr; gap: .9rem; align-items: start; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-radius: 12px; padding: .75rem; background: var(--bg); transition: border-color .2s ease; }
.evidence-featured:hover { border-color: var(--accent); color: var(--ink); }
.evidence-featured img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); background: #0b0c10; }
.evidence-featured img.contain { object-fit: contain; padding: 6%; }
.evidence-featured .evidence-thumb { width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--accent-soft); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; letter-spacing: .08em; font-size: .8rem; }
.evidence-featured strong { display: block; font-size: 1rem; line-height: 1.3; }
.evidence-featured p { margin: .25rem 0 .45rem; font-size: .88rem; color: var(--ink-2); line-height: 1.45; }
.evidence-featured .chips li { font-size: .68rem; padding: .15rem .5rem; }
.evidence-list { display: grid; gap: .5rem; }
.evidence-list a { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: center; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-radius: 10px; padding: .6rem .75rem; background: var(--bg); transition: border-color .2s ease; }
.evidence-list a:hover { border-color: var(--accent); color: var(--ink); }
.evidence-list a::after { content: "\203A"; font-size: 1.3rem; color: var(--muted); }
.evidence-owner { display: block; font-size: .7rem; color: var(--accent-ink); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .1rem; }
.evidence-text { font-size: .88rem; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.evidence-handle, .evidence-close, .evidence-cta { display: none; }
/* phones / tablets: the panel becomes a bottom sheet (closed / half / full), draggable by its handle (S-21) */
@media (max-width: 1023px) {
  .skills-explorer { grid-template-columns: 1fr; }
  .evidence { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0 auto; max-width: 40rem; height: 92vh; height: 92dvh; border-radius: 18px 18px 0 0; border-bottom: 0; padding: .5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.45); overflow: hidden; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .38s cubic-bezier(.2,.8,.2,1); touch-action: none; }
  .evidence.dragging { transition: none; }
  .evidence[data-sheet="half"] { transform: translateY(calc(92vh - 52vh)); transform: translateY(calc(92dvh - 52dvh)); }
  .evidence[data-sheet="full"] { transform: translateY(0); }
  .evidence-handle { display: grid; place-items: center; height: 1.6rem; flex: none; cursor: grab; }
  .evidence-handle span { width: 2.6rem; height: .3rem; border-radius: 999px; background: color-mix(in srgb, var(--ink) 25%, var(--rule)); }
  .evidence-close { display: grid; place-items: center; position: absolute; top: 1.2rem; right: 1rem; width: 2.2rem; height: 2.2rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
  .evidence-head { padding-right: 3rem; flex: none; flex-direction: column; align-items: flex-start; gap: .15rem; margin-bottom: .6rem; }
  .evidence-title { font-size: 1.3rem; }
  .evidence-body { overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding-bottom: 1rem; }
  .evidence-empty { display: none; }
  .evidence-cta { display: block; margin: .5rem 0 0; }
  .evidence-cta .btn { width: 100%; text-align: center; }
  .evidence-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(10,10,14,.55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  .sheet-open .evidence-backdrop { opacity: 1; pointer-events: auto; }
  .sheet-open { overflow: hidden; }
}
@media (max-width: 719px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chip { font-size: .88rem; padding: .7rem .8rem; gap: .6rem; } }
@media (prefers-reduced-motion: reduce) { .evidence, .evidence-backdrop { transition: none; } }

/* contact (S-24 reference): intro column with email + social tiles | the form with labels inside the fields */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: clamp(1.5rem, 5vw, 4rem); }
.contact-intro { border-right: 1px solid var(--rule); padding-right: clamp(1rem, 3vw, 2.5rem); }
.contact-intro h2 { margin-top: .35rem; }
.contact-blurb { color: var(--ink-2); max-width: 34ch; }
.contact-label { display: block; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.contact-value { display: block; color: var(--ink); font-size: 1.05rem; margin-top: .15rem; }
.contact-email { display: inline-flex; align-items: center; gap: 1rem; margin: 1.25rem 0 0; text-decoration: none; color: var(--ink); }
.contact-email:hover .contact-value { color: var(--accent-ink); text-decoration: underline; }
.contact-tile { width: 3.6rem; height: 3.6rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--bg-elev); display: grid; place-items: center; color: var(--accent); transition: border-color .2s ease, background .2s ease; }
.contact-tile .ico { width: 1.5rem; height: 1.5rem; }
.contact-tile .ico-brand { fill: var(--accent) !important; }
.contact-tile .ico-mail { color: var(--accent); }
a.contact-tile:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-elev)); }
.contact-elsewhere { margin: 2rem 0 .7rem; }
.contact-socials { display: flex; flex-wrap: wrap; gap: .75rem; }
.contact-form { display: grid; gap: .9rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.field { position: relative; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg-elev); padding: .75rem 1rem .6rem; transition: border-color .2s ease, box-shadow .2s ease; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field label { display: block; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 .25rem; }
.field-opt { text-transform: none; letter-spacing: .08em; color: var(--muted); }
.field input, .field textarea { font: inherit; font-size: 1rem; width: 100%; border: 0; padding: .1rem 0 .2rem; background: transparent; color: var(--ink); outline: none; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field:has([aria-invalid="true"]) { border-color: #c0392b; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .25rem; }
.btn-send { padding: .85rem 1.5rem; font-size: 1rem; }
.form-note { margin: 0; display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
.ico-lock { width: 1rem; height: 1rem; display: inline-block; }
.ico-lock svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-static { display: flex; align-items: flex-start; padding-top: .75rem; }
.field-error { color: #c0392b; font-size: .8rem; margin: .3rem 0 0; }
:root[data-theme="dark"] .field-error, :root:not([data-theme="light"]) .field-error { color: #ff8a7a; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; margin: 0; }
.form-status.ok { color: var(--accent-ink); }
.form-status.err { color: #c0392b; }
:root[data-theme="dark"] .form-status.err, :root:not([data-theme="light"]) .form-status.err { color: #ff8a7a; }
@media (max-width: 1023px) { .contact-grid { grid-template-columns: 1fr; } .contact-intro { border-right: 0; padding-right: 0; } }
@media (max-width: 719px) { .field-row { grid-template-columns: 1fr; } .form-foot { flex-direction: column; align-items: stretch; } .btn-send { text-align: center; } }

/* footer */
.site-footer { border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 2rem; color: var(--ink-2); font-size: .95rem; }
.footer-h { font-family: var(--sans); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.footer-col ul { display: grid; gap: .35rem; }
.footer-col a { color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--ink); text-decoration: underline; }
.footer-name { font-family: var(--serif); font-size: 1.5rem; align-self: end; justify-self: end; margin: 0; }
@media (max-width: 719px) { .site-footer { grid-template-columns: 1fr 1fr; } .footer-name { grid-column: 1 / -1; justify-self: start; } }

/* reveal */
@media (prefers-reduced-motion: no-preference) {
  .section > * { animation: rise .5s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
