/* Daniel Kitchen — portfolio (dark rebuild)
   Ported from the Claude Design system. Accent = sage (design default).
   Alternate accents from the design: terracotta #CC7A5C / rgba(204,122,92,.14),
   indigo #6E82D9 / rgba(110,130,217,.16). Swap --accent/--accent-soft to retheme. */

:root {
  --bg:        #000000;
  --panel:     #141414;
  --ink:       #F4F1EA;
  --ink-dim:   #D8D2C4;
  --ink-soft:  #E4DFD4;
  --muted:     #A39D8F;
  --faint:     #726C60;
  --line:      #332F27;
  --line-soft: #2A261F;
  --accent:      #63B583;
  --accent-soft: rgba(99,181,131,0.14);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans:  'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---- shared column widths ---- */
.wrap { max-width: 680px; margin: 0 auto; padding: 0 24px; }

/* ---- header ---- */
.site-header {
  max-width: 1200px; margin: 0 auto; padding: 28px 24px 0;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.masthead {
  font-family: var(--serif); font-size: 26px; letter-spacing: -0.01em;
  font-style: italic; text-decoration: none; color: inherit;
}
.masthead::after {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-left: 6px; transform: translateY(-4px);
}
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--muted); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 500; text-decoration: none;
  transition: color .2s;
}
.site-nav a:hover { color: var(--accent); }

/* ---- hero ---- */
.hero {
  max-width: 680px; margin: 84px auto 0; padding: 0 24px;
  animation: fadeUp .8s cubic-bezier(.2,.7,.3,1) both;
}
.eyebrow {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--faint); font-weight: 500; margin-bottom: 22px;
}
.hero-title {
  font-family: var(--serif); font-size: clamp(64px, 11vw, 132px);
  line-height: 0.95; letter-spacing: -0.03em; margin: 0 0 0.3em; font-weight: 400;
}
.hero-title .dot { color: var(--accent); }
.hero-dek {
  font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3.2vw, 31px);
  line-height: 1.35; color: var(--ink-dim); margin: 0; max-width: 620px;
}

