/* Scroll Felt — live website player doors (www, trust, support, invite,
   waitlist, privacy, terms, login, messages, 404). Table keeps table.css.
   /admin is site.css. */

:root {
  color-scheme: dark;
}

.theme-scroll-felt {
  --ground: #0a1512;
  --ground-2: #0d1c17;
  --ground-3: #11241d;
  --card: #12271f;
  --card-hi: #17332a;

  --ink: #f4efe2;
  --ink-2: #a6b6ab;
  --ink-3: #7d8f84;

  --cream: #efe9d9;
  --gold: #d9b566;
  --gold-dim: #a8873f;
  --bad: #e08a7a;

  --line: rgba(239, 233, 217, 0.14);
  --line-2: rgba(239, 233, 217, 0.28);
  --focus: #d9b566;

  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, sans-serif;
  --font-ui: var(--font-display);

  --t-display: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);
  --t-h2: clamp(1.6rem, 1.25rem + 1.5vw, 2.4rem);
  --t-h3: 1.25rem;
  --t-lead: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --t-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --t-small: clamp(0.95rem, 1.1vw, 1.05rem);

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.875rem;
  --s-4: 1.25rem;
  --s-5: 1.75rem;
  --s-6: 2.5rem;
  --s-7: 3.25rem;
  --s-8: 4.75rem;

  --wrap: 68rem;
  --measure: 46rem;
  --radius: 18px;
  --radius-sm: 999px;
  --nav-h: 4.5rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--t-display); max-width: 18ch; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.15; letter-spacing: -0.02em; }

p { margin: 0; }
p + p { margin-top: var(--s-4); }

.lead {
  font-size: var(--t-lead);
  line-height: 1.4;
  color: var(--ink);
  max-width: 34ch;
}

.say {
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: var(--measure);
}

.say strong { color: var(--ink); font-weight: 700; }

.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 var(--s-3);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s-4);
}

@media (min-width: 720px) {
  .wrap { padding-inline: var(--s-6); }
}

.wrap.narrow { max-width: 36rem; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cream);
  color: var(--ground);
  padding: var(--s-3) var(--s-4);
  border-radius: 0 0 var(--radius) 0;
  font-weight: 700;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- top nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand .pip { color: var(--gold); font-size: 1.1em; line-height: 1; }
.brand:hover { color: #fff; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-links a {
  display: inline-block;
  position: relative;
  padding: 0.9rem 0.95rem;
  color: var(--ink-2);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0.95rem;
  right: 0.95rem;
  bottom: 0.5rem;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.nav-cta {
  padding: 0.7rem 1.25rem;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-cta:hover { border-color: var(--cream); background: rgba(239, 233, 217, 0.08); }

@media (max-width: 760px) {
  .nav-in {
    flex-wrap: wrap;
    gap: 0 var(--s-3);
    min-height: 0;
    padding-block: 0.65rem 0;
  }

  .brand { font-size: 1.12rem; }
  .nav-end { order: 2; }

  .nav-links {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 0 var(--s-4);
    margin-top: 0.15rem;
  }

  .nav-links a { padding: 0.5rem 0 0.65rem; font-size: 1rem; }
  .nav-links a::after { left: 0; right: 0; bottom: 0.3rem; }
  .nav-cta { padding: 0.5rem 1rem; font-size: 0.95rem; }
}

/* ---------- buttons and pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-lg { min-height: 3.5rem; font-size: 1.1rem; padding: 0.95rem 2rem; }

.btn-primary { background: var(--cream); color: var(--ground); }
.btn-primary:hover { background: #fff; }

.btn-ghost {
  background: transparent;
  border-color: var(--cream);
  color: var(--cream);
}
.btn-ghost:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(239, 233, 217, 0.08);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

/* After .btn so inline-flex cannot leak Open Play or guest CTAs. */
.btn[hidden],
a.btn[hidden],
button.btn[hidden],
[hidden],
html.signed-in [data-guest-only],
html:not(.signed-in) [data-signed-in] {
  display: none !important;
}

.say a,
.lead a,
.hero-sub a,
.legal a,
.foot-note a,
.ticks a,
.tiny a {
  color: var(--gold);
  text-underline-offset: 0.2em;
}

@media (max-width: 480px) {
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.pill:hover {
  border-color: var(--cream);
  background: rgba(239, 233, 217, 0.07);
}
.pill-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- section rhythm ---------- */

.sec { padding-block: var(--s-6); }

@media (min-width: 900px) {
  .sec { padding-block: var(--s-7); }
}

.sec-alt { background: var(--ground-2); border-block: 1px solid var(--line); }

.sec-head { max-width: 54rem; margin-bottom: var(--s-5); }
.sec-head h2 { max-width: 24ch; }
.sec-head h2 + .say { margin-top: var(--s-3); }

/* ---------- hero: text only, same left edge as every band ---------- */

.hero { padding-block: var(--s-7) var(--s-6); }
.hero h1 { margin-bottom: var(--s-4); }
.hero .lead { max-width: 38ch; }
.hero-sub { margin-top: var(--s-5); }

@media (max-width: 720px) {
  .hero { padding-block: var(--s-6) var(--s-5); }
  .hero-sub { margin-top: var(--s-4); }
}

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); max-width: var(--measure); }

.ticks li {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  line-height: 1.4;
  color: var(--ink);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}

.ticks li::before {
  content: "♠";
  color: var(--gold);
  font-size: 0.95rem;
  flex: none;
}

/* ---------- three steps ---------- */

.tiles {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .tiles { grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
}

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.tile-num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold);
}

