/* ==========================================================================
   SHOCK Impulse – shocksensor.no
   ========================================================================== */

:root {
  --bg: #232220;
  --bg-raised: #2E2C29;
  --text: #F4F2EE;
  --text-muted: #CFCAC2;
  --text-subtle: #A9A49C;
  --line: #45423E;
  --accent: #E8894F;
  --signal: #E2533B;

  --font-head: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
  --header-h: 64px;
  --radius: 6px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--text);
  margin: 0;
  line-height: 1;
  letter-spacing: -0.03em;
}

p { margin: 0; }

a { color: var(--accent); }

[tabindex="-1"]:focus { outline: none; }

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

[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 980px; }

.section { padding-block: clamp(96px, 14vw, 180px); }

.visually-hidden {
  position: absolute !important;
  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: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-subtle);
  line-height: 1.4;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 1rem/1 var(--font-body);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s;
}
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: #F09A64; }
.btn--primary:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

.btn-replay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--text-subtle);
  font: 500 0.875rem/1 var(--font-body);
  cursor: pointer;
  transition: color .2s;
}
.btn-replay svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-replay:hover { color: var(--text); }
.btn-replay[hidden] { display: none; }

/* Header ----------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(35, 34, 32, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: rgba(69, 66, 62, 0.7);
}

.nav {
  height: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font: 900 1.25rem/1 var(--font-head);
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav__menu {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color .2s;
}
.nav__menu a:hover { color: var(--text); }

.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav__toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav__toggle path { transition: transform .25s; transform-origin: 12px 12px; }
.nav__toggle[aria-expanded="true"] .l1 { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .l2 { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 767px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: rgba(35, 34, 32, 0.96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a {
    display: block;
    padding: 14px 0;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--line);
  }
  .nav__menu li:last-child a { border-bottom: 0; }
}

/* 1. Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero__scene {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero__canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero__fallback {
  position: absolute;
  inset: 0;
  display: none;
}
.hero__fallback-grid {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 60%;
}
.hero__fallback-img {
  position: absolute;
  width: min(36vw, 440px);
  left: 64%;
  top: 52%;
  transform: translate(-50%, -50%);
}
html:not(.js) .hero__fallback,
.hero.no-webgl .hero__fallback { display: block; }
html:not(.js) .hero__canvas,
.hero.no-webgl .hero__canvas { display: none; }

.hero__pulse {
  position: absolute;
  z-index: 0;
  width: clamp(200px, 24vw, 360px);
  overflow: visible;
  height: auto;
  left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
}
.hero__pulse-path {
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero__pulse-dot { fill: var(--signal); }
.hero.no-webgl .hero__pulse,
html:not(.js) .hero__pulse { display: none; }

.hero__content {
  position: relative;
  padding-top: calc(var(--header-h) + 32px);
  padding-bottom: 64px;
}
.hero__content > * { max-width: 560px; }

.hero__title-row {
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2vw, 24px);
  margin-top: 18px;
}
.hero__title {
  font-size: clamp(3.25rem, 14.5vw, 10.5rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.82;
  margin-left: -0.04em;
}
.hero__model {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 0.3em;
  border-left: 1px solid var(--line);
  padding-left: clamp(14px, 2vw, 24px);
}
.hero__model-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--text-subtle);
}
.hero__model-name {
  font: 800 clamp(1.4rem, 2.6vw, 2.1rem)/1 var(--font-head);
  letter-spacing: -0.02em;
  color: var(--accent);
}
.hero__subtitle {
  margin-top: clamp(24px, 3vw, 36px);
  font: 700 clamp(1.5rem, 2.8vw, 2.25rem)/1.15 var(--font-head);
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero__line {
  margin-top: 14px;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: var(--text-muted);
}
.hero__actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

@media (max-width: 899px) {
  .hero { align-items: flex-start; }
  .hero__content { padding-top: calc(var(--header-h) + 28px); }
  .hero__fallback-img { left: 50%; top: 76%; width: min(60vw, 320px); }
}

/* Sticky hero: scenen og EKG-kurven blir stående mens man scroller videre */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-wrap {
    position: relative;
    height: 185vh;
    height: 185svh;
  }
  html.js .hero-wrap .hero {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
  }
}

/* 2. Problemet ----------------------------------------------------------- */

.problem__title {
  margin-top: 20px;
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}
.problem__text {
  margin-top: 28px;
  font: 700 clamp(1.6rem, 3.6vw, 3rem)/1.2 var(--font-head);
  letter-spacing: -0.025em;
  color: var(--text);
}
.problem__text .w { display: inline-block; will-change: transform, opacity; }

/* 3. Slik fungerer det --------------------------------------------------- */

.how {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.how__pin {
  padding-block: clamp(80px, 10vw, 140px);
}
.how__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.how__progress {
  display: none;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  gap: 10px;
  align-items: center;
  font: 600 0.8125rem/1 var(--font-body);
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}
.how__progress li {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color .3s;
}
.how__progress li + li::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line);
}
.how__progress li.is-active { color: var(--accent); }

