/* Lost in the Fold: black on white, one serif, lots of air. */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin-500-italic.woff2") format("woff2");
}

:root {
  --ink: #000;
  --paper: #fff;
  --gray: rgba(0, 0, 0, 0.55);
  --rule: rgba(0, 0, 0, 0.12);
  --serif: "EB Garamond", "Garamond", "Iowan Old Style", "Palatino", Georgia, serif;
  --measure: 34rem;
  --gutter: 1.5rem;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;          /* 19px */
  line-height: 1.5;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--paper); }

/* ---------- Layout ---------- */

.page {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 4.5rem var(--gutter) 3rem;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.page > main { flex: 1; }

@media (min-width: 48rem) {
  body { font-size: 1.25rem; }
  .page { padding-top: 9rem; }
}

section + section { margin-top: 3.5rem; }

hr,
.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3.5rem 0;
}

/* ---------- Type ---------- */

h1, h2, h3 {
  font-weight: 400;
  margin: 0;
  line-height: 1.1;
}

.title {
  font-size: clamp(3.1rem, 15vw, 5.25rem);
  letter-spacing: -0.015em;
  line-height: 0.95;
}
.title a { color: inherit; text-decoration: none; }

.headline {
  font-size: clamp(2rem, 8.5vw, 2.9rem);
  letter-spacing: -0.01em;
  line-height: 1.08;
}

h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; line-height: 1.25; }

p { margin: 0; }
p + p { margin-top: 1em; }

.lede {
  font-size: 1.35rem;
  line-height: 1.4;
  margin-top: 1.25rem;
}

.secondary,
.aside { color: var(--gray); }

/* Player-written words and hints */
.said,
.hint { font-style: italic; }

.label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  line-height: 1.4;
  margin-bottom: 0.9rem;
  font-feature-settings: "kern", "lnum";
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

strong { font-weight: 500; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 3rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { opacity: 0.85; }

.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--rule); }
.btn-secondary:hover { border-color: rgba(0, 0, 0, 0.3); }

.btn[aria-disabled="true"] {
  background: var(--paper);
  color: var(--gray);
  border-color: var(--rule);
  cursor: default;
}
.btn[aria-disabled="true"]:active { transform: none; }

.btn-block { width: 100%; }

/* ---------- Home ---------- */

.chain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.chain li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.chain li:last-child { border-bottom: 1px solid var(--rule); }
.chain .label { margin: 0; }

.modes { list-style: none; margin: 0; padding: 0; }
.modes li + li { margin-top: 2rem; }
.modes h3 { margin-bottom: 0.35rem; }

/* ---------- Join ---------- */

[data-state] .state { display: none; }
[data-state="valid"] .state-valid,
[data-state="invalid"] .state-invalid,
[data-state="empty"] .state-empty { display: block; }

.code {
  display: block;
  font-size: clamp(2.6rem, 13.5vw, 4.75rem);
  letter-spacing: 0.1em;
  line-height: 1;
  margin: 0.25rem 0 0 -0.04em;
  font-feature-settings: "kern", "lnum";
  white-space: nowrap;
  -webkit-user-select: all;
  user-select: all;
}

.code-block {
  margin-top: 2.75rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.code-block .actions { margin-top: 1.5rem; }

.copy-status { font-size: 1rem; color: var(--gray); min-height: 1.5em; }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.25rem;
}
.steps li + li { margin-top: 1.4rem; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gray);
  font-feature-settings: "lnum";
}
.steps .actions { margin-top: 1rem; }

.code-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.code-form input {
  flex: 1;
  min-width: 0;
  min-height: 3rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font: inherit;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  -webkit-appearance: none;
  appearance: none;
}
.code-form input::placeholder { color: var(--gray); font-style: italic; letter-spacing: 0.02em; text-transform: none; }
.code-form input:focus { outline: none; border-color: var(--ink); }
.form-note { margin-top: 0.85rem; font-size: 1rem; min-height: 1.5em; }

/* ---------- Prose pages (privacy, support) ---------- */

.prose h2 { font-size: 1.35rem; margin: 2.5rem 0 0.6rem; line-height: 1.3; }
.prose ul { margin: 0.75rem 0 0; padding-left: 1.15rem; }
.prose li + li { margin-top: 0.6rem; }
.prose li::marker { color: var(--gray); }

.faq details { border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 2rem 1.1rem 0;
  position: relative;
  font-size: 1.2rem;
  line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.1rem;
  top: 1.05rem;
  color: var(--gray);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 1.4rem; }
.faq .answer p + p { margin-top: 0.75em; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.95rem;
  color: var(--gray);
}
.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer a { text-decoration-color: var(--rule); }
.site-footer a:hover { color: var(--ink); text-decoration-color: currentColor; }

.home-link {
  display: inline-block;
  font-size: 1.05rem;
  text-decoration: none;
  margin-bottom: 3.5rem;
}
.home-link em { font-style: italic; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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