/* =========================================================
   Abdul Wajed Khan — Portfolio (wazedkhan.github.io)
   Editorial / engineering aesthetic. Dark by default.
   ========================================================= */

:root {
  --ivory: #f3efe6;
  --ivory-2: #e8e3d6;
  --ink: #141311;
  --ink-2: #1c1b18;
  --ink-3: #2a2824;
  --dim: #8c877c;
  --dim-2: #6b6760;
  --line: rgba(243, 239, 230, 0.12);
  --accent: oklch(0.68 0.14 45);
  --serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --unit: 1rem;
  --gutter: clamp(24px, 4vw, 64px);
}

html[data-theme="dark"] {
  --fg: var(--ivory);
  --fg-2: var(--ivory-2);
  --bg: var(--ink);
  --bg-2: var(--ink-2);
  --bg-3: var(--ink-3);
  --line: rgba(243, 239, 230, 0.12);
}
html[data-theme="light"] {
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --bg: var(--ivory);
  --bg-2: #ece7da;
  --bg-3: #ddd7c6;
  --dim: #736f67;
  --dim-2: #8f8a81;
  --line: rgba(20, 19, 17, 0.14);
}

html[data-accent="oxide"] { --accent: oklch(0.68 0.14 45); }
html[data-accent="moss"] { --accent: oklch(0.64 0.08 145); }
html[data-accent="indigo"] { --accent: oklch(0.62 0.12 265); }
html[data-accent="plum"] { --accent: oklch(0.60 0.11 340); }
html[data-accent="mono"] { --accent: var(--fg); }

/* Direction variants */
html[data-direction="terminal"] {
  --serif: var(--mono);
}
html[data-direction="swiss"] {
  --serif: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Display font override */
html[data-display="fraktion"] .hero-title em,
html[data-display="fraktion"] .section-title em,
html[data-display="fraktion"] .about-lead em,
html[data-display="fraktion"] .contact-title em,
html[data-display="fraktion"] .detail-title,
html[data-display="fraktion"] .hero-title,
html[data-display="fraktion"] .section-title,
html[data-display="fraktion"] .about-lead,
html[data-display="fraktion"] .contact-title {
  font-family: var(--sans);
  font-style: normal;
  letter-spacing: -0.03em;
}
html[data-display="monodisplay"] .hero-title,
html[data-display="monodisplay"] .section-title,
html[data-display="monodisplay"] .about-lead,
html[data-display="monodisplay"] .contact-title,
html[data-display="monodisplay"] .detail-title {
  font-family: var(--mono);
  letter-spacing: -0.02em;
}
html[data-display="monodisplay"] .hero-title em,
html[data-display="monodisplay"] .section-title em,
html[data-display="monodisplay"] .about-lead em,
html[data-display="monodisplay"] .contact-title em {
  font-family: var(--mono);
  font-style: italic;
}

html[data-density="airy"] .section { padding-block: clamp(140px, 18vh, 240px); }
html[data-density="tight"] .section { padding-block: clamp(60px, 8vh, 100px); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { cursor: none; background: var(--bg); }
body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 500ms ease, color 500ms ease;
}

@media (hover: none) { html { cursor: auto; } .cc-cursor { display: none; } }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: none; padding: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }

.mono { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.dim { color: var(--dim); }
.label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); margin-bottom: 8px; }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Grain */
html[data-grain="on"] body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* =============== CURSOR =============== */
.cc-cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-100px, -100px);
  transition: width 240ms cubic-bezier(.2,.8,.2,1), height 240ms cubic-bezier(.2,.8,.2,1), opacity 200ms ease;
  margin-left: calc(var(--s) / -2);
  margin-top: calc(var(--s) / -2);
  mix-blend-mode: difference;
}
.cc-cursor-inner { position: relative; width: 100%; height: 100%; }
.cc-cursor-inner::before {
  content: ""; position: absolute; inset: 0;
  border: 1px solid var(--ivory);
  border-radius: 50%;
  transform: scale(0.35);
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), border-radius 240ms ease;
}
.cc-cursor-inner[data-active="true"]::before {
  transform: scale(1);
  border-radius: 50%;
}
.cc-cursor-tick {
  position: absolute;
  background: var(--ivory);
  opacity: 0.8;
}
.cc-cursor-tick-t, .cc-cursor-tick-b { left: 50%; width: 1px; height: 4px; transform: translateX(-50%); }
.cc-cursor-tick-t { top: -6px; }
.cc-cursor-tick-b { bottom: -6px; }
.cc-cursor-tick-l, .cc-cursor-tick-r { top: 50%; height: 1px; width: 4px; transform: translateY(-50%); }
.cc-cursor-tick-l { left: -6px; }
.cc-cursor-tick-r { right: -6px; }

