/* =========================================================
   ThobeWear — Pre-Launch Landing
   Design language: quiet luxury, modest heritage
   Now with light + dark modes (data-theme on <html>)
   --------------------------------------------------------- */

:root {
  /* Brand constants (same gold in both themes) */
  --champagne:    #c9a24b;   /* signature gold */
  --champagne-2:  #e7cf95;   /* gold highlight */
  --champagne-deep:#9c7a2e;  /* deep gold (for light-bg contrast) */

  --maxw: 760px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shine-duration: 6s;   /* shared by the logo + "Reimagined" glares */
}

/* ---- DARK theme (default, luxury ground) ---------------- */
:root[data-theme="dark"] {
  --bg:        #0a0a0b;
  --bg-three:  0x0a0a0b;                 /* hex int for Three.js fog */
  --surface:   rgba(20, 20, 22, 0.55);
  --border:    rgba(203, 185, 163, 0.22);
  --border-strong: rgba(201, 162, 75, 0.6);
  --text:      #f5efe6;
  --text-soft: #cbb9a3;
  --muted:     #8a8378;
  --accent:    var(--champagne);
  --accent-2:  var(--champagne-2);
  --logo-mask: url("assets/logo-dark.png");
  --glare-hi:  #fff6df;   /* white-gold highlight pops on black */
}

/* ---- LIGHT theme (warm gallery ivory) ------------------- */
:root[data-theme="light"] {
  --bg:        #f4ede1;
  --bg-three:  0xf4ede1;
  --surface:   rgba(255, 255, 255, 0.6);
  --border:    rgba(120, 100, 60, 0.28);
  --border-strong: rgba(156, 122, 46, 0.65);
  --text:      #1d1a15;
  --text-soft: #5f5648;
  --muted:     #8a8378;
  --accent:    var(--champagne-deep);
  --accent-2:  var(--champagne);
  --logo-mask: url("assets/logo-light.png");
  --glare-hi:  #e8c25c;   /* bright gold (not white) stays legible on cream */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: "Jost", system-ui, -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}

/* --- Three.js canvas + vignette ------------------------- */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
:root[data-theme="dark"] .vignette {
  background:
    radial-gradient(120% 90% at 50% 18%, transparent 35%, rgba(10,10,11,0.55) 78%, rgba(10,10,11,0.92) 100%),
    linear-gradient(180deg, rgba(10,10,11,0.35) 0%, transparent 30%, transparent 60%, rgba(10,10,11,0.85) 100%);
}
:root[data-theme="light"] .vignette {
  background:
    radial-gradient(125% 95% at 50% 16%, transparent 55%, rgba(244,237,225,0.32) 85%, rgba(244,237,225,0.7) 100%),
    linear-gradient(180deg, rgba(244,237,225,0.28) 0%, transparent 36%, transparent 70%, rgba(244,237,225,0.62) 100%);
}

/* --- Layout --------------------------------------------- */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  text-align: center;
}

/* --- Top bar (brand + theme toggle) --------------------- */
/* 3-column grid keeps the logo centered while the toggle stays right */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  animation: rise 1s var(--ease) both;
}

.brand {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 96px;
}
.brand__logo-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.brand__logo {
  height: clamp(74px, 11vw, 104px);
  width: auto;
  max-width: 340px;
  object-fit: contain;
  display: block;
}
.brand__logo.is-missing { display: none; }
.brand__logo-wrap.is-missing::after { display: none; }

/* metallic sheen that periodically sweeps across the logo artwork.
   Dark mode: white artwork → a GOLD band with multiply reads as a
   gold shimmer travelling across the wordmark. */
.brand__logo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 36%,
    rgba(176, 132, 40, 0.92) 50%,
    transparent 64%
  );
  background-size: 300% 100%;
  background-repeat: no-repeat;
  -webkit-mask: var(--logo-mask) center / contain no-repeat;
          mask: var(--logo-mask) center / contain no-repeat;
  mix-blend-mode: multiply;
  will-change: background-position;
  animation: glare var(--shine-duration) linear infinite;
}
/* Light mode: black artwork → a warm gold band with screen lifts a
   golden streak out of the dark wordmark. */
:root[data-theme="light"] .brand__logo-wrap::after {
  background: linear-gradient(
    90deg,
    transparent 38%,
    rgba(231, 207, 149, 0.95) 50%,
    transparent 62%
  );
  background-size: 300% 100%;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
}

/* ONE keyframe drives both glares. Identical geometry (300% size, 90deg,
   band centred at 50%) means the highlight crosses each element's centre
   at the exact same fraction of the cycle — synced on every device. */
@keyframes glare {
  0%        { background-position: 150% 50%; }
  88%, 100% { background-position: 0% 50%; }
}

