:root {
    --mat: #24443A;
    --mat-deep: #162B24;
    --mat-line: rgba(236, 238, 230, 0.09);
    --board: #ECEEE6;
    --card: #F6F7F1;
    --ink: #16211C;
    --muted: #5C6B62;
    --copper: #A85B24;
    --copper-bright: #D0803F;
    --copper-glow: rgba(208, 128, 63, 0.35);
    --hairline: rgba(22, 33, 28, 0.16);
    --on-mat: #ECEEE6;
    --on-mat-muted: rgba(236, 238, 230, 0.6);
  }
  * { box-sizing: border-box; margin: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--board);
    color: var(--ink);
    font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  .display {
    font-family: "Archivo", "Arial Black", sans-serif;
    font-variation-settings: "wdth" 118;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }
  .mono {
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-variant-numeric: tabular-nums;
  }
  a { color: var(--copper); text-decoration-thickness: 1px; text-underline-offset: 3px; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; border-radius: 2px; }

  /* ---------- hero: the cutting mat ---------- */
  .mat {
    position: relative;
    min-height: 100svh;
    display: flex; flex-direction: column;
    background:
      radial-gradient(ellipse 90% 70% at 70% 20%, rgba(208,128,63,0.10), transparent 60%),
      repeating-linear-gradient(0deg, var(--mat-line) 0 1px, transparent 1px 48px),
      repeating-linear-gradient(90deg, var(--mat-line) 0 1px, transparent 1px 48px),
      linear-gradient(160deg, var(--mat) 0%, var(--mat-deep) 100%);
    color: var(--on-mat);
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 6vw, 5rem) 0;
  }
  .mat::after {
    content: "";
    position: absolute; inset: 0; pointer-events: none;
    background:
      linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(208,128,63,0.12) calc(50% - 0.5px), rgba(208,128,63,0.12) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
      linear-gradient(0deg, transparent calc(38% - 0.5px), rgba(208,128,63,0.10) calc(38% - 0.5px), rgba(208,128,63,0.10) calc(38% + 0.5px), transparent calc(38% + 0.5px));
  }
  .mat-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 1rem; flex-wrap: wrap;
    font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--on-mat-muted);
    border-bottom: 1px solid var(--mat-line);
    padding-bottom: 0.9rem;
    position: relative; z-index: 1;
  }
  .hero {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    position: relative; z-index: 1;
    padding: clamp(2rem, 5vh, 4rem) 0 clamp(1.5rem, 4vh, 3rem);
  }
  .hero-eyebrow {
    font-size: 0.82rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--copper-bright);
  }
  .hero h1 {
    font-size: clamp(2rem, 6.7vw, 6.25rem);
    line-height: 0.92;
    text-transform: uppercase;
    color: var(--on-mat);
    margin-top: 0.6rem;
    text-shadow: 0 0 60px rgba(208,128,63,0.25);
  }
  .hero h1 .thin { font-weight: 500; font-variation-settings: "wdth" 72; display: block; font-size: 0.62em; color: var(--on-mat-muted); }
  .hero-role {
    margin-top: 1.5rem;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    max-width: 40ch;
    color: var(--on-mat-muted);
  }
  .hero-role strong { color: var(--on-mat); font-weight: 500; }
  .hero-cta { margin-top: 2.2rem; display: flex; gap: 1rem; flex-wrap: wrap; }
  .btn {
    display: inline-block; padding: 0.75rem 1.5rem;
    font-family: "IBM Plex Mono", monospace; font-size: 0.85rem; letter-spacing: 0.08em;
    text-transform: uppercase; text-decoration: none; border-radius: 3px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  }
  .btn-copper { background: var(--copper); color: #FBF6EF; box-shadow: 0 0 0 rgba(208,128,63,0); }
  .btn-copper:hover { background: #8F4C1D; box-shadow: 0 6px 24px var(--copper-glow); transform: translateY(-2px); }
  .btn-ghost { border: 1px solid rgba(236,238,230,0.35); color: var(--on-mat); }
  .btn-ghost:hover { border-color: var(--on-mat); transform: translateY(-2px); }

  /* portrait as DETAIL A */
  .detail-view { position: relative; justify-self: center; width: min(100%, 340px); }
  .detail-view svg { position: absolute; inset: -14%; width: 128%; height: 128%; pointer-events: none; overflow: visible; }
  .detail-view .ring { stroke: var(--copper-bright); fill: none; }
  .detail-view img {
    display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(208,128,63,0.6);
    box-shadow: 0 0 0 10px rgba(208,128,63,0.08), 0 0 80px rgba(208,128,63,0.25);
    filter: saturate(0.94);
  }
  .detail-label {
    position: absolute; left: 50%; bottom: -3.2rem; transform: translateX(-50%);
    white-space: nowrap; text-align: center;
    font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--copper-bright);
  }
  .detail-label small { display: block; color: var(--on-mat-muted); letter-spacing: 0.1em; margin-top: 0.2rem; }

  /* stat strip */
  .stat-strip {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--mat-line);
    margin: 2.5rem 0 0;
  }
  .stat {
    padding: 1.4rem 1rem 1.6rem;
    border-right: 1px solid var(--mat-line);
    text-align: center;
  }
  .stat:last-child { border-right: 0; }
  .stat .n {
    font-family: "Archivo", sans-serif; font-variation-settings: "wdth" 110;
    font-weight: 800; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1;
    color: var(--copper-bright);
  }
  .stat .l { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-mat-muted); margin-top: 0.45rem; }

  /* capabilities ticker */
  .ticker {
    background: var(--ink); color: rgba(236,238,230,0.85);
    overflow: hidden; white-space: nowrap;
    border-top: 1px solid rgba(208,128,63,0.4);
    border-bottom: 1px solid rgba(208,128,63,0.4);
    padding: 0.65rem 0;
    font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase;
  }
  .ticker-track { display: inline-block; }
  .ticker span::after { content: "✕"; color: var(--copper-bright); margin: 0 1.6rem; font-size: 0.7em; }
  @media (prefers-reduced-motion: no-preference) {
    .ticker-track { animation: slide 36s linear infinite; }
  }
  @keyframes slide { to { transform: translateX(-50%); } }

  /* ---------- sheets ---------- */
  .sheet { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 6vw, 5rem); max-width: 1180px; margin: 0 auto; }
  .sheet-tag {
    display: flex; align-items: baseline; gap: 1.2rem; flex-wrap: wrap;
    border-top: 2px solid currentColor;
    padding-top: 0.8rem; margin-bottom: clamp(1.8rem, 4vw, 3rem);
  }
  .sheet-tag .no { font-size: 0.8rem; letter-spacing: 0.16em; color: var(--copper); }
  .sheet-tag h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); text-transform: uppercase; }
  .sheet-tag .note { margin-left: auto; font-size: 0.75rem; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }

  .lede { font-size: clamp(1.12rem, 1.9vw, 1.4rem); line-height: 1.6; max-width: 62ch; }
  .lede + .lede { margin-top: 1.2rem; }
  .lede strong { color: var(--copper); font-weight: 600; }

  /* services band (dark) */
  .band {
    background:
      repeating-linear-gradient(0deg, var(--mat-line) 0 1px, transparent 1px 48px),
      repeating-linear-gradient(90deg, var(--mat-line) 0 1px, transparent 1px 48px),
      linear-gradient(200deg, var(--mat) 0%, var(--mat-deep) 100%);
    color: var(--on-mat);
  }
  .band .sheet-tag .note { color: var(--on-mat-muted); }
  .services { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 1.2rem; }
  .service {
    position: relative;
    border: 1px solid rgba(236,238,230,0.18);
    border-radius: 4px;
    padding: 1.6rem 1.5rem;
    background: rgba(22,43,36,0.5);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  }
  .service:hover { border-color: var(--copper-bright); transform: translateY(-4px); box-shadow: 0 14px 40px rgba(0,0,0,0.35); }
  .service .code { font-size: 0.72rem; letter-spacing: 0.16em; color: var(--copper-bright); text-transform: uppercase; }
  .service h3 { margin-top: 0.5rem; font-size: 1.15rem; }
  .service p { margin-top: 0.5rem; font-size: 0.93rem; color: var(--on-mat-muted); }

  /* career rows */
  .role-row {
    display: grid; grid-template-columns: 9.5rem 1fr; gap: 1.5rem;
    padding: 1.15rem 0; border-bottom: 1px solid var(--hairline);
    transition: background 0.2s ease;
  }
  .role-row:hover { background: rgba(168,91,36,0.05); }
  .role-row:first-of-type { border-top: 1px solid var(--hairline); }
  .role-row .when { font-size: 0.82rem; color: var(--muted); padding-top: 0.25rem; }
  .role-row h3 { font-size: 1.08rem; font-weight: 600; }
  .role-row .org { color: var(--copper); font-weight: 500; }
  .role-row p { margin-top: 0.35rem; color: var(--muted); font-size: 0.95rem; max-width: 68ch; }
  .now {
    display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.55rem;
    font-family: "IBM Plex Mono", monospace; font-size: 0.62rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: #FBF6EF; background: var(--copper); border-radius: 999px;
    vertical-align: 0.15em;
  }

  /* project cards with corner brackets */
  .builds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.4rem; }
  .build {
    background: var(--card); border: 1px solid var(--hairline); border-radius: 4px;
    padding: 1.5rem 1.5rem 1.4rem; display: flex; flex-direction: column; gap: 0.6rem;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }
  .build::before, .build::after {
    content: ""; position: absolute; width: 16px; height: 16px;
    border: 2px solid var(--copper); opacity: 0; transition: opacity 0.25s ease;
  }
  .build::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
  .build::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
  .build:hover { transform: translateY(-5px); box-shadow: 0 16px 40px rgba(22,33,28,0.14); border-color: var(--copper); }
  .build:hover::before, .build:hover::after { opacity: 1; }
  .build .ref { font-size: 0.72rem; letter-spacing: 0.14em; color: var(--copper); text-transform: uppercase; }
  .build h3 { font-size: 1.12rem; line-height: 1.3; }
  .build p { font-size: 0.93rem; color: var(--muted); }
  .build .yr { margin-top: auto; padding-top: 0.8rem; font-size: 0.78rem; color: var(--muted); border-top: 1px dashed var(--hairline); }

  /* education + press + achievements */
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
  .col-lbl { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--copper); margin-bottom: 0.8rem; }
  .edu-item { padding: 0.9rem 0; border-bottom: 1px solid var(--hairline); }
  .edu-item:first-of-type { border-top: 1px solid var(--hairline); }
  .edu-item h3 { font-size: 1rem; font-weight: 600; }
  .edu-item .mono { font-size: 0.78rem; color: var(--muted); }
  .press-item { padding: 0.9rem 0; border-bottom: 1px solid var(--hairline); }
  .press-item:first-of-type { border-top: 1px solid var(--hairline); }
  .press-item .src { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
  .press-item a { font-weight: 500; display: inline-block; margin-top: 0.15rem; }
  .honors { margin-top: 2.6rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
  @media (max-width: 760px) { .honors { grid-template-columns: 1fr; } }
  .honor {
    border: 1px solid var(--copper); border-radius: 4px;
    background: linear-gradient(120deg, rgba(168,91,36,0.10), rgba(168,91,36,0.03));
    padding: 1.5rem 1.7rem;
    display: flex; gap: 1.4rem; align-items: baseline; flex-wrap: wrap;
  }
  .honor .rank {
    font-family: "Archivo", sans-serif; font-variation-settings: "wdth" 115; font-weight: 800;
    font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1; color: var(--copper);
  }
  .honor .rank-sm { font-size: clamp(1.3rem, 2.6vw, 1.9rem); line-height: 1.05; }
  .honor div p:first-child { font-weight: 600; font-size: 1.08rem; }
  .honor div p:last-child { color: var(--muted); font-size: 0.93rem; max-width: 55ch; }

  /* footer title block */
  .title-block {
    background: var(--mat-deep); color: var(--on-mat);
    background-image:
      repeating-linear-gradient(0deg, var(--mat-line) 0 1px, transparent 1px 48px),
      repeating-linear-gradient(90deg, var(--mat-line) 0 1px, transparent 1px 48px);
    padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 6vw, 5rem);
  }
  .tb-grid {
    max-width: 1180px; margin: 0 auto;
    border: 1px solid rgba(236,238,230,0.3);
    display: grid; grid-template-columns: 2fr 1fr 1fr;
  }
  .tb-cell { padding: 1.3rem 1.5rem; border-right: 1px solid rgba(236,238,230,0.3); }
  .tb-cell:last-child { border-right: 0; }
  .tb-cell .lbl { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-mat-muted); margin-bottom: 0.45rem; }
  .tb-cell .val { font-size: 0.95rem; }
  .tb-cell a { color: #E0A46F; }
  .tb-name { font-size: clamp(1.6rem, 4vw, 2.6rem); text-transform: uppercase; line-height: 1; }
  .tb-foot { max-width: 1180px; margin: 1.2rem auto 0; font-size: 0.72rem; letter-spacing: 0.1em; color: var(--on-mat-muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

  /* motion */
  @media (prefers-reduced-motion: no-preference) {
    .hero > div:first-child > * { opacity: 0; transform: translateY(18px); animation: rise 0.7s ease forwards; }
    .hero > div:first-child > *:nth-child(2) { animation-delay: 0.1s; }
    .hero > div:first-child > *:nth-child(3) { animation-delay: 0.22s; }
    .hero > div:first-child > *:nth-child(4) { animation-delay: 0.34s; }
    .detail-view { opacity: 0; transform: scale(0.92); animation: pop 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.1) forwards 0.5s; }
    .stat-strip .stat { opacity: 0; animation: rise 0.6s ease forwards; }
    .stat-strip .stat:nth-child(1) { animation-delay: 0.7s; }
    .stat-strip .stat:nth-child(2) { animation-delay: 0.82s; }
    .stat-strip .stat:nth-child(3) { animation-delay: 0.94s; }
    .stat-strip .stat:nth-child(4) { animation-delay: 1.06s; }
    .motion-ready .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
    .motion-ready .reveal.in { opacity: 1; transform: none; }
  }
  @keyframes rise { to { opacity: 1; transform: none; } }
  @keyframes pop { to { opacity: 1; transform: none; } }

  @media (max-width: 900px) {
    .hero h1 { font-size: clamp(2rem, 10.5vw, 5.5rem); }
    .hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
    .detail-view { width: min(70%, 280px); margin-bottom: 3rem; }
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: 0; }
    .two-col { grid-template-columns: 1fr; }
    .tb-grid { grid-template-columns: 1fr; }
    .tb-cell { border-right: 0; border-bottom: 1px solid rgba(236,238,230,0.3); }
    .tb-cell:last-child { border-bottom: 0; }
  }
  @media (max-width: 560px) {
    .role-row { grid-template-columns: 1fr; gap: 0.2rem; }
  }

  .mat-head nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
  .mat-head nav a { color: var(--on-mat); text-decoration: none; }
  .mat-head nav a:hover { color: var(--copper-bright); text-decoration: underline; }
  .skip-link { position: fixed; top: -100px; left: 1rem; z-index: 20; padding: .75rem 1rem; background: var(--board); color: var(--ink); }
  .skip-link:focus { top: 1rem; }
  section, footer { scroll-margin-top: 1.5rem; }
  .role-row > *, .tb-cell { min-width: 0; }
  .tb-cell a { overflow-wrap: anywhere; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }
