:root {
  /* Paper and ink */
  --eggshell: #ffffff;
  --taupe: #f5f5f5;
  --stone: #e8e8e8;
  --ink: #000000;
  --graphite: #44403b;
  --smoke: #6f6962;
  --ash: #a59f97;
  --ash-text: #857f77;
  --ash-small: #726c65;
  --title: #2b2f3a;
  --accent: #cda22d;
  --pill-border: #e5e5e5;
  --card-ash: #9d978f;
  --plate: var(--taupe);
  color-scheme: light;

  --font-display: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  --w-display: 400;
  --font-body: "Manrope", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1280px;
  --gutter: 64px;
  --section-base: 80px;
  --section: var(--section-base);
  --r-card: 12px;
  --r-large: 14px;
  --shadow: rgba(0, 0, 0, 0.4) 0 0 1px 0, rgba(0, 0, 0, 0.04) 0 1px 1px 0, rgba(0, 0, 0, 0.04) 0 2px 4px 0;
}

@media (max-width: 900px) {
  :root { --gutter: 32px; --section-base: 64px; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; --section-base: 48px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--eggshell);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: calc(16px * var(--body-scale, 1));
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: var(--w-display, 300); }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--ink); color: var(--eggshell); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute; left: 12px; top: -40px; z-index: 100;
  background: var(--ink); color: var(--eggshell);
  padding: 8px 14px; border-radius: 9999px; font-size: calc(14px * var(--body-scale, 1));
}
.skip:focus { top: 12px; }

/* ---------- Type ---------- */

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--smoke);
}
.mono b { font-weight: 400; color: var(--ink); }

.display {
  font-family: var(--font-display);
  font-weight: var(--w-display, 300);
  letter-spacing: calc(-0.035em + var(--track-adj, 0em));
  line-height: 0.98;
}

.h2 {
  font-family: var(--font-display);
  font-weight: var(--w-display, 300);
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.06;
  letter-spacing: calc(-0.03em + var(--track-adj, 0em));
  max-width: 22ch;
}

.lede {
  font-family: var(--font-display);
  font-weight: var(--w-display, 300);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.22;
  letter-spacing: calc(-0.015em + var(--track-adj, 0em));
}

.ash { color: var(--ash-text); }
.lede .ash, .card-top .ash, .hl-title .ash { color: var(--ash-small); }
.nowrap { white-space: nowrap; }
.h2, .hl-title, .card-top, .lede, .contact h2 { text-wrap: balance; }
.body, .xp-desc, .proj p { text-wrap: pretty; }
.body { color: var(--smoke); font-size: calc(16px * var(--body-scale, 1)); line-height: 1.6; }

/* ---------- Buttons ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 9999px;
  border: 1px solid var(--pill-border);
  background: var(--eggshell);
  color: var(--ink);
  font: 500 14px/1 var(--font-body);
  letter-spacing: 0.01em;
  box-shadow: var(--shadow);
  transition: background-color .2s ease, transform .2s ease;
  white-space: nowrap;
}
.pill:active { transform: translateY(1px); }
@media (pointer: coarse) { .pill { height: 44px; } }
.pill--ink { background: var(--ink); color: var(--eggshell); border-color: var(--ink); }
.pill .arrow { font-family: var(--font-mono); font-size: 13px; }

.chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 5px 11px;
  border-radius: 9999px; background: color-mix(in srgb, var(--eggshell) 94%, transparent);
  box-shadow: var(--shadow);
  font: 400 11px/1.25 var(--font-mono); letter-spacing: 0.03em; text-transform: uppercase; color: var(--graphite);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--eggshell) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
}
.top .wrap {
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  font: 500 15px/1 var(--font-body);
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background:
    radial-gradient(circle, var(--accent) 0 1.6px, transparent 1.9px) 0 0 / 5.5px 5.5px,
    var(--eggshell);
  box-shadow: inset 0 0 0 1px var(--stone);
}
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 12px; border-radius: 9999px;
  font-size: calc(14px * var(--body-scale, 1)); color: var(--graphite);
  transition: background-color .2s ease, color .2s ease;
}
.top-right { display: flex; align-items: center; gap: 14px; }
.clock { display: inline-flex; align-items: center; gap: 8px; }
.led {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
@media (max-width: 1100px) {
  .top .wrap { height: auto; flex-wrap: wrap; row-gap: 0; padding-top: 8px; }
  .nav {
    order: 3; gap: 6px;
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 10px;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    flex: none; display: inline-flex; align-items: center;
    height: 34px; padding: 0 14px; font-size: 13px;
    background: var(--taupe);
  }
  html { scroll-padding-top: 116px; }
}
@media (max-width: 560px) { .clock { display: none; } }

/* ---------- Section scaffolding ---------- */

section { position: relative; }
.band { background: var(--taupe); }
.pad { padding: var(--section) 0; }

.sec-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 40px;
}
.sec-head a.mono { padding: 12px 0; margin: -12px 0; }
.ruler {
  flex: 1; height: 9px;
  background:
    linear-gradient(var(--stone), var(--stone)) left bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--ash) 0 1px, transparent 1px 40px) left bottom / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, var(--stone) 0 1px, transparent 1px 8px) left bottom / 100% 5px no-repeat;
}
.sec-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 56px;
}
.sec-intro .body { max-width: 46ch; }
@media (max-width: 900px) {
  .sec-intro { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
}

/* Crop marks for printed-feeling frames */
.crop { position: relative; }
.crop::before, .crop::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border: 0 solid var(--ash); opacity: .8;
}
.crop::before { top: -10px; left: -10px; border-width: 1px 0 0 1px; }
.crop::after { bottom: -10px; right: -10px; border-width: 0 1px 1px 0; }

/* ---------- Print element ---------- */

.ht { position: relative; overflow: hidden; }
.ht > .ht-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Hero ---------- */

.hero { padding: 64px 0 var(--section); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 64px;
  align-items: end;
}
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 36px; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 32px; padding: 0 14px 0 12px;
  border-radius: 9999px; background: var(--taupe);
  box-shadow: inset 0 0 0 1px var(--stone);
  font: 500 13px/1 var(--font-body); color: var(--ink);
}
.contact-lede { margin-top: 28px; max-width: 30ch; font-size: clamp(20px, 2vw, 26px); }
.hero h1 { font-size: calc(clamp(64px, 11vw, 156px) * var(--name-scale, 1)); margin-left: -0.05em; }
.hero .lede { margin-top: 32px; max-width: 24ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }

.portrait {
  aspect-ratio: 4 / 5;
  border-radius: var(--r-large);
  background: var(--taupe);
}
.portrait .ht { position: absolute; inset: 0; border-radius: inherit; }

.spec {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--stone);
}
.spec > div {
  padding: 20px 24px 4px 0;
  border-right: 1px solid var(--stone);
  margin-right: 24px;
}
.spec > div:last-child { border-right: 0; margin-right: 0; }
.spec .mono { margin-bottom: 8px; }
.spec p { font-size: calc(15px * var(--body-scale, 1)); line-height: 1.45; }
.spec p span { color: var(--smoke); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .portrait { max-width: 520px; }
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec > div:nth-child(2) { border-right: 0; margin-right: 0; }
  .spec > div:nth-child(n+3) { border-top: 1px solid var(--stone); }
}
@media (max-width: 560px) {
  .hero { padding-top: 32px; }
  .spec { grid-template-columns: 1fr; }
  .spec > div { border-right: 0; margin-right: 0; border-top: 1px solid var(--stone); }
  .spec > div:first-child { border-top: 0; }
}

