/* ================================================================
   style.css — Aarya Bookseller
   Design: Engineering Precision
   Inspired by: teenage.engineering · worklouder.cc · ollivere.co
   ================================================================ */

/* 1. RESET
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { letter-spacing: 0; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  --ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 180ms;
  --dur-slow: 520ms;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  margin-bottom: 16px;
  line-height: 1.65;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
strong { font-weight: 600; }
em { font-style: italic; }
/* 2. LAYOUT
   ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 48px;
}
@media (max-width: 768px)  { .container { padding-inline: 24px; } }
@media (max-width: 480px)  { .container { padding-inline: 16px; } }

/* 3. TYPOGRAPHY
   ---------------------------------------------------------------- */
h1 { font-size: 3.25rem; font-weight: 700; line-height: 1.1; }
h2 { font-size: 1.8rem; font-weight: 700; line-height: 1.2; letter-spacing: 0.3px; margin-top: 0; margin-bottom: 24px; }
h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
h4 { font-size: 0.9rem; font-weight: 600; }
code, pre { font-family: var(--font-mono); }
@media (max-width: 768px) {
  h1 { font-size: 2.45rem; }
  h2 { font-size: 1.45rem; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.72rem; }
  h2 { font-size: 1.25rem; }
}

/* 4. HEADER
   ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--dur-fast) var(--ease-apple), border-color var(--dur-fast) var(--ease-apple), box-shadow var(--dur-fast) var(--ease-apple);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 16px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.site-nav a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: color 0.12s, background-color 0.12s;
}
.site-nav a:hover {
  color: var(--text);
  background-color: var(--bg-2);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background-color: var(--bg-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Icon buttons (theme toggle, accent picker) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  line-height: 0;
}
.btn-icon:hover { color: var(--text); border-color: var(--muted); }
.btn-icon svg { width: 15px; height: 15px; }

/* Alias: old pages may use .theme-toggle class for icon buttons */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  line-height: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle svg { width: 15px; height: 15px; }

/* Theme icon swap */
.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-moon { display: block; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* Accent picker dropdown */
.accent-picker { position: relative; }
.accent-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  padding: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: none;
  gap: 6px;
  z-index: 50;
}
.accent-picker[aria-expanded="true"] .accent-menu { display: flex; }
.accent-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.1s;
}
.accent-swatch:hover { transform: scale(1.15); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 53px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 14px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 8px; font-size: 0.88rem; }
  .header-bar { position: relative; }
}
@media (min-width: 769px) { .nav-toggle { display: none; } }

/* 5. HERO
   ---------------------------------------------------------------- */
.hero {
  padding: 54px 0 44px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 10%, transparent), transparent 45%),
    var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 56px;
  align-items: start;
}
.hero-content {
  min-width: 0;
}
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.hero-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
}
.hero-lead {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 58ch;
  margin-bottom: 12px;
}
.intro-block {
  margin: 28px 0;
  max-width: 62ch;
}
.intro-block + .intro-block {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.intro-block h2 {
  font-size: 1.05rem;
}
.intro-block p {
  color: var(--muted);
  font-size: 0.94rem;
}
.intro-block p:last-child {
  margin-bottom: 0;
}
.hero-sub {
  font-size: 0.87rem;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 28px;
}
.hero-portrait { padding-top: 6px; }
.hero-portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hero-panel {
  margin-top: 92px;
  border: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 5%, transparent), transparent 58%),
    var(--bg-1);
  overflow: hidden;
  transform: translateY(0);
  transition: transform var(--dur-slow) var(--ease-apple), border-color var(--dur-fast) var(--ease-apple), background-color var(--dur-fast) var(--ease-apple);
}
.hero-panel:hover {
  transform: translateY(-4px);
  border-color: var(--muted);
}
.hero-panel img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-bottom: 1px solid var(--border);
}
.hero-panel__body {
  padding: 18px;
}
.hero-panel__body > span {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  text-transform: uppercase;
}
.hero-panel__body > strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 14px;
}
.hero-panel__rows {
  display: grid;
  border-top: 1px solid var(--border);
}
.hero-panel__rows p {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
.hero-panel__rows p:last-child { border-bottom: none; }
.hero-panel__rows b { color: var(--text); font-weight: 700; }
@media (max-width: 860px) {
  .hero { padding: 48px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-portrait, .hero-panel { order: -1; max-width: 420px; margin-top: 0; }
  .hero-portrait img { max-width: 160px; }
  .home-page .hero-panel { order: 0; }
}

/* 6. BUTTONS
   ---------------------------------------------------------------- */
.cta-row, .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-sans);
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-apple), background-color var(--dur-fast) var(--ease-apple), color var(--dur-fast) var(--ease-apple), border-color var(--dur-fast) var(--ease-apple);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--bg-2); border-color: var(--muted); }
.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn--primary:hover { opacity: 0.88; }
.btn--sm { padding: 5px 10px; font-size: 0.78rem; }

