/* ==========================================================================
   Axion Web — styles
   Tokens → base → header → hero → sections → footer → motion
   ========================================================================== */

:root {
  --paper:  #FFFFFF;
  --frost:  #F3F5F8;
  --ink:    #0E1F3A;
  --slate:  #5B6B82;
  --signal: #D4213D;
  --signal-deep: #B4152E;
  --rule:   rgba(14, 31, 58, .14);
  --rule-strong: rgba(14, 31, 58, .32);

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(72px, 10vw, 128px);

  --r-sm: 6px;
  --r-md: 12px;
  --r-pill: 999px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "kern";
  -webkit-font-smoothing: antialiased;
}

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

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

a { color: inherit; text-decoration: none; }
main p a:not([class]), .faq-body a { text-decoration: underline; text-underline-offset: .15em; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--r-sm);
}
.skip:focus { top: 16px; }

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* type scale */
h1, h2, h3 { font-weight: 700; letter-spacing: -.028em; }
h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.06; text-wrap: balance; }
h3 { font-size: 20px; line-height: 1.3; letter-spacing: -.012em; }

/* ---------- buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px;
  font: inherit; font-weight: 600; line-height: 1.2;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              transform .18s var(--ease), box-shadow .18s var(--ease);
}
.button-lg { padding: 15px 24px; font-size: 18px; }

.button-primary { background: var(--signal); color: #fff; }
.button-primary:active { transform: translateY(1px); box-shadow: none; }
.button-ghost { border-color: var(--rule-strong); color: var(--ink); background: transparent; }
.button-ghost:active { transform: translateY(1px); box-shadow: none; }

@media (hover: hover) and (pointer: fine) {
  .button-primary:hover { background: var(--signal-deep); transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(212, 33, 61, .55); }
  .button-ghost:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(14, 31, 58, .4); }
}

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-stuck { border-bottom-color: var(--rule); }

.header-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1;
}
.wordmark span { font-weight: 400; }

.nav-list { display: flex; align-items: center; gap: 4px; position: relative; }
.nav-list a:not(.button) {
  display: block; padding: 8px 12px;
  font-weight: 500; font-size: 16px;
  border-radius: var(--r-sm);
  position: relative;
}
.nav-list a:not(.button)::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px;
  height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .nav-list a:not(.button):hover::after { transform: scaleX(1); }
}
/* red bar that slides to the link for the section in view (positioned by JS) */
.nav-indicator {
  position: absolute; bottom: 4px; left: 0;
  height: 2px; width: 0; background: var(--signal);
  opacity: 0;
  transition: left .35s var(--ease), width .35s var(--ease), opacity .25s;
  pointer-events: none;
}
.nav-indicator.is-visible { opacity: 1; }
.nav-cta { margin-left: 12px; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.nav-toggle-bar {
  width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child  { transform: translateY(-4px) rotate(-45deg); }

/* ---------- hero ---------- */

.hero { padding: clamp(40px, 7vw, 96px) 0 var(--section-y); overflow-x: clip; }

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(40px, 5vw, 64px);
}
.hero-copy {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  max-width: 760px;
}

.hero-title {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.hero-title .line > span { display: block; }

.hero-lead {
  max-width: 50ch;
  margin-top: 28px;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--slate);
}

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

.hero-facts {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 32px;
  margin-top: 28px;
}
.hero-facts li {
  padding-left: 16px;
  font-size: 15.5px; font-weight: 500;
  position: relative;
}
.hero-facts li::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 6px; height: 6px; margin-top: -3px;
  background: var(--ink); border-radius: 50%;
}

/* hero shot — one big screenshot, crossfading every few seconds */

.hero-shot {
  position: relative;
  width: 100%;
  max-width: 1040px;
  aspect-ratio: 1344 / 752;
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
  background: var(--frost);
  overflow: hidden;
  box-shadow: 0 24px 48px -28px rgba(14, 31, 58, .4);
}
.hero-shot-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero-shot-img.is-active { opacity: 1; }

/* ---------- sections ---------- */