/* ---------- Stack cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  aspect-ratio: 392 / 520;
  padding: 26px 0 24px;
  border-radius: var(--r-card);
  background: var(--eggshell);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 0 26px;
}
.card-top {
  font-size: calc(18px * var(--body-scale, 1)); line-height: 1.28; letter-spacing: -0.005em;
  max-width: 28ch;
}
.card-img { min-height: 180px; background: var(--taupe); }
.card-title {
  padding: 0 24px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 4.6vw, 60px);
  line-height: 0.9;
  letter-spacing: calc(-0.045em + var(--track-adj, 0em));
  color: var(--title);
}
.card-title.right { text-align: right; }
@media (max-width: 1100px) {
  .cards { grid-template-columns: 1fr; max-width: 520px; }
  .card { aspect-ratio: auto; }
  .card-img { min-height: 0; aspect-ratio: 4 / 3; }
}

/* ---------- Experience ---------- */

.banner {
  position: relative;
  aspect-ratio: 21 / 8;
  border-radius: var(--r-card);
  background: var(--taupe);
  overflow: hidden;
  margin-bottom: 24px;
}
.banner .ht { position: absolute; inset: 0; }
.banner-cap { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.banner-cap .credit { color: var(--smoke); }
@media (max-width: 560px) { .banner { aspect-ratio: 4 / 3; } }

.sub-head { margin: 64px 0 16px; font-weight: 400; }

.xp { border-top: 1px solid var(--stone); }
.xp-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1.1fr) minmax(0, 1.4fr) 168px;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--stone);
  align-items: center;
}
.plate {
  position: relative;
  height: 96px;
  border-radius: 16px;
  background: var(--plate);
  overflow: hidden;
}
.plate .ht { position: absolute; inset: 0; }
.xp-role {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px; line-height: 1.18; letter-spacing: calc(-0.02em + var(--track-adj, 0em));
}
.xp-org { margin-top: 6px; font-size: calc(15px * var(--body-scale, 1)); color: var(--graphite); }
.xp-desc { font-size: calc(15px * var(--body-scale, 1)); line-height: 1.6; color: var(--smoke); }
.xp-when { text-align: right; }
@media (max-width: 1000px) {
  .xp-row { grid-template-columns: 132px minmax(0, 1fr); gap: 12px 24px; align-items: start; }
  .plate { height: 84px; grid-row: span 3; }
  .xp-when { text-align: left; }
}
@media (max-width: 560px) {
  .xp-row { grid-template-columns: 1fr; }
  .plate { grid-row: auto; height: 88px; max-width: 200px; }
}

/* ---------- Offline Base ---------- */

.feature {
  border-radius: var(--r-large);
  background: var(--taupe);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
}
.feature-copy { padding: 48px; display: flex; flex-direction: column; gap: 28px; }
.feature-copy .h2 { max-width: 16ch; }
.feature-figure {
  position: relative; margin: 12px; min-height: 0; aspect-ratio: 16 / 10; align-self: center;
  border-radius: 16px; background: var(--plate); box-shadow: var(--shadow);
}
.feature-figure .ht { position: absolute; inset: 0; border-radius: inherit; }
.products { border-top: 1px solid var(--stone); }
.products li {
  display: grid; grid-template-columns: 136px 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--stone);
  font-size: calc(15px * var(--body-scale, 1));
}
.products li span:last-child { color: var(--smoke); }
.products li span:first-child { white-space: nowrap; }
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature-copy { padding: 32px 24px; }
  .feature-figure { min-height: 0; aspect-ratio: 4 / 3; }
}

/* ---------- Highlights ---------- */