/* 7. PROFILE ICONS
   ---------------------------------------------------------------- */
.profile-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.profile-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-apple), color var(--dur-fast) var(--ease-apple), border-color var(--dur-fast) var(--ease-apple), background-color var(--dur-fast) var(--ease-apple);
}
.profile-icons a:hover { color: var(--text); border-color: var(--muted); text-decoration: none; transform: translateY(-1px); background: var(--bg-2); }
.profile-icons svg { width: 16px; height: 16px; display: block; }

/* 8. MUSIC PILL
   ---------------------------------------------------------------- */
.music-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  font-size: 0.8rem;
  color: var(--muted);
}
.music-pill .play-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.78rem;
  line-height: 1;
}
.eq { display: flex; gap: 2px; height: 14px; align-items: flex-end; }
.eq-bar { width: 2px; background: var(--accent); opacity: 0.4; transform-origin: bottom center; }
.eq-bar:nth-child(1) { height: 6px; }
.eq-bar:nth-child(2) { height: 10px; }
.eq-bar:nth-child(3) { height: 7px; }
.eq-bar:nth-child(4) { height: 12px; }
.eq-bar:nth-child(5) { height: 5px; }
.is-playing .eq-bar { opacity: 1; animation: beat 1s ease-in-out infinite; }
.is-playing .eq-bar:nth-child(2) { animation-delay: 0.1s; }
.is-playing .eq-bar:nth-child(3) { animation-delay: 0.2s; }
.is-playing .eq-bar:nth-child(4) { animation-delay: 0.3s; }
.is-playing .eq-bar:nth-child(5) { animation-delay: 0.4s; }
@keyframes beat { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }

/* 9. SECTIONS
   ---------------------------------------------------------------- */
