/* Design tokens — extracted from Figma Make scaffold */
:root {
  --accent: #e8380d;
  --paper: #f7f4ef;
  --ink: #111010;
  --surface: #efece7;
  --border: #dedad4;
  --font-display: "Lora", Georgia, serif;
  --font-sans: "Manrope", system-ui, sans-serif;
  /* Type scale — one token per semantic role; map selectors below, not ad-hoc rems */
  /* Hero-locked: do not change .hero h1 / .hero-lead font-size values */
  --text-display: clamp(2.5rem, 5.6vw, 5.35rem);
  --text-h2: clamp(2.5rem, 6vw, 3.75rem);
  --text-contact-title: clamp(3rem, 8vw, 5.5rem); /* intentional: contact CTA, larger than section h2 */
  --text-h3: clamp(1.35rem, 2.4vw, 1.65rem);
  --text-h3-lg: clamp(2rem, 4vw, 2.75rem); /* work case titles only */
  --text-index: clamp(2rem, 4.5vw, 3rem);
  --text-stat: clamp(3.5rem, 7vw, 5rem);
  --text-pullquote: clamp(1.35rem, 3vw, 2.15rem);
  --text-contact-link: clamp(1.35rem, 3vw, 2rem);
  --text-mobile-nav: clamp(2.5rem, 8vw, 3.5rem);
  --text-lead: 1.05rem;
  --text-body: 1rem;
  --text-body-sm: 0.875rem;
  --text-card: 0.8125rem;
  --text-label: 0.625rem;
  --text-label-micro: 0.5625rem;
  --text-ui: 0.6875rem;
  --tracking-label: 0.16em;
  --tracking-ui: 0.12em;
  --tracking-nav: 0.02em;
  --lh-body: 1.6;
  --lh-lead: 1.5;
  --lh-display: 0.92;
  --ink-muted: color-mix(in srgb, var(--ink) 55%, transparent);
  --ink-subtle: color-mix(in srgb, var(--ink) 30%, transparent);
  --ink-faint: color-mix(in srgb, var(--ink) 45%, transparent);
  --paper-muted: color-mix(in srgb, var(--paper) 55%, transparent);
  --paper-subtle: color-mix(in srgb, var(--paper) 62%, transparent);
  --paper-faint: color-mix(in srgb, var(--paper) 50%, transparent);
  --pad: clamp(1.5rem, 4vw, 4rem);
  --max: 68rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
li,
blockquote,
dt,
dd,
.service,
.case,
.brand {
  cursor: default;
}

/* Atmosphere */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem var(--pad);
  background: transparent;
  transition: background 0.25s;
}

.nav.is-scrolled {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.logo {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  display: block;
}

.logo-bit {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: mark-curious 2.6s cubic-bezier(0.4, 0, 0.2, 1) 1 both;
}

@keyframes mark-curious {
  0%, 18% { transform: translate(0, 0); }
  28% { transform: translate(7%, 0); }
  40%, 50% { transform: translate(0, 0); }
  64%, 78% { transform: translate(3%, 6%); }
  92%, 100% { transform: translate(0, 0); }
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  font-size: var(--text-body-sm);
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--ink);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.25rem;
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 40%, transparent);
  border: 1px solid var(--border);
  padding: 0 0.85rem;
  transition: color 0.15s, border-color 0.15s;
}

.lang-toggle:hover,
.lang-toggle[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--ink);
}

.lang-toggle .sep {
  opacity: 0.35;
  margin: 0 0.2rem;
}

.lang-toggle [data-active="false"] {
  opacity: 0.35;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  font-family: var(--font-sans);
  font-size: var(--text-card);
  font-weight: 500;
  letter-spacing: var(--tracking-nav);
  text-transform: none;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.4rem;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn:hover {
  background: var(--accent);
  color: var(--paper);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-ghost {
  background: transparent;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  padding: 0.75rem 1rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ink) 28%, transparent);
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
}

.btn-ghost:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  text-decoration-color: var(--accent);
}

.btn-ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.nav-cta {
  display: none;
  min-height: 2.25rem;
  padding: 0 1.15rem;
}

.burger {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 1.35rem;
}

.burger::before {
  content: "";
  position: absolute;
  inset: -0.85rem -0.55rem;
}

.burger span {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
  transform-origin: center;
}

.burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--paper);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: var(--text-mobile-nav);
  transition: color 0.15s;
}

.mobile-menu a:hover {
  color: var(--accent);
}

@media (min-width: 768px) {
  .nav-links,
  .nav-cta {
    display: flex;
  }

  .burger {
    display: none;
  }
}

/* Landing = type on top, mark stage below */
.landing {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 6.25rem var(--pad) 1.25rem;
}

.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vh, 2.75rem);
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
}

.hero-noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  image-rendering: auto;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 68rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-display);
  line-height: var(--lh-display);
  letter-spacing: -0.045em;
}

/* The 0.92 line-height leaves no room under the baseline, so the rise mask
   would clip descenders. The padding drops the mask below them; the matching
   negative margin hands that space back so the leading stays at 0.92. */
.line {
  display: block;
  overflow: hidden;
  margin-bottom: -0.3em;
}

.line > span {
  display: block;
  padding-bottom: 0.3em;
  animation: rise 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.line:nth-child(2) > span {
  animation-delay: 0.1s;
}

.hero h1 em {
  font-style: italic;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}

.hero-lead {
  font-size: var(--text-lead);
  color: color-mix(in srgb, var(--ink) 48%, transparent);
  max-width: 38ch;
  margin: 1.25rem 0 1.5rem;
  line-height: 1.5;
  animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
}

.hero-lead span {
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.32s both;
}

.hero-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 16rem;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ink) 5%, var(--surface));
  border-radius: 1.25rem;
  overflow: hidden;
  /* The reel is promoted to its own compositing layer, which skips this
     rounded overflow clip unless the stage isolates. */
  isolation: isolate;
}

.hero-mark {
  width: min(48%, 18rem);
  height: auto;
  display: block;
}

.hero-reel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(110%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Sections */
.section {
  padding: 6rem var(--pad);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  letter-spacing: -0.02em;
}

.section-label,
.about-label {
  font-family: var(--font-sans);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-subtle);
  display: none;
}

@media (min-width: 768px) {
  .section-label,
  .about-label {
    display: block;
  }
}

/* Services — bento, one viewport on desktop */
#services.section {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(4rem, 8vh, 6rem);
}

#services .section-head {
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
}

.services {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .services {
    grid-template-columns: 1.25fr 1fr;
    grid-template-rows: repeat(3, auto);
    gap: 0.85rem;
    align-items: stretch;
  }

  .service-featured {
    grid-row: 1 / -1;
  }

  .service:not(.service-featured) {
    padding: 1rem 1.2rem;
    gap: 0.5rem;
  }
}

.service {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  background: var(--paper);
  min-height: auto;
  transition: border-color 0.2s, background 0.2s;
}

.service:hover {
  border-color: color-mix(in srgb, var(--ink) 35%, var(--border));
  background: color-mix(in srgb, var(--surface) 70%, var(--paper));
}

.service-featured {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  padding: 1.5rem 1.6rem;
  justify-content: space-between;
  min-height: 0;
}

.service-featured:hover {
  background: var(--ink);
  border-color: color-mix(in srgb, var(--paper) 28%, var(--ink));
}

.service-featured:hover .service-num {
  color: var(--accent);
}

.service-featured .service-num {
  color: color-mix(in srgb, var(--paper) 35%, transparent);
}

.service-featured h3 {
  color: var(--paper);
}

.service p {
  font-size: var(--text-body);
  color: var(--ink-muted);
  line-height: var(--lh-body);
}

.service-featured p {
  color: color-mix(in srgb, var(--paper) 62%, transparent);
  max-width: 28ch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

.service-featured .deliverables-label {
  color: color-mix(in srgb, var(--paper) 35%, transparent);
}

.service-featured .deliverables li {
  color: color-mix(in srgb, var(--paper) 72%, transparent);
}

.service-featured .deliverables li::before {
  background: var(--accent);
}

.service-num,
.process-step .num {
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  font-weight: 600;
  letter-spacing: var(--tracking-ui);
  color: var(--ink-subtle);
}

.service-num {
  transition: color 0.2s;
}

.process-step .num {
  margin-bottom: 1.5rem;
}

.service h3,
.process-step h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h3);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.deliverables-label {
  font-family: var(--font-sans);
  font-size: var(--text-label-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0.35rem 0 0.45rem;
}

.deliverables {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.deliverables li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-card);
  color: color-mix(in srgb, var(--ink) 65%, transparent);
}

