/* Hitglance landing — "Answers, then silence."
   One dark charcoal-ink surface, a single blue reserved for data and links,
   one white paper receipt for the closing "free" section. Zero warm hues anywhere.
   Single family: Schibsted Grotesk variable (wght 400–900), self-hosted. */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-var.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: oklch(0.17 0.012 258);
  --lift: oklch(0.21 0.014 258);
  --line: oklch(0.30 0.015 258);

  --ink: oklch(0.93 0.008 258);
  --muted: oklch(0.72 0.015 258);

  --blue: oklch(0.72 0.13 258);
  --blue-bright: oklch(0.80 0.11 258);
  --blue-wash: color-mix(in oklch, var(--blue) 14%, transparent);

  --slate: oklch(0.13 0.01 258);
  --slate-attr: oklch(0.78 0.10 258);

  --paper: oklch(1 0 0);
  --paper-ink: oklch(0.22 0.02 258);
  --paper-muted: oklch(0.44 0.02 258);
  --paper-blue: oklch(0.55 0.165 258);

  --good: oklch(0.75 0.11 150);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: clamp(20px, 5vw, 48px);
  --measure: 62ch;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

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

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  transition: top 150ms var(--ease-out);
}
.skip:focus-visible { top: 16px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-weight: 640;
  font-size: 0.97rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); }

.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: oklch(0.99 0.005 258); }

.btn.big { min-height: 52px; padding: 0 28px; font-size: 1.05rem; }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: color-mix(in oklch, var(--ink) 8%, transparent); }

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

.top {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  padding: 18px var(--gutter);
  --mark-fill: var(--blue);
  --mark-line: var(--bg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.13rem;
  letter-spacing: -0.01em;
}
.brand-mark { flex: none; }

.top nav {
  display: flex;
  gap: clamp(10px, 2vw, 26px);
  margin-inline: auto;
}
.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 520;
}
.top nav a:hover { color: var(--ink); }

.top-auth { display: flex; gap: 10px; margin-left: auto; }
.top nav + .top-auth { margin-left: 0; }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(40px, 8vh, 88px) var(--gutter) clamp(72px, 10vh, 128px);
  overflow: clip;
}
.hero > * { max-width: 1120px; margin-left: auto; margin-right: auto; }

.hero h1 {
  font-size: clamp(2.2rem, 7.6vw, 5.4rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.line-mask { display: block; overflow: clip; padding-block: 0.045em; }
.line-slide { display: block; }

.hero-sub {
  margin-top: clamp(20px, 3vw, 30px);
  max-width: 47ch;
  font-size: clamp(1.06rem, 1.6vw, 1.22rem);
  line-height: 1.6;
  color: var(--muted);
}

.hero-cta {
  margin-top: clamp(24px, 3.5vw, 38px);
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.see-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid color-mix(in oklch, var(--blue) 45%, transparent);
}
.see-more svg { transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .see-more:hover svg { transform: translateY(3px); }
  .see-more:hover { border-bottom-color: var(--blue); color: var(--blue-bright); }
}

/* Hero proof: the night glance — one quiet panel with the answer */

.hero-proof {
  position: relative;
  margin: clamp(40px, 7vh, 72px) auto 0;
}

.glance {
  background: var(--lift);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(20px, 3vw, 32px) clamp(20px, 3vw, 32px) 0;
  overflow: clip;
}

.glance-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px clamp(28px, 5vw, 64px);
  align-items: baseline;
}
.gstat { font-size: 0.95rem; color: var(--muted); }
.gstat .num {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 760;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-right: 8px;
}
.gstat .delta { color: var(--good); font-weight: 620; font-size: 0.9rem; margin-right: 8px; }

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 9px;
  animation: live-pulse 2.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.chart-svg { display: block; width: 100%; height: clamp(140px, 20vw, 210px); }
.glance .chart-svg { margin-top: clamp(18px, 3vw, 28px); }

.chart-area { fill: var(--blue-wash); }
.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.chart-line.now { stroke-dasharray: 0.02 0.018; }
.now-dot {
  fill: none;
  stroke: var(--blue);
  stroke-width: 11;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.sample-tag {
  position: absolute;
  right: clamp(20px, 3vw, 32px);
  top: clamp(20px, 3vw, 32px);
  font-size: 0.82rem;
  font-weight: 520;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--lift);
}

/* ---------- Sections ---------- */

main section {
  padding: clamp(84px, 12vw, 148px) var(--gutter);
}

.section-head { max-width: 1120px; margin: 0 auto; }
.section-head h2, #free h2 {
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: -0.022em;
}
.section-head p {
  margin-top: 18px;
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.1rem;
}

#product > *, #setup > *, #privacy > * { max-width: 1120px; margin-left: auto; margin-right: auto; }

#product { border-top: 1px solid var(--line); }

