/* Codedruns public site. Direction: split stage. See DESIGN.md. Shared tokens, buttons and forms live in base.css. */

/* ---------- Top bar ---------- */
.topbar { position: relative; z-index: 20; padding: 12px var(--gutter) 0; }
.nav { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 8px 28px; max-width: 1440px; margin: 0 auto; min-height: 56px; }
.nav > :first-child { justify-self: end; }
.nav > :last-child { justify-self: start; }
.nav .logo { padding: 0 12px; }
.nav-link { color: var(--ink); text-decoration: none; font-size: var(--step-small); font-weight: 600; padding: 12px 4px; }
.nav-link:hover, .nav-link:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Split stage ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; align-items: start; }
.stage { position: sticky; top: 12px; height: calc(100svh - 24px); order: 2; }
.stage-frame { position: relative; height: 100%; border-radius: var(--radius); overflow: hidden; background: var(--ink); }
.stage-img { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.stage-img.is-on { opacity: 1; }
.stage-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 7s linear; }
.stage-img.is-on img { transform: scale(1); }
.clockbar { position: absolute; left: 0; right: 0; bottom: 0; min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; background: var(--bg); color: var(--ink); font-size: 15px; }
.clockbar strong { font-variant-numeric: tabular-nums; font-weight: 700; }
.clockbar-gap { color: var(--muted); text-align: center; }
.sheet { order: 1; background: var(--bg); border-radius: var(--radius); padding: 0 clamp(20px, 5vw, 72px) 96px; min-height: calc(100svh - 24px); }

/* ---------- Hero ---------- */
.hero { min-height: calc(70svh - 80px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 48px 0 64px; }
.display { font-family: var(--display); font-weight: 800; font-size: clamp(2.75rem, 4.4vw, 4.5rem); line-height: 0.98; letter-spacing: -0.02em; max-width: 13ch; margin: 0 0 24px; }
.lead { font-size: var(--step-lead); line-height: 1.4; max-width: 40ch; margin: 0 auto 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: center; align-items: center; margin: 0; }

/* ---------- Intro: narrow column ---------- */
.intro { max-width: 46ch; padding: 16px 0 40px; }
.intro p { margin: 0 0 1.1em; }
.intro-first { font-weight: 600; font-size: var(--step-lead); line-height: 1.35; }

/* ---------- People band: full width, breaks the split ---------- */
.people-band { max-width: 1440px; margin: 0 auto; padding: 88px var(--gutter) 24px; display: grid; grid-template-columns: 4fr 8fr; gap: 48px; align-items: center; }
.people-words .head { max-width: 14ch; }
.people-words .lead { margin: 0 0 28px; text-align: left; max-width: 34ch; }
.people-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; height: min(78svh, 680px); }
.pg { border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pg img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform .6s ease; }
.pg:hover img { transform: scale(1.03); }
.pg-tall { grid-row: span 2; }