.brand__text { display: none; align-items: center; gap: 0.7rem; }
.brand__text.is-shown { display: flex; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
}
.brand__name {
  font-family: "Jost", sans-serif;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--text);
  padding-left: 0.42em;
}

/* --- Theme toggle --------------------------------------- */
.theme-toggle {
  grid-column: 3;
  justify-self: end;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover { border-color: var(--border-strong); transform: rotate(12deg); }
.theme-toggle svg { display: block; }
/* show the icon that represents the *current* mode */
:root[data-theme="dark"]  .theme-toggle .icon-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* --- Hero ----------------------------------------------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 3rem 0;
}

.eyebrow {
  font-size: clamp(0.9rem, 2.1vw, 1.1rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-soft);
  animation: rise 1s var(--ease) 0.1s both;
}
.eyebrow .glare-text { letter-spacing: inherit; font-weight: 500; }

.headline {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: clamp(2.9rem, 11vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  animation: rise 1.1s var(--ease) 0.2s both;
}
.headline em {
  font-style: italic;
  font-weight: 400;
}

/* Reusable gold glare for text. Shares the same @keyframes glare, duration
   and rhythm as the logo, so every glare on the page sweeps in unison.
   A 90deg gradient with uniform gold ends tiles seamlessly; background-size
   300% means one tile is a 150% shift, so the loop never jumps. */
.glare-text {
  display: inline-block;   /* clean box so the tiled gradient seams align */
  /* background-clip:text masks the glyphs to this box; the tight headline
     line-height would otherwise crop italic descenders (the "g" in
     "Reimagined."). Pad the box down and pull it back with a negative margin
     so descenders are painted in full without shifting the layout. */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) 43%,
    var(--glare-hi) 50%,
    var(--accent-2) 54%,
    var(--accent) 61%,
    var(--accent) 100%
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  will-change: background-position;
  animation: glare var(--shine-duration) linear infinite;
}

.subhead {
  max-width: 38ch;
  color: var(--text-soft);
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  font-weight: 300;
  animation: rise 1.1s var(--ease) 0.32s both;
}

/* --- Signup form ---------------------------------------- */
.signup {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  width: min(100%, 480px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.4rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: rise 1.1s var(--ease) 0.44s both;
  transition: border-color 0.4s var(--ease), background-color 0.6s var(--ease);
}
.signup:focus-within { border-color: var(--border-strong); }
.signup[hidden] { display: none; } /* class display would otherwise win over [hidden] */

.signup input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  /* softer, less geometric than the body sans — easier on the eyes */
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.7rem 1rem;
}
.signup input::placeholder {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
  opacity: 0.95;
}

.signup button {
  flex: none;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.4rem;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #14110a;
  background: linear-gradient(100deg, var(--champagne-2), var(--champagne));
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}
.signup button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.signup button:active { transform: translateY(0); }
.signup button:disabled,
.signup input:disabled { opacity: 0.6; cursor: default; pointer-events: none; }

/* Honeypot field: removed from view + the layout, but still in the DOM so
   bots fill it. Not display:none (some bots skip those) — pushed off-screen. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.signup.is-done button { background: var(--text-soft); }

.signup__note {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  animation: rise 1.1s var(--ease) 0.54s both;
  min-height: 1.2em;
}
.signup__note.is-success { color: var(--accent); }
.signup__note.is-error   { color: #c9683f; }

/* Prominent post-signup confirmation (replaces the form on success) */
.signup-done {
  width: min(100%, 480px);
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: 1.7rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px -28px rgba(201, 162, 75, 0.55);
  animation: doneIn 0.7s var(--ease) both;
}
.signup-done[hidden] { display: none; }
.signup-done__check {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #14110a;
  background: linear-gradient(100deg, var(--champagne-2), var(--champagne));
  box-shadow: 0 0 0 7px rgba(201, 162, 75, 0.16);
  animation: checkPop 0.5s var(--ease) 0.18s both;
}
.signup-done__check svg { width: 30px; height: 30px; }
.signup-done__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}
.signup-done__sub {
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  line-height: 1.55;
  color: var(--muted);
  max-width: 40ch;
}
@keyframes doneIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes checkPop {
  0%   { opacity: 0; transform: scale(0.4); }
  60%  { transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .signup-done, .signup-done__check { animation: none; }
}

/* Subtle "return home" link on the confirmation page */
.backlink {
  margin-top: 0.4rem;
  font-family: "Jost", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
  animation: rise 1.1s var(--ease) 0.4s both;
}
.backlink:hover { color: var(--accent); border-color: var(--accent); }

/* --- Footer --------------------------------------------- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 2rem;
  animation: rise 1.1s var(--ease) 0.66s both;
}
.countdown {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}
.countdown b { color: var(--accent); font-weight: 600; }

.social { display: flex; gap: 1.6rem; }
.social a,
.social .social-link {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.3s var(--ease);
  /* button reset so .social-link matches the anchors exactly */
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  line-height: inherit;
}
.social a::after,
.social .social-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}
.social a:hover,
.social .social-link:hover { color: var(--text); }
.social a:hover::after,
.social .social-link:hover::after { width: 100%; }