.hl-stack { display: grid; gap: 16px; }
.hl {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  padding: 32px;
  border-radius: var(--r-card);
  background: var(--eggshell);
  box-shadow: var(--shadow);
}
.hl-main { display: flex; flex-direction: column; gap: 20px; }
.hl-title {
  font-family: var(--font-display); font-weight: var(--w-display, 300);
  font-size: clamp(26px, 2.8vw, 36px); line-height: 1.15; letter-spacing: calc(-0.02em + var(--track-adj, 0em));
  max-width: 24ch;
}
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  column-gap: 12px;
  border-top: 1px solid var(--stone);
}
.stats > div { padding: 16px 0 0; }
.stats .num {
  font-family: var(--font-display); font-weight: var(--w-display, 300);
  font-size: clamp(28px, 2.7vw, 38px); line-height: 1; letter-spacing: calc(-0.035em + var(--track-adj, 0em));
  white-space: nowrap;
}
.stats .mono { margin-top: 6px; }
@media (max-width: 900px) {
  .hl { grid-template-columns: 1fr; gap: 28px; padding: 24px; }
}

/* ---------- Projects ---------- */

.proj { border-top: 1px solid var(--stone); }
.proj li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--stone);
  align-items: baseline;
}
.proj h3 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 22px; line-height: 1.2; letter-spacing: calc(-0.02em + var(--track-adj, 0em));
}
.proj p { font-size: calc(15px * var(--body-scale, 1)); line-height: 1.6; color: var(--smoke); }
@media (max-width: 900px) {
  .proj li { grid-template-columns: 48px minmax(0, 1fr); gap: 8px 16px; }
  .proj li > p { grid-column: 2; }
}

/* ---------- Contact ---------- */

.contact { padding: var(--section) 0 48px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.contact h2 { font-size: clamp(44px, 7vw, 104px); }
.contact-links { display: grid; border-top: 1px solid var(--stone); }
.contact-links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--stone);
  font-size: calc(17px * var(--body-scale, 1));
  transition: padding .25s ease;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }


/* ---------- Photo slots ---------- */
/* Any .ht whose image file is missing becomes a labeled slot. Drop the file in and it prints. */
.ht-missing {
  background:
    radial-gradient(circle, color-mix(in srgb, var(--ash) 55%, transparent) 0 1px, transparent 1.4px) 0 0 / 9px 9px,
    var(--taupe);
  box-shadow: inset 0 0 0 1px var(--stone);
}
.ht-missing::after {
  content: attr(data-ph);
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: calc(100% - 32px);
  padding: 6px 12px; border-radius: 9999px;
  background: var(--eggshell); box-shadow: var(--shadow);
  font: 400 11px/1.4 var(--font-mono); letter-spacing: .03em; text-transform: uppercase;
  color: var(--smoke); text-align: center;
}
.band .ht-missing { background-color: var(--eggshell); }
.band .ht-missing::after { background: var(--taupe); }

.card-img--plate, .pcard-img--plate { background: var(--plate); margin: 0 12px; border-radius: 14px; }
.plate .ht, .card-img--plate, .pcard-img--plate { color: #2b2f3a; }
.hl-main .stats { margin-top: 8px; }

/* ---------- Highlight with photo ---------- */
.hl--media { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: stretch; }
.hl-photo { border-radius: 14px; background: var(--taupe); min-height: 300px; }
@media (max-width: 900px) { .hl--media { grid-template-columns: 1fr; } .hl-photo { min-height: 0; aspect-ratio: 4 / 3; } }

/* ---------- Project cards ---------- */
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pcard {
  display: flex; flex-direction: column;
  border-radius: var(--r-card); background: var(--eggshell); box-shadow: var(--shadow);
  overflow: hidden;
}
.pcard-img { aspect-ratio: 16 / 10; background: var(--taupe); }
.pcard-img--plate { margin: 12px 12px 0; background: var(--plate); }
.pcard-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.pcard h3 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 22px; line-height: 1.2; letter-spacing: calc(-0.02em + var(--track-adj, 0em));
}
.pcard p { font-size: calc(15px * var(--body-scale, 1)); line-height: 1.55; color: var(--smoke); }
@media (max-width: 1100px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pgrid { grid-template-columns: 1fr; } }

.products a { text-decoration: underline; text-decoration-color: var(--stone); text-underline-offset: 3px; }

