/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors — mirrors DESIGN.md color tokens */
  --color-primary:     #0e0e10;
  --color-secondary:   #9a9893;
  --color-accent:      #c42032;
  --color-surface:     #fafaf7;
  --color-surface-alt: #f1f0eb;
  --color-overlay:     #1a1a1c;
  --color-on-primary:  #dddddd;
  /* Dark surface opacity layers */
  --color-surface-on-dark:  rgba(250,250,247,0.85);
  --color-label-on-dark:    rgba(250,250,247,0.60);
  --color-surface-inactive: rgba(250,250,247,0.35);
  --color-muted-on-dark:    rgba(250,250,247,0.50);
  --color-dim-on-dark:      rgba(250,250,247,0.55);
  --color-border-on-dark:   rgba(250,250,247,0.12);
  --color-divider-on-dark:  rgba(250,250,247,0.08);
  /* Body text — primary at 80% opacity */
  --color-body-text:        rgba(14,14,16,0.80);
  /* Typography */
  --font-sans: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'Martian Mono', ui-monospace, monospace;
  /* Shapes — mirrors DESIGN.md rounded tokens */
  --radius-sm: 2px;
  /* Borders */
  --stroke:   1.5px solid var(--color-primary);
  --stroke-h: 1px   solid var(--color-primary);
  --stroke-m: 1px   dashed var(--color-secondary);
}

html { scroll-behavior: smooth; }

body {
  background: var(--color-surface-alt);
  color: var(--color-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ──────────────────────────────────────────── */
.sub {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
}
.years {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
}
.mono {
  font-family: var(--font-mono);
}
.body {
  font-family: var(--font-sans);
  line-height: 1.5;
  color: var(--color-body-text);
}
/* label modifier — font-weight + tracking only, no size or family */
.label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Chip ────────────────────────────────────────────────── */
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 6px 11px;
  border: var(--stroke);
  background: var(--color-surface);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  display: inline-block;
  white-space: nowrap;
  cursor: default;
}
.chip.active  { background: var(--color-primary); color: var(--color-surface); }
.chip.dark    { background: var(--color-overlay); color: var(--color-surface); }
.chip.outline-white {
  background: transparent;
  color: var(--color-surface);
  border-color: var(--color-surface);
}

/* ── Image slot (hatched placeholder) ───────────────────── */
.img-slot {
  display: block;
  width: 100%;
}
.img-slot:not(:has(img)) {
  border: var(--stroke);
}
.img-slot img {
  display: block;
  width: 100%;
  height: auto;
  object-position: top;
}
.proj-logo img {
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.img-slot-placeholder {
  background: repeating-linear-gradient(
    135deg,
    transparent         0   11px,
    rgba(14,14,16,0.08) 11px 12px
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-slot span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  background: var(--color-surface);
  padding: 2px 8px;
  border: var(--stroke-h);
}

/* ── Section header row ──────────────────────────────────── */
.section-row,
.sub-section-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-top: 14px;
}
.sub-section-row {
  border-top: var(--stroke);
}
.section-row .s-num {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  min-width: 36px;
  flex-shrink: 0;
}
.section-row h2 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  flex: 1;
}
.sub-section-row h3 {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  flex: 1;
}

/* ── Page wrapper ────────────────────────────────────────── */
.page {
  max-width: 1240px;
  margin: 0 auto;
  background: var(--color-surface);
}

/* ════════════════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════════════════ */
.site-header {
  border-bottom: 1.5px solid var(--color-border-on-dark);
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  padding: 14px 40px;
  gap: 24px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.header-dot {
  width: 22px;
  height: 22px;
  border: var(--stroke);
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}
.header-logo {
  height: 22px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.footer-logo {
  height: 22px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.header-name {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-surface);
}
.header-toc {
  flex: 1;
  display: flex;
  gap: 22px;
  justify-content: center;
}
.header-toc a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-on-primary);
  opacity: 0.6;
  transition: opacity 0.15s;
}
.header-toc a:hover { opacity: 1; }
.header-toc a.active { opacity: 1; font-weight: 600; }
/* ── Toggle button ───────────────────────────────────────── */
.toggle-button {
  display: inline-flex;
  padding: 2px;
  background: var(--color-surface-alt);
  border: var(--stroke);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.toggle-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  padding: 5px 14px;
  min-width: 60px;
  background: transparent;
  color: var(--color-primary);
  border: none;
  border-radius: 1px; /* radius-sm minus inset */
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
}
.toggle-btn.active {
  background: var(--color-primary);
  color: var(--color-surface);
}
/* Dark surface variant — header lang toggle */
.toggle-button--dark {
  background: transparent;
  border-color: var(--color-border-on-dark); /* border-on-dark */
}
.toggle-button--dark .toggle-btn {
  color: var(--color-on-primary);
}
.toggle-button--dark .toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
}

