/* website/assets/site.css — Magnetic World teaser page.
   Colors follow lib/core/theme/app_theme.dart: navy (dark) / warm off-white (light), sand accent.
   Theme: follows the system, or data-theme="light|dark" on <html> when chosen with the toggle. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0B1120;
  --bg-2: #0F172A;
  --text: #F8FAFC;
  --sub: #AAB1B7;
  --hint: #8D97A3;
  --surface: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #D4A373;
  --accent-text: #E6BE8A;
  --accent-soft: rgba(212, 163, 115, 0.14);
  --ink-on-accent: #1A120B;
  --glow: rgba(212, 163, 115, 0.16);
  --field-dot: rgba(148, 163, 184, 0.36);
  --field-hot: #F2C994;
  --glow-hot: rgba(212, 163, 115, 0.26);
  --bar: rgba(226, 232, 240, 0.85);
  --grad: linear-gradient(100deg, #F2D3A8 0%, #D4A373 45%, #C98A6B 100%);
}

/* Light tokens: forced by the toggle ... */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F7F5F2;
  --bg-2: #F1EEE9;
  --text: #1C1917;
  --sub: #57534E;
  --hint: #69635D;
  --surface: rgba(255, 255, 255, 0.65);
  --border: #E4DFD7;
  --border-strong: #D9D3C9;
  --accent-text: #8A5A2B;
  --accent-soft: rgba(212, 163, 115, 0.18);
  --glow: rgba(212, 163, 115, 0.22);
  --field-dot: rgba(87, 83, 78, 0.24);
  --field-hot: #B9824F;
  --glow-hot: rgba(212, 163, 115, 0.3);
  --bar: #292524;
  --grad: linear-gradient(100deg, #B9824F 0%, #A86A4C 55%, #8A5A2B 100%);
}

/* ... or picked up from the system when nothing was chosen. Same values as above. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F7F5F2;
    --bg-2: #F1EEE9;
    --text: #1C1917;
    --sub: #57534E;
    --hint: #69635D;
    --surface: rgba(255, 255, 255, 0.65);
    --border: #E4DFD7;
    --border-strong: #D9D3C9;
    --accent-text: #8A5A2B;
    --accent-soft: rgba(212, 163, 115, 0.18);
    --glow: rgba(212, 163, 115, 0.22);
    --field-dot: rgba(87, 83, 78, 0.24);
    --field-hot: #B9824F;
    --glow-hot: rgba(212, 163, 115, 0.3);
    --bar: #292524;
    --grad: linear-gradient(100deg, #B9824F 0%, #A86A4C 55%, #8A5A2B 100%);
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(70vmax 45vmax at 50% -10%, var(--glow), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.i18n-pending body {
  visibility: hidden;
}

main {
  flex: 1;
}

h1, h2, p, ol {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

img, svg {
  display: block;
}

button, input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--accent);
  color: var(--ink-on-accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink-on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.i {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.container {
  position: relative;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container { padding: 0 24px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 32px; }
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Nav ---------- */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 40px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(201, 138, 107, 0.35));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.lang-switch button {
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sub);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--ink-on-accent);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--sub);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-toggle .i {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

/* Dark shows the sun (switch to light), light shows the moon. */
.theme-toggle .i-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }
:root[data-theme="light"] .theme-toggle .i-sun { opacity: 0; transform: rotate(90deg) scale(0.6); }
:root[data-theme="light"] .theme-toggle .i-moon { opacity: 1; transform: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .i-sun { opacity: 0; transform: rotate(90deg) scale(0.6); }
  :root:not([data-theme="dark"]) .theme-toggle .i-moon { opacity: 1; transform: none; }
}

@media (max-width: 479px) {
  .brand span { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 112px 0 72px;
  overflow: hidden;
}

/* The magnetic dot map (drawn by site.js) */
.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

/* Soft light that follows the magnetic pull */
.field-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-hot), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  will-change: transform;
}