.section { padding: var(--section-y) 0; }
.section-frost { background: var(--frost); }
.section-ink { background: var(--ink); color: #fff; }

/* hairline between adjacent white sections */
.section + .section:not(.section-frost):not(.section-ink) { border-top: 1px solid var(--rule); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px clamp(32px, 6vw, 96px);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.section-head h2 { max-width: 20ch; }
.section-head p {
  color: var(--slate);
  font-size: 17px;
  max-width: 44ch;
  padding-bottom: 4px;
}

/* services — a definition list with rules, not cards */

.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 6vw, 96px);
  border-top: 1px solid var(--rule);
}
.service {
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--rule);
}
.service dt { font-size: 21px; font-weight: 700; letter-spacing: -.015em; transition: transform .3s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .service:hover dt { transform: translateX(4px); }
}
.service dd { margin-top: 8px; color: var(--slate); max-width: 46ch; }

/* work slideshow — pictures only, no captions */

.slideshow { position: relative; }
.slideshow-viewport {
  overflow: hidden;
  border-radius: var(--r-md);
  background: #E9ECF1;
  border: 1px solid var(--rule);
}
.slideshow-track {
  display: flex;
  transition: transform .6s var(--ease);
  will-change: transform;
}
.slide { flex: 0 0 100%; min-width: 0; }
.slide img {
  width: 100%;
  aspect-ratio: 1344 / 752;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .slideshow-viewport:hover .slide img { transform: scale(1.02); }
}
.slideshow-controls {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-top: 20px;
}
.slideshow-arrow {
  width: 44px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--rule-strong); border-radius: 50%;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .2s var(--ease);
}
.slideshow-arrow:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .slideshow-arrow:hover { border-color: var(--ink); transform: scale(1.06); }
  .slideshow-dots button:hover { background: var(--ink); }
}
.slideshow-dots { display: flex; gap: 10px; }
.slideshow-dots button {
  width: 10px; height: 10px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--rule-strong);
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}
.slideshow-dots button[aria-selected="true"] { background: var(--ink); transform: scale(1.3); }
.slideshow.is-dragging .slideshow-track { transition: none; }

/* process — an actual sequence, so it gets numbers */

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--rule);
}
.step { padding-top: 28px; position: relative; }
.step::before {
  content: ""; position: absolute; top: -1px; left: 0;
  width: 44px; height: 2px; background: var(--ink);
}
.step-num {
  display: inline-block;
  font-size: 15px; font-weight: 600;
  color: var(--signal);
  margin-bottom: 14px;
}
.step h3 { max-width: 16ch; }
.step p { margin-top: 10px; color: var(--slate); font-size: 16px; }

/* about */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px clamp(32px, 6vw, 96px);
}
.about-body { max-width: 58ch; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; }
.about-body p + p { margin-top: 1.1em; }
.about-sig { color: var(--slate); font-size: 17px; }
.about-sig em { font-style: normal; color: var(--ink); font-weight: 600; }

/* faq — native details, styled */

