:root {
  --navy: #14243f;
  --navy-deep: #0c1830;
  --navy-soft: #2c3e5e;
  --cream: #f7f4ee;
  --paper: #fffdf9;
  --ink: #1d2433;
  --muted: #6b7384;
  --line: #d9d3c7;
  --gold: #9a7b4f;
  --error: #9b2c2c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: "Jost", -apple-system, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse at top, rgba(20, 36, 63, 0.04), transparent 60%);
}

.screen { width: 100%; }

/* ---------- Loading / redirecting ---------- */
.loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.spinner {
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Gate / chooser layout ---------- */
#gate,
#chooser {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem) 4rem;
}

.masthead {
  text-align: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.brand-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
  margin-bottom: 1.25rem;
}
.brand-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 4.25rem);
  line-height: 1;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.brand-subtitle {
  margin-top: 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-soft);
  font-weight: 400;
}
.brand-definition {
  max-width: 34rem;
  margin: 1.25rem auto 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
  font-weight: 300;
}

.brand-list {
  margin-top: 1.25rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--navy);
}

/* ---------- Chooser ---------- */
.choices {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}
.section-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}
.choice-btn {
  display: block;
  font-family: "Jost", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  padding: 1.35rem 1.5rem;
  border-radius: 2px;
  background: var(--navy);
  color: var(--cream);
  transition: background 0.25s ease, transform 0.1s ease;
}
.choice-btn:hover { background: var(--navy-deep); }
.choice-btn:active { transform: translateY(1px); }
.choice-btn:focus-visible,
.back-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Document body ---------- */
.document {
  max-height: 48vh;
  overflow-y: auto;
  padding: 0.5rem 1.5rem 0.5rem 0.25rem;
  scroll-behavior: smooth;
}
.document::-webkit-scrollbar { width: 6px; }
.document::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.notice {
  background: var(--navy);
  color: var(--cream);
  padding: 1.5rem 1.75rem;
  font-size: 0.98rem;
  line-height: 1.65;
  font-weight: 300;
  border-radius: 2px;
}

.terms-heading {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 1.85rem;
  color: var(--navy);
  margin: 2.25rem 0 0.5rem;
}
.terms-intro {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.terms {
  list-style: none;
  counter-reset: term;
}
.terms li {
  counter-increment: term;
  position: relative;
  padding: 0 0 1.4rem 2.75rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
}
.terms li::before {
  content: counter(term);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.85rem;
  height: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.terms strong { font-weight: 500; color: var(--navy); }

.affirmation {
  margin-top: 1rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  background: var(--paper);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--navy-deep);
}

/* ---------- Actions ---------- */
.actions {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.scroll-hint {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-align: center;
  transition: opacity 0.4s ease;
}
.scroll-hint.hidden { opacity: 0; height: 0; margin: 0; pointer-events: none; }

.signer { display: flex; flex-direction: column; gap: 0.45rem; }
.signer-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
#fullName {
  font-family: "Jost", sans-serif;
  font-size: 1rem;
  font-weight: 300;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.2s ease;
}
#fullName:focus { outline: none; border-color: var(--navy); }

.agree-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
}
.agree-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  accent-color: var(--navy);
  cursor: pointer;
}
.agree-check input:disabled { cursor: not-allowed; opacity: 0.4; }

.agree-btn {
  font-family: "Jost", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 1.1rem;
  border: none;
  border-radius: 2px;
  background: var(--navy);
  color: var(--cream);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.1s ease;
}
.agree-btn:hover:not(:disabled) { background: var(--navy-deep); }
.agree-btn:active:not(:disabled) { transform: translateY(1px); }
.agree-btn:disabled { background: #b4bac6; cursor: not-allowed; }

.error-msg {
  color: var(--error);
  font-size: 0.9rem;
  text-align: center;
}
.signed-as {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.03em;
}

.back-link {
  align-self: center;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--navy-soft);
}

@media (max-width: 540px) {
  .document { max-height: 42vh; }
  .notice, .affirmation { padding: 1.25rem; }
}
