:root {
  color-scheme: light dark;
  --paper: #F4F1EA;
  --ink: #14161C;
  --muted: #565963;
  --line: rgba(20, 22, 28, .16);
  --accent: #2A57D6;
  --glass: rgba(244, 241, 234, .72);
  --glass-edge: rgba(255, 255, 255, .6);

  /* The case study stays dark in both themes, so the app's dark UI sits at home. */
  --panel: #14161C;
  --panel-ink: #F1EEE6;
  --panel-muted: #A9ACB6;
  --panel-line: rgba(241, 238, 230, .16);
  --app-blue: #5282FE;
  --on-blue: #0B1020;
  --sign: #F6F0E0;
  --sign-ink: #1B1A16;

  --display: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101216;
    --ink: #F1EEE6;
    --muted: #A9ACB6;
    --line: rgba(241, 238, 230, .16);
    --accent: #8FAEFF;
    --glass: rgba(16, 18, 22, .68);
    --glass-edge: rgba(255, 255, 255, .12);
    --panel: #1A1D25;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.case :focus-visible { outline-color: #8FAEFF; }
[id] { scroll-margin-top: 88px; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--paper);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Nav */
.nav-wrap {
  position: sticky; top: 12px; z-index: 40;
  padding-inline: var(--gutter);
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  max-width: var(--max); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 6px 8px 6px 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--line);
  border-top-color: var(--glass-edge);
  border-radius: 999px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-weight: 700; letter-spacing: -.01em; text-decoration: none;
}
.mark { width: 26px; height: 26px; fill: none; stroke-width: 4; stroke-linecap: square; }
.mark-up { stroke: var(--accent); }
.mark-base { stroke: currentColor; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding-inline: 16px;
  border-radius: 999px;
  font-size: .9375rem; font-weight: 500; text-decoration: none;
  transition: background-color 160ms ease-out, transform 100ms ease-out;
}
.nav-links a:hover { background: var(--line); }
.nav-links a:active { transform: scale(.97); background: var(--line); }

/* Hero */
.hero {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding: clamp(56px, 10vw, 128px) var(--gutter) clamp(40px, 6vw, 72px);
}
.eyebrow { color: var(--muted); font-size: .9375rem; font-weight: 500; }
h1 {
  margin-top: 16px;
  max-width: 13ch;
  font-size: clamp(3rem, 10.2vw, 9.25rem);
  font-weight: 600;
  line-height: .96;
  letter-spacing: -.045em;
  text-wrap: balance;
}
h1 em {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.03em;
  color: var(--accent);
}
.lede {
  margin-top: clamp(24px, 3vw, 40px);
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.45;
}