.tile p { color: var(--ink-2); line-height: 1.45; }

.how-after { margin-top: var(--s-5); }
.help-line { margin-top: var(--s-5); }

/* ---------- app pages: support, account, messages ---------- */

.page-head {
  padding-block: var(--s-6) var(--s-5);
  border-bottom: 1px solid var(--line);
}

.page-head h1 { margin-bottom: var(--s-3); }
.page-head .lead { color: var(--ink-2); max-width: 44ch; }

:target { scroll-margin-top: calc(var(--nav-h) + var(--s-4)); }

.duo { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }

@media (max-width: 1099px) {
  html.signed-in .duo > #ticket { order: -1; }
}

@media (min-width: 1100px) {
  .duo { grid-template-columns: 1fr 1fr; gap: var(--s-5); align-items: start; }
}

.stack { display: grid; gap: var(--s-4); }

@media (min-width: 900px) {
  .stack { gap: var(--s-5); }
}

.panel {
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.panel > h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
.panel > h3, .panel h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
.panel p { color: var(--ink-2); line-height: 1.5; max-width: var(--measure); }
.panel p strong { color: var(--ink); }
.panel a:not(.btn):not(.pill) { color: var(--gold); text-underline-offset: 0.2em; }

.panel > * + * { margin-top: var(--s-3); }
.panel > * + h3 { margin-top: var(--s-5); }
.panel > h2 + * { margin-top: var(--s-4); }

.tiny { font-size: 0.95rem; line-height: 1.5; color: var(--ink-3); }
.form-err,
#inviteMsg:not(:empty),
#phoneMsg:not(:empty),
#codeMsg:not(:empty),
#waitMsg:not(:empty) {
  color: var(--bad);
}

/* ---------- forms ---------- */

.field { display: grid; gap: 0.45rem; }

.field > label,
.panel > label {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-2);
}

input, select, textarea {
  width: 100%;
  max-width: var(--measure);
  min-height: 3.25rem;
  padding: 0.75rem 0.95rem;
  font-family: var(--font-ui);
  /* stays >=16px so iOS Safari does not zoom the page on focus */
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--ink);
  color-scheme: dark;
  background-color: var(--ground-3);
  border: 1.5px solid var(--line);
  border-radius: 12px;
}

textarea { min-height: 9rem; resize: vertical; }