.deliverables li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 899px) {
  #services.section {
    min-height: 0;
  }

  .service-featured {
    min-height: 16rem;
  }
}

/* Work */
.work {
  background: var(--ink);
  color: var(--paper);
}

.work .section-head h2 {
  color: var(--paper);
}

.work .section-label {
  color: color-mix(in srgb, var(--paper) 35%, transparent);
}

.work-lead {
  max-width: 28rem;
  margin: -1.5rem 0 3.5rem;
  font-size: var(--text-lead);
  color: var(--paper-muted);
  line-height: var(--lh-lead);
}

.case {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 6rem;
  padding-bottom: 6rem;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 12%, transparent);
}

.case:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

@media (min-width: 960px) {
  .case {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3.5rem;
    align-items: center;
  }

  .case:nth-child(even) .case-media {
    order: 2;
  }
}

.case-media {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper) 8%, transparent);
}

.case-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    transparent 40%,
    color-mix(in srgb, var(--accent) 28%, transparent) 100%
  );
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.case-media:hover::after {
  opacity: 1;
}

.case-index {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  font-family: var(--font-display);
  font-size: var(--text-index);
  font-weight: 500;
  line-height: 1;
  color: var(--paper);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.case-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease, filter 0.45s ease;
  filter: saturate(0.92) contrast(1.05);
}

.case-media:hover img {
  transform: scale(1.04);
  filter: saturate(1.05) contrast(1.08);
}

.case-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}

.case-tags span {
  font-family: var(--font-sans);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
  color: var(--paper-muted);
  border: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
  padding: 0.3rem 0.7rem;
}

.case h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h3-lg);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--paper);
}

.case p {
  font-size: var(--text-body);
  color: var(--paper-subtle);
  line-height: var(--lh-body);
  margin-bottom: 1.75rem;
  max-width: 36ch;
}

.case-stat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-top: 1px solid color-mix(in srgb, var(--paper) 14%, transparent);
  padding-top: 1.5rem;
  margin-top: auto;
}

.case-stat strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-stat);
  color: var(--accent);
  line-height: 0.9;
}

.case-stat span {
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  font-weight: 600;
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
  color: var(--paper-faint);
  max-width: 11rem;
  line-height: 1.4;
}

/* Process */
.process-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

@media (min-width: 640px) {
  .process-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .process-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.process-step {
  background: var(--paper);
  padding: 1.75rem;
}

.process-step h3 {
  margin-bottom: 0.65rem;
}

.process-step p {
  font-size: var(--text-body-sm);
  color: var(--ink-muted);
  line-height: var(--lh-body);
}

.about {
  margin-top: 5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .about {
    grid-template-columns: 12rem 1fr;
    gap: 3.5rem;
  }
}

.about blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-pullquote);
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

.about-copy p {
  font-size: var(--text-body-sm);
  color: var(--ink-muted);
  line-height: var(--lh-body);
  max-width: 36rem;
  margin-bottom: 0.75rem;
}

/* Contact */
.contact {
  background: var(--ink);
  color: var(--paper);
  padding: 6rem var(--pad);
}

.contact-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .contact-inner {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
  }
}

.contact h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-contact-title);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.contact-copy {
  font-size: var(--text-lead);
  color: var(--paper-faint);
  margin-bottom: 1.75rem;
  max-width: 28ch;
  line-height: var(--lh-body);
}

.contact-mail {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-contact-link);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.contact-mail:hover,
.contact-mail:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.contact-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--paper) 10%, transparent);
}

.contact-meta dt {
  font-family: var(--font-sans);
  font-size: var(--text-label-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 25%, transparent);
  margin-bottom: 0.35rem;
}

.contact-meta dd {
  font-size: var(--text-card);
  color: var(--paper-muted);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem var(--pad);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.footer-mark {
  width: 4.5rem;
  height: 4.5rem;
  display: block;
}

.footer-word {
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  color: var(--ink);
  line-height: 1;
}

.footer-word span {
  color: var(--accent);
}

.footer-copy,
.footer a {
  font-family: var(--font-sans);
  font-size: var(--text-label);
  color: color-mix(in srgb, var(--ink) 28%, transparent);
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

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

  .hero-reel {
    display: none;
  }
}