/* Hamburger — desktop hidden */
.ham-wrap {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.ham-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-surface);
  opacity: 0.6;
}
.hamburger {
  display: flex;
  width: 28px;
  height: 28px;
  border: 1.5px solid rgba(250,250,247,0.4);
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span { display: block; height: 1px; background: var(--color-surface); }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--color-border-on-dark);
  background: var(--color-overlay);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--color-divider-on-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-surface);
  opacity: 0.8;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a.active { color: var(--color-on-primary); font-weight: 600; opacity: 1; border-bottom: 1px solid var(--color-on-primary); }
.mobile-nav a::after {
  content: '→';
  color: rgba(250,250,247,0.3);
  font-size: 10px;
}
.mob-lang-section {
  margin-top: 24px;
  padding: 16px 18px 20px;
  border-top: 1px solid var(--color-border-on-dark);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mob-lang-section .toggle-button--dark { display: flex; border: none; padding: 0; background: transparent; }
.mob-lang-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-surface);
  opacity: 0.6;
}

/* ════════════════════════════════════════════════════════════
   01 HERO
════════════════════════════════════════════════════════════ */
#intro {
  padding: 70px 40px 60px;
  border-bottom: var(--stroke);
}
.hero-label { font-size: 12px; font-weight: 400; color: var(--color-accent); margin-bottom: 18px; }
.hero-first {
  font-family: var(--font-sans);
  font-size: 110px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 4px;
}
.hero-last {
  font-family: var(--font-sans);
  font-size: 110px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--color-accent);
}
h1.hero-name {
  margin: 0 0 20px;
  padding: 0;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
}
.hero-last .dot { color: var(--color-primary); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 50px;
  align-items: start;
}
.hero-subtitle { margin-bottom: 14px; }
.hero-body { font-size: 18px; line-height: 1.55; margin-bottom: 14px; }
.hero-ctas { margin-top: 22px; display: flex; gap: 10px; }
.hero-portrait { position: relative; align-self: stretch; }

/* ════════════════════════════════════════════════════════════
   02 CONTACT
════════════════════════════════════════════════════════════ */
#contact {
  padding: 40px;
  border-bottom: var(--stroke);
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: flex-start;
}
.contact-divider {
  border-left: 1.5px solid var(--color-on-primary);
  padding-left: 24px;
}
.contact-head {
  font-family: var(--font-sans);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-on-primary);
  margin-bottom: 10px;
}
.contact-links a,
.contact-elsewhere-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-on-primary);
  text-decoration: none;
  padding-top: 3px;
}
.contact-links a:hover,
.contact-elsewhere-link:hover { text-decoration: underline; }
.contact-link-icon {
  flex-shrink: 0;
  opacity: 0.7;
}
.contact-scroll-hint {
  display: flex;
  justify-content: center;
  padding-top: 32px;
}
.contact-scroll-arrow {
  color: var(--color-on-primary);
  opacity: 0.4;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   03 SKILLS
════════════════════════════════════════════════════════════ */
#skills {
  padding: 50px 40px;
  border-bottom: var(--stroke);
}
.skills-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.skills-chips .chip {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  padding: 8px 12px;
}
.strengths-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: var(--stroke);
}
.strength-cell {
  padding: 26px;
}
.strength-cell:nth-child(odd)  { border-right: var(--stroke); }
.strength-cell:nth-child(n+3)  { border-top:   var(--stroke); }
.strength-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.strength-bullet {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--color-accent);
  flex-shrink: 0;
}
.strength-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ways-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 40px;
  align-items: start;
  margin-top: 26px;
}
.ways-para {
  margin-bottom: 14px;
}
.ways-para:last-child {
  margin-bottom: 0;
}
.ways-tools-box {
}
.ways-col-label,
.ways-tools-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.ways-tools-chips ul {
  list-style: disc;
  padding-left: 18px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ways-tools-chips li {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-body-text);
}

