/* Buildenza guide site: shared styles for the landing page and the guide reader. */
:root {
  --bg: #0b0b0a;
  --surface: #141412;
  --surface-2: #1c1b18;
  --line: #2b2a26;
  --text: #edebe6;
  --muted: #9c988f;
  --accent: #f5b700;       /* hazard amber */
  --accent-ink: #141000;
  --radius: 14px;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- shared bits ---------- */
.kicker {
  font: 600 12px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.display {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: .95;
  margin: 0;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 22px;
  border-radius: 999px;
  font: 700 15px/1 var(--body);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffc829; }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--muted); }
.btn .price { opacity: .7; font-weight: 600; }

.hazard {
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, #111 14px 28px);
  opacity: .9;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 18px/1 var(--display); font-stretch: 80%; text-transform: uppercase; letter-spacing: .02em; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--muted); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.nav .btn { padding: 11px 16px; font-size: 14px; }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(44px, 7.4vw, 92px); margin: 18px 0 22px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 19px; color: var(--muted); max-width: 34em; margin: 0 0 30px; }
.hero .lede strong { color: var(--text); font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.stat b { display: block; font: 800 34px/1 var(--display); font-stretch: 80%; }
.stat span { font-size: 13px; color: var(--muted); }

.reel-stack { position: relative; height: 560px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); }
.reel-col { display: flex; flex-direction: column; gap: 12px; animation: drift 38s linear infinite; }
.reel-col:nth-child(2) { animation-duration: 46s; animation-direction: reverse; margin-top: -120px; }
.reel-col:nth-child(3) { animation-duration: 42s; }
.reel-col img { border-radius: 12px; aspect-ratio: 9/16; object-fit: cover; border: 1px solid var(--line); }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .reel-col { animation: none; } }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 44px; gap: 36px; }
  .reel-stack { height: 360px; }
}

/* ---------- sections ---------- */
section.block { padding: 96px 0; border-bottom: 1px solid var(--line); }
.block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 44px; }
.block-head h2 { font-size: clamp(34px, 5vw, 60px); margin-top: 12px; }
.block-head p { color: var(--muted); max-width: 30em; margin: 0; }
@media (max-width: 720px) { section.block { padding: 64px 0; } }