.how__steps {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 48px;
}
.how__num {
  display: block;
  font: 800 1rem/1 var(--font-head);
  letter-spacing: 0.04em;
  color: var(--accent);
}
.how__step-title {
  margin-top: 14px;
  font-size: clamp(2.6rem, 5.5vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}
.how__step p {
  margin-top: 16px;
  max-width: 30ch;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

.how__visual {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
}
.how__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.v-bt-ring { opacity: 0; }

/* Pinned mode (satt av JS) */
.how.is-pinned .how__pin {
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--header-h) + 8px) 24px;
}
.how.is-pinned .how__progress { display: flex; }
.how.is-pinned .how__steps {
  display: grid;
  grid-template-areas: "stack";
  gap: 0;
}
.how.is-pinned .how__step { grid-area: stack; }
.how.is-pinned.step-2 .v-bt-ring { animation: bt-ping 1.6s ease-out infinite; }

@keyframes bt-ping {
  0%   { opacity: .9; transform: scale(.6); }
  100% { opacity: 0;  transform: scale(1.5); }
}
.v-bt-ring { transform-box: fill-box; transform-origin: center; }

@media (max-width: 899px) {
  .how__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .how.is-pinned .how__inner {
    align-content: center;
    height: 100%;
  }
  .how.is-pinned .how__steps { margin-top: 20px; }
  .how.is-pinned .how__step-title { font-size: clamp(2.2rem, 10vw, 3rem); margin-top: 8px; }
  .how.is-pinned .how__step p { margin-top: 10px; font-size: 1rem; }
  .how.is-pinned .how__visual {
    max-height: 42vh;
    max-height: 42svh;
    width: auto;
    margin-inline: auto;
  }
  .how.is-pinned .how__progress { margin-top: 16px; }
}
@media (max-width: 599px) {
  .v-crate-detail, .v-ticks, .v-graph { display: none; }
}

/* 4. Dette får du -------------------------------------------------------- */

.cards {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 2.5vw, 32px);
  display: flex;
  flex-direction: column;
}
.card__icon {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card__title {
  margin-top: 32px;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.card p { margin-top: 12px; font-size: 1rem; }

@media (max-width: 1023px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px)  { .cards { grid-template-columns: 1fr; } .card__title { margin-top: 24px; } }

/* 5. Spesifikasjoner ----------------------------------------------------- */

.specs { border-top: 1px solid var(--line); }
.specs__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.specs__img {
  margin-top: 40px;
  width: min(100%, 420px);
}
.specs__table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.specs__table tr + tr { border-top: 1px solid var(--line); }
.specs__table th,
.specs__table td {
  padding: 18px clamp(16px, 2.4vw, 28px);
  text-align: left;
  vertical-align: baseline;
}
.specs__table th {
  width: 42%;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-subtle);
}
.specs__table td {
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 899px) {
  .specs__inner { grid-template-columns: 1fr; }
  .specs__img { width: min(70%, 300px); margin-top: 24px; }
}
@media (max-width: 479px) {
  .specs__table, .specs__table tbody, .specs__table tr, .specs__table th, .specs__table td { display: block; width: auto; }
  .specs__table th { padding-bottom: 4px; }
  .specs__table td { padding-top: 0; }
}

/* 6. CTA-bånd ------------------------------------------------------------ */

.cta-band {
  background: var(--bg-raised);
  border-block: 1px solid var(--line);
  padding-block: clamp(72px, 10vw, 128px);
}
.cta-band__inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 32px 64px;
  align-items: end;
}
.cta-band__title {
  font-size: clamp(2.75rem, 7vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.nowrap { white-space: nowrap; }
.cta-band__side p { margin-bottom: 28px; max-width: 40ch; }
@media (max-width: 899px) { .cta-band__inner { grid-template-columns: 1fr; } }

/* 7. Kontakt ------------------------------------------------------------- */

.contact__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}
.contact__lead { margin-top: 16px; font-size: 1.125rem; }
.form { margin-top: 40px; }
.form__hp {
  position: absolute;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}
.form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 8px;
}
.field .req { color: var(--accent); }
.field input,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: 400 1rem/1.5 var(--font-body);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:hover,
.field textarea:hover { border-color: #5A5651; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 137, 79, 0.25);
}
.field [aria-invalid="true"] { border-color: var(--signal); }
.field__error {
  min-height: 0;
  margin-top: 6px;
  font-size: 0.875rem;
  color: #F08A76;
}
.field__error:empty { display: none; }

.form__footer {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.form__status { font-weight: 500; }
.form__status.is-success { color: var(--text); }
.form__status.is-error { color: #F08A76; }

@media (max-width: 599px) {
  .form__grid { grid-template-columns: 1fr; }
  .form__footer .btn { width: 100%; }
}

/* 8. Footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 56px;
  font-size: 0.9375rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px 48px;
}
.site-footer__logo { width: 180px; }
.site-footer__text {
  display: grid;
  gap: 4px;
  text-align: right;
}
.site-footer__text a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.site-footer__copy { color: var(--text-subtle); }
@media (max-width: 599px) { .site-footer__text { text-align: left; } }

/* Reveal (kun med JS) ----------------------------------------------------- */

html.js [data-reveal],
html.js [data-card],
html.js [data-row] { opacity: 0; }
html.js .problem__text[data-split] { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal],
  html.js [data-card],
  html.js [data-row] { opacity: 1; }
  html.js .problem__text[data-split] { visibility: visible; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Fallback hvis GSAP ikke lastet */
html.no-gsap [data-reveal],
html.no-gsap [data-card],
html.no-gsap [data-row] { opacity: 1; }
html.no-gsap .problem__text[data-split] { visibility: visible; }

/* Uten WebGL: ingen sticky-strekning */
html.js .hero-wrap:has(.hero.no-webgl) { height: auto; }
html.js .hero-wrap .hero.no-webgl { position: relative; }
