/* =============================================================================
   Arnheim AS — stylesheet
   Aesthetic: "technical document / industrial ledger"
   A dark, precisely typeset interface that reads like an engineering spec sheet.
   Hairline rules, mono annotations, numbered sections, an asymmetric label/content
   grid, and a single thread of copper used only as accent — never as a fill.
   Pure CSS, no build step. Mobile-first.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette — deliberately narrow. Copper is the only warm note. */
  --bg:        #0A0B0D;  /* page base, near-black */
  --surface:   #111319;  /* raised panel */
  --surface-2: #15181F;  /* deeper panel / hover */
  --line:      rgba(255, 255, 255, 0.08); /* hairline rules */
  --line-2:    rgba(255, 255, 255, 0.14); /* stronger hairline */
  --ink:       #F4F6F8;  /* primary text */
  --muted:     #9AA1AD;  /* secondary text */
  --copper:    #C9824E;  /* accent only: numbers, links, thin rules, hero glow */
  --copper-rgb: 201, 130, 78;

  /* Type families. Display = Bricolage Grotesque, body = Schibsted Grotesk,
     technical labels = IBM Plex Mono. No Inter/Roboto/Arial defaults. */
  --font-display: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif;
  --font-body:    'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Shape */
  --radius-sm: 4px;
  --radius:    7px;

  /* Layout */
  --maxw: 75rem;          /* 1200px content cap */
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --header-h: 4.25rem;    /* approximate sticky-header height for scroll offsets */

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* -----------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

/* Anchored targets clear the sticky header. */
[id] { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

body {
  margin: 0;
  background-color: var(--bg);
  /* A faint top-down glow keeps the black from reading flat — no trend gradient. */
  background-image: radial-gradient(120% 75% at 50% -8%, #101218 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Backstop against decorative bleed. `clip` (not `hidden`) avoids turning the
     body into a scroll container, which would otherwise break position: sticky. */
  overflow-x: clip;
}

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

h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

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

::selection {
  background: rgba(var(--copper-rgb), 0.85);
  color: #0A0B0D;
}

/* -----------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */
.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-feature-settings: "ss01" off;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: #0A0B0D;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* -----------------------------------------------------------------------------
   4. Brand mark
   -------------------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}
.brand__mark {
  width: 30px;
  height: 30px;
  color: var(--ink); /* drives the "A" strokes via currentColor; crossbar is copper */
  flex: none;
}
.brand__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}
.brand--sm .brand__mark { width: 26px; height: 26px; }
.brand--sm .brand__word { font-size: 0.95rem; }

/* -----------------------------------------------------------------------------
   5. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 13, 0.68);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
/* Set once the page has scrolled (toggled in JS). */
.site-header.is-scrolled {
  background: rgba(10, 11, 13, 0.88);
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}
.nav__link {
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding-block: 0.4rem;
  transition: color 0.2s var(--ease);
}
.nav__link:hover { color: var(--ink); }
/* Copper underline grows from the left — the accent thread, on an interactive element. */
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.nav__link:hover::after { transform: scaleX(1); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

/* Language switch — present in header and footer. */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.lang__btn {
  background: none;
  border: 0;
  padding: 0.25rem 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.lang__btn:hover { color: var(--ink); }
.lang__btn[aria-pressed="true"] {
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--copper);
}
.lang__sep {
  color: var(--muted);
  opacity: 0.45;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* The CTA shown inside the nav (mobile menu only) vs. the standalone header CTA.
   Scoped to .nav so it outranks the .btn display rule on desktop. */
.nav .nav__cta { display: none; }

/* Hamburger — hidden on desktop. */
.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: 0;
  padding: 0.35rem 0.1rem;
  color: var(--ink);
  cursor: pointer;
}
.menu-toggle__label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.menu-toggle__bars {
  position: relative;
  width: 22px;
  height: 14px;
  flex: none;
}
.menu-toggle__bars span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.28s var(--ease), opacity 0.2s var(--ease);
}
.menu-toggle__bars span:nth-child(1) { top: 3px; }
.menu-toggle__bars span:nth-child(2) { bottom: 3px; }
/* Open state folds the two bars into an X. */
.site-header.is-open .menu-toggle__bars span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.site-header.is-open .menu-toggle__bars span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* -----------------------------------------------------------------------------
   6. Buttons & inline links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
              border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn__arrow { transition: transform 0.2s var(--ease); }