/* Work */
.work {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.work-label {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: .9375rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.work-label h2 { font: inherit; }

.case {
  background: var(--panel);
  color: var(--panel-ink);
  border-radius: clamp(20px, 3vw, 36px);
  padding: clamp(20px, 4.4vw, 64px);
  overflow: clip;
}
.case-top {
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.case-top > * { min-width: 0; }
.app-icon { width: 80px; height: 80px; border-radius: 20px; }
.case-kicker { margin-top: 24px; color: var(--panel-muted); font-size: .9375rem; font-weight: 500; }
.case h3 {
  margin-top: 6px;
  font-size: clamp(2.125rem, 4.6vw, 4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.case-copy { margin-top: 20px; max-width: 32rem; color: #CFD1D8; line-height: 1.55; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 28px;
  min-height: 52px; padding: 12px 24px;
  border-radius: 999px;
  background: var(--app-blue); color: var(--on-blue);
  font-weight: 600; text-decoration: none;
  touch-action: manipulation;
  transition: background-color 160ms ease-out, transform 100ms ease-out;
}
.cta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.cta:hover { background: #7198FF; }
.cta:active { transform: scale(.97); }

/* Lens demo */
.sign {
  position: relative;
  height: 280px;
  width: 100%;
  border-radius: 20px;
  background: var(--sign);
  color: var(--sign-ink);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
}
.sign-layer {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(18px, 3.4vw, 44px);
  font-family: var(--serif);
}
.sign-source { transition: opacity 180ms ease-out; }
.sign-source.is-swapping { opacity: 0; }
.sign-result { background: var(--app-blue); color: var(--on-blue); }
.sign-layer.is-rtl { direction: rtl; }
.row {
  padding-block: clamp(5px, .9vw, 10px);
  font-size: clamp(1.0625rem, 2vw, 1.625rem);
  line-height: 1.2;
  white-space: nowrap;
  border-bottom: 1px dashed rgba(27, 26, 22, .22);
}
.row:last-child { border-bottom: 0; }
.row-title {
  font-style: italic;
  font-size: clamp(1.5rem, 3.1vw, 2.5rem);
  letter-spacing: -.01em;
}
.lens {
  position: absolute; top: 0; left: 0;
  display: none;
  border-radius: 18px;
  touch-action: none;
  cursor: grab;
  will-change: transform;
}
.js .lens { display: block; }
.lens.is-dragging { cursor: grabbing; }
.lens:focus-visible { outline: none; }
.lens-frame {
  position: absolute; inset: 0;
  border-radius: 18px;
  box-shadow: 0 0 0 1.5px rgba(11, 16, 32, .5), 0 14px 30px -10px rgba(11, 16, 32, .55);
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.lens.is-dragging .lens-frame { transform: scale(1.015); box-shadow: 0 0 0 2px rgba(11, 16, 32, .75), 0 22px 40px -12px rgba(11, 16, 32, .6); }
.lens:focus-visible .lens-frame { box-shadow: 0 0 0 3px var(--sign), 0 0 0 6px #1D44B8; }
.lens-frame i {
  position: absolute;
  width: 22px; height: 22px;
  border: 3px solid #FFF;
}
.lens-frame i:nth-child(1) { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-top-left-radius: 9px; }
.lens-frame i:nth-child(2) { top: 8px; right: 8px; border-left: 0; border-bottom: 0; border-top-right-radius: 9px; }
.lens-frame i:nth-child(3) { bottom: 8px; left: 8px; border-right: 0; border-top: 0; border-bottom-left-radius: 9px; }
.lens-frame i:nth-child(4) { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-bottom-right-radius: 9px; }

.demo figcaption { margin-top: 14px; }
.demo-hint { display: none; color: var(--panel-muted); font-size: .9375rem; }
.js .demo-hint { display: block; }
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.js .langs { display: flex; }
html:not(.js) .langs { display: none; }
.langs button {
  min-height: 44px; padding-inline: 16px;
  background: transparent;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  color: var(--panel-ink);
  font-size: .9375rem;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 100ms ease-out;
}
.langs button:hover { border-color: var(--panel-muted); }
.langs button:active { transform: scale(.97); }
.langs button[aria-pressed="true"] { background: var(--panel-ink); border-color: var(--panel-ink); color: #14161C; font-weight: 600; }

/* Facts */
.facts {
  display: grid;
  gap: 4px 32px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-block: 18px;
  border-block: 1px solid var(--panel-line);
  color: var(--panel-muted);
}
.facts strong { color: var(--panel-ink); font-weight: 600; }

/* Screens */
.rail {
  display: flex; gap: clamp(14px, 2vw, 24px);
  margin-top: clamp(32px, 5vw, 56px);
  margin-inline: calc(-1 * clamp(20px, 4.4vw, 64px));
  padding-inline: clamp(20px, 4.4vw, 64px);
  padding-bottom: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: clamp(20px, 4.4vw, 64px);
  scrollbar-width: thin;
  scrollbar-color: var(--panel-line) transparent;
}
.shot { flex: 0 0 clamp(190px, 20vw, 240px); scroll-snap-align: start; }
.shot img {
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--panel-line);
  background: #121318;
}
.shot figcaption { margin-top: 10px; color: var(--panel-muted); font-size: .9375rem; }

/* Features */
.features {
  display: grid;
  gap: 0 clamp(32px, 5vw, 72px);
  margin-top: clamp(32px, 5vw, 56px);
}
.features li { padding-block: 20px; border-top: 1px solid var(--panel-line); }
.features h4 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -.01em; }
.features p { margin-top: 4px; color: var(--panel-muted); max-width: 30rem; }

/* Studio */
.studio {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding: clamp(72px, 11vw, 160px) var(--gutter) clamp(56px, 8vw, 112px);
}
.studio > h2 { color: var(--muted); font-size: .9375rem; font-weight: 500; }
.principles { margin-top: 16px; }
.principles li {
  display: grid; gap: 8px clamp(32px, 5vw, 72px);
  padding-block: clamp(24px, 3.4vw, 40px);
  border-top: 1px solid var(--line);
}
.principles h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}
.principles p { color: var(--muted); max-width: 30rem; align-self: center; }

/* Footer */
.footer {
  padding-inline: var(--gutter);
  overflow: hidden;
}
.footer-links {
  max-width: var(--max); margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px;
  padding-block: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9375rem;
}
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
.footer-links span { margin-left: auto; }
.wordmark {
  max-width: var(--max); margin-inline: auto;
  font-size: clamp(5rem, 24.5vw, 22rem);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.055em;
  white-space: nowrap;
  margin-top: 8px;
  margin-bottom: .02em;
}

/* Motion */
.js .load {
  opacity: 0;
  animation: rise 700ms var(--ease) forwards;
  animation-delay: calc(var(--i) * 70ms);
}
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 720px) {
  .sign { height: auto; aspect-ratio: 5 / 4; }
  .facts { grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .features { grid-template-columns: 1fr 1fr; }
  .principles li { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
@media (min-width: 1000px) {
  .case-top { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .load { animation: fade 200ms ease forwards; animation-delay: 0ms; }
  .js .reveal { transform: none; transition: opacity 200ms ease; }
  .cta:active, .langs button:active, .nav-links a:active { transform: none; }
  .lens.is-dragging .lens-frame { transform: none; }
}
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .nav { background: var(--paper); border-color: var(--ink); }
  :root { --line: rgba(20, 22, 28, .5); --panel-line: rgba(241, 238, 230, .5); }
}
