/* Launch-sida. Färger och typsnitt styrs av temat i config.php. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

.theme-light {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #6b6b6b;
  --error: #b42318;
}

.theme-dark {
  --bg: #000000;
  --ink: #ffffff;
  --muted: #9a9a9a;
  --error: #ff8a7a;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

/* ---------- Ramverk ---------- */

.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(16px, 3vh, 36px) clamp(16px, 4vw, 56px);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wordmark {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 1;
  letter-spacing: 0.01em;
}

.social {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  font-size: 0.9375rem;
}

.social a {
  text-decoration: none;
}

.social a:hover {
  text-decoration: underline;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(12px, 3vh, 48px) 0;
}

/* ---------- 3D-logga ---------- */

.hero-logo {
  position: relative;
  width: 100%;
  height: clamp(240px, 38vh, 440px);
  margin-bottom: clamp(16px, 3vh, 36px);
}

.hero-logo img,
.hero-logo canvas {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 0.6s ease;
}

.hero-logo img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.hero-logo canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  touch-action: pan-y;
}

.hero-logo canvas:active {
  cursor: grabbing;
}

.hero-logo::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: min(46%, 300px);
  height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.theme-dark .hero-logo::after {
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
}

.hero-logo.is-3d::after {
  opacity: 1;
}

.hero-logo.is-3d canvas {
  opacity: 1;
}

.hero-logo.is-3d img {
  opacity: 0;
}

/* ---------- Rubrik och datum ---------- */

.headline {
  margin: 0;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.tagline,
.when {
  margin-top: 6px;
  font-size: 1.0625rem;
  color: var(--muted);
}

/* ---------- Nedräkning ---------- */

.countdown {
  margin-top: clamp(14px, 2.5vh, 28px);
  max-width: 100%;
}

.digits {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  white-space: nowrap;
  font-size: clamp(3.25rem, 15vw, 8rem);
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.num,
.sep {
  font-weight: 820;
  font-stretch: 62%;
  font-variant-numeric: tabular-nums;
  line-height: 0.8;
  letter-spacing: -0.015em;
}

.sep {
  opacity: 0.28;
  padding: 0 0.06em;
}

.label {
  margin-top: clamp(8px, 1.2vh, 14px);
  font-size: clamp(0.8125rem, 0.75rem + 0.25vw, 0.9375rem);
  line-height: 1;
  color: var(--muted);
}

/* ---------- Formulär ---------- */

.notify {
  width: 100%;
  max-width: 32rem;
  margin-top: clamp(28px, 4.5vh, 56px);
}

.form-title {
  display: block;
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 600;
}

.field {
  display: flex;
  border: 1.5px solid var(--ink);
  text-align: left;
}

.field:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.field input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input:focus {
  outline: none;
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 100px var(--bg) inset;
}

.field button,
.button {
  flex: none;
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.field button:hover,
.button:hover {
  opacity: 0.84;
}

.field button:disabled {
  cursor: progress;
  opacity: 0.6;
}

.form.is-done .field,
.form.is-done .form-title {
  display: none;
}

.msg {
  min-height: 1.5em;
  margin-top: 10px;
  font-size: 0.9375rem;
}

.form.is-done .msg {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.125rem;
  font-weight: 600;
}

.msg.is-error {
  color: var(--error);
}

.note {
  font-size: 0.875rem;
  color: var(--muted);
}

.privacy {
  margin-top: 2px;
}

.privacy summary {
  display: inline;
  cursor: pointer;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

.privacy p {
  margin: 8px auto 0;
  max-width: 30rem;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Efter lansering ---------- */

.is-live .headline {
  word-spacing: 0.06em;
  font-size: clamp(3.5rem, 12vw, 10rem);
  font-weight: 820;
  font-stretch: 62%;
  line-height: 0.85;
  letter-spacing: -0.015em;
}

.is-live .tagline {
  margin-top: 16px;
}

.shop {
  margin-top: clamp(28px, 4vw, 48px);
}

.button {
  display: inline-block;
  padding: 18px 32px;
  text-decoration: none;
}

/* ---------- Sidfot ---------- */

.bottom {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- Mobil ---------- */

@media (max-width: 640px) {
  .when {
    font-size: 1rem;
  }

  .field {
    flex-direction: column;
    border: 0;
    gap: 10px;
  }

  .field:focus-within {
    outline: none;
  }

  .field input {
    flex: none;
    height: 54px;
    border: 1.5px solid var(--ink);
  }

  .field input:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }

  .field button {
    height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo img,
  .hero-logo canvas {
    transition: none;
  }
}