/* ════════════════════════════════════════════════════════════
   04 HISTORY
════════════════════════════════════════════════════════════ */
#history {
  padding: 50px 40px;
  border-bottom: var(--stroke);
}
.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: var(--stroke);
}
.hist-work { border-right: var(--stroke); padding: 22px; }
.hist-edu  { padding: 22px; }
.hist-col-label { margin-bottom: 16px; }
.history-job {
  display: grid;
  grid-template-columns: 110px 1fr;
  padding: 14px 0;
  border-top: var(--stroke-h);
  gap: 12px;
}
.job-title   { font-family: var(--font-sans); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--color-primary); }
.job-company { font-family: var(--font-sans); font-size: 14px; margin-top: 3px; }
.job-desc    { font-family: var(--font-sans); font-size: 14px; line-height: 1.5; margin-top: 6px; color: var(--color-body-text); }
.edu-degree  { border-top: var(--stroke-h); padding-top: 14px; margin-bottom: 40px; }
.degree-details {
  list-style: disc;
  padding-left: 16px;
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
}
.degree-details li + li {
  margin-top: 4px;
}
.extra-ed-row {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  padding: 8px 0;
  border-top: var(--stroke-h);
  gap: 10px;
  align-items: baseline;
}

/* Mobile tabs (hidden on desktop) */
.history-tabs { display: none; }
.history-tab-panel { display: none; }

/* ════════════════════════════════════════════════════════════
   05 PROJECTS
════════════════════════════════════════════════════════════ */
#work {
  padding: 50px 40px 30px;
}
.featured-intro {
  margin-bottom: 22px;
  font-size: 16px;
}
.featured-disclaimer {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  font-style: italic;
  margin-top: 22px;
  color: var(--color-body-text);
}
.project-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

/* Accordion tile */
.proj-tile {
  border: var(--stroke);
  background: var(--color-surface);
  margin-bottom: 10px;
}
.proj-header {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 22px;
  align-items: stretch;
  padding: 18px 54px 18px 18px;
  position: relative;
  cursor: pointer;
  user-select: none;
}
.proj-logo {
  height: 70px;
  overflow: hidden;
  align-self: center;
}
.proj-header-text {
  display: flex;
  flex-direction: column;
}
.proj-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.55;
  flex: 1;
  display: flex;
  align-items: center;
}
.proj-meta { }
.caret-symbol {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-accent);
}
.proj-caret,
.ai-caret {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* Shared accordion body padding */
.accordion-body {
  padding: 0 26px 26px;
  background: var(--color-surface-alt);
}

.proj-body {
  display: none;
  padding: 0 26px 26px;
  background: var(--color-surface-alt);
}

/* Expanded state */
.proj-tile.expanded { background: var(--color-surface-alt); }
.proj-tile.expanded .proj-header { background: var(--color-surface-alt); padding: 40px 54px 0 26px; }
.proj-tile.expanded .proj-body   { display: block; }

.proj-detail-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 22px;
  padding-top: 24px;
  margin-bottom: 22px;
}
.proj-secondary { display: flex; flex-direction: column; gap: 12px; }
.proj-box {
  border: var(--stroke);
  padding: 16px;
  background: var(--color-surface);
}
.proj-box ul {
  margin: 0;
  padding-left: 16px;
  color: var(--color-body-text);
  font-size: 14px;
  line-height: 1.55;
  font-family: var(--font-sans);
}
.proj-sidelist-label {
  color: var(--color-accent);
  font-size: 14px;
  border-bottom: var(--stroke);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.proj-sidelist ul {
  margin: 0;
  padding-left: 16px;
  color: var(--color-body-text);
  font-size: 14px;
  line-height: 1.55;
  font-family: var(--font-sans);
}
.proj-screens-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.proj-screens-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* ════════════════════════════════════════════════════════════
   06 BASIC REFS
════════════════════════════════════════════════════════════ */
#basic-refs {
  padding: 60px 40px;
}
.refs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
button.chip { cursor: pointer; appearance: none; }
.refs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top:  var(--stroke-h);
  border-left: var(--stroke-h);
}
.ref-cell {
  border-right:  var(--stroke-h);
  border-bottom: var(--stroke-h);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.ref-top  { display: flex; flex-direction: row; align-items: baseline; gap: 6px; height: 36px; flex-shrink: 0; overflow: hidden; }
.ref-logo { height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ref-logo img { max-width: 90%; max-height: 90%; object-fit: contain; }
.ref-desc { font-family: var(--font-sans); font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--color-body-text); overflow-wrap: break-word; }

/* ════════════════════════════════════════════════════════════
   07 AI / PERSONAL
════════════════════════════════════════════════════════════ */
#ai {
  padding: 60px 40px;
}
.ai-row {
  border-top: var(--stroke-h);
}
.ai-row:first-of-type { border-top: none; }
.ai-header {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 24px;
  padding: 18px 54px 18px 26px;
  position: relative;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.ai-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-accent);
}
.ai-desc { font-size: 16px; }
.ai-expand { display: none; padding: 0 26px 26px; background: var(--color-surface-alt); }
.ai-body {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: 24px;
}
.ai-body-left { display: flex; flex-direction: column; gap: 10px; }
.ai-body-right .img-slot { width: 100%; }
.ai-row.expanded { background: var(--color-surface-alt); }
.ai-row.expanded .ai-header { padding: 40px 54px 40px 26px; }
.ai-row.expanded .ai-expand { display: block; }