/* proof grid */
.shorts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.short { position: relative; display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none; border: 1px solid var(--line); background: var(--surface); }
.short img { aspect-ratio: 9/16; object-fit: cover; width: 100%; transition: transform .4s ease; }
.short:hover img { transform: scale(1.04); }
.short .meta { position: absolute; inset: auto 0 0 0; padding: 40px 12px 12px; background: linear-gradient(transparent, rgba(0,0,0,.88)); }
.short .views { font: 800 26px/1 var(--display); font-stretch: 80%; color: var(--accent); }
.short .title { font-size: 13px; line-height: 1.35; margin-top: 6px; color: #e6e3dc; }
@media (max-width: 900px) { .shorts { grid-template-columns: repeat(2, 1fr); } }

/* workflow */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage { background: var(--surface); padding: 26px 22px 28px; }
.stage .n { font: 600 12px/1 var(--mono); color: var(--accent); letter-spacing: .12em; }
.stage h3 { font: 800 24px/1.05 var(--display); font-stretch: 80%; text-transform: uppercase; margin: 14px 0 10px; }
.stage p { margin: 0; color: var(--muted); font-size: 14.5px; }
@media (max-width: 900px) { .stages { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stage { padding: 20px 16px; } .stage h3 { font-size: 20px; } }

/* chapters */
.chapters { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; counter-reset: ch; }
.chapter-row { display: flex; align-items: baseline; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.chapter-row .num { font: 600 13px/1 var(--mono); color: var(--muted); min-width: 2.2em; }
.chapter-row .name { font-weight: 600; }
.chapter-row .desc { color: var(--muted); font-size: 14px; margin-top: 2px; }
.chapter-row .tag { margin-left: auto; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 760px) { .chapters { grid-template-columns: 1fr; } }

/* tools */
.tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.tool .job { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.tool .name { font: 800 22px/1.1 var(--display); font-stretch: 80%; text-transform: uppercase; margin: 12px 0 8px; }
.tool p { margin: 0; font-size: 14px; color: var(--muted); }
@media (max-width: 900px) { .tools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tools { grid-template-columns: 1fr; } }

/* faq */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font: 400 22px/1 var(--mono); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 12px 0 0; }

/* final cta */
.final { text-align: center; padding: 110px 0; }
.final h2 { font-size: clamp(40px, 7vw, 84px); margin: 16px 0 20px; }
.final p { color: var(--muted); margin: 0 auto 32px; max-width: 32em; }

footer.site { padding: 36px 0 48px; color: var(--muted); font-size: 13px; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* =========================================================
   Guide reader
   ========================================================= */
.reader { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 64px); }
.toc { border-right: 1px solid var(--line); padding: 28px 18px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.toc .progress { margin: 0 6px 22px; }
.toc .progress .bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.toc .progress .fill { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.toc .progress small { color: var(--muted); font-size: 12.5px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 14.5px; }
.toc a:hover { background: var(--surface); color: var(--text); }
.toc a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.toc .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font: 600 10.5px/1 var(--mono); color: var(--muted); }
.toc li.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toc li.done .dot span { display: none; }
.toc li.done .dot::after { content: "✓"; font-size: 12px; }
.toc-toggle { display: none; }

.article-wrap { padding: 56px 40px 96px; }
article.chapter { max-width: 760px; margin: 0 auto; }
article.chapter header { margin-bottom: 34px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
article.chapter header h1 { font-size: clamp(38px, 5.4vw, 64px); margin-top: 12px; }
.prose { font-size: 17px; }
.prose h4, .prose h3 { font: 800 24px/1.1 var(--display); font-stretch: 80%; text-transform: uppercase; margin: 44px 0 14px; letter-spacing: .01em; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent); }
.prose code { font: 14px/1.5 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.prose td:first-child { font-weight: 600; white-space: nowrap; }

.codebox { position: relative; margin: 10px 0 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.codebox pre { margin: 0; padding: 18px 20px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.codebox pre code { background: none; border: 0; padding: 0; font-size: 14px; line-height: 1.65; color: #dcd8cf; }
.codebox.is-flow pre code { color: var(--text); }
.codebox .copy { position: absolute; top: 10px; right: 10px; font: 600 12px/1 var(--body); padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.codebox .copy:hover { border-color: var(--muted); }
.codebox .copy.ok { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.codebox.is-prompt { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.codebox.is-prompt::before { content: "Prompt"; position: absolute; top: -10px; left: 14px; padding: 0 8px; background: var(--bg); font: 600 11px/20px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.codebox.is-prompt pre { padding-top: 22px; padding-right: 84px; }

.callout { margin: 22px 0 26px; padding: 16px 20px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-radius: 0 12px 12px 0; }
.callout .label { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 8px; }
.callout p { margin: 0 0 6px; }
.callout p:last-child { margin: 0; }

.frames { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 24px; }
.frames figure, .shot { margin: 0; flex: 1 1 200px; }
.img-missing { display: grid; place-items: center; aspect-ratio: 9/16; max-height: 360px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font: 600 12px/1.4 var(--mono); text-align: center; padding: 16px; background: var(--surface); }
.shot .img-missing { aspect-ratio: 16/9; }
figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; text-align: center; }

.chapter-foot { max-width: 760px; margin: 56px auto 0; display: grid; gap: 18px; }
.mark-done { justify-self: start; }
.mark-done[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.pager a:hover { border-color: var(--muted); }
.pager small { color: var(--muted); font-size: 12.5px; }
.pager b { display: block; margin-top: 4px; }
.pager .next { text-align: right; grid-column: 2; }
.legal { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 30px; }

@media (max-width: 900px) {
  .reader { grid-template-columns: 1fr; }
  .toc { position: fixed; inset: 64px 0 0 0; height: auto; z-index: 15; background: var(--bg); border-right: 0; transform: translateX(-100%); transition: transform .25s ease; }
  .toc.open { transform: none; }
  .toc-toggle { display: inline-flex; padding: 10px 14px; font-size: 14px; }
  .article-wrap { padding: 32px 20px 72px; }
  .prose { font-size: 16px; }
  .prose td:first-child { white-space: normal; }
}

.locked { padding: 36px 30px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.locked p { color: var(--muted); margin: 12px auto 22px; max-width: 30em; }
