/* Digital Edge - digitaliedge.com
   Type: Cabinet Grotesk (Fontshare, self-hosted) + JetBrains Mono (OFL).
   Shape rule: media 16px, everything interactive or label-like is a full pill, full-bleed photos are square. */

@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --paper: #f0efea;
  --paper-2: #e4e3dd;
  --ink: #111110;
  --ink-2: #33322e;
  --muted: #66655f;
  --line: rgba(17, 17, 16, 0.13);
  --line-strong: rgba(17, 17, 16, 0.28);
  --edge: #ff4a1c;
  --edge-hover: #ff6a42;
  --on-edge: #111110;
  --night: #0c0c0b;
  --on-night: #eeede8;
  --on-night-muted: rgba(238, 237, 232, 0.72);
  --maxw: 1440px;
  --gutter: clamp(16px, 4vw, 56px);
  --r-media: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Cabinet Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f0f0e;
    --paper-2: #1b1b19;
    --ink: #edebe6;
    --ink-2: #cfcdc6;
    --muted: #9d9b94;
    --line: rgba(237, 235, 230, 0.14);
    --line-strong: rgba(237, 235, 230, 0.3);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--edge); color: var(--on-edge); }
:focus-visible { outline: 2px solid var(--edge); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  background: var(--edge); color: var(--on-edge); padding: 10px 16px; border-radius: 999px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

section[id], header[id] { scroll-margin-top: 72px; }

/* Buttons and links ------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--edge); color: var(--on-edge);
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { background: var(--edge-hover); }
.btn:active { transform: scale(0.97); }
.btn-sm { height: 42px; padding: 0 18px; font-size: 0.9375rem; }

.text-link {
  display: inline-flex; gap: 8px; align-items: center;
  font-weight: 500; text-decoration: none; padding: 12px 2px;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - 8px) / 100% 1px;
  transition: background-size 0.35s var(--ease);
}
.text-link:hover { background-size: 0% 1px; background-position-x: 100%; }

/* Scroll edge: a thin lit line down the right side, like the rim of a phone */

.edge-progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 761px) {
    .edge-progress {
      display: block; position: fixed; top: 0; right: 0; z-index: 70;
      width: 3px; height: 100vh; background: var(--edge);
      transform-origin: top; transform: scaleY(0);
      animation: edge-grow linear both; animation-timeline: scroll(root);
      pointer-events: none;
    }
  }
}
@keyframes edge-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Nav --------------------------------------------------------------------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding-inline: var(--gutter);
  color: var(--on-night);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.nav.is-solid {
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}
.nav-logo { display: block; padding: 8px 0; }
.nav-logo svg { display: block; height: 28px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; font-weight: 500; font-size: 1rem; }
.nav-links a:not(.btn) { text-decoration: none; opacity: 0.86; transition: opacity 0.2s; }
.nav-links a:not(.btn):hover { opacity: 1; }

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  background: var(--night); color: var(--on-night);
}
.hero-media img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 8, 7, 0.6) 0%, rgba(8, 8, 7, 0) 150px),
    linear-gradient(90deg, rgba(8, 8, 7, 0.7) 0%, rgba(8, 8, 7, 0.35) 40%, rgba(8, 8, 7, 0) 64%),
    linear-gradient(0deg, rgba(8, 8, 7, 0.72) 0%, rgba(8, 8, 7, 0) 48%);
}
.hero-copy { padding-top: 140px; padding-bottom: clamp(40px, 8vh, 96px); }
.hero-title {
  margin: 0 0 0.32em;
  font-weight: 800; font-size: clamp(3rem, 6vw, 7rem);
  line-height: 0.9; letter-spacing: -0.045em;
  max-width: 10.6em;
}
.hero-sub {
  margin: 0; max-width: 33ch;
  font-size: clamp(1.0625rem, 1.3vw, 1.375rem); line-height: 1.42;
  color: var(--on-night-muted);
}
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; margin-top: clamp(24px, 3vw, 36px); }

