/*
  Studio landing page — flat-vector sea aesthetic, dark/light aware.
  Theming: light is the default; dark applies via prefers-color-scheme AND via
  an explicit [data-theme] stamped by the toggle, so the toggle wins in both
  directions regardless of the OS setting.
*/

:root {
  /* light — a bright, hazy dawn sea */
  --bg: #dff1f4;
  --ink: #0d2733;
  --ink-soft: #3f5b66;
  --brand: #0d2733;
  --accent: #0e7c86;
  --accent-ink: #ffffff;
  --line: rgba(13, 39, 51, 0.14);
  --card: rgba(255, 255, 255, 0.72);

  --sky: #cfeaf0;
  --celestial: #ffd9a0;
  --haze: #bfe3e6;
  --isle: #7fb0ac;
  --wave-3: #8fd0d1;
  --wave-2: #4fb3ba;
  --wave-1: #2b8f9a;
  --hull: #6b4a2f;
  --mast: #4a3320;
  --sail: #fbf4e6;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* dark — deep night waters under a pale moon */
    --bg: #071d28;
    --ink: #eaf6f8;
    --ink-soft: #9fc0c8;
    --brand: #eaf6f8;
    --accent: #35c4c9;
    --accent-ink: #04222a;
    --line: rgba(234, 246, 248, 0.16);
    --card: rgba(9, 34, 45, 0.6);

    --sky: #0b2a3a;
    --celestial: #cfe4ea;
    --haze: #0e3346;
    --isle: #123a48;
    --wave-3: #123f52;
    --wave-2: #145162;
    --wave-1: #0c6b78;
    --hull: #2a1c11;
    --mast: #543a24;
    --sail: #d7e9ec;
  }
}

/* Explicit toggle overrides — must win over the media query in both directions. */
:root[data-theme="light"] {
  --bg: #dff1f4;
  --ink: #0d2733;
  --ink-soft: #3f5b66;
  --brand: #0d2733;
  --accent: #0e7c86;
  --accent-ink: #ffffff;
  --line: rgba(13, 39, 51, 0.14);
  --card: rgba(255, 255, 255, 0.72);
  --sky: #cfeaf0;
  --celestial: #ffd9a0;
  --haze: #bfe3e6;
  --isle: #7fb0ac;
  --wave-3: #8fd0d1;
  --wave-2: #4fb3ba;
  --wave-1: #2b8f9a;
  --hull: #6b4a2f;
  --mast: #4a3320;
  --sail: #fbf4e6;
}

:root[data-theme="dark"] {
  --bg: #071d28;
  --ink: #eaf6f8;
  --ink-soft: #9fc0c8;
  --brand: #eaf6f8;
  --accent: #35c4c9;
  --accent-ink: #04222a;
  --line: rgba(234, 246, 248, 0.16);
  --card: rgba(9, 34, 45, 0.6);
  --sky: #0b2a3a;
  --celestial: #cfe4ea;
  --haze: #0e3346;
  --isle: #123a48;
  --wave-3: #123f52;
  --wave-2: #145162;
  --wave-1: #0c6b78;
  --hull: #2a1c11;
  --mast: #543a24;
  --sail: #d7e9ec;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100svh;
  position: relative;
  color: var(--ink);
  background: var(--bg);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}

/* The sea fills the viewport behind the content. */
.sea {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.sky {
  fill: var(--sky);
}
.celestial {
  fill: var(--celestial);
  opacity: 0.85;
}
.haze {
  fill: var(--haze);
  opacity: 0.7;
}
.isle {
  fill: var(--isle);
  opacity: 0.85;
}
.wave-3 {
  fill: var(--wave-3);
}
.wave-2 {
  fill: var(--wave-2);
}
.wave-1 {
  fill: var(--wave-1);
}
.hull {
  fill: var(--hull);
}
.mast {
  fill: var(--mast);
}
.sail {
  fill: var(--sail);
}

.boat {
  animation: bob 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes bob {
  0%,
  100% {
    transform: translate(560px, 452px) rotate(-1.5deg);
  }
  50% {
    transform: translate(560px, 446px) rotate(1.5deg);
  }
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  backdrop-filter: blur(6px);
}
.theme-toggle:hover {
  border-color: var(--accent);
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.wordmark {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(3.2rem, 16vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--brand);
  text-shadow: 0 1px 0 var(--line);
}

.teaser {
  margin: 0 auto 1.5rem;
  max-width: 30rem;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  color: var(--ink-soft);
}

.signup {
  width: min(30rem, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.signup-row {
  display: flex;
  gap: 0.5rem;
}

#email {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
#email:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.submit {
  padding: 0.75rem 1.1rem;
  font-size: 1rem;
  font-weight: 650;
  white-space: nowrap;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 0.6rem;
  cursor: pointer;
}
.submit:hover {
  filter: brightness(1.06);
}
.submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.status {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
}
/* Collapse entirely when there's no message, so the email field and the
   fineprint sit close together until a status actually appears. */
.status:empty {
  display: none;
}
.status-ok {
  color: var(--accent);
  font-weight: 600;
}
.status-error {
  color: #d1495b;
}
.status-muted {
  color: var(--ink-soft);
}

.fineprint {
  margin: 0.6rem 0 0.2rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.footer {
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.footer .dot {
  margin: 0 0.4rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 5;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.9rem;
  border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
  left: 0;
}

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

@media (max-width: 30rem) {
  .signup-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boat {
    animation: none;
  }
}