/* ---------- Product tabs ---------- */

.tabs-row { margin-top: clamp(32px, 5vw, 52px); }

.feature-tabs {
  position: relative;
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  background: var(--lift);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.feature-tabs [role="tab"] {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 180ms ease;
}
.feature-tabs [role="tab"][aria-selected="true"] { color: var(--bg); }

.tab-thumb {
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--blue);
  transition: transform 260ms var(--ease-out), width 260ms var(--ease-out);
}

html:not(.js) .js-only { display: none; }

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

.panel { max-width: 880px; }
.panel + .panel { margin-top: 72px; }
html.js .panel + .panel { margin-top: 0; }

.panel-title { font-size: 1.35rem; font-weight: 700; }
html.js .panel-title {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

html.js .panel { animation: panel-in 260ms var(--ease-out) both; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stat strip */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 26px 0 0;
  border-block: 1px solid var(--line);
}
.stat { padding: 18px 20px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat dt { font-size: 0.88rem; font-weight: 500; color: var(--muted); }
.stat dd { margin: 0; }
.stat-value {
  font-size: 1.75rem;
  font-weight: 720;
  letter-spacing: -0.01em;
  margin-top: 2px;
}
.stat-delta { font-size: 0.85rem; font-weight: 600; margin-top: 2px; }
.stat-delta.up { color: var(--good); }
.stat-delta.flat { color: var(--muted); }

.product-chart { margin-top: 30px; }

.panel-note {
  margin-top: 26px;
  max-width: var(--measure);
  color: var(--muted);
}

/* Bar lists (goals, funnels, revenue) */

.bar-list {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.bar-list li {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr minmax(78px, auto);
  align-items: center;
  gap: 16px;
}
.bar-label { font-weight: 540; font-size: 0.98rem; }
.bar {
  height: 12px;
  border-radius: 6px;
  background: color-mix(in oklch, var(--blue) 55%, var(--bg));
  width: var(--w, 50%);
  transform-origin: left center;
}
html.js .panel .bar { animation: bar-in 600ms var(--ease-out) both; }
html.js .panel li:nth-child(2) .bar { animation-delay: 60ms; }
html.js .panel li:nth-child(3) .bar { animation-delay: 120ms; }
html.js .panel li:nth-child(4) .bar { animation-delay: 180ms; }

@keyframes bar-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.bar-value {
  font-weight: 640;
  text-align: right;
  white-space: nowrap;
}

.revenue-line { margin-top: 26px; }
.revenue-value {
  font-size: 2.3rem;
  font-weight: 760;
  letter-spacing: -0.01em;
}
.revenue-label { color: var(--muted); font-weight: 500; }

/* ---------- Setup ---------- */

#setup { border-top: 1px solid var(--line); }

.steps {
  list-style: none;
  counter-reset: setup;
  margin: clamp(36px, 5vw, 56px) auto 0;
  padding: 0;
  display: grid;
  gap: clamp(36px, 5vw, 52px);
}
.steps > li {
  counter-increment: setup;
  display: grid;
  grid-template-columns: clamp(52px, 7vw, 84px) 1fr;
  column-gap: clamp(16px, 3vw, 34px);
}
.steps > li > * { grid-column: 2; }
.steps > li::before {
  grid-column: 1;
  grid-row: 1;
  content: counter(setup);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 800;
  color: var(--blue);
}
.steps h3 { font-size: 1.3rem; font-weight: 700; }
.steps p { margin-top: 10px; max-width: 56ch; color: var(--muted); }

.slate {
  background: var(--slate);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
  font-size: clamp(0.72rem, 1.6vw, 0.95rem);
  line-height: 1.5;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}
.slate .attr { color: var(--slate-attr); }

.setup-slate {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: 12px;
}
.setup-slate code { overflow-x: auto; padding-block: 4px; }

.inline-code {
  font-size: 0.9em;
  background: var(--lift);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  white-space: nowrap;
}

.copy-button {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 620;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.copy-button:hover { background: color-mix(in oklch, var(--ink) 9%, transparent); }
.copy-button:active { transform: scale(0.96); }

.copy-idle, .copy-done {
  grid-area: 1 / 1;
  transition: opacity 200ms ease, filter 200ms ease;
}
.copy-done { opacity: 0; filter: blur(4px); color: var(--blue-bright); }
.copy-button.copied .copy-idle { opacity: 0; filter: blur(4px); }
.copy-button.copied .copy-done { opacity: 1; filter: blur(0); }

/* ---------- Privacy ---------- */

#privacy { border-top: 1px solid var(--line); }

.ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(36px, 6vw, 96px);
  margin-top: clamp(40px, 6vw, 64px);
}
.ledger h3 {
  font-size: 1.02rem;
  font-weight: 620;
  color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.ledger ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ledger li {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 660;
  letter-spacing: -0.01em;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.counted li { color: var(--ink); }
.never li { color: var(--muted); }

.strike-wrap { position: relative; display: inline-block; }
.strike {
  position: absolute;
  left: -2%;
  right: -2%;
  top: 55%;
  height: 0.085em;
  border-radius: 99px;
  background: var(--blue);
  transform: scaleX(1);
  transform-origin: left center;
}
html.js .never .strike {
  transform: scaleX(0);
  transition: transform 560ms var(--ease-out);
}
html.js .never li:nth-child(2) .strike { transition-delay: 110ms; }
html.js .never li:nth-child(3) .strike { transition-delay: 220ms; }
html.js .never li:nth-child(4) .strike { transition-delay: 330ms; }
html.js .never.in .strike { transform: scaleX(1); }

/* ---------- Free: the paper receipt ---------- */

#free {
  background: var(--paper);
  color: var(--paper-ink);
  text-align: center;
}
#free h2 { letter-spacing: -0.022em; }

.price {
  margin-top: clamp(20px, 3vw, 30px);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 540;
  color: var(--paper-muted);
}
.price-value {
  display: block;
  font-size: clamp(4rem, 11vw, 6rem);
  line-height: 1;
  font-weight: 830;
  letter-spacing: -0.035em;
  color: var(--paper-blue);
  margin-bottom: 6px;
}
.price-terms {
  margin: 18px auto 0;
  max-width: 44ch;
  color: var(--paper-muted);
}
#free .btn { margin-top: clamp(28px, 4vw, 40px); }
#free .btn.primary { background: var(--paper-ink); color: var(--paper); }
#free .btn.primary:hover { background: oklch(0.32 0.02 258); }
#free :focus-visible { outline-color: var(--paper-blue); }

/* ---------- Footer ---------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 34px var(--gutter);
  --mark-fill: var(--blue);
  --mark-line: var(--bg);
}
.foot .brand { font-size: 1.02rem; }
.foot nav { display: flex; gap: 4px; }
.foot nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 520;
}
.foot nav a:hover { color: var(--ink); }

/* ---------- Hero entrance choreography (JS present only) ---------- */

html.js .line-slide { animation: line-up 680ms var(--ease-out) both; }
html.js .line-mask:nth-child(2) .line-slide { animation-delay: 110ms; }

@keyframes line-up {
  from { transform: translateY(112%); }
  to { transform: translateY(0); }
}

html.js .rise { animation: rise-in 560ms var(--ease-out) both 320ms; }
html.js .hero-cta.rise { animation-delay: 420ms; }
html.js .hero-proof { animation: rise-in 620ms var(--ease-out) both 540ms; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

html.js .hero .draw {
  stroke-dasharray: 1;
  animation: draw-line 900ms cubic-bezier(0.33, 1, 0.68, 1) both 900ms;
}
html.js .hero .draw-late {
  stroke-dasharray: 0.02 0.018;
  animation: draw-dashed 320ms ease-out both 1760ms;
}
html.js .hero .chart-area { animation: fade-in 700ms ease both 1200ms; }
html.js .now-dot { animation: fade-in 280ms ease both 2000ms; }

@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes draw-dashed {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Product chart draws when scrolled into view */

html.js .draw-scroll { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.js .in .draw-scroll, html.js .in.draw-scroll {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 900ms cubic-bezier(0.33, 1, 0.68, 1) 120ms;
}

/* ---------- Odometer ---------- */

.odometer { display: inline-block; }
html.js .odometer.ready {
  display: inline-flex;
  overflow: clip;
  height: 1.1em;
  line-height: 1.1;
  vertical-align: bottom;
}
.digit-col { display: block; transition: transform 950ms var(--ease-out); font-variant-numeric: tabular-nums; }
.odo-sep { font-variant-numeric: normal; }
.digit-col > span { display: block; height: 1.1em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .top nav { display: none; }
  .top-auth { margin-left: auto; }
}

@media (max-width: 700px) {
  .sample-tag {
    position: static;
    display: inline-block;
    width: fit-content;
    margin-top: 14px;
    background: transparent;
  }
}

@media (max-width: 640px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat { padding: 14px 16px; }

  .bar-list li { grid-template-columns: 1fr auto; }
  .bar-list .bar { grid-column: 1 / -1; grid-row: 2; }

  .steps > li { grid-template-columns: auto 1fr; }

  .feature-tabs {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
  }
  .feature-tabs [role="tab"] { flex: none; }

  .setup-slate { flex-direction: column; align-items: stretch; padding-right: 22px; }
  .copy-button { width: 100%; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .live-dot { animation: none; }
  html.js .never .strike { transform: scaleX(1); }
  html.js .draw-scroll { stroke-dashoffset: 0; }
}