@media (prefers-reduced-motion: no-preference) {
  .hero-media img { animation: hero-settle 2.6s var(--ease) both; }
  .hero-title, .hero-sub, .hero-actions { animation: rise 1.1s var(--ease) both; }
  .hero-title { animation-delay: 0.15s; }
  .hero-sub { animation-delay: 0.3s; }
  .hero-actions { animation-delay: 0.42s; }
}
@keyframes hero-settle { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* Statement --------------------------------------------------------------- */

.statement { padding-block: clamp(96px, 13vw, 210px); }
.statement-text {
  margin: 0; max-width: 19.5em;
  font-weight: 700; font-size: clamp(2rem, 4.3vw, 4.6rem);
  line-height: 1.04; letter-spacing: -0.035em;
  text-wrap: pretty;
}
.statement mark {
  color: inherit; padding: 0 0.02em;
  background: linear-gradient(var(--edge), var(--edge)) no-repeat 0 90% / 100% 0.11em;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .statement mark {
      animation: mark-draw linear both;
      animation-timeline: view();
      animation-range: entry 70% cover 42%;
    }
  }
}
@keyframes mark-draw { from { background-size: 0% 0.11em; } to { background-size: 100% 0.11em; } }

/* Section titles ---------------------------------------------------------- */

.h2 {
  margin: 0;
  font-weight: 800; font-size: clamp(2.25rem, 4.8vw, 4.9rem);
  line-height: 0.95; letter-spacing: -0.042em;
}

/* A day on the home screen ------------------------------------------------ */

.day { padding-bottom: clamp(100px, 12vw, 190px); }
.day-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(28px, 3.6vw, 52px); }
.day-controls { display: flex; gap: 10px; flex: none; }
.arrow {
  width: 54px; height: 54px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font: 500 1.25rem/1 var(--mono); cursor: pointer;
  transition: background-color 0.2s, color 0.2s, opacity 0.2s, transform 0.2s var(--ease);
}
.arrow:hover { background: var(--ink); color: var(--paper); }
.arrow:active { transform: scale(0.95); }
.arrow:disabled { opacity: 0.22; pointer-events: none; }

.strip {
  --pad: max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter)));
  list-style: none; margin: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(260px, 27vw, 430px);
  gap: clamp(12px, 1.4vw, 20px);
  padding: 0 var(--pad) 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad);
  scrollbar-width: none; cursor: grab;
}
.strip::-webkit-scrollbar { display: none; }
.strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.strip.is-dragging .moment-img img { transform: none; }
.moment { scroll-snap-align: start; }
.moment figure { margin: 0; }
.moment-img { aspect-ratio: 4 / 5; border-radius: var(--r-media); overflow: hidden; background: var(--paper-2); }
.moment-img img {
  width: 100%; height: 100%; object-fit: cover;
  user-select: none; -webkit-user-drag: none;
  transition: transform 0.9s var(--ease);
}
@media (hover: hover) { .moment:hover .moment-img img { transform: scale(1.035); } }
.moment figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 16px; }
.time { font: 500 0.8125rem/1 var(--mono); letter-spacing: 0.02em; color: var(--muted); }
.now-tag {
  display: none;
  font: 500 0.6875rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--edge); color: var(--on-edge); padding: 5px 8px 4px; border-radius: 999px;
}
.moment.is-now .now-tag { display: inline-block; }
.moment.is-now .time { color: var(--ink); }
.cap { flex-basis: 100%; font-weight: 500; font-size: 1.125rem; line-height: 1.3; }

/* How we work ------------------------------------------------------------- */

.work { padding-bottom: clamp(110px, 13vw, 200px); }
.work-title { max-width: 11em; margin-bottom: clamp(40px, 6vw, 96px); }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 112px); align-items: start; }
.work-frame {
  position: sticky; top: 96px;
  height: min(calc(100svh - 136px), 780px);
  border-radius: var(--r-media); overflow: hidden; background: var(--paper-2);
}
.work-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.05);
  transition: opacity 0.7s var(--ease), transform 1.4s var(--ease);
}
.work-frame img.is-active { opacity: 1; transform: none; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { min-height: min(78svh, 760px); display: flex; flex-direction: column; justify-content: center; padding-block: 6vh; }
.js .step { opacity: 0.3; transition: opacity 0.5s var(--ease); }
.js .step.is-active { opacity: 1; }
.step-img { display: none; }
.step-name {
  margin: 0 0 0.22em;
  font-weight: 800; font-size: clamp(3.25rem, 7.4vw, 7.5rem);
  line-height: 0.88; letter-spacing: -0.055em;
}
.step p { margin: 0 0 26px; max-width: 31ch; font-size: clamp(1.125rem, 1.45vw, 1.5rem); line-height: 1.38; color: var(--ink-2); }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: 34em; }
.step-list li {
  font: 500 0.8125rem/1 var(--mono); letter-spacing: 0.01em;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 10px 13px 9px;
}