/* ════════════════════════════════════════════════════════════
   08 WRITINGS
════════════════════════════════════════════════════════════ */
#writing {
  padding: 60px 40px;
  border-top: var(--stroke);
}
.writing-row {
  display: grid;
  grid-template-columns: 1fr;
  padding: 14px 54px 14px 0;
  border-top: var(--stroke-h);
  position: relative;
  text-decoration: none;
  color: var(--color-primary);
}
.writing-row:first-of-type { border-top: none; }
.writing-row:hover .wr-title { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   09 PERSONAL
════════════════════════════════════════════════════════════ */
#personal {
  padding: 60px 40px;
  border-top: var(--stroke);
}
.personal-interests {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: var(--stroke);
}
.personal-interests-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.personal-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.personal-card {
  padding: 24px;
  border-top: var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.personal-card:not(:last-child) {
  border-right: var(--stroke);
}
.personal-card-body {
  flex: 1;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-body-text);
}
.personal-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-primary);
  margin-top: auto;
}
.personal-card-link:hover .personal-card-link-label {
  text-decoration: underline;
}
.personal-icon {
  flex-shrink: 0;
  display: block;
}
#personal .section-row { margin-bottom: 22px; }

/* ════════════════════════════════════════════════════════════
   10 FOOTER
════════════════════════════════════════════════════════════ */
.site-footer {
  padding: 40px;
  background: var(--color-primary);
  color: var(--color-surface);
  display: grid;
  grid-template-columns: 1fr 3fr 1fr;
  gap: 32px;
  align-items: start;
}
.footer-brand-col {
  display: flex;
  align-items: flex-start;
}
.footer-contact-col {
  display: flex;
  flex-direction: column;
}
.footer-cta-col {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}
.footer-cta-btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-surface);
  text-decoration: none;
  border: 1.5px solid var(--color-on-primary);
  padding: 10px 18px;
  transition: background 0.15s, color 0.15s;
}
.footer-cta-btn:hover {
  background: var(--color-on-primary);
  color: var(--color-primary);
}
#footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-surface-on-dark);
  text-decoration: none;
}
.footer-link:hover { text-decoration: underline; }
.footer-link-icon {
  flex-shrink: 0;
  opacity: 0.7;
}
.footer-copyright-gap {
  margin-top: 32px;
}
.footer-copyright {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-on-primary);
}