.section,
.hero,
.hero-section {
  animation: softReveal var(--dur-slow) var(--ease-apple) both;
}
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--border); }
main > section {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e8e8e8;
}
main > section:last-child {
  border-bottom: none;
}
.home-page main > section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.home-page .section + .section {
  border-top: none;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  display: block;
}
.section-lead {
  font-size: 0.96rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 66ch;
  margin-bottom: 32px;
}
.updates-section {
  padding: 52px 0;
  background: var(--bg);
}
.updates-timeline {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 920px;
  list-style: none;
  padding: 6px 0 0;
  margin: 0;
}
.updates-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--border));
}
.timeline-update {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(118px, 154px) minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  padding: 0 0 24px;
  min-width: 0;
}
.timeline-update:last-child { padding-bottom: 0; }
.timeline-update__date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1.35;
  padding-top: 1px;
}
.timeline-update__point {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 2px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 35%, var(--border));
}
.timeline-update--major .timeline-update__point {
  background: var(--bg);
  box-shadow:
    inset 0 0 0 3px var(--accent),
    0 0 0 1px color-mix(in oklab, var(--accent) 45%, var(--border)),
    0 0 0 7px color-mix(in oklab, var(--accent) 9%, transparent);
}
.timeline-update__body {
  min-width: 0;
  max-width: 72ch;
  padding-bottom: 2px;
}
.timeline-update__body h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  line-height: 1.25;
}
.timeline-update__body h2 a {
  color: inherit;
  text-decoration: none;
}
.timeline-update__body h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}
.timeline-update__body p a {
  color: var(--accent);
}
.timeline-update__body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.58;
  text-align: left;
  overflow-wrap: anywhere;
}
@media (max-width: 860px) {
  .updates-section .container {
    padding-right: 28px;
  }
  .updates-timeline {
    padding-top: 2px;
  }
  .timeline-update {
    grid-template-columns: 18px minmax(0, 1fr);
    row-gap: 3px;
    column-gap: 16px;
    padding-bottom: 26px;
  }
  .timeline-update__date {
    grid-column: 2;
  }
  .timeline-update__point {
    grid-column: 1;
    grid-row: 1 / 3;
    margin-top: 2px;
  }
  .timeline-update__body {
    grid-column: 2;
  }
  .timeline-update__body h2 { font-size: 1rem; }
  .timeline-update__body p { font-size: 0.9rem; }
}
@keyframes softReveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-section {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--border);
}
.hero-section--portfolio,
.hero-section--index {
  padding: 42px 0 32px;
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 12%, transparent), transparent 42%),
    var(--bg);
}
.portfolio-hero,
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 44px;
  align-items: end;
}
.portfolio-hero__copy,
.page-hero__copy {
  max-width: 68ch;
}
.portfolio-hero__eyebrow,
.page-hero__eyebrow {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
}
.hero-page-title {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-page-lead {
  font-size: 0.94rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.7;
  margin-bottom: 24px;
}
.portfolio-snapshot,
.page-snapshot {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.snapshot-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}
.snapshot-metric {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
}
.snapshot-metric:last-child { border-right: none; }
.snapshot-metric strong {
  display: block;
  font-size: 1.4rem;
  color: var(--text);
  line-height: 1;
}
.snapshot-metric span {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--muted);
  line-height: 1.25;
}
.snapshot-focus {
  padding: 16px;
}
.snapshot-focus span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--muted);
  text-transform: uppercase;
}
.snapshot-focus strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
  color: var(--text);
}
.snapshot-focus p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
}
.service-focus {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.service-focus__label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent);
  text-transform: uppercase;
}
.service-focus h2 {
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 10px;
}
.service-focus p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 14px;
}
.service-focus__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.service-focus__list span {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.72rem;
  color: var(--muted-strong);
  background: var(--bg-1);
}
.portfolio-toolbar,
.page-toolbar {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
  .hero-title { font-size: 2.35rem; }
  .hero-page-title { font-size: 2.1rem; }
  .portfolio-hero,
  .page-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
@media (max-width: 480px) {
  .hero .container,
  .hero-content,
  .intro-block,
  .hero-lead,
  .context-strip,
  .focus-areas {
    max-width: 100%;
    min-width: 0;
  }
  .hero-title {
    max-width: 11ch;
    font-size: 1.42rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .hero-lead,
  .intro-block p,
  .context-strip {
    max-width: 28ch;
    overflow-wrap: anywhere;
  }
  .focus-pill {
    max-width: 100%;
    white-space: normal;
  }
  .hero-page-title { font-size: 1.75rem; }
  .hero-section--portfolio,
  .hero-section--index { padding-top: 34px; }
}
@media (max-width: 380px) {
  .snapshot-metrics { grid-template-columns: 1fr; }
  .snapshot-metric { border-right: none; border-bottom: 1px solid var(--border); }
  .snapshot-metric:last-child { border-bottom: none; }
}

/* 10. ABOUT CARDS
   ---------------------------------------------------------------- */
.about-section { padding-top: 46px; }
.home-page .about-section {
  padding-bottom: 16px;
}
.home-page .updates-section {
  padding-top: 16px;
  border-top: 0 !important;
  box-shadow: none;
}
.section-heading {
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) minmax(0, 0.64fr);
  gap: 32px;
  align-items: start;
  margin-bottom: 28px;
}
.section-heading .section-label { margin-bottom: 0; }
.section-heading .section-lead { margin-bottom: 0; max-width: none; }
.about-box-grid {
  column-count: 2;
  column-gap: 12px;
}
.about-box-grid > * {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
}
.about-story,
.about-card--compact {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  border-radius: var(--radius);
  padding: 18px;
  align-self: start;
  min-height: 0;
}
.about-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}
.about-story h2 {
  font-size: 1.35rem;
  line-height: 1.15;
  margin-bottom: 12px;
}
.about-story p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 10px;
}
.about-card--compact {}
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  gap: 1px;
}
.about-card {
  background: var(--bg-1);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  padding: 28px;
  transition: background 0.18s;
}
.about-card:hover {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 4%, transparent), transparent 58%),
    var(--bg-1);
}
.card-label {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: block;
}
.about-card p { font-size: 0.875rem; color: var(--muted); line-height: 1.75; }
.about-card p + p { margin-top: 10px; }
.about-card a { color: var(--accent); }
@media (max-width: 900px) {
  .section-heading,
  .about-layout { grid-template-columns: 1fr; }
  .about-layout .about-card--compact:last-child { grid-column: auto; }
  .about-box-grid { column-count: 1; }
  .about-story { min-height: 0; }
}
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

