/* ============================================================
   Snö — Scandinavian light. Paper, ice, ink; the app's own calm.
   One viewport: nav, hero, footer. All the dials live in :root.
   ============================================================ */

@font-face {
  font-family: "Switzer";
  src: url("./assets/fonts/Switzer-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("./assets/fonts/Switzer-VariableItalic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* palette */
  --paper: #fafcfe;      /* page */
  --ice: #edf3f9;        /* tinted panels */
  --ink: #0e1726;        /* headings */
  --body: #33415c;       /* body text */
  --muted: #5c6b84;      /* secondary text */
  --line: #dfe7f0;       /* hairlines */
  --action: #0166d8;     /* buttons (AA on white) */
  --action-ink: #014fa9; /* hover */
  --brand-blue: #0088ff; /* the app's accent, used sparingly */
  --focus: #0166d8;

  /* type */
  --font: "Switzer", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* rhythm */
  --max: 1200px;
  --pad: clamp(20px, 4vw, 48px);

  /* device */
  --bezel: #11151c;
  --device-r: clamp(38px, 3.4vw, 50px);

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; display: flex; }

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

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

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 999px; text-decoration: none; font-weight: 500;
  transition: top 0.25s var(--ease);
}
.skip:focus-visible { top: 12px; }

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

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

.nav { padding: 20px var(--pad); }
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em;
}

.langs { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; }
.langs button {
  font: inherit; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 6px 11px; border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.langs button:hover { color: var(--ink); }
.langs button.is-active { background: var(--ink); color: #fff; }

/* ---------- hero ---------- */

.hero {
  width: 100%;
  max-width: var(--max);
  margin: auto;
  padding: clamp(24px, 4vh, 56px) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  color: var(--ink);
  font-size: clamp(2.6rem, 5.6vw, 4.3rem);
  line-height: 1.05;
  letter-spacing: -0.032em;
  font-weight: 640;
  max-width: 12ch;
  padding-bottom: 4px; /* italic descender room */
}
.hero h1 em { font-style: italic; font-weight: 560; }

.hero .sub {
  margin-top: 22px;
  font-size: 1.14rem;
  color: var(--muted);
  max-width: 46ch;
}

/* entrance */
[data-hero] { animation: hero-in 0.9s var(--ease) both; }
[data-hero="2"] { animation-delay: 0.08s; }
[data-hero="3"] { animation-delay: 0.16s; }
[data-hero="4"] { animation-delay: 0.22s; }
[data-hero="5"] { animation-delay: 0.3s; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- waitlist form ---------- */

.waitlist { margin-top: 34px; }
.waitlist .row { display: flex; gap: 10px; max-width: 460px; }
.waitlist input[name="email"] {
  flex: 1; min-width: 0;
  /* same type as the button so the row reads as one piece */
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 20px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.waitlist input[name="email"]::placeholder { color: #93a2b8; font-weight: 500; }
.waitlist input[name="email"]:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 16%, transparent);
}
.waitlist .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  font: inherit; font-weight: 600; font-size: 0.98rem;
  display: inline-flex; align-items: center; gap: 9px;
  color: #fff; background: var(--action);
  border: 0; border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--action) 55%, transparent);
}
.btn .icon { width: 15px; height: 15px; transition: transform 0.25s var(--ease); }
.btn:hover { background: var(--action-ink); transform: translateY(-1px); }
.btn:hover .icon { transform: translateX(3px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.7; cursor: default; transform: none; }

.form-note { margin-top: 12px; font-size: 0.84rem; color: var(--muted); }
.form-msg { margin-top: 10px; font-size: 0.95rem; font-weight: 550; min-height: 1.4em; }
form[data-state="done"] .form-msg { color: #1d8f43; }
form[data-state="error"] .form-msg { color: #c23b3b; }
form[data-state="done"] .row, form[data-state="done"] .form-note { opacity: 0.45; }

/* ---------- hero devices ---------- */

.hero-devices {
  position: relative;
  height: clamp(430px, 62vh, 640px);
}

.device {
  background: var(--bezel);
  border-radius: var(--device-r);
  padding: 9px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.18),
    0 2px 5px rgba(14, 23, 38, 0.16),
    0 36px 80px -24px rgba(14, 23, 38, 0.42);
}
.device img {
  border-radius: calc(var(--device-r) - 9px);
  width: 100%; height: auto;
}

.hero-devices .device {
  position: absolute;
  width: clamp(220px, 21vw, 290px);
}
.hero-devices .d-home {
  left: 4%; top: 4%;
  transform: rotate(-3deg);
  z-index: 2;
}
.hero-devices .d-inbox {
  right: 0; top: 0;
  transform: rotate(4deg) scale(0.94);
  filter: saturate(0.97);
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-devices .d-home { animation: hero-in 0.9s var(--ease) 0.22s both, float 7s ease-in-out 1.2s infinite; }
  .hero-devices .d-inbox { animation: hero-in 0.9s var(--ease) 0.3s both, float 8s ease-in-out 1.6s infinite reverse; }
  @keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -9px; }
  }
}

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

.footer {
  border-top: 1px solid var(--line);
  padding: 26px var(--pad) 34px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer .brand { font-size: 1rem; }
.footer .legal { color: #8b99ad; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

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

/* ---------- mobile ---------- */

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }
  .hero h1 { max-width: none; }
  .hero-devices {
    height: auto;
    display: flex;
    justify-content: center;
    gap: 4vw;
    margin-top: 16px;
  }
  .hero-devices .device { position: static; width: min(44vw, 250px); }
}

@media (max-width: 560px) {
  .waitlist .row { flex-direction: column; }
  .btn { justify-content: center; }
  .hero-devices .device { width: min(66vw, 260px); }
  .hero-devices .d-inbox { display: none; }
  .footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}
