/* ==========================================================================
   Saba LT — shared styles
   Dark, quiet, precise. Gold accent, serif display, generous space.
   ========================================================================== */

:root {
  --bg: #06080c;
  --bg-raise: #0b0f16;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #e9edf3;
  --ink-muted: #94a0b3;
  --ink-faint: #5c687a;
  --gold: #d8ad5e;
  --gold-bright: #edc987;
  --good: #6fd9a6;
  --bad: #ff7a7a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- ambient backdrop: soft gold glow + faint grid --------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 70% -10%, rgba(216, 173, 94, 0.17), transparent 60%),
    radial-gradient(50rem 35rem at 10% 110%, rgba(90, 130, 220, 0.11), transparent 60%),
    var(--bg);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(70rem 50rem at 50% 0%, rgba(0, 0, 0, 0.55), transparent 75%);
  -webkit-mask-image: radial-gradient(70rem 50rem at 50% 0%, rgba(0, 0, 0, 0.55), transparent 75%);
}

/* --- type ---------------------------------------------------------------- */

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.lede { color: var(--ink-muted); }

/* --- landing (gate) page: scroll-driven globe sequence ---------------------
   .journey is tall; .stage stays pinned while scroll progress drives the
   globe spin/split and the card reveal (see globe.js). */

html { scroll-behavior: smooth; }

.journey {
  position: relative;
  height: 340vh;
}

.journey-end {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 1px;
}

.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* title and card share the stage center; JS cross-fades them */
.stage .hero-title,
.stage .gate-card {
  grid-area: 1 / 1;
}

.stage .gate-card {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity, transform;
}

#globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-title {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.hero-logo {
  width: clamp(56px, 8vw, 92px);
  filter: drop-shadow(0 0 24px rgba(6, 8, 12, 0.9));
  animation: rise 1.4s 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-wordmark {
  position: relative;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: 0.16em;
  text-shadow: 0 0 40px rgba(6, 8, 12, 0.9), 0 0 12px rgba(6, 8, 12, 0.9);
  animation: rise 1.4s 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  color: var(--gold);
  font-size: 1.5rem;
  text-decoration: none;
  animation: bob 2.2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 10px); }
}

.gate-panel {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.gate {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

/* "Saba | <LT mark>" lockup at the top of the card */
.gate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.gate-brand .wordmark {
  font-size: 1.3rem;
  letter-spacing: 0.12em;
}

.gate-brand-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--line-strong);
}

.gate-logo {
  display: block;
  width: 26px;
  opacity: 0.9;
}

.gate-card {
  width: min(22rem, 100%);
  padding: 2.4rem 2.2rem 1.8rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gate-card .wordmark { font-size: 2.1rem; }

.gate-card .rule {
  width: 3.5rem;
  height: 1px;
  margin: 1.25rem 0;
  border: 0;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.gate-card form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  text-align: left;
}

.gate-card footer {
  margin-top: 1.6rem;
  font-size: 0.72rem;
  color: var(--ink-faint, #5c687a);
  letter-spacing: 0.06em;
}

/* --- fields -------------------------------------------------------------- */

.field { position: relative; }

.field input,
.field textarea {
  width: 100%;
  padding: 1.15rem 1rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.field textarea { resize: vertical; min-height: 6.5rem; }

.field label {
  position: absolute;
  left: 1rem;
  top: 0.85rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
  pointer-events: none;
  transition: transform 0.18s, font-size 0.18s, color 0.18s;
  transform-origin: left top;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(216, 173, 94, 0.05);
  box-shadow: 0 0 0 3px rgba(216, 173, 94, 0.12);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-0.55rem);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

/* --- buttons ------------------------------------------------------------- */

button {
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: transparent;
  color: var(--gold-bright);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

button:hover { background: var(--gold); color: #14100a; }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: wait; }

button:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* --- status text ---------------------------------------------------------- */

.error { color: var(--bad); margin: 0; font-size: 0.9rem; }
.ok    { color: var(--good); margin: 0; font-size: 0.9rem; }

/* the post-submit confirmation stands alone in the panel — give it presence */
#apply-status.ok {
  font-family: var(--serif);
  font-size: 1.15rem;
}

.shake { animation: shake 0.4s; }

/* --- protected pages ------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.6rem 1.5rem;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.site-header .brand-logo { height: 1.35rem; width: auto; }

.site-header .wordmark { font-size: 1.15rem; }

.site-header .badge {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

.page {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.hero { padding: 3.5rem 0 2.5rem; }

.hero .wordmark { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.15; }

.hero .lede { max-width: 38rem; font-size: 1.1rem; margin-top: 1.25rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.card {
  padding: 1.6rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  border-radius: 14px;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--gold-bright);
}

.card p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }

.panel {
  margin-top: 3rem;
  padding: 2.25rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: 18px;
}

.panel h2 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
}

.panel > .lede { margin: 0 0 1.75rem; font-size: 0.98rem; }

.panel form { display: flex; flex-direction: column; gap: 1.1rem; }

.panel .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

/* click-to-expand role sections */
.roles {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.75rem;
}

details.role {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s;
}

details.role[open] { border-color: var(--line-strong); }

details.role summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.15rem 1.4rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--ink);
}

details.role summary::-webkit-details-marker { display: none; }

details.role summary::after {
  content: "+";
  color: var(--gold);
  font-family: var(--sans);
  font-size: 1.2rem;
}

details.role[open] summary::after { content: "\2212"; }

.role-body {
  padding: 0 1.4rem 1.4rem;
  color: var(--ink-muted);
  font-size: 0.96rem;
}

.role-body > p:first-child {
  margin-top: 0;
  color: var(--gold-bright);
  font-family: var(--serif);
}

.role-body ul { margin: 0.6rem 0; padding-left: 1.15rem; }
.role-body li { margin: 0.35rem 0; }

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

/* file drop area */
.file-field input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--ink-muted);
  transition: border-color 0.2s, background 0.2s;
}
.file-field:hover, .file-field:focus-within {
  border-color: var(--gold);
  background: rgba(216, 173, 94, 0.04);
}
.file-field .doc { font-size: 1.3rem; }
.file-field .file-name { color: var(--ink); }

.site-footer {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint, #5c687a);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

/* --- motion ---------------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

.reveal { animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.reveal-late { animation: rise 0.7s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both; }

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

  /* No scroll choreography: static globe, title and card simply stacked. */
  .journey { height: auto; }
  .stage {
    position: relative;
    height: auto;
    min-height: 100svh;
    grid-template-rows: auto auto;
    align-content: center;
    gap: 3rem;
    padding: 3.5rem 1.5rem;
  }
  .stage .hero-title,
  .stage .gate-card {
    grid-area: auto;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }
  .scroll-cue { display: none; }
}