/* Primary = high-contrast neutral fill (copper is never a fill). */
.btn--primary { background: var(--ink); color: #0A0B0D; }
.btn--primary:hover { background: #ffffff; transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }

/* Ghost = hairline outline; copper appears only on hover, as accent. */
.btn--ghost { color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--copper); }

.btn:hover .btn__arrow { transform: translateX(3px); }       /* → */
.btn--ghost:hover .btn__arrow { transform: translateY(3px); } /* ↓ */

/* Inline links read in copper with a soft underline. */
.link {
  color: var(--copper);
  box-shadow: inset 0 -1px 0 rgba(var(--copper-rgb), 0.4);
  transition: box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}
.link:hover {
  color: #E0A574;
  box-shadow: inset 0 -1px 0 var(--copper);
}

/* -----------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4.5rem, 13vh, 8.5rem) clamp(3.5rem, 9vw, 6rem);
}
.hero__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
/* The single permitted soft glow — copper, low opacity, upper-right. */
.hero__glow {
  position: absolute;
  top: -18%;
  right: -12%;
  width: min(60vw, 720px);
  aspect-ratio: 1;
  background: radial-gradient(circle at center,
    rgba(var(--copper-rgb), 0.20) 0%,
    rgba(var(--copper-rgb), 0.06) 38%,
    rgba(var(--copper-rgb), 0) 65%);
}
/* Topographic contour — a quiet nod to the Løkken Verk mining ground. */
.hero__contour {
  position: absolute;
  top: 50%;
  right: clamp(-180px, -4vw, -40px);
  transform: translateY(-50%);
  width: min(70vw, 640px);
  aspect-ratio: 1;
  background: url("../img/contour.svg") no-repeat center / contain;
  opacity: 0.55;
}
.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 62rem;
}
.hero__overline {
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 1.5rem + 6.2vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-top: 1.2rem;
  max-width: 17ch;
  text-wrap: balance;
}
.hero__lead {
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.55;
  max-width: 46ch;
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  margin-top: clamp(2.75rem, 7vw, 4.5rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}
.hero__meta-item { display: flex; flex-direction: column; }
.hero__meta-item dt {
  color: var(--copper);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
}
.hero__meta-item dd {
  color: var(--ink);
  font-size: 0.95rem;
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}

/* -----------------------------------------------------------------------------
   8. Sections — shared structure (asymmetric label / content grid)
   -------------------------------------------------------------------------- */
.section {
  border-top: 1px solid var(--line);
  padding-block: clamp(3.5rem, 9vw, 7rem);
}
.section__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
}
.section__aside { min-width: 0; }
.section__num {
  display: block;
  color: var(--copper);
  font-size: 0.8125rem;
  letter-spacing: 0.28em;
}
.section__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.65rem, 1.2rem + 2vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-top: 0.85rem;
}
.section__intro {
  color: var(--muted);
  margin-top: 0.85rem;
  max-width: 24ch;
}
.section__content { min-width: 0; }

/* -----------------------------------------------------------------------------
   9. Ledger — services as numbered spec rows
   -------------------------------------------------------------------------- */
.ledger { border-top: 1px solid var(--line); }
.ledger__item {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding-block: clamp(1.4rem, 3.5vw, 2rem);
  border-bottom: 1px solid var(--line);
}
.ledger__index {
  color: var(--copper);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  padding-top: 0.35rem;
}
.ledger__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.ledger__desc {
  color: var(--muted);
  margin-top: 0.6rem;
  max-width: 56ch;
}

/* -----------------------------------------------------------------------------
   10. Ventures — two framed cards with a registration-mark corner
   -------------------------------------------------------------------------- */