/* ---------- How it works: pinned fragment ---------- */
.how { display: grid; grid-template-columns: 5fr 1fr 6fr; padding: 112px var(--gutter) 64px; max-width: 1440px; margin: 0 auto; }
.how-steps { grid-column: 1; }
.how-step { min-height: 46vh; display: flex; flex-direction: column; justify-content: center; color: var(--muted); transition: color .3s ease; }
.how-step.is-active { color: var(--ink); }
.how-step p:not(.statement) { max-width: 40ch; margin: 0; }
.statement { font-family: var(--display); font-weight: 700; font-size: clamp(1.75rem, 2.4vw, 2.25rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 16px; max-width: 18ch; }
.how-stage { grid-column: 3; position: sticky; top: 12vh; height: 64vh; display: grid; place-items: center; background: var(--surface); border-radius: var(--radius); align-self: start; }
.phone { width: min(360px, 90%); background: var(--bg); border-radius: 28px; padding: 28px 22px 20px; position: relative; min-height: 440px; font-size: 16px; }
.ui-state { position: absolute; inset: 28px 22px 48px; opacity: 0; transform: translateY(12px); transition: opacity .35s ease, transform .35s ease; }
.phone[data-state="0"] .ui-s0, .phone[data-state="1"] .ui-s1, .phone[data-state="2"] .ui-s2 { opacity: 1; transform: none; }
.ui-title { font-weight: 700; font-size: 18px; margin: 0 0 16px; display: flex; align-items: center; gap: 4px; }
.ui-field { margin: 0 0 12px; padding: 10px 12px; background: var(--surface); border-radius: 10px; }
.ui-field span { display: block; font-size: 13px; color: var(--muted); }
.ui-btn { display: inline-block; margin: 8px 0 0; padding: 10px 20px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-weight: 700; }
.ui-btn-liked { background: var(--ink); color: var(--bg); }
.ui-card { text-align: center; }
.ui-avatar { width: 120px; height: 120px; border-radius: 50%; margin: 8px auto 16px; display: block; object-fit: cover; object-position: center 20%; }
.ui-face { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: center 20%; display: inline-block; vertical-align: middle; margin-right: 6px; }
.ui-name { font-weight: 700; font-size: 22px; margin: 0; }
.ui-meta { color: var(--muted); margin: 4px 0 12px; }
.ui-bio { margin: 0 0 8px; }
.ui-bubble { max-width: 80%; margin: 0 0 10px; padding: 10px 14px; border-radius: 16px; background: var(--surface); }
.ui-mine { margin-left: auto; background: var(--ink); color: var(--bg); }
.ui-caption { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Showcase: output index ---------- */
.showcase { display: grid; grid-template-columns: 5fr 1fr 6fr; padding: 72px var(--gutter) 112px; max-width: 1440px; margin: 0 auto; align-items: start; }
.showcase-index { grid-column: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 48px; }
.showcase-name { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 3.6vw, 3.5rem); line-height: 1.1; letter-spacing: -0.02em; color: var(--muted); background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; transition: color .2s ease; }
.showcase-name.is-on, .showcase-name:hover { color: var(--ink); }
.showcase-note { max-width: 40ch; margin: 32px 0 0; }
.showcase-stage { grid-column: 3; position: relative; height: 62svh; min-height: 480px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.chat-sheet { position: absolute; top: 72px; left: 56px; width: min(440px, calc(100% - 72px)); background: var(--bg); border-radius: 18px 18px 0 0; padding: 22px 20px 120px; opacity: 0; transition: opacity .2s ease; }
.chat-sheet.is-on { opacity: 1; }
.cs-head { font-weight: 700; margin: 0 0 18px; display: flex; align-items: center; gap: 4px; }
.cs-head span { font-weight: 400; color: var(--muted); font-size: 14px; }
.cs-bubble { max-width: 82%; margin: 0 0 12px; padding: 10px 14px; border-radius: 16px; background: var(--surface); }
.cs-mine { margin-left: auto; background: var(--ink); color: var(--bg); }
.cs-warn { margin: 18px 0 12px; padding: 12px 14px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; font-size: 15px; }
.cs-warn a { color: inherit; font-weight: 700; }

/* ---------- What's free: printed menu ---------- */
.menu-wrap { background: var(--ink); padding: 120px var(--gutter); }
.menu { max-width: 600px; margin: 0 auto; background: var(--bg); padding: 64px clamp(20px, 5vw, 56px) 72px; clip-path: polygon(0 12px, 4% 0, 8% 12px, 12% 0, 16% 12px, 20% 0, 24% 12px, 28% 0, 32% 12px, 36% 0, 40% 12px, 44% 0, 48% 12px, 52% 0, 56% 12px, 60% 0, 64% 12px, 68% 0, 72% 12px, 76% 0, 80% 12px, 84% 0, 88% 12px, 92% 0, 96% 12px, 100% 0, 100% calc(100% - 12px), 96% 100%, 92% calc(100% - 12px), 88% 100%, 84% calc(100% - 12px), 80% 100%, 76% calc(100% - 12px), 72% 100%, 68% calc(100% - 12px), 64% 100%, 60% calc(100% - 12px), 56% 100%, 52% calc(100% - 12px), 48% 100%, 44% calc(100% - 12px), 40% 100%, 36% calc(100% - 12px), 32% 100%, 28% calc(100% - 12px), 24% 100%, 20% calc(100% - 12px), 16% 100%, 12% calc(100% - 12px), 8% 100%, 4% calc(100% - 12px), 0 100%); }
.menu .head { text-align: center; margin: 0 0 40px; }
.menu-group { font-family: var(--text); font-size: 20px; font-weight: 700; margin: 44px 0 16px; }
.menu-group:first-of-type { margin-top: 0; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li { margin: 0 0 18px; }
.menu-row { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 19px; }
.menu-row i { flex: 1; border-bottom: 4px dotted var(--ink); transform: translateY(-4px); min-width: 24px; }
.menu-desc { margin: 2px 0 0; font-size: 15px; color: var(--muted); max-width: 34ch; }

/* ---------- Guides strip ---------- */
.guides-strip { max-width: 1440px; margin: 0 auto; padding: 112px var(--gutter) 24px; display: grid; grid-template-columns: 4fr 8fr; gap: 0 48px; }
.guides-strip h2 { grid-row: span 2; }
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list a { display: block; padding: 18px 0; text-decoration: none; color: var(--ink); }
.guide-list a:hover .guide-title { text-decoration: underline; text-underline-offset: 5px; }
.guide-title { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 2vw, 1.9rem); line-height: 1.15; letter-spacing: -0.01em; }
.guide-meta { display: block; font-size: var(--step-small); color: var(--muted); margin-top: 6px; }
.guide-desc { display: block; margin-top: 8px; }

/* ---------- FAQ: reading text ---------- */
.faq { max-width: 1440px; margin: 0 auto; padding: 88px var(--gutter) 112px; display: grid; grid-template-columns: 3fr 1fr 8fr; }
.faq h2 { grid-column: 1; }
.faq-text { grid-column: 3; columns: 2; column-gap: 56px; }
.faq-text p { break-inside: avoid; margin: 0 0 20px; line-height: 1.55; }
.faq-text strong { font-weight: 700; }

/* ---------- Closing CTA: first step already open ---------- */
.cta { background: var(--ink); color: var(--bg); min-height: 72svh; display: grid; grid-template-columns: 6fr 1fr 5fr; align-items: center; padding: 64px var(--gutter); }
.cta-words { grid-column: 1; align-self: end; padding-bottom: 24px; }
.display-xl { font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 6.4vw, 6.5rem); line-height: 0.94; letter-spacing: -0.03em; margin: 0 0 24px; max-width: 10ch; }
.cta-words p { max-width: 40ch; margin: 0; }
.dialog { grid-column: 3; background: var(--bg); color: var(--ink); border-radius: var(--radius); padding: 28px; width: min(440px, 100%); box-shadow: 0 24px 60px rgba(0, 0, 0, .28); /* taste-skill-ignore: a real dialog, open above the page */ }
.dialog-title { font-weight: 700; font-size: 22px; margin: 0 0 20px; }
.dialog label { display: block; font-weight: 600; margin: 0 0 6px; }
.dialog input[type="text"], .dialog input:not([type]) { width: 100%; margin-bottom: 20px; }
.seg { border: 0; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--surface); border-radius: 999px; padding: 4px; }
.seg legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.seg label { margin: 0; text-align: center; padding: 12px 8px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: var(--bg); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Prose pages ---------- */
.prose { max-width: 62ch; padding: 48px 0 0; }
.prose .head { margin: 0 0 16px; }
.prose .lead { margin: 0 0 32px; text-align: left; }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 2.2vw, 2.1rem); line-height: 1.12; letter-spacing: -0.01em; margin: 48px 0 12px; }
.prose h3 { font-size: 1.15rem; margin: 28px 0 8px; }
.prose p, .prose li { line-height: 1.6; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 0 0 8px; }
.prose a { color: var(--ink); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--surface); }
.prose-cta { margin-top: 48px; }
.crumbs, .byline { font-size: var(--step-small); color: var(--muted); }
.crumbs a { color: var(--muted); }
.toc { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0 8px; }
.toc p { margin: 0 0 8px; }
.toc ul { margin: 0; }
.guide-body h2#faq { margin-top: 64px; }
.guide-join { background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 28px; margin: 56px 0 0; }
.guide-join p { margin: 0 0 16px; }
.guide-join p:last-child { margin: 0; }
.related { padding-top: 64px; }
.guide-cards { list-style: none; margin: 32px 0 0; padding: 0; max-width: 62ch; }
.guide-cards a { display: block; padding: 24px 0; color: var(--ink); text-decoration: none; }
.guide-cards a:hover .guide-title { text-decoration: underline; text-underline-offset: 5px; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.topics a { padding: 10px 16px; border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.topics a[aria-current] { background: var(--ink); color: var(--bg); }

/* ---------- Forms on the site ---------- */
.form-page { max-width: 520px; padding: 48px 0 0; }

/* ---------- Footer: one quiet close ---------- */
.footer { padding: 96px var(--gutter) 32px; max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px 24px; align-items: baseline; font-size: 15px; }
.footer p { margin: 0; }
.footer-what { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; }
.footer-links a, .footer-legal a { color: var(--ink); }
.footer-legal { justify-self: end; color: var(--muted); }
.credits { grid-column: 1 / -1; font-size: 14px; color: var(--muted); max-width: 120ch; margin-top: 24px !important; }
.credits a { color: var(--muted); }

/* ---------- Motion: entrances (JS adds .reveal; content visible without JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .stage-img, .stage-img img, .ui-state, .chat-sheet, .js .reveal { transition: none !important; transform: none !important; }
}

/* ---------- Phone and tablet ---------- */
@media (max-width: 960px) {
  .nav { grid-template-columns: auto 1fr auto; gap: 0 12px; }
  .nav > .nav-link:nth-child(1), .nav > .nav-link:nth-child(2), .nav > .nav-link:nth-child(4) { display: none; }
  .nav .logo { grid-column: 1; padding: 0; justify-self: start; }
  .nav > :last-child { grid-column: 3; justify-self: end; }
  .split { grid-template-columns: 1fr; padding: 12px; gap: 0; }
  .stage { order: 0; position: sticky; top: 12px; height: 56svh; z-index: 0; }
  .sheet { position: relative; z-index: 1; margin-top: -48px; padding: 0 20px 72px; min-height: 0; }
  .hero { min-height: 0; padding: 40px 0 48px; }
  .display { font-size: 10vw; }
  .hero-actions .btn { width: 100%; }
  .intro { max-width: 92%; padding: 24px 0 48px; }
  .how, .showcase, .faq, .guides-strip { grid-template-columns: 1fr; padding: 64px 20px; }
  .people-band { grid-template-columns: 1fr; padding: 48px 20px 8px; gap: 24px; }
  .people-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; height: auto; }
  .people-grid .pg { aspect-ratio: 3 / 4; }
  .pg-tall { grid-row: auto; grid-column: span 2; aspect-ratio: 4 / 3 !important; }
  .people-grid .pg:nth-child(n+4) { display: none; }
  .how-steps, .how-stage, .showcase-index, .showcase-stage, .faq h2, .faq-text { grid-column: 1; }
  .how-stage { position: static; height: auto; padding: 24px 0; margin: 24px 0 0; order: 2; }
  .how-step { min-height: 0; padding: 20px 0; color: var(--ink); }
  .showcase-index { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; padding: 0 0 16px; }
  .showcase-name { font-size: 22px; }
  .showcase-note { display: none; }
  .showcase-stage { height: 70svh; min-height: 460px; }
  .chat-sheet { left: 16px; top: 16px; width: calc(100% - 32px); }
  .menu-wrap { padding: 72px 12px; }
  .faq-text { columns: 1; }
  .faq h2 { margin-bottom: 24px; }
  .cta { grid-template-columns: 1fr; min-height: 84svh; padding: 64px 16px; align-items: start; gap: 40px; }
  .cta-words, .dialog { grid-column: 1; }
  .display-xl { font-size: 13vw; }
  .dialog { width: 100%; }
  .footer { grid-template-columns: 1fr; padding-top: 20svh; }
  .footer-links { justify-content: flex-start; }
  .footer-legal { justify-self: start; }
  .guides-strip h2 { grid-row: auto; margin-bottom: 16px; }
  .clockbar { font-size: 14px; padding: 8px 14px; }
}
