/* Secret Reads — homepage styles. No external requests: the font is self-hosted. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"),
       url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000000;
  --white: #ffffff;
  --red: #e11d2e;
  --red-hover: #c8102e;
  --red-tint: #1a0507;
  --red-tint-strong: #2a080c;
  --muted: #b3b3b3;
  --dim: #8a8a8a;
  --line: #1f1f1f;
  --card: #0d0d0d;
  --border: #2a2a2a;
  --border-strong: #3a3a3a;
  --yellow: #ffc42e;
  --error: #ff6b78;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html.modal-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Honeypot field: invisible to people, tempting to bots */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.red { color: var(--red); }
.dim { color: var(--dim); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }

/* ---------- Type ---------- */
.display {
  margin: 0;
  font-weight: 800;
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.95;
  color: var(--white);
}
.display-xl { font-size: clamp(44px, 8vw, 112px); line-height: 0.92; }
.display-lg { font-size: clamp(36px, 5vw, 64px); }
.display-md { font-size: clamp(34px, 4.6vw, 60px); }

.eyebrow {
  margin: 0;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700;
}

.body-text { margin: 0; font-size: 18px; line-height: 1.6; color: var(--muted); }
.body-strong { margin: 0; font-size: 18px; font-weight: 700; }

/* ---------- Header ---------- */
.site-header { display: flex; justify-content: center; padding: 28px 20px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; }
.logo svg { width: 26px; height: 26px; }
.logo span { font-size: 15px; letter-spacing: 0.32em; font-weight: 500; }
.logo b { font-weight: 800; }

/* ---------- Hero ---------- */
.hero, .cta { position: relative; overflow: hidden; }
.hero { padding: clamp(48px, 7vw, 88px) 20px clamp(64px, 8vw, 104px); }

.keyhole-bg {
  position: absolute; top: 20px; left: 50%;
  width: 480px; max-width: 120%; height: auto;
  transform: translateX(-50%);
  pointer-events: none;
}
.keyhole-bg-sm { width: 400px; max-width: 110%; }

.hero-inner, .cta-inner {
  position: relative;
  margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  gap: 24px;
}
.hero-inner { max-width: 960px; }
.cta-inner { max-width: 680px; }

.pill {
  margin: 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--black);
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700;
}

.lede { margin: 0; max-width: 500px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--muted); }

/* ---------- Sign-up form ---------- */
.signup { width: 100%; max-width: 560px; margin-top: 12px; }
.signup-form { display: flex; flex-direction: column; gap: 14px; }

.signup-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px;
  background: var(--white);
  border-radius: 12px;
  transition: box-shadow 0.15s ease;
}
.signup-bar:focus-within { box-shadow: 0 0 0 4px rgba(225, 29, 46, 0.6); }
.signup-bar input {
  flex: 1 1 220px; min-width: 0;
  height: 56px; padding: 0 14px;
  font: inherit; font-size: 17px;
  color: #000; background: #fff;
  border: 0; border-radius: 8px;
}
.signup-bar input:focus { outline: none; }
.signup-bar input::placeholder { color: #6b6b6b; }
.signup-bar .btn { flex: 1 0 170px; }

.fine-print { margin: 0; font-size: 13px; line-height: 1.5; color: var(--dim); }
.fine-print a { color: var(--muted); }

.form-error { margin: 0; font-size: 15px; font-weight: 600; color: var(--error); }
.form-error:empty { display: none; }

.joined-note {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: clamp(20px, 3vw, 28px);
  background: var(--card);
  border: 1px solid var(--red);
  border-radius: 16px;
}
.joined-note p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.joined-note strong { color: var(--white); }
.joined-note .joined-title {
  font-size: 34px; font-weight: 800; font-stretch: 75%; text-transform: uppercase; line-height: 1; color: var(--white);
}
.joined-note .dim { font-size: 14px; color: var(--dim); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 56px; padding: 0 26px;
  font: inherit; font-size: 16px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  border: 0; border-radius: 8px;
  cursor: pointer; text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-hover); }
.btn[disabled] { opacity: 0.75; cursor: progress; }
.btn-block { width: 100%; }

.link-btn {
  min-height: 44px; padding: 0 8px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--dim); background: transparent; border: 0;
  text-decoration: underline; cursor: pointer;
}
.link-btn:hover { color: var(--muted); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; margin: -10px -10px 0 0;
  color: var(--dim); background: transparent; border: 0; border-radius: 8px;
  cursor: pointer;
}
.icon-btn:hover { color: var(--white); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn-corner { position: absolute; top: 10px; right: 10px; margin: 0; }

/* ---------- Rating ---------- */
.rating {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 12px;
  font-size: 14px; color: var(--muted);
}
.rating b { color: var(--white); }
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 16px; height: 16px; fill: var(--yellow); }