.ventures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}
.venture {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  overflow: hidden;
}
.venture__tag {
  color: var(--copper);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
}
.venture__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  letter-spacing: -0.01em;
  margin-top: 0.5rem;
}
.venture__desc {
  color: var(--muted);
  margin-top: 0.75rem;
  max-width: 38ch;
}
/* Thin copper corner bracket, like a print registration mark. */
.venture__corner {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 16px;
  height: 16px;
  border-top: 1px solid var(--copper);
  border-right: 1px solid var(--copper);
  opacity: 0.7;
}

/* -----------------------------------------------------------------------------
   11. Prose — about
   -------------------------------------------------------------------------- */
.prose {
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.45rem);
  line-height: 1.6;
  max-width: 56ch;
  color: var(--ink);
  font-weight: 400;
}
/* Founder name carries a quiet copper underline — the key entity on the page. */
.prose__name {
  font-weight: 600;
  box-shadow: inset 0 -1px 0 rgba(var(--copper-rgb), 0.55);
}

/* -----------------------------------------------------------------------------
   12. Datasheet — contact as a spec table
   -------------------------------------------------------------------------- */
.datasheet { border-top: 1px solid var(--line); }
.datasheet__row {
  display: grid;
  grid-template-columns: clamp(7rem, 26vw, 11rem) minmax(0, 1fr);
  gap: 1rem clamp(1rem, 3vw, 2rem);
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.datasheet__key {
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 0.15rem;
}
.datasheet__val {
  color: var(--ink);
  font-size: 1.0625rem;
}
.datasheet__cta { margin-top: clamp(1.75rem, 4vw, 2.5rem); }

/* -----------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.25rem, 5vw, 3.25rem);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.site-footer__legal {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}
.site-footer__meta {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.75rem);
}
.coords {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

/* -----------------------------------------------------------------------------
   14. Scroll-reveal (progressive enhancement; JS adds .reveal-init)
   Without JS, content is simply visible. .reveal-init sets the hidden start
   state; .is-visible plays it. Staggering is handled per group below.
   -------------------------------------------------------------------------- */
.reveal-init {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.reveal-init.is-visible {
  opacity: 1;
  transform: none;
}
.ledger__item.reveal-init:nth-child(2) { transition-delay: 0.08s; }
.ledger__item.reveal-init:nth-child(3) { transition-delay: 0.16s; }
.venture.reveal-init:nth-child(2) { transition-delay: 0.1s; }

/* One-time, orchestrated hero entrance (pure CSS, plays on load). */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.hero__overline { animation: heroRise 0.7s var(--ease) both 0.05s; }
.hero__title    { animation: heroRise 0.8s var(--ease) both 0.14s; }
.hero__lead     { animation: heroRise 0.8s var(--ease) both 0.24s; }
.hero__actions  { animation: heroRise 0.8s var(--ease) both 0.34s; }
.hero__meta     { animation: heroRise 0.8s var(--ease) both 0.44s; }

/* =============================================================================
   15. Responsive
   ========================================================================== */

/* Desktop navigation ≥ 56rem (896px). Below, collapse to a hamburger menu. */
@media (max-width: 56rem) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    /* hidden until toggled */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .site-header.is-open .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav__link {
    padding-block: 0.9rem;
    font-size: 1.05rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .nav__link::after { display: none; }
  .nav .nav__cta {
    display: inline-flex;
    justify-content: center;
    margin-top: 1.1rem;
  }
  .header__cta { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* Two-column section grid with a sticky label rail ≥ 60rem (960px). */
@media (min-width: 60rem) {
  .section__grid {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
  }
  .section__aside {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
}

/* Stack venture cards on narrow screens. */
@media (max-width: 38rem) {
  .ventures { grid-template-columns: minmax(0, 1fr); }
}

/* Very small screens: tighten the services row so the index never crowds. */
@media (max-width: 26rem) {
  .ledger__item { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .menu-toggle__label { display: none; }
}

/* =============================================================================
   16. Reduced motion — honor the user's preference fully.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* Make sure progressively-revealed and hero content is simply shown. */
  .reveal-init { opacity: 1; transform: none; }
  .hero__overline, .hero__title, .hero__lead, .hero__actions, .hero__meta {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