/* inert placeholders for not-yet-created accounts */
.social-soon {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: default;
  opacity: 0.7;
}

/* --- Contact modal -------------------------------------- */
.modal {
  /* Center reliably across browsers (don't rely on the UA dialog centering). */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(92vw, 460px);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 0;
  /* Near-opaque (not the translucent --surface): the modal floats over a dark
     dimming backdrop, so a see-through panel would look muddy gray. */
  background: rgba(22, 22, 24, 0.97);
  color: var(--text);
  box-shadow: 0 30px 80px -32px rgba(0, 0, 0, 0.7);
}
:root[data-theme="light"] .modal {
  background: rgba(248, 244, 236, 0.98); /* warm near-solid cream */
}
.modal::backdrop {
  background: rgba(8, 8, 10, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal[open] { animation: modalIn 0.35s var(--ease) both; }
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -50%) translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

.modal__panel,
.modal__done { padding: 1.8rem 1.6rem; }
.modal__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}
.modal__done[hidden] { display: none; }

.modal__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.3rem;
}
.modal__sub {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1.2rem;
}
.modal__done .modal__sub { margin-bottom: 0.4rem; }

.field { display: block; margin-bottom: 0.9rem; }
.field__label {
  display: block;
  font-family: "Jost", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}
.field input,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.05rem;
  padding: 0.6rem 0.75rem;
  outline: none;
  transition: border-color 0.25s var(--ease);
}
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea { background: rgba(0, 0, 0, 0.03); }
.field input:focus,
.field textarea:focus { border-color: var(--border-strong); }
.field textarea { resize: vertical; min-height: 5rem; }

.modal__note {
  min-height: 1.1em;
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.modal__note.is-error { color: #c9683f; }

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.modal__actions--center { justify-content: center; margin-top: 0.8rem; }

.btn-gold,
.btn-ghost {
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 11px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: filter 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn-gold {
  border: none;
  color: #14110a;
  background: linear-gradient(100deg, var(--champagne-2), var(--champagne));
}
.btn-gold:hover { filter: brightness(1.08); }
.btn-gold:disabled { opacity: 0.6; cursor: default; pointer-events: none; }
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }

.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  z-index: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  transition: color 0.25s var(--ease);
}
.modal__close:hover { color: var(--text); }

.copy {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* --- Custom cursor -------------------------------------- */
/* Hide the native cursor only when our custom one is active.
   Text fields keep a caret so typing still feels right. */
:root.cursor-on,
:root.cursor-on a,
:root.cursor-on button,
:root.cursor-on .theme-toggle { cursor: none; }
:root.cursor-on input { cursor: text; }

.cursor-dot,
.cursor-ring,
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  will-change: transform;
}
:root.cursor-visible .cursor-dot,
:root.cursor-visible .cursor-ring { opacity: 1; }
:root.cursor-visible .cursor-glow { opacity: 1; }

.cursor-dot {
  z-index: 90;
  width: 6px; height: 6px;
  margin: 0;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(201, 162, 75, 0.8);
}

.cursor-ring {
  z-index: 89;
  width: 34px; height: 34px;
  border: 1px solid var(--accent);
  background: transparent;
  transition: opacity 0.35s var(--ease),
              width 0.3s var(--ease), height 0.3s var(--ease),
              background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

/* soft gold pool that trails behind, lighting the field */
.cursor-glow {
  z-index: 1;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(201, 162, 75, 0.18), transparent 62%);
  mix-blend-mode: screen;
  filter: blur(6px);
}
:root[data-theme="light"] .cursor-glow {
  background: radial-gradient(circle, rgba(156, 122, 46, 0.20), transparent 62%);
  mix-blend-mode: multiply;
}

/* grow + fill the ring over interactive elements */
:root.cursor-hover .cursor-ring {
  width: 56px; height: 56px;
  background: rgba(201, 162, 75, 0.12);
  border-color: var(--accent-2);
}
:root.cursor-hover .cursor-dot { opacity: 0.4; }

/* press feedback */
:root.cursor-down .cursor-ring { width: 26px; height: 26px; }

/* --- Utilities ------------------------------------------ */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

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

@media (max-width: 540px) {
  .signup { flex-direction: column; }
  .signup button { padding: 0.85rem; }
}
