/* Norwegian 4x4 site styles.
   One stylesheet for the landing page and the guide.
   Dark-first, matching the app (src/constants/theme.ts). */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark light;

  --grad-a: #16294F;
  --grad-b: #0F1D38;
  --grad-c: #070C18;
  --flat:   #070C18;

  --ink:    #F8FAFC;
  --ink-2:  #8FA3BE;
  --ink-3:  #6E819C;

  --glass:      rgba(190, 215, 255, 0.05);
  --glass-hi:   rgba(190, 215, 255, 0.08);
  --line:       rgba(190, 215, 255, 0.12);
  --line-hi:    rgba(190, 215, 255, 0.22);

  --red-a:  #F05252;
  --red-b:  #DC2626;

  --warmup:   #F59E0B;
  --interval: #EF4444;
  --recovery: #3B82F6;
  --cooldown: #8B5CF6;
  --below:    #3B82F6;
  --inzone:   #22C55E;
  --above:    #FBBF24;

  --r-card: 16px;
  --r-stat: 18px;
  --r-zone: 20px;

  --wordmark: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --shell: 1080px;
  --gut: clamp(20px, 5vw, 40px);
}

@media (prefers-color-scheme: light) {
  :root {
    --grad-a: #FFFFFF;
    --grad-b: #F2F5FA;
    --grad-c: #E7ECF5;
    --flat:   #FFFFFF;

    --ink:   #0B1526;
    --ink-2: #4A5A73;
    --ink-3: #5C6C85;

    --glass:    rgba(15, 29, 56, 0.035);
    --glass-hi: rgba(15, 29, 56, 0.06);
    --line:     rgba(15, 29, 56, 0.14);
    --line-hi:  rgba(15, 29, 56, 0.26);

    --interval: #DC2626;
    --above:    #B45309;
    --inzone:   #15803D;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--flat);
  background-image: linear-gradient(180deg, var(--grad-a) 0%, var(--grad-b) 46%, var(--grad-c) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration-color: var(--line-hi); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

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

h1, h2, h3 {
  font-family: var(--wordmark);
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(40px, 7.2vw, 68px); }
h2 { font-size: clamp(28px, 4.4vw, 40px); }
h3 { font-size: clamp(19px, 2.4vw, 23px); letter-spacing: -0.01em; line-height: 1.2; }

p { margin: 0; }

.num, time, td, th { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}

section { padding-block: clamp(56px, 9vw, 104px); }
section + section { border-top: 1px solid var(--line); }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
}

.lede { color: var(--ink-2); font-size: clamp(17px, 2vw, 20px); max-width: 60ch; }

.stack   { display: flex; flex-direction: column; gap: 16px; }
.stack-l { display: flex; flex-direction: column; gap: 28px; }

/* ---------- chrome ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--flat) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.masthead .shell {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-block: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-right: auto;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span {
  font-family: var(--wordmark);
  font-weight: 900;
  font-style: italic;
  font-size: 19px;
  letter-spacing: -0.02em;
}

/* ---------- buttons ---------- */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 34px;
  border-radius: 999px;
  border: 0;
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 600;
  color: #FFFFFF;
  text-decoration: none;
  background-image: linear-gradient(180deg, var(--red-a) 0%, var(--red-b) 100%);
  box-shadow: 0 10px 30px -12px rgba(220, 38, 38, 0.75);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -14px rgba(220, 38, 38, 0.85); filter: saturate(112%); }
.cta:active { transform: translateY(0); }
.cta svg { flex: none; }

.cta-sm { min-height: 48px; padding: 0 22px; font-size: 16px; }

.cta-ghost {
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid var(--line-hi);
  background: var(--glass);
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease;
}
.cta-ghost:hover { background: var(--glass-hi); border-color: var(--ink-3); }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

.fineprint { color: var(--ink-2); font-size: 15px; }

/* ---------- glass surfaces ---------- */
.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 3vw, 28px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-2); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.stat {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-stat);
  padding: 20px;
}
.stat dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stat dd {
  margin: 6px 0 0;
  font-family: var(--wordmark);
  font-weight: 700;
  font-style: italic;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- hero ---------- */
.hero { padding-top: clamp(44px, 7vw, 76px); }
.hero-grid {
  display: grid;
  gap: clamp(32px, 6vw, 64px);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.hero h1 span { display: block; }
.hero-shot { justify-self: center; max-width: 340px; width: 100%; }
.hero-shot img {
  width: 100%;
  border-radius: 42px;
  filter: drop-shadow(0 40px 60px rgba(2, 6, 16, 0.55));
}

.pill-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pill-tags li {
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-shot { max-width: 300px; }
}

/* ---------- interval bar ---------- */
.bar {
  display: grid;
  grid-template-columns: 5fr 4fr 3fr 4fr 3fr 4fr 3fr 4fr 5fr;
  gap: 4px;
  height: 46px;
}
.bar i { border-radius: 8px; display: block; }
.bar .w { background: var(--warmup); }
.bar .i { background: var(--interval); }
.bar .r { background: var(--recovery); }
.bar .c { background: var(--cooldown); }

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 14px;
  color: var(--ink-2);
}
.bar-legend li { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 999px; flex: none; }

/* ---------- steps ---------- */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px 20px;
}
.steps li::before {
  content: counter(s);
  font-family: var(--wordmark);
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  line-height: 1.3;
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--ink-2); }

