@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-standard-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-standard-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
/* Layout: one woven thread drawing on a fixed canvas; the scroll carries it through three chapters, text left, cloth right. */
:root {
  --ground: #050708;
  --ink: #FDFDFC;
  --ink-soft: #DBDBDA;
  --ink-quiet: #A7AAA3;
  --rule: #424638;
  --green: #95C23D;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
html { background: var(--ground); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
  overflow-x: hidden;
}
html.gated, html.gated body { overflow: hidden; height: 100%; }
html.gated main, html.gated .mark, html.gated .where { visibility: hidden; }

#loom { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
/* The script moves focus here after Enter for screen readers; the heading is not interactive, so no ring. */
h1:focus { outline: none; }

.gate {
  position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; text-align: center; transition: opacity .9s ease;
  padding-block: 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.gate[hidden] { display: none; }
.gate.leaving { opacity: 0; pointer-events: none; }
.gate img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.gate-name { margin: 0; font: 300 clamp(34px, 6vw, 60px)/1.08 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.gate-action {
  display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 28px 44px;
  transform: translate(-7vw, 9vh);
  background: radial-gradient(closest-side, var(--ground) 62%, transparent);
}
.gate-line { margin: 0; color: var(--ink); font: italic 300 20px/1.3 var(--display); }
.gate-line span { font: 400 13px/1 var(--text); font-style: normal; font-variant-numeric: tabular-nums; color: var(--green); margin-left: 8px; }
.gate button {
  min-height: 48px; padding-inline: 32px; background: transparent; color: var(--ink); cursor: pointer;
  border: 1px solid var(--green); border-radius: 2px; font: 500 15px/1 var(--text); letter-spacing: .02em;
}
.gate button:hover { background: var(--green); color: var(--ground); }

.mark {
  position: fixed; z-index: 3; top: calc(16px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-size: 14px; font-weight: 500;
}
.mark img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.where {
  position: fixed; z-index: 3; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  min-height: 44px; display: flex; align-items: center; color: var(--ink-quiet);
  font: italic 300 18px/1 var(--display);
}

main { position: relative; z-index: 1; }
.panel {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box;
  padding-block: 96px;
  padding-left: max(16px, env(safe-area-inset-left, 0px), 6vw);
  padding-right: max(16px, env(safe-area-inset-right, 0px), 6vw);
}
.copy { max-width: 31rem; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 300; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(46px, 7.4vw, 104px); line-height: 1.02; max-width: 13em; }
h2 { font-size: clamp(38px, 4.6vw, 66px); line-height: 1.05; }
em { font-style: italic; color: var(--green); }
.hero { gap: 28px; }
.hero p { margin: 0; max-width: 34rem; font-size: 19px; color: var(--ink-soft); }
.numeral { margin: 0; font: italic 300 22px/1 var(--display); color: var(--green); }
.copy p.body { margin: 0; color: var(--ink-soft); }
.thread-link {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none;
  border-bottom: 1px solid var(--green);
}
.thread-link:hover { color: var(--green); }
.cue { color: var(--ink-quiet); font-size: 13px; letter-spacing: .08em; }

.end { align-items: center; text-align: center; gap: 32px; }
.end h2 { font-size: clamp(42px, 6.4vw, 92px); max-width: 12em; }
.cta {
  display: inline-flex; align-items: center; min-height: 52px; padding-inline: 32px; border-radius: 2px;
  background: var(--green); color: var(--ground); text-decoration: none; font-weight: 600;
}
.cta:hover { background: var(--ink); }
footer {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-block: 24px; color: var(--ink-quiet); font-size: 14px; border-top: 1px solid var(--rule); background: var(--ground);
  padding-left: max(16px, env(safe-area-inset-left, 0px), 6vw);
  padding-right: max(16px, env(safe-area-inset-right, 0px), 6vw);
}

@media (max-width: 899px) {
  .chapter { justify-content: flex-end; padding-top: 52vh; padding-bottom: 56px; }
  .chapter .copy { background: linear-gradient(transparent, var(--ground) 24px); padding-top: 24px; }
  .where { display: none; }
  .gate-action { transform: translate(-3vw, 7vh); padding: 24px 20px; }
  body { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gate { transition: none; }
}

/* Privacy and Terms: plain reading pages, no canvas. */
.legal-page .mark { position: static; }
.legal-page header { padding: 16px max(16px, 6vw); }
.legal { max-width: 40rem; padding: 32px max(16px, 6vw) 96px; box-sizing: content-box; }
.legal h1 { font-size: clamp(38px, 5vw, 60px); margin-bottom: 8px; }
.legal h2 { font-size: 26px; line-height: 1.2; margin: 40px 0 8px; }
.legal p, .legal li { color: var(--ink-soft); }
.legal p { margin: 0 0 16px; }
.legal a { color: var(--green); }
.legal .updated { color: var(--ink-quiet); font-size: 14px; margin-bottom: 32px; }

/* Detail pages: text left, the chapter's cloth held still on the right. */
.detail { padding-block: 112px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px), 6vw); padding-right: max(16px, env(safe-area-inset-right, 0px), 6vw); }
.detail-page .mark { position: absolute; }
.detail section { max-width: min(31rem, 38vw); min-width: 280px; }
.detail .lead { margin: 20px 0 0; font-size: 19px; color: var(--ink-soft); }
.detail .numeral { margin-bottom: 20px; color: var(--green); }
.detail h1 { font-size: clamp(42px, 4.8vw, 68px); line-height: 1.04; }
.detail h2 { font-size: clamp(26px, 2.4vw, 32px); line-height: 1.15; margin: 56px 0 10px; }
.detail p { margin: 0 0 14px; color: var(--ink-soft); }
.detail .closing { margin-top: 96px; padding-top: 40px; border-top: 1px solid var(--rule); }
.detail .closing h2 { font-size: clamp(34px, 3.4vw, 48px); margin: 0 0 28px; color: var(--ink); }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; color: var(--ink-quiet); text-decoration: none; }
.back:hover { color: var(--green); }
.closing .back { display: flex; width: max-content; margin-top: 20px; }

@media (max-width: 899px) {
  .detail-page #loom { position: absolute; height: 100vh; height: 100svh; }
  .detail { padding-top: 52vh; }
  .detail section { max-width: none; min-width: 0; }
}
