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

:root {
  --ground: #f3f4f1;
  --paper: #ffffff;
  --ink: #15181b;
  --ink-2: #4a5056;
  --line: #d9dcd6;
  --accent: #2b3fd6;
  --accent-ink: #1d2ca8;
  --accent-ground: #2b3fd6;
  --on-accent: #ffffff;
  --on-accent-2: #d6dbff;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --gutter: max(clamp(20px, 4.4vw, 64px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --max: 1280px;
  --space-section: clamp(96px, 14vw, 200px);

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  --step-3: clamp(2.125rem, 1.4rem + 3vw, 3.75rem);
  --step-4: clamp(2.5rem, 1.3rem + 3.6vw, 4.5rem);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--on-accent); }

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }

a, button { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 6px;
}
.skip:focus { top: 12px; }

/* Links and buttons */
.link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 160ms ease, color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: currentColor; color: var(--accent); }
  .link--light:hover { color: var(--on-accent); }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 600; letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-ink); }
}
.btn--small { min-height: 42px; padding: 0 18px; font-size: var(--step--1); }
.btn--light { background: var(--paper); color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) {
  .btn--light:hover { background: #eef0ff; }
}

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  padding-top: env(safe-area-inset-top, 0px);
}
.top__bar { display: flex; align-items: center; gap: 32px; min-height: 72px; }
.mark { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 28px; margin-left: auto; font-size: var(--step--1); }
.nav a { color: var(--ink-2); text-decoration: none; transition: color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--ink); } }
@media (max-width: 820px) {
  .tour__stage { top: 64px; }
  .nav { display: none; }
  .top__bar { justify-content: space-between; min-height: 64px; }
}

/* Hero */
.hero { padding-top: clamp(40px, 6vw, 80px); }
.hero__title {
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 650;
  max-width: 18ch;
  text-wrap: balance;
}
.hero__foot {
  display: grid; gap: 28px;
  margin-top: clamp(28px, 4vw, 48px);
  grid-template-columns: minmax(0, 34rem) auto;
  align-items: end; justify-content: space-between;
}
.hero__lede { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; text-wrap: pretty; }
.hero__actions { display: flex; align-items: center; gap: 24px; }
@media (max-width: 820px) {
  .hero__foot { grid-template-columns: 1fr; }
}

/* Stages: framed screenshots */
.stage { margin-top: clamp(48px, 7vw, 96px); }
.stage__art {
  position: relative;
  padding-right: clamp(40px, 12vw, 180px);
  padding-bottom: clamp(36px, 6vw, 80px);
}
.stage--phones .stage__art { padding-right: 0; padding-left: clamp(64px, 17vw, 240px); }

.browser {
  display: block;
  container-type: inline-size;
  border-radius: 14px;
  background: var(--paper);
  box-shadow:
    0 0 0 1px rgb(21 24 27 / 0.08),
    0 2px 4px rgb(21 24 27 / 0.04),
    0 24px 60px -18px rgb(21 24 27 / 0.22);
  overflow: hidden;
  color: inherit; text-decoration: none;
}
.browser__bar {
  display: flex; align-items: center; justify-content: center;
  height: clamp(28px, 2.6vw, 38px);
  border-bottom: 1px solid #eceee9;
  background: #fbfbfa;
}
.browser__url {
  font-size: clamp(0.6875rem, 0.6rem + 0.3vw, 0.8125rem);
  color: #565c62;
  padding: 3px 14px; border-radius: 6px; background: #f0f1ee;
  letter-spacing: 0.005em;
}
.browser__view {
  position: relative; display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e9ebe6;
}
.browser__first, .browser__full { width: 100%; }
.browser__first { position: relative; height: 100%; object-fit: cover; object-position: top; }
.browser__full {
  position: absolute; inset: 0 0 auto 0; z-index: 1;
  opacity: 0;
  transform: translateY(0);
  transition: transform 900ms var(--ease-out), opacity 300ms ease 600ms;
}
.browser__view picture:first-child { display: contents; }

/* Peek: hover a framed site and it scrolls through the whole page. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .browser:not(.browser--static):hover .browser__full {
    opacity: 1;
    transform: translateY(calc(-100% + 62.5cqw));
    transition: transform var(--peek, 10s) var(--ease-in-out) 200ms, opacity 160ms ease;
  }
}


.phone {
  position: absolute; right: 0; bottom: 0;
  width: clamp(112px, 22%, 270px);
  aspect-ratio: 390 / 844;
  padding: clamp(4px, 0.55vw, 8px);
  border-radius: clamp(22px, 3.2vw, 44px);
  background: #121416;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.06) inset,
    0 30px 60px -20px rgb(21 24 27 / 0.45),
    0 8px 16px -8px rgb(21 24 27 / 0.3);
}
.phone img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  border-radius: clamp(18px, 2.7vw, 37px);
}
.phone--left { right: auto; left: 0; }

.stage__cap {
  margin-top: 18px;
  font-size: var(--step--1); color: var(--ink-2);
  max-width: 60ch;
}
.stage--hero .stage__cap { margin-top: 22px; }
.hover-only { display: none; }
@media (hover: hover) and (pointer: fine) { .hover-only { display: inline; } }

/* Sections */
.section-title {
  font-size: var(--step-3);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 650;
  text-wrap: balance;
}
.section-note { margin-top: 18px; max-width: 46ch; color: var(--ink-2); font-size: var(--step-1); line-height: 1.5; text-wrap: pretty; }