/* 11. PRINCIPLES
   ---------------------------------------------------------------- */
.principles-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  overflow: hidden;
  margin-top: 32px;
}
.principles-block--compact { margin-top: 0; }
.hobbies-block {
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.about-card,
.about-story,
.principles-block,
.service-card,
.qual-section,
.info-card,
.skills-card,
.skills-group,
.cert-card,
.course-card,
.pub-card,
.timeline-item,
.project-card {
  transition: transform var(--dur-slow) var(--ease-apple), border-color var(--dur-fast) var(--ease-apple), background-color var(--dur-fast) var(--ease-apple), box-shadow var(--dur-slow) var(--ease-apple);
}
.about-card:hover,
.about-story:hover,
.service-card:hover,
.info-card:hover,
.pub-card:hover,
.project-card:hover {
  transform: translateY(-3px);
}
.principles-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.principles-list { list-style: none; }
.principles-list li {
  display: flex;
  gap: 12px;
  padding: 10px 18px;
  font-size: 0.875rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.principles-list li:last-child { border-bottom: none; }
.principle-n {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.5;
  min-width: 20px;
  padding-top: 2px;
}
.principles-list strong { color: var(--text); font-weight: 600; }

/* 12. PORTFOLIO CONTROLS
   ---------------------------------------------------------------- */
.project-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0;
  align-items: flex-end;
}
.control-field {
  display: grid;
  gap: 5px;
  min-width: 160px;
}
.control-field span {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
}
.control-field select {
  width: 100%;
  min-height: 36px;
  padding: 7px 32px 7px 10px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--text);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background-color 0.12s;
  color-scheme: light dark;
}
.control-field select:hover { border-color: var(--muted); }
.control-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 380px) {
  .control-field { flex: 1 1 100%; min-width: 0; }
}

/* 13. PROJECT CARDS
   ---------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 960px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  border: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  border-radius: var(--radius);
  background: var(--bg-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background 0.18s;
  transition: border-color 0.12s;
  opacity: 0;
  transform: translateY(8px);
}
.project-card[hidden] { display: none; }
.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.12s;
}
.project-card:hover {
  border-color: var(--muted);
  transform: translateY(-3px);
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 4%, transparent), transparent 58%),
    var(--bg-1);
}
.project-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}
.project-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-card__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 8px;
}
.project-card__title {
  font-size: 0.94rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.3;
}
.project-card__date {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--muted-strong);
  line-height: 1.25;
}
.project-card__meta {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--muted-strong);
  margin-bottom: 10px;
  line-height: 1.4;
}
.project-card__links {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.12s, border-color 0.12s;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.project-card p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 8px;
}

/* 14. PILLS / TAGS
   ---------------------------------------------------------------- */
.pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  background: var(--bg-2);
  white-space: nowrap;
  text-decoration: none;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  background: var(--bg-2);
}

/* 15. QUALIFICATIONS
   ---------------------------------------------------------------- */
.qual-main { display: grid; gap: 0; }
#experience {
  order: -1;
  border-radius: var(--radius) var(--radius) 0 0;
}
#publications { border-radius: 0; }
.qual-section {
  border: 1px solid var(--border);
  background: var(--bg-1);
  border-bottom: none;
}
.qual-section:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.qual-section:last-child  { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }

.qual-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 16px;
}
.qual-summary::-webkit-details-marker { display: none; }
.qual-summary::after { content: "+"; font-size: 1rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.qual-section[open] > .qual-summary::after { content: "−"; }
.qual-section[open] > .qual-summary { border-bottom: 1px solid var(--border); }

.qual-head { display: flex; flex-direction: column; gap: 4px; }
.qual-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  color: var(--muted);
}
.qual-summary h2 { font-size: 1.05rem; font-weight: 700; }
.qual-body { padding: 24px; display: grid; gap: 20px; }

/* Publications */
.qual-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.info-card {
  border: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg);
  transition: background 0.18s;
}
.info-card:hover {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 5%, transparent), transparent 58%),
    var(--bg);
}
.info-card h3 { font-size: 0.92rem; font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.info-card .meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.4;
  display: block;
}
.info-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; margin-bottom: 8px; }
.info-card ul { padding-left: 1.2em; list-style: disc; margin-bottom: 8px; }
.info-card li { font-size: 0.84rem; color: var(--muted); margin-bottom: 4px; }
.info-card a { color: var(--accent); }

/* Experience */
.timeline { display: grid; gap: 10px; }
.timeline-item {
  border: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  border-radius: var(--radius);
  background: var(--bg-1);
  overflow: hidden;
  transition: background-color 0.1s, border-color 0.1s;
}
.timeline-item:first-child,
.timeline-item:last-child { border-radius: var(--radius); }
.timeline-item:hover,
.timeline-item[open] {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 6%, transparent), transparent 55%),
    var(--bg-1);
}
.timeline-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 18px 22px;
  cursor: pointer;
  list-style: none;
}
.timeline-item summary::-webkit-details-marker { display: none; }
.timeline-item summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}
.timeline-item summary:only-child::after { content: ""; }
.timeline-item[open] summary {
  border-bottom: 1px solid var(--border);
}
.timeline-item[open] summary::after { content: "−"; }
.timeline-item[open] summary:only-child {
  border-bottom: none;
}
.timeline-item[open] summary:only-child::after { content: ""; }
.xp-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.xp-company {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
}
.timeline-item h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0; }
.timeline-item h3 a { color: var(--text); text-decoration: none; }
.timeline-item h3 a::after { content: " ↗"; font-size: 0.72em; color: var(--accent); opacity: 0.7; }
.timeline-item h3 a:hover { color: var(--accent); }
.xp-sub {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
  display: block;
}
.timeline-detail {
  padding: 18px 22px 22px;
}
.xp-overview {
  max-width: 78ch;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 14px;
}
.timeline-item ul { padding-left: 1.2em; list-style: disc; margin-bottom: 10px; }
.timeline-item li { font-size: 0.86rem; color: var(--muted); margin-bottom: 7px; line-height: 1.6; }
.timeline-item li strong { color: var(--text); }
.xp-focus {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.xp-focus span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--accent) 5%, var(--bg-2));
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 9px;
}