input::placeholder, textarea::placeholder { color: var(--ink-3); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  padding-right: 2.4rem;
  background-color: var(--ground-3);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.3rem) calc(50% - 1px), calc(100% - 1rem) calc(50% - 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select:disabled { color: var(--ink-3); }

.phone-row {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: var(--s-3);
  align-items: end;
}

@media (max-width: 34rem) {
  .phone-row { grid-template-columns: 1fr; }
}

.otp-code {
  letter-spacing: 0.42em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
}

.hidden { display: none !important; }

.btn-sm { min-height: 2.9rem; padding: 0.55rem 1.2rem; font-size: 1rem; }

.btn-row-tight { margin-top: var(--s-3); gap: var(--s-2); }

@media (max-width: 480px) {
  .btn-row-tight { flex-direction: row; }
  .btn-row-tight .btn { width: auto; }
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  background: var(--ground-2);
  padding-block: var(--s-6);
}

.foot-in { display: grid; gap: var(--s-4); }
.foot .brand { margin-right: 0; }

.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); list-style: none; margin: 0; padding: 0; }

.foot-links a {
  display: inline-block;
  padding: 0.45rem 0;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.foot-links a:hover { color: var(--ink); border-bottom-color: var(--gold); }

.foot-note { color: var(--ink-3); font-size: 0.98rem; }

/* ---------- account controls painted by chrome.js ---------- */

.nav-end .bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0 0.35rem;
  gap: 0.15rem;
  line-height: 1;
  color: var(--ink-2);
  text-decoration: none;
  opacity: 0.55;
}
.nav-end .bell.has-mail { opacity: 1; color: var(--gold); }
.nav-end .bell > .bell-icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  line-height: 1;
  filter: grayscale(1);
}
.nav-end .bell.has-mail > .bell-icon { filter: none; }
.bell-count {
  display: inline-block;
  margin-left: 0.2rem;
  min-width: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ground);
  font-size: 0.7rem;
  font-weight: 800;
}

.nav-chips {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.15rem 0.7rem 0.15rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 16, 14, 0.55);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.nav-chips:hover { border-color: var(--line-2); }
.nav-chips .chip-mark { width: 1.08rem; height: 1.08rem; flex: none; }

.nav-account { position: relative; }
.nav-account summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  list-style: none;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.nav-account summary::-webkit-details-marker { display: none; }
.nav-account summary::after { content: "\25BE"; font-size: 0.8em; opacity: 0.7; }
.nav-account summary:hover { background: rgba(239, 233, 217, 0.08); }
.nav-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: var(--card-hi) center / cover no-repeat;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  overflow: hidden;
}
.nav-avatar.has-photo { color: transparent; }
.nav-name {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 11rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.45rem 0.15rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  z-index: 60;
}
.nav-menu a, .nav-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.75rem;
  text-align: left;
  background: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-decoration: none;
}
.nav-menu a:hover, .nav-menu button:hover {
  background: rgba(239, 233, 217, 0.08);
}
.nav-menu-rule {
  height: 0;
  margin: 0.25rem 0.6rem;
  border: 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .nav-account summary { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .nav-name { display: none; }
  .chips-word { display: none; }
  .nav-end { gap: 0.15rem; }
}

/* ---------- legal and trust prose ---------- */

.legal h2 { margin-top: var(--s-6); }
.legal h2:first-child { margin-top: 0; }
.legal p { max-width: var(--measure); }
.legal ul { padding-left: 1.2em; }
.turnstile-box { min-height: 65px; width: 100%; margin: var(--s-3) 0; }

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-5);
  color: var(--ink-3);
  font-size: var(--t-small);
}
.stepper li.is-on { color: var(--gold); font-weight: 700; }

/* ---------- landscape phone ---------- */

@media (orientation: landscape) and (max-height: 520px) {
  .theme-scroll-felt {
    --t-display: clamp(1.7rem, 7vh, 2.6rem);
    --t-h2: clamp(1.4rem, 5.6vh, 2.1rem);
    --t-lead: 1.08rem;
    --t-body: 1.02rem;
    --nav-h: 3rem;
    --s-6: 1.75rem;
    --s-7: 2.25rem;
  }

  .nav { position: static; }
  .btn-lg { min-height: 3.25rem; font-size: 1.05rem; padding: 0.7rem 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