/* ---------- feature rows ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.feature:nth-of-type(even) .feature-media { order: -1; }
.feature + .feature { margin-top: clamp(48px, 7vw, 88px); }
.feature-copy { display: flex; flex-direction: column; gap: 14px; }
.feature-copy p { color: var(--ink-2); }

.frame {
  justify-self: center;
  max-width: 300px;
}
.frame img {
  border-radius: 38px;
  filter: drop-shadow(0 30px 50px rgba(2, 6, 16, 0.5));
}

.watch-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 360px;
  justify-self: center;
}
.watch-row img {
  border-radius: 22px;
  filter: drop-shadow(0 18px 30px rgba(2, 6, 16, 0.45));
}

@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature:nth-of-type(even) .feature-media { order: 0; }
}

/* ---------- zone strip ---------- */
.zones { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.zone {
  border-radius: var(--r-zone);
  border: 1px solid var(--line);
  background: var(--glass);
  padding: 18px 20px;
  border-left-width: 1px;
}
.zone b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.zone span { color: var(--ink-2); font-size: 15px; }
.zone.below b { color: var(--below); }
.zone.good  b { color: var(--inzone); }
.zone.above b { color: var(--above); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--glass); }
table { width: 100%; border-collapse: collapse; min-width: 460px; }
caption { text-align: left; padding: 16px 20px 0; color: var(--ink-3); font-size: 14px; }
th, td { padding: 14px 20px; text-align: left; font-size: 16px; }
thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
tbody tr + tr td { border-top: 1px solid var(--line); }
tbody th { font-weight: 600; }
td { color: var(--ink-2); }
.phase { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }

/* ---------- faq ---------- */
.faq { display: grid; gap: 12px; }
.faq details {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 4px 20px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 32px 16px 0;
  position: relative;
  font-family: var(--wordmark);
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 160ms ease;
}
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq details p { color: var(--ink-2); padding-bottom: 18px; }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding-block: 40px 56px;
  color: var(--ink-3);
  font-size: 15px;
}
.site-foot .shell { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.site-foot a { color: var(--ink-2); }
.site-foot .spacer { margin-left: auto; }

/* ---------- article (guide) ---------- */
.article { padding-block: clamp(40px, 6vw, 72px); }
.article-head { max-width: 44rem; display: flex; flex-direction: column; gap: 18px; }
.article-body { max-width: 44rem; }
.article-body > * + * { margin-top: 22px; }
.article-body h2 { margin-top: clamp(44px, 6vw, 64px); }
.article-body h3 { margin-top: 32px; }
.article-body p { color: var(--ink-2); font-size: 18px; }
.article-body ul { color: var(--ink-2); padding-left: 22px; }
.article-body li + li { margin-top: 8px; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article .steps p, .article .steps h3 { max-width: none; }

.callout {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--glass);
  padding: 22px 24px;
}
.callout p { color: var(--ink-2); }

.crumb { font-size: 14px; color: var(--ink-3); }
.crumb a { color: var(--ink-2); }

.byline { color: var(--ink-3); font-size: 15px; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    @keyframes reveal {
      from { opacity: 0; transform: translateY(20px); }
      to   { opacity: 1; transform: none; }
    }
  }
}