/* =============== NAV =============== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px var(--gutter);
  background: transparent;
  transition: background 300ms ease, border-color 300ms ease, padding 300ms ease;
  border-bottom: 1px solid transparent;
}
.nav-scrolled {
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-block: 14px;
}
.nav-mark { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.nav-mark-box {
  border: 1px solid var(--fg);
  padding: 4px 7px;
  font-weight: 500;
}
.nav-mark-name { color: var(--dim); }
.nav-links {
  display: flex; gap: 26px;
  list-style: none; margin: 0; padding: 0;
  justify-content: center;
}
.nav-links a {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 0;
  position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 250ms cubic-bezier(.2,.8,.2,1);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-num { color: var(--dim); font-size: 10px; }
.nav-theme { display: inline-flex; align-items: center; gap: 8px; justify-self: end; border: 1px solid var(--line); padding: 6px 10px; border-radius: 100px; }
.nav-theme-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); transition: background 200ms; }
.nav-theme-dot[data-on="true"] { background: var(--accent); }

@media (max-width: 860px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
}

/* =============== HERO =============== */
.hero {
  padding: 160px var(--gutter) 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 15% 20%, color-mix(in oklch, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(ellipse 60% 45% at 85% 75%, color-mix(in oklch, var(--accent) 12%, transparent), transparent 50%);
  opacity: 0.85;
}
.hero-status {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--dim);
}
.hero-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 60%, transparent);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 60%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}
.hero-status-sep { color: var(--dim-2); }

.hero-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(56px, 9.5vw, 160px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 40px 0;
  max-width: 20ch;
  text-wrap: balance;
}
.hero-title em { font-style: italic; }
.hero-eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin-bottom: 28px;
  line-height: 1;
}
.hero-line-1, .hero-line-2 { display: block; }
.hero-line-1 { animation: rise 900ms cubic-bezier(.2,.8,.2,1) both; }
.hero-line-2 { animation: rise 900ms cubic-bezier(.2,.8,.2,1) 120ms both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.hero-meta-col { display: flex; flex-direction: column; }
.hero-meta-col .sig {
  font-family: var(--serif); font-style: italic; font-size: 22px;
  display: inline-flex; align-items: baseline;
}
.hero-meta-col .caret { color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero-meta-col .mono { font-size: 13px; text-transform: none; letter-spacing: 0.02em; }

.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: var(--gutter); right: var(--gutter);
  display: flex; justify-content: space-between;
  color: var(--dim);
}
.hero-scroll .mono { font-size: 10px; }

@media (max-width: 720px) {
  .hero-meta { grid-template-columns: 1fr; gap: 20px; }
}

/* =============== SECTIONS =============== */
.section {
  padding: clamp(100px, 14vh, 180px) var(--gutter);
  border-top: 1px solid var(--line);
  position: relative;
}
.section-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 40px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
}
.section-num { color: var(--accent); }
.section-label { color: var(--fg); }
.section-rule { flex: 1; height: 1px; background: var(--line); }
.section-count { color: var(--dim); }
.section-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 4.5vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 60px;
  max-width: 22ch;
  text-wrap: pretty;
}

/* =============== WORK =============== */
.work-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.chip {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--dim);
  transition: color 200ms, border-color 200ms, background 200ms;
}
.chip:hover { color: var(--fg); border-color: var(--fg); }
.chip-active { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.chip-static { cursor: default; }
.chip-static:hover { color: var(--dim); border-color: var(--line); }

.work-list {
  position: relative;
  display: flex;
  flex-direction: column;
}
.work-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto 24px;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  transition: color 300ms, padding 300ms;
  position: relative;
}
.work-list .work-row:last-of-type { border-bottom: 1px solid var(--line); }
.work-row:hover { color: var(--fg); padding-left: 12px; }
.work-row:hover .work-row-title { color: var(--accent); }
.work-row-num { color: var(--dim); }
.work-row-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -0.01em;
  transition: color 250ms;
}
.work-row-role, .work-row-year { color: var(--dim); }
.work-row-arrow { color: var(--dim); transition: transform 250ms; }
.work-row:hover .work-row-arrow { color: var(--accent); transform: translate(4px, -4px); }

