:root {
  --paper: #f8f5ee;
  --canvas: #efede7;
  --canvas-2: #e7e8e3;
  --ink: #1f2428;
  --muted: #61676c;
  --line: #d4d6d1;
  --line-strong: #bfc3bd;
  --blue: #3155d5;
  --blue-dark: #2443ae;
  --green: #4d7767;
  --amber: #b9781f;
  --white: #ffffff;
  --shadow: 0 28px 70px rgba(36, 42, 47, 0.12);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --page-max: 1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 12%, rgba(49, 85, 213, 0.08), transparent 28rem),
    linear-gradient(180deg, var(--paper) 0, #f5f3ed 32rem, var(--canvas) 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-180%);
  padding: .75rem 1rem;
  border-radius: .5rem;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
}

.skip-link:focus { transform: translateY(0); }

.site-header,
.hero,
.how,
.production,
.site-footer {
  width: min(calc(100% - 40px), var(--page-max));
  margin-inline: auto;
}

.site-header {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, .5);
}

.brand-mark span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.brand-mark span:nth-child(2) { width: 72%; background: var(--blue); }
.brand-mark span:nth-child(3) { width: 88%; }

.brand-name {
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.production-status,
.production-label {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(77, 119, 103, .12);
  animation: status-pulse 3.2s ease-in-out infinite;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, .92fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
  min-height: calc(100vh - 90px);
  padding: 5rem 0 7rem;
}

.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 1.75rem;
  font-size: clamp(3.2rem, 6.4vw, 6.9rem);
  line-height: .94;
  letter-spacing: -.062em;
  max-width: 10.4ch;
}

.hero-lead {
  max-width: 42rem;
  margin-bottom: 2.35rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
}

.phase-note {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: .85rem;
  align-items: center;
  padding: .8rem 1rem .8rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .45);
}

.phase-index {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 9px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  font-size: .78rem;
}

.phase-note strong,
.phase-note span { display: block; }
.phase-note strong { font-size: .77rem; text-transform: uppercase; letter-spacing: .09em; }
.phase-note div > span { color: var(--muted); font-size: .92rem; }