/* ---------- Footer wordmark ---------- */
.mark {
  position: relative;
  height: clamp(180px, 24vw, 340px);
  background: var(--taupe);
  border-top: 1px solid var(--stone);
  overflow: hidden;
}
.mark-print { position: absolute; left: 0; right: 0; top: 44px; bottom: 0; color: var(--accent); }
.mark-cap { position: absolute; left: 0; right: 0; top: 16px; z-index: 1; pointer-events: none; }
.mark-cap .wrap { display: flex; justify-content: space-between; gap: 16px; }
@media (hover: none) { .hint-hover { display: none; } }
@media (prefers-reduced-motion: reduce) { .hint-hover { display: none; } }
.foot { background: var(--taupe); border-top: 1px solid var(--stone); }
.foot .wrap {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 18px; padding-bottom: 22px;
}

/* ---------- Hover (pointer devices only, so taps never leave styles stuck) ---------- */

@media (hover: hover) {
  a.mono:hover { color: var(--ink); }
  .status:hover { background: var(--stone); }
  .pill:hover { background: var(--taupe); }
  .pill--ink:hover { background: var(--graphite); }
  .nav a:hover { background: var(--taupe); color: var(--ink); }
  .banner-cap .credit:hover { color: var(--ink); }
  .pcard h3 a:hover, .products a:hover { color: var(--accent); }
  .contact-links a:hover { padding-left: 8px; }
  .contact-links a:hover .mono { color: var(--ink); }
}
.contact-links a:active { background: var(--taupe); }

/* ---------- Dark theme ---------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --eggshell: #111111;
    --taupe: #191919;
    --stone: #2a2a2a;
    --ink: #f3f0eb;
    --graphite: #cfc9c1;
    --smoke: #a39d94;
    --ash: #7a746c;
    --ash-text: #958f86;
    --ash-small: #a09a91;
    --title: #ece8e2;
    --accent: #cda22d;
    --pill-border: #34312d;
    --card-ash: #8a847b;
    --plate: #ece7df;
    --shadow: rgba(0, 0, 0, 0.6) 0 0 0 1px, rgba(255, 255, 255, 0.04) 0 1px 0 0 inset;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --eggshell: #111111;
  --taupe: #191919;
  --stone: #2a2a2a;
  --ink: #f3f0eb;
  --graphite: #cfc9c1;
  --smoke: #a39d94;
  --ash: #7a746c;
  --ash-text: #958f86;
  --ash-small: #a09a91;
  --title: #ece8e2;
  --accent: #cda22d;
  --pill-border: #34312d;
  --card-ash: #8a847b;
  --plate: #ece7df;
  --shadow: rgba(0, 0, 0, 0.6) 0 0 0 1px, rgba(255, 255, 255, 0.04) 0 1px 0 0 inset;
  color-scheme: dark;
}

/* Theme toggle */
.theme-btn {
  width: 40px; height: 40px; padding: 0; justify-content: center;
  box-shadow: none; background: transparent; border-color: var(--stone);
}
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn .moon { display: none; }
:root[data-resolved-theme="dark"] .theme-btn .sun { display: none; }
:root[data-resolved-theme="dark"] .theme-btn .moon { display: block; }
@media (pointer: coarse) { .theme-btn { width: 44px; height: 44px; } }

/* ---------- Phone tuning ---------- */