/* Education */
.edu-card {
  border: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg);
  transition: background 0.18s;
}
.edu-card:hover {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 6%, transparent), transparent 58%),
    var(--bg);
}
.edu-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.edu-card .meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); display: block; margin-bottom: 4px; }
.edu-card .tag-list { margin-top: 14px; }
.edu-card .xp-overview {
  max-width: none;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.skills-group {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  transition: background 0.18s;
}
.skills-group:hover {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 5%, transparent), transparent 58%),
    var(--bg-1);
}
.skills-group h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
@media (max-width: 760px) { .skills-grid { grid-template-columns: 1fr; } }

/* Certifications */
.cert-list { list-style: none; }
.cert-list--timeline {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cert-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  background: var(--bg-1);
  transition: background 0.18s;
}
.cert-row:hover {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 4%, transparent), transparent 56%),
    var(--bg-1);
}
.cert-row:last-child { border-bottom: none; }
.cert-row h3 {
  font-size: 0.9rem;
  margin-bottom: 3px;
}
.cert-row h3 a { color: var(--text); }
.cert-row h3 a:hover { color: var(--accent); }
.cert-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.cert-date { font-family: var(--font-mono); font-size: 0.69rem; color: var(--accent); white-space: nowrap; }
@media (max-width: 560px) {
  .cert-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Coursework */
.coursework-grid { display: grid; gap: 0; margin-top: 4px; }
.course-card {
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--bg-1);
  overflow: hidden;
}
.course-card:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.course-card:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.course-card summary {
  padding: 14px 20px;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
  color: var(--text);
}
.course-card summary::-webkit-details-marker { display: none; }
.course-card summary::after { content: "+"; font-weight: 700; color: var(--muted); }
.course-card[open] summary::after { content: "−"; }
.course-card[open] summary { border-bottom: 1px solid var(--border); }
.course-card .pills { padding: 16px 20px 18px; }
.course-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 22px;
  row-gap: 0;
  padding: 16px 20px 18px;
}
.course-list span {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.course-list span:last-child,
.course-list span:nth-last-child(2),
.course-list span:nth-last-child(3):nth-child(3n+1) { border-bottom-color: transparent; }
.course-list strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .course-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-list span:nth-last-child(3):nth-child(3n+1) {
    border-bottom-color: color-mix(in oklab, var(--border) 70%, transparent);
  }
  .course-list span:nth-last-child(2):nth-child(odd) { border-bottom-color: transparent; }
}
@media (max-width: 600px) {
  .course-list { grid-template-columns: 1fr; }
  .course-list span:nth-last-child(2):nth-child(odd) {
    border-bottom-color: color-mix(in oklab, var(--border) 70%, transparent);
  }
  .course-list span { grid-template-columns: 76px minmax(0, 1fr); }
  .course-list span:last-child { border-bottom-color: transparent; }
}

/* Page local nav */
.local-nav { display: flex; gap: 5px; flex-wrap: wrap; margin: 16px 0 24px; }
.page-toolbar .local-nav { margin: 0; }
.local-nav a {
  font-size: 0.76rem;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: color 0.12s, border-color 0.12s;
}
.local-nav a:hover { color: var(--text); border-color: var(--muted); }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Resume button (used on qual page) */
.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  background: transparent;
  transition: background-color 0.12s, border-color 0.12s;
}
.resume-btn:hover { background: var(--bg-2); border-color: var(--muted); text-decoration: none; }