.prototype {
  position: relative;
  padding: 1.15rem;
  border: 1px solid rgba(49, 85, 213, .18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .66);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.prototype::before {
  content: "";
  position: absolute;
  inset: 12% -6% auto auto;
  width: 34%;
  height: 58%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(49, 85, 213, .12);
  filter: blur(45px);
}

.prototype-topline,
.document-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.prototype-topline { padding: .25rem .35rem 1rem; }

.prototype-badge {
  padding: .35rem .55rem;
  border-radius: 999px;
  color: var(--blue-dark);
  background: rgba(49, 85, 213, .09);
  letter-spacing: .04em;
  text-transform: none;
}

.decision-card,
.document-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.decision-card { padding: 1.4rem; }

.decision-card legend {
  padding: 0 .45rem;
  color: var(--blue);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .14em;
}

.decision-card > p {
  margin-bottom: 1.15rem;
  font-size: 1.04rem;
  font-weight: 740;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 46px;
  margin-top: .55rem;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.choice:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.choice:has(input:checked) { border-color: rgba(49, 85, 213, .48); background: rgba(49, 85, 213, .055); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice input:focus-visible + .radio-ui { outline: 3px solid rgba(49, 85, 213, .25); outline-offset: 3px; }

.radio-ui {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 0 0 4px var(--white);
}

.choice input:checked + .radio-ui { border-color: var(--blue); background: var(--blue); }

.logic-rail {
  display: grid;
  grid-template-rows: auto 28px auto;
  justify-items: center;
  margin: .2rem 0;
  color: var(--blue);
}

.logic-node { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.logic-line { width: 1px; height: 28px; background: linear-gradient(var(--blue), rgba(49, 85, 213, .22)); }
.logic-arrow { margin-top: -8px; font-size: .82rem; }

.document-card { overflow: hidden; }
.document-meta { padding: .8rem 1rem; background: #f5f6f3; border-bottom: 1px solid var(--line); }
.document-status { display: inline-flex; align-items: center; gap: .4rem; color: var(--green); letter-spacing: .04em; text-transform: none; }
.document-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.document-paper { padding: 1.5rem 1.65rem 1.8rem; background: #fffdf8; }
.paragraph-number { margin-bottom: .55rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; font-weight: 700; }
.generated-clause { min-height: 4.8rem; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; line-height: 1.65; transition: opacity .16s ease, transform .16s ease; }
.generated-clause.is-changing { opacity: .22; transform: translateY(3px); }
.prototype-note { margin: .85rem .2rem .1rem; color: var(--muted); font-size: .74rem; }

.how { padding: 7.5rem 0; border-top: 1px solid var(--line); }
.section-heading { max-width: 730px; margin-bottom: 3.5rem; }
h2 { margin-bottom: 1rem; font-size: clamp(2.1rem, 4vw, 4.2rem); line-height: 1.05; letter-spacing: -.045em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step { min-height: 260px; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, .36); }
.step-number { margin-bottom: 3.3rem; color: var(--blue); font-size: .78rem; font-weight: 850; letter-spacing: .12em; }
.step h3 { margin-bottom: .7rem; font-size: 1.28rem; letter-spacing: -.02em; }
.step p { margin: 0; color: var(--muted); }

.production {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2rem;
  padding: 4.2rem;
  border-radius: var(--radius-lg);
  color: #f7f8f8;
  background: var(--ink);
}
.production-label { align-self: start; color: #bfc6cb; }
.production .status-dot { background: #8fc3a9; box-shadow: 0 0 0 5px rgba(143, 195, 169, .12); }
.production-content { max-width: 780px; }
.production h2 { margin-bottom: 1.35rem; font-size: clamp(2rem, 3.4vw, 3.5rem); }
.production-content > p { color: #c6ccd0; font-size: 1.06rem; }
.release-note { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .15); }

.site-footer {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2.8rem 0 3.2rem;
  color: var(--muted);
  font-size: .82rem;
}
.site-footer a { text-underline-offset: 3px; }
.footer-note { justify-self: end; text-align: right; }

.privacy-page main,
.error-page main {
  width: min(calc(100% - 40px), 840px);
  margin: 0 auto;
  padding: 6rem 0 8rem;
}
.privacy-page h1,
.error-page h1 { max-width: none; font-size: clamp(2.8rem, 7vw, 5.2rem); }
.privacy-card {
  padding: clamp(1.4rem, 4vw, 2.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .55);
}
.privacy-card h2 { margin-top: 2.2rem; font-size: 1.35rem; letter-spacing: -.02em; }
.privacy-card p, .privacy-card li { color: var(--muted); }
.notice {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--amber);
  background: rgba(185, 120, 31, .08);
}
.back-link { display: inline-flex; margin-top: 1.4rem; font-weight: 750; color: var(--blue-dark); text-underline-offset: 4px; }

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(77, 119, 103, .12); }
  50% { box-shadow: 0 0 0 9px rgba(77, 119, 103, .035); }
}

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 4.5rem; }
  h1 { max-width: 11ch; }
  .prototype { max-width: 650px; }
  .production { grid-template-columns: 1fr; padding: 3rem; }
  .steps { grid-template-columns: 1fr; }
  .step { min-height: auto; }
  .step-number { margin-bottom: 2rem; }
}

@media (max-width: 620px) {
  .site-header, .hero, .how, .production, .site-footer { width: min(calc(100% - 28px), var(--page-max)); }
  .site-header { min-height: 76px; }
  .brand-name { font-size: .79rem; letter-spacing: .08em; }
  .production-status { font-size: .75rem; }
  .hero { padding: 3.8rem 0 5.2rem; gap: 3.2rem; }
  h1 { font-size: clamp(3.15rem, 15vw, 4.7rem); }
  .hero-lead { font-size: 1rem; }
  .phase-note { display: grid; width: 100%; }
  .prototype { padding: .8rem; border-radius: 20px; }
  .prototype-topline { align-items: flex-start; }
  .prototype-badge { max-width: 10rem; text-align: right; }
  .decision-card { padding: 1.15rem; }
  .choice { align-items: flex-start; }
  .document-paper { padding: 1.25rem; }
  .generated-clause { font-size: 1rem; }
  .how { padding: 5.4rem 0; }
  .production { padding: 2rem 1.45rem; border-radius: 20px; }
  .site-footer { grid-template-columns: 1fr auto; }
  .footer-note { grid-column: 1 / -1; justify-self: start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