/* ════════════════════════════════════════════════════════════
   MOBILE  ≤ 768px
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Header */
  .header-inner  { padding: 12px 18px; }
  .header-dot    { width: 18px; height: 18px; }
  .header-name   { font-size: 12px; }
  .header-toc    { display: none; }
  .toggle-button--dark { display: none; }
  .ham-wrap      { display: flex; }

  /* Hero */
  #intro { padding: 36px 18px 32px; }
  .hero-first,
  .hero-last { font-size: 54px; }
  .hero-first { margin-bottom: 2px; }
  .hero-last  { padding-bottom: 12px; }
  .hero-grid  { grid-template-columns: 1fr; gap: 18px; }
  .hero-portrait { order: -1; aspect-ratio: 1; }
  .hero-portrait img { position: static; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
  .hero-ctas  { flex-direction: column; }
  .hero-ctas .chip { text-align: center; padding: 10px; width: 100%; }

  /* Contact */
  #contact { padding: 32px 18px; }
  .contact-section-label { margin-bottom: 18px; }
  .contact-grid { grid-template-columns: 1fr; gap: 0; }
  .contact-divider {
    border-left: none;
    border-top: 1.5px solid var(--color-on-primary);
    padding-left: 0;
    padding-top: 16px;
    margin-top: 22px;
  }
  .contact-head { font-size: 32px; }

  /* Skills */
  #skills { padding: 36px 18px; }
  .skills-chips .chip { font-size: 12px; padding: 6px 9px; white-space: normal; }
  .strengths-grid { grid-template-columns: 1fr; }
  .strength-cell:nth-child(odd)  { border-right: none; }
  .strength-cell:nth-child(n+2)  { border-top: var(--stroke); }
  .strength-cell:nth-child(n+3)  { border-top: var(--stroke); }
  /* Ways */
  .ways-grid { grid-template-columns: 1fr; gap: 24px; }

  /* History */
  #history { padding: 36px 18px; }
  .history-grid  { display: block; }
  .hist-work     { display: none; border-right: none; padding: 0; }
  .hist-edu      { display: none; padding: 0; }
  .history-tabs  {
    display: flex;
    border-bottom: var(--stroke);
    margin-bottom: 14px;
  }
  .h-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: none;
    border-right: var(--stroke);
    background: transparent;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-primary);
  }
  .h-tab:last-child { border-right: none; }
  .h-tab.active { background: var(--color-primary); color: var(--color-surface); }

  .history-tab-panel.active { display: block; }
  .history-tab-panel { padding-top: 20px; }
  .history-tab-panel .history-job { display: block; }
  .history-tab-panel .history-job .sub { margin-bottom: 4px; }
  /* Projects */
  #work { padding: 36px 18px 24px; }
  .project-filters .chip { font-size: 9px; padding: 4px 7px; }
  .proj-header { grid-template-columns: 50px 1fr; gap: 12px; padding: 12px 44px 12px 12px; }
  .proj-logo   { height: 40px; }
  .proj-title  { font-size: 16px; }
  .proj-tile.expanded .proj-header { padding: 26px 44px 0 14px; }
  .proj-tile.expanded .proj-body   { padding: 0 14px 14px; }
  .proj-detail-grid  { grid-template-columns: 1fr; }
  .proj-screens-grid { gap: 6px; }

  /* Basic refs */
  #basic-refs { padding: 36px 18px; }
  .refs-grid  { grid-template-columns: repeat(2, 1fr); }

  /* AI */
  #ai { padding: 36px 18px; }
  .ai-header {
    grid-template-columns: 1fr;
    gap: 4px 0;
    padding: 14px 44px 14px 14px;
  }
  .ai-title  { font-size: 14px; }
  .ai-expand { padding: 0 14px 14px; }
  .ai-row.expanded .ai-header { padding: 26px 44px 26px 14px; }
  .ai-body   { grid-template-columns: 1fr; }

  /* Writings */
  #writing { padding: 36px 18px; }

  /* Personal */
  #personal { padding: 36px 18px; }
  .personal-cards { grid-template-columns: 1fr; }
  .personal-card:not(:last-child) { border-right: none; border-bottom: var(--stroke); }

  /* Footer */
  .site-footer {
    padding: 28px 18px;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-cta-col {
    justify-content: flex-start;
  }
}