/* ---- live trace panel ---- */
.trace { max-width: 1200px; margin: 44px auto 0; padding: 0 24px; }
.trace-card {
  border: 1px solid var(--line); border-radius: 3px;
  padding: clamp(20px, 4vw, 30px); background: var(--panel);
}
.trace-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 6px; flex-wrap: wrap;
}
.trace-head .label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
}
.trace-status {
  display: flex; align-items: center; gap: 8px; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.trace-status .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: livePulse 1.7s ease-in-out infinite;
}
.trace-canvas-wrap { position: relative; width: 100%; aspect-ratio: 16/9; min-height: 400px; }
.trace-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.trace-mobile { display: none; text-align: center; padding: 36px 16px; }
.trace-mobile .badge {
  display: inline-block; border: 1px solid var(--accent); border-radius: 2px;
  padding: 16px 26px; background: var(--accent-soft);
  font-family: var(--serif); font-style: italic; font-size: 24px;
}
.trace-mobile .badge small {
  display: block; font-family: var(--sans); font-style: normal; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-top: 4px;
}
.trace-mobile p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 20px auto 0; max-width: 340px; }
.rotate-hint {
  display: inline-flex; align-items: center; gap: 9px; margin: 22px auto 0;
  padding: 8px 15px; border: 1px solid var(--accent); border-radius: 24px;
  background: var(--accent-soft); font-size: 12px; color: var(--ink-dim);
}
.rotate-hint .icon {
  width: 16px; height: 16px; flex: 0 0 auto; fill: var(--accent);
  animation: rotateHint 2.6s ease-in-out infinite;
}
.trace-legend {
  display: flex; flex-wrap: wrap; gap: 16px 20px; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.trace-legend .item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.trace-legend .sw { width: 9px; height: 9px; border-radius: 2px; }
.trace-caption { margin-top: 14px; font-size: 13px; line-height: 1.6; color: var(--muted); }
@media (max-width: 640px) {
  .trace-canvas-wrap { display: none; }
  .trace-mobile { display: block; }
}

/* ---- lede ---- */
.lede {
  max-width: 680px; margin: clamp(48px, 7vw, 88px) auto 0; padding: 0 24px;
  font-family: var(--serif); font-size: clamp(22px, 2.5vw, 27px);
  line-height: 1.55; color: var(--ink); letter-spacing: -0.005em;
}

/* ---- chapters ---- */
.chapter { margin-top: 120px; }
.chapter-label {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 20px; font-weight: 500;
}
.chapter-num { color: var(--accent); margin-right: 10px; }
.chapter-heading {
  font-family: var(--serif); font-size: clamp(38px, 5.5vw, 54px);
  line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 0.7em; font-weight: 400;
}
.chapter p { font-size: 18px; line-height: 1.7; color: var(--ink-dim); margin: 0; }
.chapter p + p { margin-top: 1.4em; }
.chapter a { color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; transition: color .2s, border-color .2s; }
.chapter a:hover { color: var(--accent); border-color: var(--accent); }
.flist { list-style: none; padding: 0; margin: 0; font-size: 18px; line-height: 1.7; color: var(--ink-dim); }
.flist li { padding: 15px 0; border-bottom: 1px solid var(--line); }
.flist b { color: var(--ink); font-weight: 600; }
.note {
  margin-top: 52px; padding: 16px 20px; border-left: 2px solid var(--accent);
  background: var(--accent-soft); font-size: 14px; line-height: 1.6; color: var(--ink-dim);
}
.note b { color: var(--ink); }
/* A note callout is usually a <p class="note"> right after a plain <p>, where
   `.chapter p + p` (0,1,2) would otherwise beat `.note` (0,1,0) and steal its
   top margin. This higher-specificity rule restores the intended 52px break. */
.chapter .note { margin-top: 52px; }

/* ---- roles grid ---- */
.roles-intro { font-size: 18px; line-height: 1.7; color: var(--ink-dim); margin: 0 0 32px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.role-card { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 20px 18px; }
.role-card .name { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.role-card .role { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---- outcomes / stat row (shared) ---- */
.outcomes { max-width: 680px; margin: 0 auto; padding: 0 24px; }
.outcomes .grid {
  margin-top: 72px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px; padding: 28px 0;
}
.outcome { display: flex; flex-direction: column; gap: 10px; }
.outcome .bar { width: 20px; height: 2px; background: var(--accent); }
.outcome .num { font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--ink); }
.outcome .lbl { font-size: 12px; line-height: 1.45; color: var(--muted); }

/* ---- backlink ---- */
.backlink {
  display: inline-block; margin: 40px auto 0; max-width: 680px; padding: 0 24px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; width: 100%; transition: color .2s;
}
.backlink:hover { color: var(--accent); }

/* ---- footer ---- */
.site-footer { margin: 160px auto 0; padding: 48px 24px 80px; border-top: 1px solid var(--line); max-width: 1200px; }
.site-footer .inner { max-width: 680px; margin: 0 auto; font-size: 14px; line-height: 1.7; color: var(--muted); }
.site-footer .inner p { margin: 0; }
.site-footer .colophon { margin-top: 28px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.site-footer .colophon a { color: var(--ink-dim); text-decoration: none; transition: color .2s; }
.site-footer .colophon a:hover { color: var(--accent); }

/* ---- buttons / CTAs (shared) ---- */
.btn {
  display: inline-block; font-size: 13px; letter-spacing: 0.04em; font-weight: 500;
  border-radius: 3px; padding: 12px 22px; text-decoration: none; cursor: pointer;
  font-family: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
}
.btn-primary { color: #15130F; background: var(--accent); border: 1px solid var(--accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(99,181,131,0.27); }
.btn-ghost { color: var(--ink-soft); background: transparent; border: 1px solid #3A362E; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---- keyframes ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
@keyframes rotateHint { 0%,55%,100% { transform: rotate(0deg); } 74%,90% { transform: rotate(-88deg); } }
/* The site's animations are content — the diagrams and orb are the showpiece — so OS
   reduced-motion is intentionally NOT used to freeze them (that read as "dead"). If a
   calmer mode is ever wanted, re-add a gentler reduced-motion variant here. */