/* Contact ----------------------------------------------------------------- */

.contact {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 92vh; min-height: 92svh;
  display: flex; background: var(--night); color: var(--on-night);
}
.contact-media { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.contact::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 8, 7, 0.5) 0%, rgba(8, 8, 7, 0) 34%, rgba(8, 8, 7, 0) 62%, rgba(8, 8, 7, 0.6) 100%);
}
.contact-copy { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding-block: clamp(80px, 10vw, 150px); }
.contact-title {
  margin: 0; max-width: 9em;
  font-weight: 800; font-size: clamp(2.6rem, 6.2vw, 6.5rem);
  line-height: 0.9; letter-spacing: -0.045em;
}
.contact-end { display: flex; flex-direction: column; align-items: flex-start; }
.contact-mail {
  font-weight: 800; font-size: clamp(1.75rem, 5.6vw, 6rem);
  line-height: 1.02; letter-spacing: -0.04em;
  color: var(--on-night); text-decoration: none; overflow-wrap: anywhere;
  padding-bottom: 0.06em;
  background: linear-gradient(var(--edge), var(--edge)) no-repeat 0 100% / 0% 0.07em;
  transition: background-size 0.55s var(--ease);
}
.contact-mail:hover, .contact-mail:focus-visible { background-size: 100% 0.07em; }
.contact-note { margin: 18px 0 0; font: 400 0.875rem/1.5 var(--mono); color: var(--on-night-muted); }

/* Footer ------------------------------------------------------------------ */

.footer { padding-top: clamp(56px, 8vw, 120px); padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.footer-mark { display: block; color: var(--ink); }
.footer-mark svg { display: block; width: 100%; height: auto; }
.footer-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 32px;
  margin-top: clamp(28px, 3.4vw, 48px); padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 0.9375rem; color: var(--muted);
}
.footer-row p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Mobile tab bar: thumb-reach nav, iOS style ------------------------------ */

.tabbar { display: none; }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 960px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .work-frame { display: none; }
  .step { min-height: 0; padding-block: 0 72px; }
  .step:last-child { padding-bottom: 0; }
  .js .step { opacity: 1; }
  .step-img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-media); margin-bottom: 26px; background: var(--paper-2); }
}

@media (max-width: 760px) {
  .nav { height: 60px; }
  .nav-logo svg { height: 24px; }
  .nav-links { display: none; }

  .hero-media img { object-position: 50% 30%; }
  .hero::after {
    background:
      linear-gradient(180deg, rgba(8, 8, 7, 0.55) 0%, rgba(8, 8, 7, 0) 120px),
      linear-gradient(0deg, rgba(8, 8, 7, 0.86) 0%, rgba(8, 8, 7, 0.55) 34%, rgba(8, 8, 7, 0) 58%);
  }
  .hero-copy { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .hero-title { font-size: clamp(2.75rem, 12.4vw, 4rem); }

  .day-controls { display: none; }
  .strip { grid-auto-columns: 78vw; }

  .contact { min-height: 86svh; }
  .contact-media { object-position: 78% 50%; }

  .footer { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
  .footer-row { flex-direction: column; }

  .tabbar {
    position: fixed; z-index: 60;
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
    height: 60px; padding: 0 8px 0 20px; border-radius: 999px;
    background: rgba(20, 20, 19, 0.74);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(8, 8, 7, 0.28);
    color: var(--on-night);
  }
  .tabbar a:not(.btn) { text-decoration: none; font-weight: 500; font-size: 0.9375rem; padding: 12px 6px; }
  .tabbar .btn { height: 44px; }
  .js .tabbar { transform: translateY(160%); transition: transform 0.5s var(--ease); }
  .js .tabbar.is-on { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .tabbar { background: #141413; }
  .nav.is-solid { background: var(--paper); }
}

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