.faq-list { border-top: 1px solid var(--rule); max-width: 820px; }
.faq { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 44px 22px 0;
  font-size: 20px; font-weight: 600; letter-spacing: -.012em; line-height: 1.3;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%;
  width: 16px; height: 2px; margin-top: -1px;
  background: var(--ink);
  transition: transform .25s var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq[open] summary::after { transform: rotate(0); }
.faq-body { padding: 0 0 24px; color: var(--slate); max-width: 62ch; }
.faq-body p { overflow: hidden; }
/* with JS the answer grows/shrinks; without JS <details> just works natively */
html.js .faq-body { display: grid; grid-template-rows: 0fr; padding: 0; transition: grid-template-rows .35s var(--ease); }
html.js .faq-body > p { min-height: 0; }
html.js .faq.is-open .faq-body { grid-template-rows: 1fr; }
html.js .faq.is-open .faq-body > p { padding-bottom: 24px; }

/* contact */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px clamp(32px, 6vw, 96px);
  align-items: start;
}
.contact-copy p { margin-top: 20px; color: rgba(255, 255, 255, .72); max-width: 40ch; }
.contact-direct { display: flex; flex-direction: column; gap: 6px; margin-top: 24px; }
.contact-direct a {
  font-size: 20px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 5px; text-decoration-color: rgba(255,255,255,.35);
}
.contact-direct a:hover { text-decoration-color: #fff; }

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.field-full { grid-column: 1 / -1; }
.field label { display: block; font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.field .optional { color: rgba(255,255,255,.55); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit; font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid transparent; border-radius: var(--r-sm);
  padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%230E1F3A' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(212, 33, 61, .3); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--signal); }
.field-error { font-size: 14px; color: #FFB4C0; margin-top: 6px; }

.form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; }
.form-status { font-size: 16px; color: rgba(255,255,255,.85); }
.form-status.is-success::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px;
  background: #4ADE80; border-radius: 50%; vertical-align: middle;
}
.contact-form.is-sending .button { opacity: .6; pointer-events: none; }

/* ---------- footer ---------- */

.site-footer { padding: 40px 0 48px; border-top: 1px solid var(--rule); }
.footer-row {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) minmax(0, 2fr);
  gap: 24px 32px;
  align-items: start;
}
.wordmark-footer { font-size: 20px; }
.footer-line { margin-top: 10px; color: var(--slate); font-size: 15.5px; max-width: 40ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; padding-top: 4px; }
.footer-nav a { font-size: 15.5px; font-weight: 500; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-copy { color: var(--slate); font-size: 15px; padding-top: 4px; justify-self: end; }

/* ---------- responsive ---------- */

@media (max-width: 1040px) {
  .hero-title { font-size: clamp(36px, 7vw, 60px); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-row { grid-template-columns: 1fr 1fr; }
  .footer-copy { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-list {
    position: absolute; left: 0; right: 0; top: 72px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s;
  }
  .nav-list.is-open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
  .nav-list a:not(.button)::after { display: none; }
  .nav-indicator { display: none; }
  .nav-list a:not(.button) { padding: 12px 8px; font-size: 18px; }
  .nav-cta { margin: 8px 0 0; }
  .nav-cta .button { width: 100%; }

  .section-head, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .section-head { gap: 14px; }
  .service-list { grid-template-columns: 1fr; }
  .service { padding: 22px 0 24px; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { padding: 24px 0; border-bottom: 1px solid var(--rule); }
  .step::before { display: none; }
  .step h3 { max-width: none; }
  .step-num { margin-bottom: 8px; }
  .contact-form { grid-template-columns: 1fr; }
  .faq summary { font-size: 18px; padding-block: 18px; }
  .slideshow-controls { gap: 14px; }
  .hero-actions .button { flex: 1 1 auto; }
}

/* ==========================================================================
   MOTION
   One page-load sequence in the hero; everything else answers a user action.
   ========================================================================== */

.hero-title .line > span {
  transform: translateY(105%);
  animation: rise .8s var(--ease) forwards;
}
.hero-title .line:nth-child(1) > span { animation-delay: .05s; }
.hero-title .line:nth-child(2) > span { animation-delay: .17s; }

.hero-lead, .hero-actions, .hero-facts {
  opacity: 0;
  animation: fade .7s var(--ease) forwards;
}
.hero-lead    { animation-delay: .45s; }
.hero-actions { animation-delay: .55s; }
.hero-facts   { animation-delay: .65s; }

.hero-shot {
  opacity: 0;
  animation: settle .9s var(--ease) .35s both;
}

@keyframes rise   { to { transform: translateY(0); } }
@keyframes fade   { to { opacity: 1; } }
@keyframes settle { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }

/* header fades in just ahead of the headline */
.site-header { animation: fade .5s var(--ease) both; }

/* scroll reveals — hidden only once JS is confirmed running, revealed one-shot
   by initReveal; siblings stagger via --reveal-delay (index × 60ms) */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
  .hero-title .line > span { transform: none; }
  .hero-lead, .hero-actions, .hero-facts, .hero-shot, .site-header { opacity: 1; transform: none; translate: none; }
  .hero-shot-img { transition: none; }
  .slideshow-track { transition: none; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .nav-indicator { transition: none; }
}