/* ---------- Perks ---------- */
.perks { border-top: 1px solid var(--line); padding: clamp(40px, 5vw, 56px) 20px; }
.perks-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 32px 48px;
}
.perk { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.perk svg { width: 28px; height: 28px; }
.perk h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.perk p { margin: 0; font-size: 15px; color: var(--dim); }

/* ---------- How it works ---------- */
.how { border-top: 1px solid var(--line); padding: clamp(64px, 8vw, 104px) 20px; }
.how-inner {
  max-width: 1000px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(32px, 4vw, 48px);
}
.how-head { max-width: 720px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.steps {
  list-style: none; margin: 0; padding: 0; width: 100%;
  display: flex; flex-wrap: wrap; gap: 16px;
}
.step {
  flex: 1 1 260px; min-width: 0;
  display: flex; flex-direction: column; gap: 12px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.step-num { font-weight: 800; font-stretch: 75%; font-size: 44px; line-height: 1; color: var(--red); }
.step-title { font-size: 19px; font-weight: 700; line-height: 1.3; }
.step-text { font-size: 16px; line-height: 1.55; color: var(--muted); }
.how-close { max-width: 640px; text-align: center; }

/* ---------- Bottom CTA ---------- */
.cta { border-top: 1px solid var(--line); padding: clamp(64px, 8vw, 104px) 20px; }
.cta .signup { margin-top: 8px; }
.cta .joined-note p { color: var(--white); font-size: 17px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 20px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px;
  font-size: 13px; color: var(--dim);
}
.site-footer a { color: var(--dim); }

/* ---------- Genre popup ---------- */
.modal {
  width: calc(100% - 32px);
  max-width: 540px;
  max-height: calc(100% - 96px);
  margin: 64px auto auto;
  padding: 0;
  color: var(--white);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
}
.modal::backdrop { background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in 0.18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-panel {
  position: relative;
  display: flex; flex-direction: column; gap: 20px;
  padding: clamp(22px, 4vw, 32px);
}
.modal-panel[hidden] { display: none; }
.modal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head { display: flex; flex-direction: column; gap: 10px; }
.modal-title { font-size: clamp(30px, 4vw, 38px); line-height: 1; }
.modal-title:focus { outline: none; }
.modal-text { margin: 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.modal-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.genres { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.genre-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.genre {
  flex: 1 1 200px; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.genre span { font-size: 16px; font-weight: 600; }
.genre input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--red); cursor: pointer; }
.genre:hover { border-color: var(--border-strong); }
.genre:has(input:checked) { border-color: var(--red); background: var(--red-tint); }
.genre:has(input:focus-visible) { outline: 3px solid var(--white); outline-offset: 2px; }
.genre input:focus-visible { outline: none; }

/* Select All stands out */
.genre-all {
  flex: none;
  min-height: 56px; padding: 0 18px; gap: 14px;
  border: 2px solid var(--red);
  border-radius: 12px;
  background: var(--red-tint);
}
.genre-all:hover { border-color: var(--red); }
.genre-all span { font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.genre-all input { width: 22px; height: 22px; }
.genre-all:has(input:checked) { background: var(--red-tint-strong); }

/* Author details fields */
.fields { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.field-optional { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: none; color: var(--dim); }
.field input {
  width: 100%; height: 52px; padding: 0 14px;
  font: inherit; font-size: 16px;
  color: var(--white); background: var(--black);
  border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: #6b6b6b; }
.field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.35); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field-hint { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.field-hint svg { width: 15px; height: 15px; flex: none; fill: var(--yellow); }

/* Confirmation */
.modal-done { align-items: center; text-align: center; gap: 18px; padding-top: clamp(28px, 4vw, 40px); padding-bottom: clamp(28px, 4vw, 40px); }
.check-badge {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.check-badge svg { width: 30px; height: 30px; }
.notice {
  width: 100%;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--black);
  text-align: left;
}
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.notice p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.notice b { color: var(--white); }

/* ---------- Simple content pages (privacy, welcome) ---------- */
.page { max-width: 720px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) 20px clamp(64px, 8vw, 96px); }
.page h1 { margin: 0 0 24px; }
.page h2 { margin: 36px 0 10px; font-size: 20px; font-weight: 800; }
.page p, .page li { font-size: 17px; line-height: 1.65; color: var(--muted); }
.page a { color: var(--white); }
.page .draft-note {
  margin: 0 0 28px; padding: 14px 16px;
  border: 1px solid var(--yellow); border-radius: 12px;
  color: var(--white); font-size: 15px;
}
.center { text-align: center; }
.about .pill { margin-bottom: 20px; }
.about .about-lede { margin: 0; font-size: clamp(19px, 2vw, 22px); line-height: 1.5; color: var(--white); }
.about-points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.about-points li {
  margin: 0; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 12px;
}
.about-points b { color: var(--white); }
.page .about-cta { margin-top: 36px; }
.page .about-cta .btn { color: var(--white); }
.confirm-page section { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.confirm-page .dim { color: var(--dim); font-size: 15px; }
.confirm-badge { margin-bottom: 20px; }

@media (max-width: 480px) {
  .modal { margin-top: 16px; max-height: calc(100% - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
