/* NordicGate — produktstudio
   Warm paper, ink and a single fjord-blue accent (from the original mountain-and-water
   mark), so the product icons carry the rest of the colour. */

:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6da;
  --card: #fbfaf6;
  --ink: #121826;
  --ink-2: #3a4150;
  --muted: #6a707b;
  --line: rgba(18, 24, 38, 0.12);
  --accent: #2b63c0;
  --accent-hover: #2253a6;
  --on-accent: #ffffff;
  --pos: #2f7d5b;
  --neg: #b23a24;
  --shadow: 0 1px 2px rgba(18, 24, 38, 0.06), 0 12px 32px -12px rgba(18, 24, 38, 0.18);

  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e131c;
    --paper-2: #141b27;
    --card: #151c28;
    --ink: #eef0f3;
    --ink-2: #c3c8d1;
    --muted: #8c94a2;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #6ea4f2;
    --accent-hover: #8cb8f6;
    --on-accent: #0a1428;
    --pos: #5cc497;
    --neg: #e2694e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { top: 12px; }

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

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.mark-mountain { fill: currentColor; }
.mark-water { fill: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav .nav-cta { color: var(--ink); border: 1px solid var(--line); }

@media (max-width: 640px) {
  .nav li:not(:last-child) { display: none; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; overflow-wrap: anywhere; }

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

.hero { padding-block: clamp(48px, 9vw, 112px) clamp(56px, 8vw, 96px); overflow: hidden; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.25rem); max-width: 14ch; }

.lede {
  margin-top: 22px;
  font-size: clamp(1.075rem, 1.6vw, 1.25rem);
  color: var(--ink-2);
  max-width: 34em;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin: 44px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { font-size: 0.8125rem; color: var(--muted); }
.hero-stats dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* The gate: an arched doorway the products stand inside */
.gate { position: relative; justify-self: center; width: min(100%, 400px); }

.gate-arch {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 100%;
  border-radius: 999px 999px 24px 24px;
  background:
    radial-gradient(120% 70% at 50% 100%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(180deg, var(--paper-2), var(--card));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 8% 12%;
}

/* The NordicGate mark, blown up as the landscape seen through the gate */
.gate-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--ink);
}
.gate-scene .mark-mountain { opacity: 0.1; }
.gate-scene .mark-water { opacity: 0.32; }

.gate-tiles {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
}
.tile img, .tile svg { width: 100%; max-width: 64px; height: auto; border-radius: 14px; }
.tile:nth-child(2) { translate: 0 -18px; }

.lab-bg { fill: var(--ink); }
.lab-line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.lab-line-dream { stroke: var(--paper); opacity: 0.35; stroke-dasharray: 2 7; }
.lab-line-real { stroke: var(--accent); }

.gate-ground {
  height: 10px;
  margin: 14px 12% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(18, 24, 38, 0.18), transparent);
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .gate { width: min(100%, 340px); }
}

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

.section { padding-block: clamp(64px, 9vw, 112px); border-top: 1px solid var(--line); }

.section-head { max-width: 40rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2, .section h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
.section-lede { margin-top: 16px; color: var(--ink-2); font-size: 1.125rem; }

/* ---------- Products ---------- */

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

.product {
  --brand: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(24px, 3.5vw, 36px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.product::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--brand);
}
.product-pinnad { --brand: #16a34a; }
.product-projektlogg { --brand: #2183da; }

.product-head { display: flex; align-items: center; gap: 14px; }
.product-head img { border-radius: 14px; flex: none; }
.product-head h3 { font-size: 1.6rem; }
.product-url { font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }

.status {
  margin-left: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pos);
  background: color-mix(in srgb, var(--pos) 12%, transparent);
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.product-lede { font-family: var(--serif); font-size: 1.3rem; line-height: 1.3; }
.product > p:not(.product-lede) { color: var(--ink-2); }

.features {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.features li {
  position: relative;
  padding-left: 22px;
  font-size: 0.975rem;
  color: var(--ink-2);
}
.features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
}

.product-link {
  margin-top: auto;
  padding-top: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-self: flex-start;
  gap: 6px;
}
.product-link span { transition: translate 0.15s ease; }
.product-link:hover span { translate: 4px 0; }
.product-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Lab ---------- */

.section-lab { background: var(--paper-2); }

.lab-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.lab-copy h2 { margin-bottom: 20px; }
.lab-copy p + p { margin-top: 14px; }
.lab-copy p { color: var(--ink-2); }
.lab-copy strong { color: var(--ink); }
.fine { font-size: 0.875rem; color: var(--muted) !important; }

.lab-figure {
  margin: 0;
  padding: clamp(22px, 3.5vw, 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.lab-figure figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.fig-title { font-weight: 600; }
.fig-sub { font-size: 0.875rem; color: var(--muted); }

.diverge { display: grid; gap: 22px; }
.diverge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label value" "track track";
  gap: 8px 12px;
  align-items: baseline;
}
.diverge-label { grid-area: label; font-size: 0.9375rem; color: var(--ink-2); }
.diverge-value {
  grid-area: value;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.diverge-value-pos { color: var(--pos); }
.diverge-value-neg { color: var(--neg); }

/* Scale: -8 % … +14 % mapped across the track; zero sits at 8/22 ≈ 36.4 %. */
.diverge-track {
  grid-area: track;
  position: relative;
  height: 14px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.diverge-zero {
  position: absolute;
  left: 36.4%;
  top: -6px;
  bottom: -6px;
  width: 2px;
  background: var(--ink-2);
  border-radius: 1px;
}
.diverge-bar { position: absolute; top: 0; bottom: 0; }
.diverge-pos { left: calc(36.4% + 2px); width: 54.7%; background: var(--pos); border-radius: 0 4px 4px 0; }
.diverge-neg { right: calc(63.6% - 0px); width: 25.2%; background: var(--neg); border-radius: 4px 0 0 4px; }

.fig-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.975rem;
}
.fig-foot strong { color: var(--ink); }

@media (max-width: 860px) {
  .lab-inner { grid-template-columns: 1fr; }
}

/* ---------- Principles ---------- */

.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 20px;
  counter-reset: principle;
}
.principles li {
  counter-increment: principle;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}
.principles li::before {
  content: "0" counter(principle);
  display: block;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.principles h3 { font-size: 1.35rem; margin-bottom: 10px; }
.principles p { color: var(--ink-2); font-size: 0.975rem; }

/* ---------- Contact ---------- */

.section-contact { background: var(--ink); color: var(--paper); border-top: 0; }
.section-contact .eyebrow { color: color-mix(in srgb, var(--accent) 70%, var(--paper)); }
.section-contact .section-lede { color: color-mix(in srgb, var(--paper) 75%, transparent); max-width: 34rem; }
.section-contact .btn-primary { background: var(--paper); color: var(--ink); }
.section-contact .btn-primary:hover { background: color-mix(in srgb, var(--paper) 88%, var(--ink)); }

.contact-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

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

.site-footer { padding-block: 40px; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.footer-links a { color: var(--ink-2); text-decoration: none; font-size: 0.9375rem; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.footer-note { flex-basis: 100%; font-size: 0.8125rem; color: var(--muted); }

/* ---------- 404 ---------- */

.notfound {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 48px;
}
.notfound img { margin: 0 auto 28px; border-radius: 14px; }
.notfound h1 { font-size: clamp(2rem, 5vw, 3rem); }
.notfound p { margin: 14px auto 28px; color: var(--ink-2); max-width: 28rem; }