.field-glow.on {
  opacity: 1;
}

/* Keep the text readable on top of the dots */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 46% 38% at 50% 50%, var(--bg) 0%, transparent 100%);
  opacity: 0.55;
  pointer-events: none;
}

.hero-copy {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--sub);
  font-size: 0.85rem;
  font-weight: 550;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  from { transform: scale(0.5); opacity: 0.9; }
  to { transform: scale(1.6); opacity: 0; }
}

.hero h1 {
  max-width: 920px;
  margin-top: 26px;
  font-size: clamp(2.75rem, 1.2rem + 6.4vw, 6rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

/* ---------- Waitlist form ---------- */
.waitlist {
  width: 100%;
  max-width: 460px;
  margin-top: 40px;
}

.waitlist-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.waitlist-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.waitlist-field input {
  flex: 1 1 200px;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  font-size: 1rem;
  outline: none;
}

.waitlist-field input::placeholder {
  color: var(--hint);
}

.btn {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.btn .i {
  width: 18px;
  height: 18px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover .i {
  transform: translateX(3px);
}

.btn-primary {
  color: var(--ink-on-accent);
  background: linear-gradient(135deg, #EBC593 0%, #D4A373 50%, #C98A6B 100%);
  box-shadow: 0 10px 30px -10px rgba(212, 163, 115, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px -10px rgba(212, 163, 115, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

@media (min-width: 480px) {
  .waitlist-field { flex-wrap: nowrap; }
  .btn { flex: none; }
}

.waitlist-note {
  margin-top: 12px;
  color: var(--hint);
  font-size: 0.85rem;
}

.waitlist-note a {
  color: var(--sub);
}

.waitlist-status {
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 550;
}

.waitlist-status:empty {
  display: none;
}

.waitlist-status.is-error {
  color: #F87171;
}

.waitlist.is-sending .btn {
  opacity: 0.7;
  pointer-events: none;
}

.waitlist.is-done .waitlist-field,
.waitlist.is-done .waitlist-note {
  display: none;
}

.waitlist.is-done .waitlist-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--accent);
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--text);
  text-align: left;
}

.waitlist.is-done .waitlist-status::before {
  content: "";
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5' fill='none' stroke='%231A120B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
}

.hp {
  display: none;
}

/* ---------- Teaser strip ---------- */
.teaser {
  padding: 8px 0 72px;
}

.teaser-grid {
  display: grid;
  border-top: 1px solid var(--border);
}

@media (min-width: 760px) {
  .teaser-grid { grid-template-columns: repeat(3, 1fr); }
}

.teaser-item {
  padding: 28px 4px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 760px) {
  .teaser-item {
    padding: 32px 28px 8px;
    border-bottom: 0;
  }
  .teaser-item + .teaser-item { border-left: 1px solid var(--border); }
  .teaser-item:first-child { padding-left: 0; }
}

.teaser-num {
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

.teaser-item h2 {
  margin-top: 10px;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.teaser-item p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--sub);
}

.secret p {
  color: var(--accent-text);
  font-weight: 600;
}

.secret p .i {
  width: 16px;
  height: 16px;
}

/* Redacted title with a slow shimmer */
.bar {
  position: relative;
  display: inline-block;
  width: 9.5ch;
  height: 0.85em;
  vertical-align: -0.08em;
  border-radius: 5px;
  background: var(--bar);
  overflow: hidden;
}

.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(212, 163, 115, 0.7) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 50% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---------- Footer ---------- */
.footer {
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  color: var(--hint);
  font-size: 0.85rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.footer-links a {
  color: var(--sub);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-note {
  margin-top: 10px;
  font-size: 0.78rem;
}

/* ---------- Motion ---------- */
.rise {
  animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--d, 0) * 100ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-ready .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .rise,
  .pulse::after,
  .bar::after {
    animation: none;
  }
}
