/* ==========================================================================
   Built by Navi. Design system.
   One typeface, one colour, real screenshots. Hand-written, no framework.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #FFFFFF;
  --ink: #1F1916;
  --ink-2: #574A43;
  --line: #E1DDDA;
  --grey: #F3F3F2;

  --brand: #A93A00;        /* oklch(0.50 0.165 48): amber glass on a white shelf */
  --brand-deep: #862B00;
  --brand-soft: #F9E3D5;   /* secondary text on the brand surface */

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

  --w: 1200px;
  --pad: clamp(1.25rem, 4.5vw, 3.5rem);
  --section: clamp(5rem, 11vw, 9rem);
  --overlap: clamp(4rem, 12vw, 11rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --z-header: 20;
  --z-skip: 30;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
::selection { background: var(--brand); color: #fff; }
[id] { scroll-margin-top: 6rem; }

.wrap {
  max-width: var(--w);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- Type ---------- */
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  text-wrap: balance;
}
.display {
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
h2 { font-size: clamp(2rem, 3.8vw, 3.2rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.12; letter-spacing: -0.015em; }

p { text-wrap: pretty; }
.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  max-width: 34em;
}
.muted { color: var(--ink-2); }

.prose { max-width: 64ch; }
.prose p + p { margin-top: 1.25em; }
.prose strong { font-weight: 700; }

.ul {
  text-decoration: none;
  font-weight: 600;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 1px;
  transition: background-size 0.35s var(--ease);
}
.ul:hover { background-size: 30% 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  border-radius: 999px;
  padding: 1em 1.6em;
  border: 1.5px solid transparent;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn .arrow { transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-deep); }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: var(--brand-soft); }
.btn-ghost { border-color: rgba(31, 25, 22, 0.5); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--z-skip);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.75em 1.4em;
  transform: translateY(-300%);
}
.skip-link:focus-visible { transform: none; outline: 2px solid #fff; outline-offset: -5px; box-shadow: 0 0 0 3px var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  color: #fff;
  transition: transform 0.5s var(--ease), background 0.3s, color 0.3s, box-shadow 0.3s;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}
.site-header.hidden { transform: translateY(-100%); }
/* Case pages sit on white from the top, so the header starts dark. */
.site-header.on-light { color: var(--ink); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 74px;
}
.wordmark {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.site-nav a:not(.btn) {
  font-weight: 600;
  padding-block: 0.65rem;
  font-size: 0.9375rem;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.site-nav a:not(.btn):hover { opacity: 1; }
.site-nav .btn { padding: 0.7em 1.15em; font-size: 0.9375rem; white-space: nowrap; }

/* The Upwork pill flips with the header's surface. */
.site-header.scrolled .btn-hire,
.site-header.on-light .btn-hire { background: var(--brand); color: #fff; }
.site-header.scrolled .btn-hire:hover,
.site-header.on-light .btn-hire:hover { background: var(--brand-deep); }

@media (max-width: 600px) {
  .site-nav .nav-hide-sm { display: none; }
  .wordmark { font-size: 1.05rem; }
  .site-nav .btn { padding: 0.6em 0.95em; font-size: 0.875rem; }
}

/* ---------- Hero (the brand surface) ---------- */
.hero {
  background: var(--brand);
  color: #fff;
  padding-top: clamp(8rem, 18vh, 11rem);
  /* The figure hangs out of the bottom of the band into the white below. */
  padding-bottom: var(--overlap);
}
.hero .display { max-width: 15ch; }
.hero .lede { color: var(--brand-soft); margin-top: 1.6rem; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.75rem; margin-top: 2.4rem; }
.hero-ctas .ul { color: #fff; }

.hero-figure {
  margin-top: clamp(3rem, 7vw, 5rem);
  margin-bottom: calc(-1 * var(--overlap) - clamp(2rem, 6vw, 5rem));
  position: relative;
}
/* The section after the hero makes room for the hanging figure. */
.after-hero { padding-top: calc(var(--overlap) + clamp(4rem, 8vw, 7rem)); }

/* ---------- Screenshots ---------- */
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 40px 80px -40px rgba(31, 25, 22, 0.45);
}
.shot figcaption {
  margin-top: 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
}

.phone {
  background: var(--ink);
  border-radius: 2.4rem;
  padding: 9px;
  box-shadow: 0 30px 60px -30px rgba(31, 25, 22, 0.55);
}
/* The screen clips a tall capture of the page. On hover it scrolls slowly
   through it; a capture that is only one screen tall simply does not move. */
.phone-screen {
  aspect-ratio: 390 / 844;
  overflow: hidden;
  border-radius: 1.9rem;
  container-type: size;
  background: #fff;
}
.phone-screen img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 1.1s var(--ease);
}
@media (hover: hover) {
  .project-figure:hover .phone-screen img,
  .case-aside .phone:hover .phone-screen img {
    transform: translateY(calc(100cqh - 100%));
    transition: transform 5s cubic-bezier(0.45, 0.05, 0.55, 0.95);
  }
}

/* ---------- Section rhythm ---------- */
.section { padding-block: var(--section); }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .lede { margin-top: 1rem; color: var(--ink-2); }

/* ---------- Work ---------- */
.projects { display: grid; gap: clamp(6.5rem, 13vw, 11rem); }

.project {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.project:nth-child(even) .project-figure { order: 2; }


.project h3 { margin-bottom: 0.7rem; }
.project .sub { color: var(--ink-2); max-width: 32em; }
.project .stack {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin-top: 1.1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
}
.project .stack li + li::before { content: "·" / ""; margin-inline: 0.55em; color: var(--brand); }
.project .links { display: flex; flex-wrap: wrap; gap: 1.25rem 1.75rem; margin-top: 1.5rem; }
.project .links .ul { color: var(--brand); }


@media (max-width: 820px) {
  .project { grid-template-columns: 1fr; gap: 2.25rem; }
  .project:nth-child(even) .project-figure { order: 0; }
}

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
}
.service h3 { margin-bottom: 0.6rem; }
.service p { color: var(--ink-2); font-size: 1rem; }

/* ---------- Quote band ---------- */
.band {
  background: var(--brand);
  color: #fff;
  padding-block: clamp(4.5rem, 10vw, 8rem);
}
.band blockquote {
  font-size: clamp(1.75rem, 4.2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 20em;
  text-wrap: balance;
}
.band blockquote::before { content: "\201C" / ""; }
.band blockquote::after { content: "\201D" / ""; }
.band figcaption { margin-top: 1.75rem; color: var(--brand-soft); font-size: 1rem; }
.band figcaption strong { color: #fff; font-weight: 700; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }

.facts { border-top: 1px solid var(--line); }
.facts > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.facts dt { color: var(--ink-2); font-weight: 500; }
.facts dd { font-weight: 600; }
@media (max-width: 420px) { .facts > div { grid-template-columns: 1fr; gap: 0.2rem; } }

.about .prose { margin-top: 1.5rem; }

/* ---------- Contact ---------- */
.contact .display { max-width: 14ch; }
.contact .lede { margin-top: 1.5rem; color: var(--ink-2); }
.contact-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; }
.contact .fine { margin-top: 2rem; font-size: 0.9375rem; color: var(--ink-2); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.2rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.footer-inner .wordmark { color: var(--ink); font-size: 1.05rem; }
.footer-inner nav { display: flex; gap: 1.5rem; }
.footer-inner nav a { padding-block: 0.6rem; }
.footer-inner a { text-decoration: none; color: var(--ink-2); }
.footer-inner a:hover { color: var(--ink); }

/* ==========================================================================
   Case study pages
   ========================================================================== */
.case-hero { padding-top: clamp(8rem, 18vh, 11rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.case-hero .label { font-weight: 500; color: var(--ink-2); margin-bottom: 1.25rem; }
.case-hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); font-weight: 900; letter-spacing: -0.035em; max-width: 14ch; }
.case-hero .lede { margin-top: 1.5rem; color: var(--ink-2); }

.case-meta {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1.1fr 1.3fr;
  gap: 1.5rem;
  border-block: 1px solid var(--line);
  padding-block: 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
@media (max-width: 1000px) { .case-meta { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .case-meta { grid-template-columns: 1fr; row-gap: 1.1rem; } }
.case-meta .k { font-size: 0.875rem; color: var(--ink-2); margin-bottom: 0.3rem; }
.case-meta .v { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
.case-meta .v a { color: var(--brand); }

.case-figure { margin-block: clamp(2.5rem, 6vw, 4.5rem); }

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
  padding-bottom: var(--section);
}
.case-aside { position: sticky; top: 6.5rem; }
.case-aside .phone { max-width: 320px; margin-inline: auto; }
.case-aside .cap { margin-top: 1rem; font-size: 0.9rem; color: var(--ink-2); text-align: center; }
@media (max-width: 860px) {
  .case-body { grid-template-columns: 1fr; }
  .case-aside { position: static; max-width: 260px; margin: 1rem auto 0; }
}

.case-section + .case-section { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.case-section h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); margin-bottom: 1rem; }

.details { list-style: none; border-top: 1px solid var(--line); }
.details li { padding: 1rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.5rem; }
.details li::before { content: "\2192"; content: "\2192" / ""; color: var(--brand); font-weight: 700; }

.case-quote { background: var(--grey); border-radius: 12px; padding: clamp(1.75rem, 4vw, 2.75rem); }
.case-quote blockquote { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.case-quote figcaption { margin-top: 1rem; font-size: 0.9375rem; color: var(--ink-2); }


.pager { border-top: 1px solid var(--line); }
.pager-grid { display: grid; grid-template-columns: 1fr 1fr; }
.pager-grid a { text-decoration: none; padding: clamp(2rem, 5vh, 3rem) var(--pad); transition: background 0.3s var(--ease); }
.pager-grid a:hover { background: var(--grey); }
.pager-grid .next { text-align: right; border-left: 1px solid var(--line); }
.pager-grid .dir { display: block; font-size: 0.875rem; color: var(--ink-2); margin-bottom: 0.4rem; }
.pager-grid .name { font-weight: 800; font-size: clamp(1.3rem, 2.4vw, 1.9rem); letter-spacing: -0.02em; }
@media (max-width: 560px) {
  .pager-grid { grid-template-columns: 1fr; }
  .pager-grid .next { border-left: 0; border-top: 1px solid var(--line); text-align: left; }
}

/* ---------- Accessibility & print ---------- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.hero :focus-visible, .band :focus-visible,
.site-header:not(.scrolled):not(.on-light) :focus-visible { outline-color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

@media print {
  .site-header, .skip-link { display: none; }
  .hero, .band { background: none; color: var(--ink); }
  .hero .lede, .band figcaption { color: var(--ink-2); }
  .hero .ul, .band blockquote, .band figcaption strong { color: var(--ink) !important; }
  .btn { color: var(--ink) !important; background: none !important; border: 1px solid var(--ink); }
  .hero-figure { margin-bottom: 0; }
  .after-hero { padding-top: var(--section); }
}

/* Header pill sits outlined on the brand band so the hero's white pill is the one solid action in view */
.site-header:not(.scrolled):not(.on-light) .btn-hire { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.75); }
.site-header:not(.scrolled):not(.on-light) .btn-hire:hover { background: #fff; color: var(--brand); }

/* Services read as a list, not four pillars */
.service { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.service p { max-width: 52ch; }


/* Even rows keep the wide column for the figure */
@media (min-width: 821px) { .project:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.pager-grid { max-width: var(--w); margin-inline: auto; }
.about .facts { margin-top: 2rem; }

/* Hero entrance in CSS, so it runs from first paint and cannot flash after the fact */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
[data-hero] { animation: rise 1s var(--ease) both; }
[data-hero] + [data-hero] { animation-delay: 0.1s; }
[data-hero] + [data-hero] + [data-hero] { animation-delay: 0.2s; }
[data-hero-figure] { animation: rise 1.2s var(--ease) 0.3s both; }
@media (prefers-reduced-motion: reduce) { [data-hero], [data-hero-figure] { animation: none; } }
@media print { [data-hero], [data-hero-figure], .project *, .service, .steps li, .facts > div, .details li, .band *, .contact *, .shot, .case-aside .phone, .section-head { opacity: 1 !important; transform: none !important; animation: none !important; } .phone-float { display: none; } }

/* Facts read as label over value where the two-column grid gets tight */
@media (min-width: 821px) and (max-width: 1080px) {
  .facts > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* Captions should not strand a single word on the last line */
.case-quote figcaption, .case-aside .cap, .shot figcaption { text-wrap: pretty; }


/* One quiet way to make contact from the end of a case study */
.case-cta { padding-bottom: clamp(3rem, 7vw, 5rem); }
.case-cta p { max-width: 54ch; color: var(--ink-2); }
.case-cta .ul { color: var(--brand); font-weight: 600; }

/* The headline slides in without fading, so it paints at once and LCP is not delayed */
@keyframes riseonly { from { transform: translateY(24px); } to { transform: none; } }
h1[data-hero] { animation: riseonly 1s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { h1[data-hero] { animation: none; } }

/* Under 380px the wordmark plus a nav link plus the pill will not fit, and the pill
   is the one that has to survive, so the Work link steps aside. */
@media (max-width: 380px) {
  .site-nav a[href$="#work"] { display: none; }
  .site-nav { gap: 0.75rem; }
}

/* Screenshot plus phone: the phone sits on the outer bottom corner, over the
   margin of the picture rather than over the client's headline. */
.shot-stage { position: relative; }
.shot-stage .phone-float {
  position: absolute;
  width: 22%;
  bottom: -18%;
  left: -3%;
}
.project:nth-child(even) .shot-stage .phone-float { left: auto; right: -3%; }
.shot-stage .phone {
  padding: clamp(2px, 0.3vw, 5px);
  border-radius: clamp(0.65rem, 1.1vw, 1.15rem);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55), 0 24px 48px -24px rgba(31, 25, 22, 0.55);
}
.shot-stage .phone-screen { border-radius: clamp(0.5rem, 0.85vw, 0.9rem); }
.shot-stage > img { transition: box-shadow 0.6s var(--ease); }
.phone-float { will-change: transform; }
@media (hover: hover) {
  .project-figure:hover .shot-stage > img { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 48px 90px -40px rgba(31, 25, 22, 0.55); }
}
.project:nth-child(odd) .project-figure figcaption { padding-inline-start: 27%; }
.project:nth-child(even) .project-figure figcaption { padding-inline-end: 27%; }
.project-figure figcaption { margin-top: 1.1rem; }
.shot figcaption.review { font-size: 1rem; color: var(--ink); line-height: 1.5; }
.shot figcaption.review strong { font-weight: 700; }
@media (max-width: 820px) {
  .project-figure { margin-bottom: 14%; }
  .shot-stage .phone-float { width: 22%; bottom: -28%; left: 2%; }
  .project:nth-child(even) .shot-stage .phone-float { left: auto; right: 2%; }
  .project:nth-child(odd) .project-figure figcaption { padding-inline-start: 27%; }
  .project:nth-child(even) .project-figure figcaption { padding-inline-end: 27%; }
}

/* Second figure inside a case study section */
.shot.inline { margin: 1.75rem 0 1.5rem; }
.shot.inline img { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 24px 48px -32px rgba(31, 25, 22, 0.4); }

/* About: how a project runs. A real sequence, so it is numbered. */
.steps-title { margin-top: 2.5rem; font-size: 1.25rem; }
.steps { list-style: none; counter-reset: step; margin-top: 1rem; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 2rem 1fr; gap: 0.25rem 0.75rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.steps li::before { counter-increment: step; content: counter(step); font-weight: 800; color: var(--brand); font-size: 1.1rem; line-height: 1.5; }
.steps strong { font-weight: 700; }
.steps p { grid-column: 2; color: var(--ink-2); font-size: 1rem; }

/* 404 */
.not-found { padding-bottom: var(--section); min-height: 62vh; }
.not-found .contact-ctas { margin-top: 2rem; }

/* Magnetic buttons: GSAP moves them, so the CSS transition must not also ease transform */
.btn-hire, .contact .btn-ghost { transition-property: background-color, color, border-color, box-shadow; }
