:root {
  color-scheme: light;
  color: #090b0b;
  background: #f1ede4;
  font-family: Aptos, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ink: #090b0b;
  --paper: #f1ede4;
  --paper-light: #fbf8f1;
  --amber: #ffad00;
  --line: rgba(9, 11, 11, 0.16);
  --muted: #626563;
  --muted-strong: #5d605e;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 136px 136px;
}
a { color: inherit; }
.shell { display: flex; min-height: 100vh; flex-direction: column; }
.header {
  position: relative;
  display: flex;
  min-height: 4rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--paper-light);
}
.header::after {
  position: absolute;
  top: 0;
  right: 0;
  width: min(38vw, 30rem);
  height: 3px;
  background: var(--amber);
  content: "";
}
.header__inner { display: flex; width: min(calc(100% - 2rem), 70rem); align-items: center; justify-content: space-between; margin-inline: auto; }
.header__actions { display: flex; align-items: center; gap: 0.55rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.25rem 0.15rem 0.25rem 1.1rem;
  font-size: 1.1rem;
  font-weight: 760;
  letter-spacing: -0.025em;
  text-decoration: none;
}
.brand > span {
  position: relative;
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 1rem rgba(255, 173, 0, 0.7);
}
.brand > span::before {
  position: absolute;
  top: 50%;
  right: 100%;
  width: 0.95rem;
  height: 1px;
  background: var(--amber);
  content: "";
}
.theme-toggle {
  position: relative;
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper-light) 82%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--amber); background: var(--amber); color: #090b0b; transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 3px solid rgba(255, 173, 0, 0.55); outline-offset: 3px; }
.theme-toggle__icon {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: opacity 180ms ease, transform 180ms ease;
}
.theme-toggle__sun { opacity: 0; transform: rotate(-20deg) scale(0.72); }
.theme-toggle__moon { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle__sun { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle__moon { opacity: 0; transform: rotate(20deg) scale(0.72); }
.install-button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-light) 82%, transparent);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.install-button[hidden] { display: none; }
.install-button:hover { border-color: var(--amber); background: var(--amber); color: #090b0b; transform: translateY(-1px); }
.install-button:focus-visible { outline: 3px solid rgba(255, 173, 0, 0.55); outline-offset: 3px; }
.install-button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
main { flex: 1; padding: clamp(2rem, 8vw, 7rem) 1rem; }
.portal-content { width: min(100%, 70rem); margin-inline: auto; }
.portal-content:focus { outline: none; }
[hidden] { display: none !important; }
.human-gate {
  position: relative;
  width: min(100%, 42rem);
  margin-inline: auto;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--paper-light);
  box-shadow: 0 1.4rem 3.4rem rgba(9, 11, 11, 0.13);
}
.human-gate::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 42%;
  height: 0.35rem;
  background: var(--amber);
  content: "";
}
.human-gate h1 { font-size: clamp(2.25rem, 7vw, 4rem); }
.human-gate > p:not(.eyebrow) { max-width: 34rem; color: var(--muted-strong); line-height: 1.6; }
.human-gate__widget { width: min(100%, 26rem); min-height: 4.1rem; margin-top: 1.6rem; }
.human-gate__status { margin: 1rem 0 0 !important; font-size: 0.82rem; font-weight: 700; }
.human-gate__status[data-state="error"] { color: #a23418 !important; }
.human-gate__status[data-state="success"] { color: #34713f !important; }
.choice-panel {
  position: relative;
  width: min(100%, 70rem);
  padding: clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--paper-light);
  box-shadow: 0 1.4rem 3.4rem rgba(9, 11, 11, 0.13);
  overflow: hidden;
}
.choice-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 38%;
  height: 0.35rem;
  background: var(--amber);
  content: "";
}
.eyebrow { margin: 0 0 1rem; color: #b36b00; font-size: 0.76rem; font-weight: 850; letter-spacing: 0.14em; }
h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 4.8rem); line-height: 1; }
.intro { max-width: 43rem; margin: 1.2rem 0 2.5rem; color: var(--muted-strong); font-size: 1.05rem; line-height: 1.55; }
.choices { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  min-height: 16rem;
  padding: clamp(1.25rem, 4vw, 2.4rem);
  transition: background 180ms ease, transform 180ms ease;
}
.choice + .choice { border-left: 1px solid var(--line); }
.choice:hover { background: rgba(255, 173, 0, 0.09); }
.number { color: #d18300; font-family: ui-monospace, monospace; font-size: 0.85rem; font-weight: 800; }
.choice h2 { margin: 0 0 0.7rem; font-size: clamp(1.55rem, 4vw, 2.2rem); }
.choice p { margin: 0 0 2rem; color: var(--muted); line-height: 1.55; }
.choice-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; }
.choice-actions a {
  border-bottom: 2px solid var(--amber);
  padding: 0.45rem 0;
  font-weight: 800;
  text-decoration: none;
}
.choice-actions a:focus-visible { outline: 3px solid rgba(255, 173, 0, 0.55); outline-offset: 3px; }
.choice-actions--split { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.choice-actions--split a { padding: 0.75rem 0.85rem; border-bottom: 2px solid var(--amber); }
.choice-actions--split a + a { border-left: 1px solid var(--line); }
.how-it-works { display: grid; gap: 1rem; margin-top: clamp(2.5rem, 7vw, 5rem); }
.how-it-works__heading { max-width: 48rem; margin-bottom: 1rem; }
.how-it-works__heading h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.how-it-works__heading > p:last-child { max-width: 42rem; margin: 1rem 0 0; color: var(--muted); line-height: 1.6; }
.story { overflow: hidden; border: 1px solid var(--line); border-radius: 0.65rem; background: var(--paper-light); box-shadow: 0 0.8rem 2.2rem rgba(9, 11, 11, 0.08); }
.story__header { display: flex; align-items: flex-start; gap: 1rem; padding: 1.4rem 1.6rem; border-bottom: 1px solid var(--line); }
.story__header > span { color: #d18300; font-family: ui-monospace, monospace; font-size: 0.8rem; font-weight: 850; }
.story__header h3 { margin: 0; font-size: clamp(1.25rem, 3vw, 1.65rem); }
.story__header p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; }
.story--link .story__header { background: linear-gradient(90deg, rgba(255, 173, 0, 0.13), transparent 55%); }
.story--qr .story__header { background: linear-gradient(90deg, rgba(255, 173, 0, 0.06), transparent 55%); }
.comic-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; }
.comic-strip li { position: relative; display: grid; align-content: start; min-width: 0; min-height: 14.5rem; gap: 0.55rem; padding: 1.4rem; }
.comic-strip li + li { border-left: 1px solid var(--line); }
.comic-strip li:not(:last-child)::after { position: absolute; z-index: 2; top: 4.3rem; right: -0.8rem; display: grid; width: 1.6rem; height: 1.6rem; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper-light); color: #b36b00; content: "→"; font-size: 0.9rem; font-weight: 900; }
.comic-picture {
  position: relative;
  display: grid;
  width: 5.8rem;
  height: 5.8rem;
  place-items: center;
  margin-bottom: 0.25rem;
  border: 1px solid rgba(179, 107, 0, 0.24);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 173, 0, 0.24) 0 0.32rem, transparent 0.36rem),
    linear-gradient(145deg, color-mix(in srgb, var(--amber) 12%, var(--paper-light)), var(--paper-light));
  box-shadow: inset 0 0 0 0.28rem color-mix(in srgb, var(--amber) 4%, transparent), 0 0.55rem 1rem rgba(9, 11, 11, 0.08);
  color: var(--ink);
  transform: rotate(-2deg);
}
.comic-picture::after {
  position: absolute;
  right: -0.22rem;
  bottom: 0.75rem;
  width: 0.58rem;
  height: 0.58rem;
  border: 2px solid var(--paper-light);
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0.6rem rgba(255, 173, 0, 0.52);
  content: "";
}
.comic-strip li:nth-child(even) .comic-picture { transform: rotate(2deg); }
.comic-picture svg { width: 3.55rem; height: 3.55rem; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.25; }
.comic-picture .icon-soft { fill: color-mix(in srgb, var(--amber) 18%, transparent); stroke: none; }
.comic-picture .icon-paper { fill: var(--paper-light); }
.comic-picture .icon-solid { fill: var(--amber); stroke: var(--amber); }
.comic-picture .icon-accent { fill: none; stroke: var(--amber); stroke-width: 2.8; }
.comic-picture .icon-cutout { fill: none; stroke: var(--paper-light); stroke-width: 2.2; }
.comic-strip strong { font-size: 1rem; }
.comic-strip li > span { color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.footer {
  display: grid;
  min-height: 4.75rem;
  place-items: center;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--paper-light);
  text-align: center;
}
.footer__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.55rem; }
.footer p {
  margin: 0;
  color: #64675f;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.footer .footer__years { display: flex; align-items: center; gap: 0.55rem; color: #303633; font-size: 0.8rem; font-variant-numeric: tabular-nums; letter-spacing: 0.12em; }
.footer__separator { color: var(--amber); }
.footer a { border-bottom: 1px dotted rgba(9, 11, 11, 0.45); color: #303633; font-size: 0.68rem; font-weight: 760; letter-spacing: 0.08em; text-decoration: none; text-transform: uppercase; }
.footer a:hover { border-color: var(--amber); color: #7a4d00; }
.install-dialog {
  width: min(calc(100% - 2rem), 34rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, 0.4);
}
.install-dialog::backdrop { background: rgba(9, 11, 11, 0.7); backdrop-filter: blur(0.2rem); }
.install-dialog form { position: relative; padding: clamp(1.5rem, 6vw, 3rem); }
.install-dialog h2 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1; }
.install-dialog p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.install-dialog ol { display: grid; gap: 0.75rem; margin: 1.5rem 0; padding-left: 1.3rem; color: var(--muted); line-height: 1.5; }
.install-dialog strong { color: var(--ink); }
.install-dialog__close { position: absolute; top: 0.75rem; right: 0.85rem; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.8rem; line-height: 1; }
.install-dialog__done { width: 100%; min-height: 3rem; border: 1px solid #d88900; border-radius: 0.3rem; background: var(--amber); color: #090b0b; cursor: pointer; font-weight: 850; }
@media (max-width: 700px) {
  body { background-size: 84px 84px; }
  .choices { grid-template-columns: 1fr; }
  .choice { min-height: 0; }
  .choice + .choice { border-top: 1px solid var(--line); border-left: 0; }
  .choice-actions--split { grid-template-columns: 1fr; }
  .choice-actions--split a + a { border-top: 1px solid var(--line); border-left: 0; }
  .comic-strip { grid-template-columns: 1fr 1fr; }
  .comic-strip li { min-height: 13.5rem; }
  .comic-strip li:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .comic-strip li:nth-child(4) { border-top: 1px solid var(--line); }
  .comic-strip li:nth-child(2)::after { top: auto; right: auto; bottom: -0.8rem; left: calc(50% - 0.8rem); content: "↓"; }
}
@media (max-width: 430px) {
  .install-button { width: 2.75rem; justify-content: center; padding: 0; }
  .install-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .comic-strip { grid-template-columns: 1fr; }
  .comic-strip li { min-height: 0; grid-template-columns: 4.4rem 1fr; column-gap: 1rem; }
  .comic-strip li + li { border-top: 1px solid var(--line); border-left: 0; }
  .comic-picture { grid-row: 1 / span 2; width: 4.4rem; height: 4.4rem; }
  .comic-picture svg { width: 2.6rem; height: 2.6rem; }
  .comic-strip li:not(:last-child)::after,
  .comic-strip li:nth-child(2)::after { top: auto; right: auto; bottom: -0.8rem; left: calc(50% - 0.8rem); content: "↓"; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  color: #f4f0e7;
  background: #090b0b;
  --ink: #f4f0e7;
  --paper: #090b0b;
  --paper-light: #111413;
  --line: rgba(244, 240, 231, 0.16);
  --muted: #b9bdbb;
  --muted-strong: #c9cdcb;
}
:root[data-theme="dark"] .footer p,
:root[data-theme="dark"] .footer .footer__years,
:root[data-theme="dark"] .footer a { color: #c9cdcb; }
:root[data-theme="dark"] .footer a { border-color: rgba(244, 240, 231, 0.45); }
:root[data-theme="dark"] .how-it-works__heading > p:last-child,
:root[data-theme="dark"] .story__header p,
:root[data-theme="dark"] .comic-strip li > span { color: #b9bdbb; }