.work { padding-top: var(--space-section); }
.project { margin-top: clamp(72px, 10vw, 150px); }
.project__head {
  display: grid; gap: 10px 48px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  grid-template-areas: "name text" "meta text";
  align-items: start;
}
.project__name { grid-area: name; font-size: var(--step-2); font-weight: 650; letter-spacing: -0.025em; line-height: 1.1; }
.project__meta { grid-area: meta; font-size: var(--step--1); color: var(--ink-2); }
.project__text { grid-area: text; max-width: 52ch; text-wrap: pretty; }
.project .stage { margin-top: clamp(28px, 4vw, 48px); }
@media (max-width: 820px) {
  .project__head { grid-template-columns: 1fr; grid-template-areas: "name" "meta" "text"; }
  .project__text { margin-top: 8px; }
}

/* Services */
.services { padding-top: var(--space-section); }
.plans {
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--ink);
}
.plan {
  display: grid; gap: 8px 48px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto;
  align-items: baseline;
  padding: clamp(24px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--line);
}
.plan__name { font-size: var(--step-2); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.plan__text { color: var(--ink-2); max-width: 50ch; text-wrap: pretty; }
.plan__price { font-weight: 600; white-space: nowrap; font-size: var(--step-1); font-variant-numeric: tabular-nums; }
.price { color: var(--accent); }
.care {
  display: grid; gap: 8px 48px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto;
  align-items: baseline;
  margin-top: clamp(28px, 4vw, 44px);
  padding: clamp(24px, 3vw, 32px) clamp(20px, 2.5vw, 32px);
  background: var(--paper);
  border-radius: 14px;
}
.care__name { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.015em; }
.care__opt { font-weight: 400; color: var(--ink-2); }
.care__text { color: var(--ink-2); max-width: 50ch; }
@media (max-width: 820px) {
  .plan, .care { grid-template-columns: 1fr; }
  .plan__price { margin-top: 6px; }
}

/* Process */
.process { padding-top: var(--space-section); }
.steps {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px;
  counter-reset: step;
}
.step { counter-increment: step; border-top: 1px solid var(--ink); padding-top: 22px; }
.step::before {
  content: counter(step);
  display: block; margin-bottom: 36px;
  font-size: var(--step-2); font-weight: 500; letter-spacing: -0.02em; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.step__name { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.015em; margin-bottom: 8px; }
.step p { color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px; } }
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { display: grid; grid-template-columns: 2.5rem 1fr; padding: 20px 0 26px; }
  .step::before { margin: 0; font-size: var(--step-1); }
  .step__name, .step p { grid-column: 2; }
}

/* About */
.about { padding-block: var(--space-section); }
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px 48px; }
.about__body { display: grid; gap: 18px; max-width: 56ch; }
.about__lead { font-size: var(--step-2); line-height: 1.25; letter-spacing: -0.02em; font-weight: 500; text-wrap: balance; }
.about__body p:not(.about__lead) { color: var(--ink-2); }
@media (max-width: 820px) { .about__grid { grid-template-columns: 1fr; } }

