/* =========================================================
   Claude Showcase · Shared Stylesheet
   Anthropic-inspired editorial design system
   - Dark theme with accent #cc785c (Anthropic 橙)
   - Editorial serif for headlines, geometric sans for body
   - Slide deck layout with HUD + progress bar
   ========================================================= */

:root {
  --bg: #0d0d0d;
  --bg-soft: #161616;
  --panel: #1c1c1c;
  --panel-2: #202020;
  --line: #2a2a2a;
  --line-soft: #1f1f1f;
  --text: #f5f3ee;
  --text-2: #e9e4dc;
  --muted: #a8a29e;
  --muted-2: #847f7a;
  --accent: #cc785c;
  --accent-2: #d4a27f;
  --accent-3: #e9b48f;
  --accent-soft: rgba(204,120,92,0.15);
  --accent-glow: rgba(204,120,92,0.35);
  --good: #84cc8c;
  --warn: #e9b872;
  --danger: #ef6b6b;
  --info: #88b8d8;

  --serif: "EB Garamond", "Source Serif Pro", "Songti SC", Georgia, serif;
  --sans: "Inter", "PingFang SC", -apple-system, "Helvetica Neue", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.45);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; border-bottom: 1px dotted var(--accent); }
a:hover { color: var(--accent-3); }
code { font-family: var(--mono); font-size: 0.92em; color: var(--accent-2); background: rgba(204,120,92,0.08); padding: 1px 6px; border-radius: 4px; }

/* ---------- Slide layout ---------- */
.deck { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
.slide {
  position: absolute; inset: 0;
  padding: 60px 80px 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.slide::-webkit-scrollbar { width: 6px; }
.slide::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.slide.active { opacity: 1; transform: translateX(0); pointer-events: auto; }
.slide.prev { transform: translateX(-40px); }

/* Single-slide pages (when file is opened standalone) */
body.single .deck .slide { opacity: 1; transform: none; pointer-events: auto; position: relative; min-height: 100vh; }

/* ---------- HUD / Pager ---------- */
.hud {
  position: fixed;
  bottom: 22px; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  z-index: 50;
  pointer-events: none;
}
.hud .brand {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .04em;
}
.hud .pager {
  pointer-events: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  background: rgba(20,20,20,.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  backdrop-filter: blur(12px);
}
.hud button {
  background: transparent;
  color: var(--text);
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: inherit;
  transition: background .2s, color .2s;
}
.hud button:hover { background: var(--accent-soft); color: var(--accent-3); }
.hud .counter { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; padding: 0 8px; }

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width .4s ease;
  z-index: 60;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-block;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent-soft);
}
h1.title {
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 80px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1.title em { color: var(--accent); font-style: italic; }
h2.section {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 52px);
  line-height: 1.1;
  margin-bottom: 22px;
  font-weight: 500;
  color: var(--text);
}
h2.section em { color: var(--accent); font-style: italic; }
h3.sub {
  font-size: 21px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h4 { font-size: 17px; color: var(--text); font-weight: 600; }
h5 { font-size: 15.5px; color: var(--text); font-weight: 600; }

p, li { color: var(--muted); line-height: 1.7; font-size: 16px; }
p strong, li strong { color: var(--text); font-weight: 600; }
.lead {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--text);
  max-width: 880px;
  font-weight: 400;
}
.quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  line-height: 1.5;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 22px;
  margin: 18px 0;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 18px;
  font-style: italic;
}
.kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