/* 16. SERVICE PAGE
   ---------------------------------------------------------------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.service-card {
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  background: var(--bg-1);
  transition: background 0.18s;
}
.service-card:hover {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 4%, transparent), transparent 58%),
    var(--bg-1);
}
.service-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  display: block;
}
.service-card-body { padding: 22px; }
.service-card h3 { font-size: 0.94rem; font-weight: 700; margin-bottom: 10px; }
.service-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; margin-bottom: 8px; }
.service-card a { color: inherit; display: block; text-decoration: none; }
.service-card a:hover { text-decoration: none; }
.service-link { font-size: 0.78rem; color: var(--accent); font-weight: 600; margin-top: 10px; display: block; }
@media (max-width: 760px) { .service-grid { grid-template-columns: 1fr; } }

/* Contact page */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 28px;
  align-items: start;
}
.contact-panel,
.contact-card {
  border: 1px solid var(--border);
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, var(--border));
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 4%, transparent), transparent 58%),
    var(--bg-1);
}
.contact-panel {
  padding: 28px;
}
.contact-panel h2,
.contact-card h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}
.contact-panel p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}
.contact-methods {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.contact-method {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.contact-method span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}
.contact-method a {
  color: var(--text);
  text-align: right;
}
.contact-method a:hover {
  color: var(--accent);
}
.contact-card {
  padding: 28px;
}
.contact-form {
  display: grid;
  gap: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field {
  display: grid;
  gap: 7px;
}
.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  padding: 11px 12px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-apple), background-color var(--dur-fast) var(--ease-apple);
}
.field textarea {
  min-height: 180px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}
.contact-submit {
  justify-self: start;
}
.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
@media (max-width: 860px) {
  .contact-layout,
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* 17. FOOTER
   ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  margin-top: 64px;
}
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--muted);
}
.footer-contact {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--accent);
  text-decoration: none;
  margin-left: auto;
}
.footer-contact:hover {
  color: var(--text);
  text-decoration: none;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 5px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.84rem;
  text-decoration: none;
  transition: color 0.12s, border-color 0.12s;
}
.footer-links a:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.footer-links img { width: 14px; height: 14px; object-fit: contain; }

/* Tooltip */
.tooltip { position: relative; display: inline-flex; }
.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 0.73rem;
  white-space: nowrap;
  transition: opacity 0.12s;
  z-index: 20;
  pointer-events: none;
}
.tooltip:hover .tooltip-text { visibility: visible; opacity: 1; }

/* 18. BACK TO TOP
   ---------------------------------------------------------------- */
#backToTop {
  position: fixed;
  top: 50%;
  right: 18px;
  z-index: 1000;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%);
  transition: opacity 0.2s, color 0.12s, border-color 0.12s, transform 0.2s;
}
#backToTop:hover {
  color: var(--text);
  border-color: var(--muted);
  transform: translateY(-50%) translateX(-2px);
}
#backToTop.show { opacity: 1; visibility: visible; }

/* 19. A11Y
   ---------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* ================================================================
   PROGRESSIVE DISCLOSURE & COMPACT STYLES
   ================================================================ */

/* Focus area pills (hero) */
.focus-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
}
.focus-pill {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  background: var(--bg-1);
}
.hero-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}
.hero-signal-grid div {
  padding: 14px;
  background: var(--bg-1);
}
.hero-signal-grid strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--text);
}
.hero-signal-grid span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 680px) {
  .hero-signal-grid { grid-template-columns: 1fr; }
}

/* Context strip (end-to-end line) */
.context-strip {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--muted);
  margin-bottom: 28px;
  opacity: 0.7;
}

/* Fact list — about cards */
.fact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}
.fact-list li {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}
.fact-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: 0.7;
}
.fact-list a { color: var(--accent); }
.fact-list strong { color: var(--text); font-weight: 600; }

/* Project card: expandable details */
.project-details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.project-details > summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.12s, background 0.12s;
}
.project-details > summary::-webkit-details-marker { display: none; }
.project-details > summary::after {
  content: "↓";
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
}
.project-details[open] > summary::after { content: "↑"; }
.project-details > summary:hover { color: var(--accent); }
.project-details__body { padding-top: 12px; }
.project-details__body p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 8px;
}