.work-preview {
  position: absolute;
  top: 0; left: 0;
  width: 320px;
  pointer-events: none;
  z-index: 5;
  opacity: 0; animation: fade-in 200ms ease forwards;
}
@keyframes fade-in { to { opacity: 1; } }
.work-preview-art {
  width: 100%; aspect-ratio: 4/3;
  border: 1px solid var(--line);
  overflow: hidden;
}
.work-preview-meta {
  display: flex; justify-content: space-between;
  margin-top: 10px;
  color: var(--dim);
}

@media (max-width: 860px) {
  .work-row { grid-template-columns: 30px 1fr auto; }
  .work-row-role { display: none; }
  .work-preview { display: none; }
}

/* =============== ABOUT =============== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 80px;
}
.about-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.2;
  margin: 0 0 32px;
  max-width: 26ch;
}
.about-col p { margin: 0 0 18px; color: var(--fg); }
.about-col p + p { color: var(--fg-2); }
.about-aside { display: flex; flex-direction: column; gap: 24px; padding-top: 10px; }
.about-meta { padding-bottom: 20px; border-bottom: 1px dashed var(--line); }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* =============== SERVICES =============== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
}
.service { padding: 32px 0; border-top: 1px solid var(--line); }
.service-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.service-n {
  color: var(--accent); font-size: 11px;
}
.service-title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 28px; line-height: 1; margin: 0;
}
.service p { margin: 0 0 18px; color: var(--fg-2); }
.service-deliverables { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 720px) { .services-grid { grid-template-columns: 1fr; gap: 8px; } }

/* =============== NOW =============== */
.now-list { display: flex; flex-direction: column; }
.now-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.now-row:last-child { border-bottom: 1px solid var(--line); }
.now-k { color: var(--dim); }

/* =============== WRITING =============== */
.writing-list { display: flex; flex-direction: column; }
.writing-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto 100px 24px;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
  transition: padding 300ms, color 300ms;
}
.writing-list a:last-of-type { border-bottom: 1px solid var(--line); }
.writing-row:hover { padding-left: 10px; }
.writing-row:hover .writing-title { color: var(--accent); }
.writing-title { font-family: var(--serif); font-style: italic; font-size: 22px; transition: color 200ms; }
.writing-arrow { color: var(--dim); transition: transform 200ms; }
.writing-row:hover .writing-arrow { transform: translateX(4px); color: var(--accent); }

@media (max-width: 720px) {
  .writing-row { grid-template-columns: 30px 1fr 24px; }
  .writing-row > :nth-child(3), .writing-row > :nth-child(4), .writing-row > :nth-child(5) { display: none; }
}

/* =============== QUOTES =============== */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.quote { margin: 0; padding: 32px 0; border-top: 1px solid var(--line); }
.quote blockquote {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.35;
  position: relative;
  text-wrap: pretty;
}
.quote-mark { color: var(--accent); font-size: 48px; line-height: 0; vertical-align: -12px; margin-right: 4px; }
@media (max-width: 860px) { .quotes { grid-template-columns: 1fr; gap: 0; } }

/* =============== PRESS =============== */
.press-row {
  display: flex; flex-wrap: wrap; gap: 56px; align-items: baseline;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.press-logo {
  font-family: var(--serif); font-style: italic; font-size: clamp(24px, 3vw, 42px);
  color: var(--dim);
  transition: color 250ms;
}
.press-logo:hover { color: var(--fg); }

.press-row-links {
  justify-content: flex-start;
  gap: clamp(32px, 6vw, 72px);
}
.press-link {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(26px, 3.5vw, 44px);
  color: var(--dim);
  transition: color 250ms;
  border-bottom: 1px solid transparent;
}
.press-link:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in oklch, var(--accent) 50%, transparent);
}

