@layer reset, base, layout, components, motion;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  img { display: block; max-width: 100%; height: auto; }
  button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
  a { color: inherit; }
}

@layer base {
  :root {
    --bg: #fbfaf7;
    --ink: #1c2733;
    --mid: #7f858d;
    --stone: #d8d7d2;
    --moss: #e8891d;
    --line: color-mix(in oklab, var(--ink) 12%, transparent);

    --serif: "Newsreader", Georgia, "Times New Roman", serif;
    --sans: "Onest", "Helvetica Neue", Arial, sans-serif;

    --step--1: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem);
    --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.1rem);
    --step-1: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
    --step-2: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
    --step-3: clamp(2.2rem, 1.3rem + 3.6vw, 4.6rem);
    --step-4: clamp(2.6rem, 1.2rem + 6vw, 7rem);

    --gutter: clamp(1.25rem, 4vw, 4.5rem);
    --section: clamp(5rem, 12vw, 12rem);
    color-scheme: light;
  }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg); color: var(--ink);
    font-family: var(--sans); font-size: var(--step-0); font-weight: 300; line-height: 1.55;
    -webkit-font-smoothing: antialiased; overflow-x: clip;
  }
  h1, h2 { font-family: var(--serif); font-weight: 300; line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance; font-variation-settings: "opsz" 72; }
  h1 { font-size: var(--step-4); font-weight: 200; }
  h2 { font-size: var(--step-2); }
  p { max-width: 54ch; text-wrap: pretty; }
  a { text-decoration: none; }
  :focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; }
  ::selection { background: var(--moss); color: var(--bg); }
  .skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 100; }
  .skip:focus { top: 1rem; }
}