/* ════════════════════════════════════════════════════════════
   NEW SEMANTIC CLASSES (inline-style refactor)
════════════════════════════════════════════════════════════ */

/* Hero */
.hero-body p + p { margin-top: 12px; }
@media (min-width: 769px) {
  .hero-portrait img { position: absolute; bottom: 0; right: 0; aspect-ratio: 1; max-height: 100%; max-width: 100%; height: auto; width: auto; display: block; object-fit: cover; object-position: top center; }
}

/* Contact */
.contact-section-label {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-on-primary);
  margin-bottom: 24px;
}
.contact-avail-sub    { font-size: 16px; color: var(--color-on-primary); line-height: 1.5; margin-top: 8px; }
.contact-col-head {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-on-primary);
  margin-bottom: 16px;
}
.contact-email-val    { margin-bottom: 16px; }
.contact-email-wrap   { display: flex; align-items: center; gap: 9px; }
.contact-email-icon   { flex-shrink: 0; color: var(--color-on-primary); display: block; }
.contact-email-link {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-on-primary);
  text-decoration: none;
}
.contact-email-link:hover { color: var(--color-accent); }
.contact-looking-body  { font-size: 16px; color: var(--color-on-primary); line-height: 1.5; }

/* Section rows — per-section spacing */
#skills     .section-row     { margin-bottom: 26px; }
#history    .section-row     { margin-bottom: 28px; }
#work       .section-row     { margin-bottom: 24px; }
#basic-refs .sub-section-row { margin-bottom: 22px; }
#ai         .sub-section-row { margin-bottom: 24px; }
#writing    .section-row     { margin-bottom: 22px; }

/* Skills */
.section-sub-label { margin-bottom: 12px; }
.strength-body     { font-size: 14px; }

/* History — desktop */
.degree-name       { font-family: var(--font-sans); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 6px; }
.add-edu-label     { margin-top: 18px; margin-bottom: 10px; }
.edu-name          { font-size: 14px; }

/* History — shared desktop + mobile */
.degree-year-school { margin-bottom: 6px; }

/* First mobile history job — no top border */
.history-job--first { border-top: none !important; padding-top: 0 !important; }

/* Image slot aspect-ratio variants */

/* Projects */
.proj-logo-label         { font-size: 9px; }
.proj-client-label       { color: var(--color-accent); margin-bottom: 6px; }
.proj-box-label          { color: var(--color-accent); font-size: 14px; margin-bottom: 8px; }
.proj-role-label {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: block;
  margin-bottom: 8px;
}
.proj-role-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
}
.proj-role-p             { font-size: 16px; margin-bottom: 10px; }
.proj-role-p:last-child  { margin-bottom: 0; }
.proj-screens-label      { }
.proj-gallery-link       { color: var(--color-accent); }

/* Basic refs */
.refs-browse    { }
.ref-industry   { }
.ref-logo-label { font-size: 9px; }

/* AI */
.ai-body-meta {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
}
.ai-body-purpose { color: var(--color-accent); }
.ai-body-body { font-size: 16px; line-height: 1.5; }
.ai-body-body ul, .ai-body-body ol { padding-left: 18px; margin: 6px 0; }
.ai-body-body li { margin-bottom: 4px; }
.ai-tools     { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-repo,
.ai-repo-note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  word-break: break-all;
}
.ai-repo {
  color: var(--color-accent);
  text-decoration: none;
}
.ai-repo:hover { text-decoration: underline; }
.ai-repo-note  { }

/* Writings */
.wr-title { font-size: 18px; line-height: 1.55; }
.wr-link  {
  color: var(--color-accent);
  font-size: 18px;
  line-height: 1.55;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* Footer */

/* ════════════════════════════════════════════════════════════
   LIGHTBOX
════════════════════════════════════════════════════════════ */
.lb-trigger {
  cursor: zoom-in;
}
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 16, 0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.lightbox.open {
  display: flex;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--color-surface);
  cursor: pointer;
  padding: 6px;
  opacity: 0.7;
  line-height: 0;
  transition: opacity 0.15s;
}
.lightbox-close:hover {
  opacity: 1;
}