/* =============== STATS (GitHub snapshot) =============== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  border: 1px solid var(--line);
  background: var(--line);
}
.stat-card {
  padding: clamp(28px, 4vw, 40px);
  background: var(--bg);
}
.stat-card-n {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  color: var(--accent);
  margin-bottom: 12px;
}
.stat-card-label {
  display: block;
  margin-bottom: 12px;
  color: var(--fg);
}
.stat-card-note {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-2);
}
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.contact-card-static {
  cursor: default;
}
.contact-card-static::after {
  display: none;
}
.contact-card-static:hover {
  background: var(--bg);
}

/* =============== RESUME =============== */
.resume-list { display: flex; flex-direction: column; }
.resume-row {
  display: grid;
  grid-template-columns: 180px 1fr 1.5fr;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.resume-list .resume-row:last-of-type { border-bottom: 1px solid var(--line); }
.resume-year { color: var(--dim); }
.resume-role { font-family: var(--serif); font-style: italic; font-size: 24px; margin-bottom: 4px; }
.resume-note { color: var(--fg-2); }
@media (max-width: 720px) {
  .resume-row { grid-template-columns: 1fr; gap: 6px; }
}

/* =============== CONTACT =============== */
.section-contact { border-top: 1px solid var(--line); background: var(--bg); }
.contact-title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 60px;
  max-width: 18ch;
}
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; border: 1px solid var(--line); }
.contact-card {
  padding: 32px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 10px;
  transition: background 250ms, color 250ms;
  position: relative;
}
.contact-card::after {
  content: "↗"; position: absolute; top: 24px; right: 24px;
  color: var(--dim); transition: transform 250ms, color 250ms;
}
.contact-card:hover { background: var(--bg-2); }
.contact-card:hover::after { color: var(--accent); transform: translate(4px, -4px); }
.contact-val { font-family: var(--serif); font-style: italic; font-size: 28px; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }

.footer {
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* =============== PROJECT DETAIL OVERLAY =============== */
.detail-overlay {
  position: fixed; inset: 0;
  background: color-mix(in oklch, var(--bg) 60%, transparent);
  backdrop-filter: blur(8px);
  z-index: 500;
  animation: fade-in 200ms ease;
}
.detail-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(720px, 92vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 32px clamp(24px, 4vw, 48px) 80px;
  animation: slide-in 360ms cubic-bezier(.2,.8,.2,1);
}
@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.detail-title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(40px, 5vw, 64px); line-height: 1;
  margin: 8px 0 0;
}
.detail-close {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 100px;
  font-size: 18px;
  color: var(--dim);
  transition: color 200ms, border-color 200ms;
}
.detail-close:hover { color: var(--fg); border-color: var(--fg); }
.detail-hero { width: 100%; aspect-ratio: 16/9; margin-bottom: 32px; border: 1px solid var(--line); overflow: hidden; }
.detail-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  padding-bottom: 24px; border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.detail-meta > div:last-child { font-family: var(--serif); font-style: italic; font-size: 18px; }
.detail-meta .mono { font-family: var(--mono); font-size: 12px; font-style: normal; text-transform: none; letter-spacing: 0.02em; }
.detail-section { margin-bottom: 28px; }
.detail-section p { margin: 0; color: var(--fg-2); text-wrap: pretty; }
.detail-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.detail-metric { padding: 16px 0; border-top: 1px solid var(--line); }
.detail-metric-n { font-family: var(--serif); font-style: italic; font-size: 32px; line-height: 1; margin-bottom: 6px; }
.detail-footer {
  display: flex; justify-content: space-between;
  padding-top: 32px; border-top: 1px solid var(--line);
  color: var(--dim);
  margin-top: 16px;
}
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; gap: 14px; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* =============== TWEAKS =============== */
.tweaks {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 320px;
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  padding: 16px;
  z-index: 600;
  font-size: 13px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tweaks-head button { font-size: 20px; line-height: 1; }
.tweaks-row { margin-bottom: 18px; }
.tweaks-options, .tweaks-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bg); outline: 1px solid var(--line); }
.swatch-active { outline: 2px solid var(--fg); }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.tweaks-hint { margin-top: 6px; font-size: 10px; }

/* =============== REVEAL ANIMATION =============== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 900ms cubic-bezier(.2,.8,.2,1), transform 900ms cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Selection */
::selection { background: var(--accent); color: var(--bg); }