/* Contact: the close owns the accent */
.contact {
  background: var(--accent-ground); color: var(--on-accent);
  padding-block: clamp(80px, 11vw, 160px);
}
.contact ::selection { background: var(--paper); color: var(--accent-ink); }
.contact :focus-visible { outline-color: var(--paper); }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px clamp(48px, 7vw, 120px); align-items: start; }
.contact__title { font-size: var(--step-4); line-height: 1; letter-spacing: -0.035em; font-weight: 650; }
.contact__intro p { margin-top: 22px; font-size: var(--step-1); color: var(--on-accent-2); max-width: 32ch; line-height: 1.5; }
.contact__intro .contact__alt { font-size: var(--step-0); }
.contact .link { color: var(--on-accent); }
@media (max-width: 860px) { .contact__grid { grid-template-columns: 1fr; } }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-size: var(--step--1); font-weight: 500; color: var(--on-accent-2); }
.field input, .field textarea {
  width: 100%;
  font: inherit; font-size: 16px; color: var(--on-accent);
  background: rgb(255 255 255 / 0.09);
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 10px;
  padding: 14px 16px;
  caret-color: var(--paper);
  transition: border-color 160ms ease, background-color 160ms ease;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #dfe3ff; opacity: 1; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--paper); background: rgb(255 255 255 / 0.14); }
.field [aria-invalid="true"] { border-color: #ffd2c4; }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { justify-self: start; min-width: 140px; margin-top: 6px; }
.form .btn[disabled] { opacity: 0.6; cursor: progress; }
.form__status { min-height: 1.5em; color: var(--on-accent); font-weight: 500; }

/* Footer */
.foot { background: var(--accent-ground); color: var(--on-accent-2); padding-bottom: env(safe-area-inset-bottom, 0px); }
.foot__bar {
  display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between;
  padding-block: 28px 36px;
  border-top: 1px solid rgb(255 255 255 / 0.22);
  font-size: var(--step--1);
}
.foot .link { color: var(--on-accent); }

/* Reveal: content is visible by default; script opts in. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] .browser,
  .js [data-reveal] .phone {
    transition: transform 1100ms var(--ease-out), opacity 700ms ease, clip-path 1100ms var(--ease-out);
  }
  .js [data-reveal]:not(.is-in):not(.stage--hero) .browser { opacity: 0; transform: translateY(40px); }
  .js [data-reveal]:not(.is-in):not(.stage--hero) .phone { opacity: 0; transform: translateY(80px); }
  .js .stage--hero .browser, .js .stage--hero .phone { animation: rise 1000ms var(--ease-out) 160ms both; }
  .js .stage--hero .phone--b { animation-delay: 260ms; }
  .js .stage--hero .phone--a { animation-delay: 340ms; }
  .js [data-reveal].is-in .phone { transition-delay: 140ms; }

  .js .hero__title, .js .hero__foot { animation: rise 900ms var(--ease-out) both; }
  .js .hero__foot { animation-delay: 90ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* Hero trio: one laptop, two phones */
.stage__art--trio { --pw: clamp(92px, 19%, 250px); padding-right: calc(var(--pw) * 1.45); }
.stage__art--trio .phone { width: var(--pw); }
.phone--a { z-index: 2; }
.phone--b { right: calc(var(--pw) * 0.78); bottom: clamp(20px, 5vw, 72px); z-index: 1; }

/* Wrenfield tour: pick a point, the page scrolls to it */
.tour { display: grid; gap: 28px; margin-top: clamp(28px, 4vw, 48px); }
.tour__stage { position: sticky; top: 72px; z-index: 2; background: var(--ground); padding-block: 10px 4px; }
.tour .stage__art { padding-right: clamp(56px, 15vw, 150px); padding-bottom: clamp(24px, 4vw, 48px); }
.tour__phone { width: clamp(84px, 21%, 200px); transition: transform 600ms var(--ease-out), box-shadow 600ms var(--ease-out); }
.tour__full {
  width: 100%; height: auto; max-width: none;
  transform: translateY(max(calc(var(--at, 0) * -100%), calc(-100% + 62.5cqw)));
  transition: transform 900ms var(--ease-in-out);
}
.tour[data-phone-on] .tour__phone {
  transform: translateY(-10px) scale(1.04);
  box-shadow: 0 0 0 3px var(--accent), 0 40px 70px -20px rgb(21 24 27 / 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .tour__full, .tour__phone { transition: none; }
  .tour[data-phone-on] .tour__phone { transform: none; }
}

.tour__list { display: grid; gap: 2px; counter-reset: t; }
.tour__item {
  display: grid; grid-template-columns: 2rem 1fr; column-gap: 8px; width: 100%;
  padding: 16px 14px 16px 10px;
  border: 0; border-radius: 12px; background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  transition: background-color 200ms ease, transform 140ms var(--ease-out);
  counter-increment: t;
}
.tour__item::before {
  content: counter(t); grid-row: span 2; padding-top: 1px;
  font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums;
  transition: color 200ms ease;
}
.tour__item:active { transform: scale(0.985); }
.tour__name { font-weight: 600; font-size: var(--step-1); letter-spacing: -0.015em; line-height: 1.3; }
.tour__text { margin-top: 4px; color: var(--ink-2); font-size: var(--step--1); line-height: 1.5; display: none; }
.tour__item[aria-pressed="true"] { background: var(--paper); box-shadow: 0 1px 2px rgb(21 24 27 / 0.06), 0 8px 24px -12px rgb(21 24 27 / 0.18); }
.tour__item[aria-pressed="true"]::before { color: var(--accent); }
.tour__item[aria-pressed="true"] .tour__text { display: block; }
@media (hover: hover) and (pointer: fine) {
  .tour__item:not([aria-pressed="true"]):hover { background: rgb(255 255 255 / 0.55); }
}
@media (min-width: 960px) {
  .tour { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: center; gap: clamp(32px, 4vw, 64px); }
  .tour__stage { position: static; padding: 0; background: none; }
}