@layer layout {
  .top {
    position: fixed; inset-inline: 0; top: 0; z-index: 20;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem var(--gutter); font-size: var(--step--1); font-weight: 400;
  }
  .brand { display: inline-flex; }
  .logo { height: 1.7rem; width: auto; display: block; }
  .nav { display: flex; gap: 1.8rem; }
  .nav a, .arrow-link { position: relative; }
  .nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: -.15rem; height: 1px; background: var(--moss); transform: scaleX(0); transform-origin: right; transition: transform .35s cubic-bezier(.7,0,.2,1); }
  .nav a:hover::after { transform: scaleX(1); transform-origin: left; }
  .burger { display: none; font-weight: 400; }
  .mobile-nav { position: fixed; inset: 0; z-index: 15; background: var(--bg); display: grid; align-content: center; gap: 1rem; padding: var(--gutter); font-family: var(--serif); font-size: var(--step-3); font-weight: 200; }
  .mobile-nav[hidden] { display: none; }

  /* Hero */
  .hero {
    min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; padding: 6rem var(--gutter) 0; position: relative; overflow: hidden;
  }
  .hero-kicker { font-size: var(--step--1); color: var(--mid); font-weight: 400; }
  .hero-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--gutter); align-items: end; align-self: center; padding-block: 3rem; }
  .hero h1 { max-width: 14ch; }
  .hero-side { display: grid; gap: 1.2rem; padding-bottom: .6rem; max-width: 30rem; }
  .wordmark { border-top: 1px solid var(--line); padding-block: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2.5rem); color: var(--ink); user-select: none; }
  .wordmark-svg { display: block; width: 100%; height: auto; }

  /* Horizontal scroll */
  .hscroll { height: 340vh; view-timeline-name: --h; }
  .hscroll-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; align-items: center; }
  .hscroll-track { display: flex; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; width: max-content; padding-inline: var(--gutter); will-change: transform; }
  .h-item { display: flex; flex-direction: column; gap: .6rem; flex: none; }
  .h-item img { object-fit: cover; width: 100%; flex: 1; min-height: 0; }
  .h-tall { width: min(34vw, 30rem); height: min(72svh, 44rem); }
  .h-wide { width: min(60vw, 56rem); height: min(56svh, 36rem); }
  .h-mid { width: min(42vw, 38rem); height: min(50svh, 30rem); }
  .h-item figcaption { font-size: var(--step--1); color: var(--mid); }
  .h-end { width: min(30vw, 24rem); justify-content: center; gap: 1.5rem; }
  .h-end p { font-family: var(--serif); font-size: var(--step-2); font-weight: 300; line-height: 1.15; }

  /* Fields */
  .fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); padding: var(--section) var(--gutter); border-top: 1px solid var(--line); }
  .field { display: grid; grid-template-rows: auto auto 1fr auto; gap: 1.2rem; align-content: start; }
  .field ul { display: grid; gap: .25rem; color: var(--mid); font-size: var(--step--1); font-weight: 400; }
  .field figure { margin-top: 1rem; }
  .field img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
  .field:nth-child(2) figure { padding-top: 3rem; }
  .field:nth-child(3) figure { padding-top: 6rem; }
  .field p { font-size: var(--step--1); color: var(--ink); }

  /* Studio */
  .studio { padding: var(--section) var(--gutter); border-top: 1px solid var(--line); display: grid; gap: clamp(3rem, 8vw, 7rem); }
  .statement { font-family: var(--serif); font-size: var(--step-3); font-weight: 200; line-height: 1.05; max-width: 22ch; letter-spacing: -0.015em; font-variation-settings: "opsz" 72; text-wrap: balance; }
  .studio-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gutter); }
  .studio-cols h2 { font-size: var(--step-1); margin-bottom: 1.2rem; font-family: var(--sans); font-weight: 400; letter-spacing: 0; }
  .steps { display: grid; gap: .8rem; }
  .steps li { display: grid; grid-template-columns: 2rem 1fr; gap: .5rem; align-items: baseline; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
  .steps span { font-family: var(--serif); font-size: var(--step-1); color: var(--moss); font-variation-settings: "opsz" 24; }
  .brands { font-family: var(--serif); font-size: var(--step-2); font-weight: 300; line-height: 1.2; max-width: 22ch; }
  .muted { color: var(--mid); margin-top: 1.5rem; font-weight: 400; font-size: var(--step--1); }

  /* Contact */
  .contact { padding: var(--section) var(--gutter); border-top: 1px solid var(--line); display: grid; gap: clamp(2rem, 6vw, 5rem); }
  .mail { font-family: var(--serif); font-size: clamp(2.4rem, 9vw, 9rem); font-weight: 200; letter-spacing: -0.03em; line-height: 1; justify-self: start; transition: color .3s; font-variation-settings: "opsz" 72; overflow-wrap: anywhere; }
  .mail:hover { color: var(--moss); }
  .contact-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); font-size: var(--step--1); font-weight: 400; }
  .contact-cols a:hover { color: var(--moss); }
  .contact-cols .arrow-link { margin-top: .6rem; display: inline-block; }

  .foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding: 1.5rem var(--gutter) 2rem; font-size: var(--step--1); color: var(--mid); border-top: 1px solid var(--line); }

  @media (max-width: 900px) {
    .nav { display: none; }
    .burger { display: block; }
    .hero { padding-top: 5rem; }
    .hero-grid { grid-template-columns: 1fr; }
    .hscroll { height: auto; }
    .hscroll-sticky { position: static; height: auto; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-block: 2rem; }
    .hscroll-sticky::-webkit-scrollbar { display: none; }
    .hscroll-track { transform: none !important; animation: none !important; }
    .h-item { scroll-snap-align: start; }
    .h-tall { width: 60vw; height: 24rem; }
    .h-wide { width: 84vw; height: 20rem; }
    .h-mid { width: 72vw; height: 18rem; }
    .h-end { width: 70vw; }
    .fields { grid-template-columns: 1fr; }
    .field:nth-child(2) figure, .field:nth-child(3) figure { padding-top: 0; }
    .studio-cols, .contact-cols { grid-template-columns: 1fr; }
  }
}

@layer components {
  .arrow-link { font-size: var(--step--1); font-weight: 400; color: var(--ink); border-bottom: 1px solid var(--stone); padding-bottom: .1rem; transition: border-color .3s; }
  .arrow-link:hover { border-color: var(--moss); }
}

@layer motion {
  .hero-kicker, .hero h1, .hero-side { --end: 0; }
  .wordmark { --end: 0; }
  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      .hscroll-track { animation: slide linear both; animation-timeline: --h; animation-range: contain 0% contain 100%; }
    }
    .hero-kicker, .hero h1, .hero-side { opacity: 0; translate: 0 .6rem; animation: up 1s cubic-bezier(.2,.7,.2,1) forwards; }
    .hero h1 { animation-delay: .1s; } .hero-side { animation-delay: .25s; }
    .wordmark { opacity: 0; translate: 0 12%; animation: up 1.4s .3s cubic-bezier(.2,.7,.2,1) forwards; }
  }
  @keyframes slide { to { transform: translateX(calc(-100% + 100vw)); } }
  @keyframes up { to { opacity: 1; translate: 0 var(--end); } }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  }
}
