:root {
  --ink: #15110f;
  --paper: #f3eee5;
  --paper-dim: #d9d0c3;
  --red: #ff4d36;
  --red-dark: #a62719;
  --line: rgba(243, 238, 229, 0.22);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
body { margin: 0; overflow-x: hidden; background: var(--ink); color: var(--paper); font-family: var(--sans); }
button, textarea { font: inherit; }
a { color: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 16px; background: var(--paper); color: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.signal { position: fixed; z-index: -1; inset: 0; display: flex; align-items: center; justify-content: space-around; opacity: 0.08; pointer-events: none; }
.signal i { display: block; width: 1px; height: 115vh; background: linear-gradient(transparent, var(--red), transparent); transform: rotate(13deg); animation: drift 12s ease-in-out infinite alternate; }
.signal i:nth-child(2n) { animation-delay: -4s; animation-duration: 17s; }
.signal i:nth-child(3n) { animation-delay: -8s; animation-duration: 20s; }

.topbar, main > section, footer { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.topbar { min-height: 80px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; }
.topbar p { margin: 0; color: var(--paper-dim); }
.topbar a { text-decoration: none; }
.topbar > a:last-child { justify-self: end; }
.lab-link { font-weight: 800; }
.lab-link span, .topbar > a:last-child span { color: var(--red); }

.hero { position: relative; min-height: calc(100svh - 80px); display: flex; flex-direction: column; justify-content: center; padding-block: 100px 72px; }
.hero-index { position: absolute; top: 12%; right: 1%; font: 400 clamp(4rem, 12vw, 10rem)/1 var(--serif); color: transparent; -webkit-text-stroke: 1px rgba(243,238,229,0.11); transform: rotate(90deg); }
.eyebrow, .section-label { margin: 0; color: var(--red); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; }
.hero h1 { max-width: 1050px; margin: 22px 0 28px; font: 400 clamp(4.2rem, 10.8vw, 9.8rem)/0.82 var(--serif); letter-spacing: -0.07em; }
.hero h1 em { color: var(--red); font-weight: inherit; }
.lead { max-width: 610px; margin: 0; color: var(--paper-dim); font-size: clamp(1rem, 1.7vw, 1.26rem); line-height: 1.72; }
.primary-link { width: fit-content; margin-top: 42px; padding: 14px 0; border-bottom: 1px solid var(--red); text-decoration: none; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.primary-link span { margin-left: 24px; color: var(--red); font-size: 1rem; }
.scroll-note { position: absolute; right: 0; bottom: 38px; margin: 0; color: rgba(243,238,229,0.45); font-size: 0.58rem; letter-spacing: 0.17em; text-transform: uppercase; writing-mode: vertical-rl; }

.ruled { display: grid; grid-template-columns: minmax(160px, 0.5fr) minmax(0, 1.5fr); gap: 48px; padding-block: 110px; border-top: 1px solid var(--line); }
.ruled h2, .outputs h2, .faq h2, .studio h2 { margin: 0; font: 400 clamp(2.55rem, 5.6vw, 5.4rem)/0.96 var(--serif); letter-spacing: -0.045em; }
.ruled > div > p { max-width: 720px; color: var(--paper-dim); font-size: 1.08rem; line-height: 1.8; }

.studio { padding-block: 110px; border-top: 1px solid var(--line); }
.studio-head { display: grid; grid-template-columns: 1fr 0.65fr; align-items: end; gap: 40px; margin-bottom: 48px; }
.studio-head .section-label { margin-bottom: 18px; }
.studio-head > p { margin: 0 0 8px; color: var(--paper-dim); line-height: 1.65; }
.subtitle-machine { border: 1px solid var(--line); background: rgba(0,0,0,0.16); }
.scene-picker { padding: 22px; border-bottom: 1px solid var(--line); }
.scene-picker > p { margin: 0 0 14px; color: var(--paper-dim); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: transparent; color: var(--paper); cursor: pointer; }
.chip:hover, .chip.is-active { border-color: var(--red); background: var(--red); color: var(--ink); }
.frame { position: relative; min-height: 420px; margin: 0; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 68% 35%, rgba(255,77,54,0.19), transparent 33%), linear-gradient(135deg, #080706, #29201c); overflow: hidden; }
.frame::before { content: ""; position: absolute; inset: 12% 15% 20%; border: 1px solid rgba(243,238,229,0.08); box-shadow: 45px 28px 0 rgba(243,238,229,0.025), -34px -20px 0 rgba(255,77,54,0.05); transform: skew(-8deg); }
.frame-grain { position: absolute; inset: 0; opacity: 0.2; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"); }
.frame figcaption { position: relative; align-self: flex-start; margin: 20px; padding: 7px 10px; background: rgba(21,17,15,0.8); color: var(--paper-dim); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; }
.live-subtitle { position: relative; align-self: center; max-width: 84%; margin: 0 0 44px; padding: 8px 12px; background: rgba(0,0,0,0.78); font: 400 clamp(1rem, 2.2vw, 1.35rem)/1.4 var(--serif); text-align: center; }
.composer { padding: 28px; border-top: 1px solid var(--line); }
.composer label { display: block; margin-bottom: 12px; color: var(--paper-dim); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
textarea { width: 100%; min-height: 110px; resize: vertical; border: 0; border-bottom: 1px solid var(--line); padding: 14px 0; background: transparent; color: var(--paper); font: 400 clamp(1.35rem, 3vw, 2.3rem)/1.35 var(--serif); }
textarea::placeholder { color: rgba(243,238,229,0.28); }
.composer-meta { display: flex; justify-content: space-between; gap: 24px; margin-top: 10px; color: rgba(243,238,229,0.5); font-size: 0.62rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.button, .text-button { min-height: 44px; border: 1px solid var(--line); padding: 11px 15px; background: transparent; color: var(--paper); cursor: pointer; }
.button--ink { border-color: var(--red); background: var(--red); color: var(--ink); font-weight: 800; }
.button:hover, .text-button:hover { border-color: var(--red); }
.text-button { border-color: transparent; margin-left: auto; color: var(--paper-dim); text-decoration: underline; text-underline-offset: 4px; }
.notebook { margin-top: 28px; border: 1px solid var(--line); }
.notebook-head { display: flex; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.notebook-head h3 { margin: 0; font: 400 1.5rem/1 var(--serif); }
.notebook-head span { color: var(--red); font-size: 0.65rem; letter-spacing: 0.13em; text-transform: uppercase; }
#entries { margin: 0; padding: 0; list-style: none; }
#entries li { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 18px 22px; border-top: 1px solid var(--line); }
#entries li:first-child { border-top: 0; }
#entries strong { display: block; margin-bottom: 5px; font-weight: 500; }
#entries small { color: var(--paper-dim); }
#entries button { align-self: center; border: 0; background: none; color: var(--red); cursor: pointer; }
#entries .empty { display: block; color: var(--paper-dim); font-style: italic; }
.status { min-height: 1.4em; color: var(--red); }

.steps { margin: 42px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 62px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.steps li > span { color: var(--red); font: 400 1.25rem/1 var(--serif); }
.steps h3 { margin: 0 0 7px; font: 400 1.5rem/1.2 var(--serif); }
.steps p { margin: 0; color: var(--paper-dim); line-height: 1.6; }
.outputs { padding-block: 110px; border-top: 1px solid var(--line); }
.outputs > div:first-child { display: grid; grid-template-columns: minmax(160px, 0.5fr) minmax(0, 1.5fr); gap: 48px; }
.output-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 54px; border: 1px solid var(--line); }
.output-grid article { min-height: 250px; padding: 24px; border-right: 1px solid var(--line); }
.output-grid article:last-child { border-right: 0; }
.output-grid span { color: var(--red); font-size: 2rem; }
.output-grid h3 { margin: 60px 0 10px; font: 400 1.35rem/1.15 var(--serif); }
.output-grid p { margin: 0; color: var(--paper-dim); font-size: 0.9rem; line-height: 1.6; }

.faq { display: grid; grid-template-columns: minmax(160px, 0.5fr) minmax(0, 1.5fr); gap: 48px; padding-block: 110px; border-top: 1px solid var(--line); }
.faq h2 { margin-bottom: 38px; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { padding: 20px 32px 20px 0; cursor: pointer; font-weight: 700; }
details p { margin: 0 0 22px; color: var(--paper-dim); line-height: 1.7; }
.closing { padding-block: 130px; border-top: 1px solid var(--line); text-align: center; }
.closing .section-label { margin-bottom: 24px; }
.closing h2 { margin: 0; font: 400 clamp(3rem, 7vw, 6.7rem)/0.94 var(--serif); letter-spacing: -0.055em; }
.closing > p { max-width: 620px; margin: 28px auto; color: var(--paper-dim); line-height: 1.7; }
.disabled-cta { display: inline-block; margin: 4px 6px 22px; padding: 14px 18px; border: 1px solid rgba(243,238,229,0.28); color: rgba(243,238,229,0.55); cursor: not-allowed; }
.closing > a { display: block; width: fit-content; margin: auto; color: var(--red); text-underline-offset: 5px; }
footer { min-height: 130px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; border-top: 1px solid var(--line); color: rgba(243,238,229,0.55); font-size: 0.64rem; letter-spacing: 0.08em; }
footer p { color: var(--paper); font-weight: 800; }
footer a { justify-self: end; }

@keyframes drift { to { transform: translateX(4vw) rotate(17deg) scaleY(0.87); } }
@media (max-width: 800px) {
  .topbar, main > section, footer { width: min(100% - 30px, 680px); }
  .topbar { grid-template-columns: 1fr 1fr; }
  .topbar p { display: none; }
  .ruled, .faq, .studio-head, .outputs > div:first-child { grid-template-columns: 1fr; gap: 24px; }
  .output-grid { grid-template-columns: 1fr 1fr; }
  .output-grid article:nth-child(2) { border-right: 0; }
  .output-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  footer { grid-template-columns: 1fr; padding-block: 30px; }
  footer a { justify-self: start; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: clamp(3.6rem, 19vw, 5.2rem); }
  .ruled, .studio, .outputs, .faq { padding-block: 76px; }
  .frame { min-height: 330px; }
  .composer { padding: 22px 18px; }
  .composer-meta { display: block; }
  .composer-meta span { display: block; margin-top: 5px; }
  .text-button { margin-left: 0; }
  .output-grid { grid-template-columns: 1fr; }
  .output-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .output-grid article:last-child { border-bottom: 0; }
  .scroll-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (prefers-contrast: more) {
  :root { --paper-dim: #fff; --line: rgba(255,255,255,0.65); }
}