.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 560px) {
  .hero-meta { margin-bottom: 24px; }
  .hero .lede { margin-top: 24px; }
  .hero-cta { margin-top: 28px; }
  .hero-grid { gap: 40px; }
  .portrait { aspect-ratio: 1 / 1; }
  .feature-figure { aspect-ratio: 2 / 1; }

  .xp-row { grid-template-columns: 96px minmax(0, 1fr); gap: 12px 16px; align-items: center; }
  .plate { grid-row: auto; height: 64px; max-width: none; border-radius: 12px; }
  .xp-row > .xp-desc, .xp-row > .xp-when { grid-column: 1 / -1; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .products li { grid-template-columns: 1fr; gap: 2px; }
  .proj li > p { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .top .wrap { column-gap: 12px; }
  .top-right { gap: 8px; }
  .top .pill:not(.theme-btn) { padding: 0 14px; }
}

/* ---------- Tweak hooks ---------- */
[data-ash="accent"] .ash, [data-ash="accent"] .card-top .ash, [data-ash="accent"] .spec p span { color: var(--accent); }

@media (min-width: 901px) {
  [data-hero="left"] .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
  [data-hero="left"] .portrait { order: -1; }
  [data-hero="center"] .hero-grid, [data-hero="banner"] .hero-grid { grid-template-columns: 1fr; }
}
[data-hero="center"] .hero-grid { text-align: center; justify-items: center; }
[data-hero="center"] .portrait { order: -1; width: min(300px, 70%); }
[data-hero="center"] .hero-meta, [data-hero="center"] .hero-cta { justify-content: center; }
[data-hero="center"] .hero .lede { margin-left: auto; margin-right: auto; }
[data-hero="center"] .hero h1 { margin-left: 0; }
[data-hero="banner"] .portrait { order: -1; aspect-ratio: 21 / 8; max-width: none; width: 100%; }
@media (max-width: 560px) { [data-hero="banner"] .portrait { aspect-ratio: 4 / 3; } }

/* ---------- Tweaks panel ---------- */
.tw { position: fixed; right: 16px; bottom: 16px; z-index: 90; font-family: "Inter", system-ui, sans-serif; }
.tw-fab {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 9999px; border: 1px solid var(--ink); background: var(--ink); color: var(--eggshell);
  font: 500 14px/1 "Inter", system-ui, sans-serif; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.tw-fab svg { width: 16px; height: 16px; }
.tw.is-open .tw-fab { display: none; }
.tw-panel {
  width: 340px; max-height: min(78vh, 760px);
  display: flex; flex-direction: column;
  background: var(--eggshell); color: var(--ink);
  border: 1px solid var(--stone); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), var(--shadow);
  overflow: hidden;
}
.tw-panel[hidden] { display: none; }
.tw-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--stone); }
.tw-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.tw-x:hover { background: var(--taupe); }
.tw-body { overflow-y: auto; padding: 0 16px 8px; overscroll-behavior: contain; }
.tw-group { border: 0; margin: 0; padding: 10px 0 6px; }
.tw-group legend { padding: 0; margin-bottom: 8px; }
.tw-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.tw-opts button {
  min-height: 32px; padding: 0 12px; border-radius: 9999px;
  border: 1px solid var(--stone); background: var(--eggshell); color: var(--ink);
  font-size: 13px; line-height: 1; cursor: pointer; transition: background-color .15s ease, border-color .15s ease;
}
.tw-opts button:hover { background: var(--taupe); }
.tw-opts button[aria-pressed="true"] { background: var(--ink); color: var(--eggshell); border-color: var(--ink); }
.tw-opts--swatch button { width: 34px; height: 34px; min-height: 0; padding: 0; display: grid; place-items: center; }
.tw-opts--swatch button i { width: 20px; height: 20px; border-radius: 50%; display: block; }
.tw-opts--swatch button[aria-pressed="true"] { background: var(--eggshell); border: 2px solid var(--ink); }
.tw-foot { border-top: 1px solid var(--stone); padding: 12px 16px 14px; background: var(--taupe); }
.tw-sum { text-transform: none; font-size: 11px; line-height: 1.5; margin-bottom: 10px; user-select: all; }
.tw-actions { display: flex; gap: 8px; }
.tw-btn {
  height: 36px; padding: 0 16px; border-radius: 9999px; cursor: pointer;
  border: 1px solid var(--stone); background: var(--eggshell); color: var(--ink);
  font: 500 13px/1 "Inter", system-ui, sans-serif;
}
.tw-btn--ink { background: var(--ink); color: var(--eggshell); border-color: var(--ink); }
.tw-sec { border-bottom: 1px solid var(--stone); }
.tw-sec:last-child { border-bottom: 0; }
.tw-sec > summary {
  list-style: none; cursor: pointer; padding: 12px 0;
  display: flex; justify-content: space-between; align-items: center;
  font: 500 14px/1 "Inter", system-ui, sans-serif; color: var(--ink);
}
.tw-sec > summary::-webkit-details-marker { display: none; }
.tw-sec > summary::after { content: "+"; font: 400 18px/1 "Inter", system-ui, sans-serif; color: var(--smoke); }
.tw-sec[open] > summary::after { content: "–"; }
.tw-sec[open] { padding-bottom: 8px; }
.tw-custom { position: relative; display: inline-flex; }
.tw-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.tw-custom button i { background-image: conic-gradient(red, yellow, lime, cyan, blue, magenta, red) !important; }
.tw-custom button[aria-pressed="true"] i { background-image: none !important; }
@media (max-width: 560px) {
  .tw { right: 12px; bottom: 12px; left: auto; }
  .tw.is-open { left: 12px; }
  .tw-panel { width: 100%; max-height: 72vh; }
}