/* Background: collapsible timeline items */
details.tl-item {
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--bg-1);
}
details.tl-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
details.tl-item:last-child  { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
details.tl-item:hover { background: var(--bg-2); }
details.tl-item[open] { background: var(--bg-1); }

details.tl-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 24px;
  user-select: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
details.tl-item > summary::-webkit-details-marker { display: none; }
details.tl-item > summary::after {
  content: "+";
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 1px;
}
details.tl-item[open] > summary::after { content: "−"; }
details.tl-item[open] > summary { border-bottom: 1px solid var(--border); }

.tl-title { font-size: 0.92rem; font-weight: 700; margin-bottom: 3px; }
.tl-title a { color: var(--text); }
.tl-title a:hover { text-decoration: underline; }
.tl-meta {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 4px;
}
.tl-result {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.tl-body {
  padding: 16px 24px 20px;
}
.tl-body ul {
  padding-left: 1.2em;
  list-style: disc;
}
.tl-body li { font-size: 0.84rem; color: var(--muted); margin-bottom: 4px; line-height: 1.55; }
.tl-body .xp-sub { margin-top: 10px; }

/* Compact publication cards */
.pub-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}
.pub-card__top { padding: 18px 20px; }
.pub-card h3 { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; line-height: 1.4; }
.pub-card .meta {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
  line-height: 1.4;
}

.pub-expand > summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  user-select: none;
  transition: color 0.12s;
}
.pub-expand > summary::-webkit-details-marker { display: none; }
.pub-expand > summary::after { content: "↓"; }
.pub-expand[open] > summary::after { content: "↑"; }
.pub-expand > summary:hover { color: var(--text); }
.pub-expand__body { padding: 16px 20px; }
.pub-expand__body p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; margin-bottom: 8px; }
.pub-expand__body ul { padding-left: 1.2em; list-style: disc; margin-bottom: 8px; }
.pub-expand__body li { font-size: 0.84rem; color: var(--muted); margin-bottom: 4px; }
.pub-expand__body a { color: var(--accent); }

/* Final homepage mobile guardrails */
@media (max-width: 480px) {
  .home-page .hero .container,
  .home-page .hero-grid,
  .home-page .hero-content,
  .home-page .intro-block,
  .home-page .focus-areas,
  .home-page .hero-signal-grid,
  .home-page .cta-row,
  .home-page .music-pill {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .home-page .hero-title {
    width: 100%;
    max-width: 100%;
    font-size: 1.7rem;
    line-height: 1.15;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .home-page .hero-lead,
  .home-page .intro-block p,
  .home-page .context-strip,
  .home-page .hero-signal-grid span {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .home-page .focus-pill,
  .home-page .btn,
  .home-page .music-pill {
    white-space: normal;
  }
}

/* ================================================================
   A11Y / MOTION
   ================================================================ */
@media (prefers-reduced-motion: no-preference) {
  body {
    animation: pageEnter 520ms var(--ease-apple) both;
  }

  .reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 650ms var(--ease-apple) var(--reveal-delay, 0ms),
      transform 650ms var(--ease-apple) var(--reveal-delay, 0ms),
      border-color var(--dur-fast) var(--ease-apple),
      background-color var(--dur-fast) var(--ease-apple),
      box-shadow var(--dur-fast) var(--ease-apple);
    will-change: opacity, transform;
  }

  .reveal-on-scroll.is-revealed {
    opacity: 1;
    transform: translateY(0);
  }

  .btn,
  .btn-icon,
  .theme-toggle,
  .project-card,
  .service-card,
  .qual-section,
  .timeline-item,
  .contact-card,
  .contact-panel {
    transition:
      transform var(--dur-fast) var(--ease-apple),
      border-color var(--dur-fast) var(--ease-apple),
      background-color var(--dur-fast) var(--ease-apple),
      color var(--dur-fast) var(--ease-apple),
      box-shadow var(--dur-fast) var(--ease-apple);
  }
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .project-card,
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