/* ---------- Grid layouts ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: start; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .3s, transform .3s, box-shadow .3s;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card .num {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 34px;
  font-style: italic;
  line-height: 1;
  margin-bottom: 12px;
}
.card h4 { margin-bottom: 8px; font-size: 17px; }
.card p { font-size: 14.5px; line-height: 1.65; }

.card-soft {
  background: linear-gradient(135deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.card-soft::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 140px; height: 140px;
  background: var(--accent);
  border-radius: 50%;
  opacity: .07;
  transition: opacity .4s;
}
.card-soft:hover::after { opacity: .14; }

/* Pills & badges */
.pill {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid rgba(204,120,92,.3);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
}
.pill.green { background: rgba(132,204,140,0.12); color: var(--good); border-color: rgba(132,204,140,0.3); }
.pill.warn { background: rgba(233,184,114,0.12); color: var(--warn); border-color: rgba(233,184,114,0.3); }
.pill.info { background: rgba(136,184,216,0.12); color: var(--info); border-color: rgba(136,184,216,0.3); }
.badge-date {
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
}
.badge-version {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent-2);
  margin-right: 6px;
}

/* ---------- Code blocks ---------- */
pre.code {
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  color: #e7e2da;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  margin: 12px 0;
  position: relative;
}
pre.code .c { color: #6b7280; }   /* comment */
pre.code .k { color: var(--accent-2); }  /* keyword */
pre.code .s { color: #9ad0a3; }   /* string */
pre.code .v { color: #88b8d8; }   /* value */
pre.code .n { color: #e9b872; }   /* number */
pre.code .o { color: var(--muted); }  /* operator */
pre.code .label {
  position: absolute;
  top: 8px; right: 12px;
  font-size: 11px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 32px; margin-top: 16px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 4px; bottom: 4px;
  width: 2px;
  background: linear-gradient(var(--accent), transparent);
}
.timeline .item { position: relative; margin-bottom: 22px; }
.timeline .item::before {
  content: "";
  position: absolute;
  left: -29px; top: 6px;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(204,120,92,0.25);
}
.timeline .item.major::before { background: var(--accent-3); box-shadow: 0 0 0 6px rgba(204,120,92,0.3); width: 14px; height: 14px; left: -30px;}
.timeline .date { color: var(--accent); font-family: var(--serif); font-style: italic; font-size: 14px; margin-bottom: 4px; }
.timeline h5 { font-size: 16.5px; margin-bottom: 4px; }
.timeline p { font-size: 14px; line-height: 1.6; }

/* ---------- Tables ---------- */
table.compare { width: 100%; border-collapse: collapse; margin-top: 12px; }
table.compare th, table.compare td {
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px; color: var(--text);
}
table.compare th {
  color: var(--muted); font-weight: 500;
  text-transform: uppercase; font-size: 11.5px; letter-spacing: .1em;
  background: var(--bg-soft);
}
table.compare td.feature { color: var(--text); font-weight: 500; }
table.compare td.principle-tag { color: var(--accent-2); font-family: var(--serif); font-style: italic; }
table.compare tr:hover td { background: rgba(204,120,92,0.04); }

/* Numeric/bench table */
table.bench { width: 100%; border-collapse: collapse; }
table.bench th, table.bench td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.bench th { background: var(--bg-soft); color: var(--muted); text-align: left; font-weight: 500; }
table.bench td.metric { color: var(--text); font-weight: 600; }
table.bench td.num { font-family: var(--mono); color: var(--accent-2); font-variant-numeric: tabular-nums; }
table.bench td.up::after { content: " ↑"; color: var(--good); }
table.bench td.down::after { content: " ↓"; color: var(--danger); }

/* ---------- Video frame ---------- */
.video-wrap {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: var(--shadow-md);
}
.video-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
  color: var(--muted);
  text-align: center;
  padding: 20px;
}
.video-placeholder .play {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: #fff; font-size: 28px;
}

/* ---------- Principle box / Icons ---------- */
.principle {
  background: linear-gradient(135deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.principle::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  background: var(--accent);
  border-radius: 50%;
  opacity: .07;
}
.principle .icon {
  width: 48px; height: 48px;
  background: var(--accent-soft);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: var(--accent);
}
.principle h3 { font-family: var(--serif); font-size: 26px; margin-bottom: 10px; }

/* ---------- Feature row ---------- */
.row-feat { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0; }
.row-feat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 9px;}
.row-feat span { color: var(--text); font-size: 15px; line-height: 1.55;}

/* ---------- TOC ---------- */
ol.toc { list-style: none; counter-reset: toc; column-count: 2; column-gap: 50px; }
ol.toc li {
  counter-increment: toc;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  color: var(--text);
  break-inside: avoid;
  cursor: pointer;
  transition: padding-left .25s;
}
ol.toc li:hover { padding-left: 8px; color: var(--accent-2); }
ol.toc li::before {
  content: "0" counter(toc) "  ";
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
  margin-right: 8px;
}
ol.toc li:nth-child(n+10)::before { content: counter(toc) "  "; }
ol.toc li span { color: var(--muted); margin-left: 6px; font-size: 13px; }

/* ---------- Cover decoration ---------- */
.cover {
  background:
    radial-gradient(1000px 600px at 80% 20%, rgba(204,120,92,0.18), transparent 60%),
    radial-gradient(800px 500px at 10% 90%, rgba(212,162,127,0.12), transparent 60%),
    var(--bg);
}
.cover .meta {
  margin-top: 36px;
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13.5px;
}
.cover .meta span strong { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; font-weight: 600;}
.cover .ornament {
  position: absolute;
  right: 80px; top: 50%; transform: translateY(-50%);
  width: 360px; height: 360px;
  opacity: .9;
}
.orbit { width: 100%; height: 100%; position: relative; }
.orbit-ring { position: absolute; inset: 0; border: 1px solid rgba(204,120,92,.3); border-radius: 50%; animation: rotate 40s linear infinite; }
.orbit-ring.r2 { inset: 40px; border-style: dashed; animation-duration: 60s; animation-direction: reverse; }
.orbit-ring.r3 { inset: 90px; border-color: rgba(212,162,127,.2); animation-duration: 80s; }
.orbit-core { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.orbit-core svg { width: 130px; height: 130px; filter: drop-shadow(0 0 30px rgba(204,120,92,.4)); }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.slide.active > * { animation: fadeUp .55s ease both; }
.slide.active > *:nth-child(2) { animation-delay: .1s; }
.slide.active > *:nth-child(3) { animation-delay: .18s; }
.slide.active > *:nth-child(4) { animation-delay: .26s; }
.slide.active > *:nth-child(5) { animation-delay: .32s; }

/* ---------- End slide ---------- */
.end {
  text-align: center;
  background:
    radial-gradient(800px 500px at 50% 50%, rgba(204,120,92,0.18), transparent 60%),
    var(--bg);
}
.end h1 { font-size: clamp(44px, 5.6vw, 92px); }
.end p { margin-top: 22px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ---------- Diagrams ---------- */
.flow {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.flow .node {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 18px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.flow .node.accent { border-color: var(--accent); color: var(--accent-2); }
.flow .arrow { color: var(--muted); font-size: 18px; }

/* Stat block */
.stat {
  display: flex; align-items: baseline; gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stat .v {
  font-family: var(--serif);
  font-size: 36px;
  color: var(--accent);
  font-weight: 500;
}
.stat .l { color: var(--muted); font-size: 14px; }
.stat .delta { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.stat .delta.up { color: var(--good); background: rgba(132,204,140,0.12); }
.stat .delta.down { color: var(--danger); background: rgba(239,107,107,0.12); }

/* ---------- Index landing (special for index.html) ---------- */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.index-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  display: block;
  transition: all .25s;
  border-bottom: 1px solid var(--line);
}
.index-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.index-card .ix { color: var(--accent); font-family: var(--serif); font-style: italic; font-size: 14px; }
.index-card h4 { margin: 8px 0 6px; color: var(--text); font-size: 17px; }
.index-card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ---------- Mobile ---------- */
@media (max-width: 980px) {
  .slide { padding: 40px 26px 80px; }
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; gap: 22px; }
  ol.toc { column-count: 1; }
  .cover .ornament { display: none; }
  h1.title { font-size: clamp(34px, 7vw, 56px); }
  h2.section { font-size: clamp(26px, 5vw, 38px); }
}