/* ---------- More tweak hooks ---------- */
[data-case="upper"] .display, [data-case="upper"] .h2, [data-case="upper"] .hl-title,
[data-case="upper"] .card-title, [data-case="upper"] .xp-role, [data-case="upper"] .pcard h3 { text-transform: uppercase; }
[data-bands="off"] .band { background: transparent; }
[data-header="static"] .top { position: relative; }
[data-labels="hide"] .sec-head > .mono:first-child { display: none; }
[data-ruler="line"] .ruler { height: 1px; background: var(--stone); }
[data-ruler="none"] .ruler { visibility: hidden; }
[data-labels="hide"][data-ruler="none"] .sec-head { display: none; }
[data-status="hide"] .hero .status { display: none; }
[data-clock="hide"] .clock { display: none; }
[data-footer="hide"] .mark { display: none; }
[data-photo="bw"] .ht-canvas { filter: grayscale(1); }
[data-photo="contrast"] .ht-canvas { filter: grayscale(1) contrast(1.35); }
[data-hero="none"] .portrait { display: none; }
[data-hero="none"] .hero-grid { grid-template-columns: 1fr; }
[data-hero="none"] .hero .lede { max-width: 30ch; }

[data-buttons="rounded"] :is(.pill, .status, .chip, .nav a, .theme-btn) { border-radius: 10px; }
[data-buttons="square"] :is(.pill, .status, .chip, .nav a, .theme-btn) { border-radius: 3px; }

[data-cards="outline"] :is(.card, .pcard, .hl, .feature-figure) { box-shadow: none; border: 1px solid var(--stone); }
[data-cards="flat"] :is(.card, .pcard, .hl, .feature-figure) { box-shadow: none; background: color-mix(in srgb, var(--ink) 5%, var(--eggshell)); }

[data-logos="hide"] .xp-row .plate { display: none; }
[data-logos="hide"] .xp-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 168px; }
@media (max-width: 1000px) { [data-logos="hide"] .xp-row { grid-template-columns: minmax(0, 1fr); } }

[data-projects="list"] .pgrid { grid-template-columns: 1fr; }
[data-projects="list"] .pcard { flex-direction: row; align-items: stretch; }
[data-projects="list"] .pcard-img { width: min(320px, 38%); flex: none; aspect-ratio: 16 / 10; }
[data-projects="list"] .pcard-img--plate { margin: 12px 0 12px 12px; }
[data-projects="list"] .pcard-body { justify-content: center; }
@media (max-width: 560px) {
  [data-projects="list"] .pcard { flex-direction: column; }
  [data-projects="list"] .pcard-img { width: auto; }
  [data-projects="list"] .pcard-img--plate { margin: 12px 12px 0; }
}
