:root {
  --paper: #f3f0e8;
  --paper-2: #e9e5da;
  --ink: #121212;
  --muted: #5d5a53;
  --line: rgba(18, 18, 18, 0.14);
  --accent: #ff4a1c;
  --dark: #0f0f0f;
  --on-dark: #efece4;
  --on-dark-muted: #a19d93;
  --line-dark: rgba(239, 236, 228, 0.16);

  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; }

/* ---------- Type ---------- */
.display {
  font-weight: 850;
  font-stretch: 112%;
  font-size: clamp(2.6rem, 7.2vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h2 {
  font-weight: 800;
  font-stretch: 108%;
  font-size: clamp(1.9rem, 3.8vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--muted); max-width: 40ch; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2fbf5b; box-shadow: 0 0 0 4px rgba(47, 191, 91, 0.18); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.8em 1.25em;
  border: 1.5px solid var(--b);
  border-radius: 999px;
  background: var(--b);
  color: var(--paper);
  font-weight: 650;
  font-size: 0.98rem;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn .arrow { width: 1em; height: 1em; transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-sm { padding: 0.6em 1em; font-size: 0.9rem; }
.btn-lg { padding: 1em 1.5em; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--b); }
.btn-ghost:hover { background: var(--b); color: var(--paper); }
.btn-accent { --b: var(--accent); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: block; color: var(--ink); }
.logo { height: 46px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
.nav a:not(.btn) { text-decoration: none; font-weight: 550; font-size: 0.95rem; position: relative; }
.nav a:not(.btn)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav a:not(.btn):hover::after { transform: scaleX(1); }
.menu-toggle { display: none; }

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex; font: inherit; font-weight: 600; font-size: 0.95rem;
    background: none; border: 1.5px solid var(--ink); color: var(--ink); border-radius: 999px; padding: 0.45em 1em; cursor: pointer;
  }
  .nav {
    position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .nav .btn { margin-top: 16px; justify-content: center; }
  .logo { height: 38px; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 10vw, 140px) 0 clamp(48px, 7vw, 96px); }
.hero .eyebrow { color: var(--ink); margin-bottom: clamp(20px, 3vw, 36px); }
.hero-title { max-width: 12ch; font-size: clamp(3rem, 9vw, 8.5rem); }
.hero-foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 32px; margin-top: clamp(32px, 5vw, 64px);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* Phones: tighter hero so the logo wall starts above the fold. */
@media (max-width: 600px) {
  .hero { padding: 28px 0 36px; }
  .hero .eyebrow { margin-bottom: 14px; }
  .hero-title { font-size: clamp(2.5rem, 12.5vw, 3.25rem); }
  .hero-foot { gap: 22px; margin-top: 18px; }
  .hero .lede { font-size: 1.05rem; }
  .hero .btn-lg { padding: 0.85em 1.25em; font-size: 1rem; }
}

/* ---------- Brands ---------- */
.brands { padding: 8px 0 clamp(16px, 3vw, 32px); }
.brands .eyebrow { margin-bottom: 18px; }
.logo-wall {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.logo-wall li {
  display: flex; align-items: center; justify-content: center;
  height: 108px; padding: 18px 22px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.logo-wall img {
  width: auto; height: auto;
  max-width: calc(132px * var(--s, 1)); max-height: calc(38px * var(--s, 1));
  filter: brightness(0); opacity: 0.82; transition: opacity 0.2s ease;
}
.logo-wall img.keep-color { filter: grayscale(1) contrast(1.15); }
.logo-wall li:hover img { opacity: 1; }
@media (max-width: 900px) { .logo-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .logo-wall li { height: 76px; padding: 12px 10px; }
  .logo-wall img { max-width: min(100%, calc(84px * var(--s, 1))); max-height: calc(24px * var(--s, 1)); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 140px) 0; }
.section-tight { padding: clamp(48px, 6vw, 88px) 0; }
.section-line { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 46rem; }

/* ---------- Work grid ---------- */
.grid-work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px) clamp(20px, 3vw, 40px); }
.card { display: block; text-decoration: none; }
.card-media { overflow: hidden; border-radius: var(--radius); background: var(--paper-2); aspect-ratio: 16 / 9; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.card:hover .card-media img { transform: scale(1.035); }
.card-body { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; padding-top: 18px; }
.card-num { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding-top: 0.45em; }
.card-title { font-weight: 800; font-stretch: 108%; font-size: clamp(1.35rem, 2vw, 1.7rem); letter-spacing: -0.02em; line-height: 1.1; }
.card:hover .card-title { color: var(--accent); }
.card-summary { color: var(--muted); font-size: 0.98rem; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 180px; }
.tags li {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.3em 0.75em; white-space: nowrap;
}
@media (max-width: 760px) {
  .grid-work { grid-template-columns: 1fr; }
  .card-body { grid-template-columns: auto 1fr; }
  .tags { grid-column: 2; justify-content: flex-start; max-width: none; }
}

/* ---------- Services / steps ---------- */
.services, .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.services li, .steps li { padding: 28px 28px 36px 0; border-bottom: 1px solid var(--line); }
.services li + li, .steps li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.services li:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
.num { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); display: block; margin-bottom: 28px; }
.services h3, .steps h3 { font-weight: 750; font-stretch: 106%; font-size: 1.3rem; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 10px; }
.services p, .steps p { color: var(--muted); font-size: 0.98rem; }
@media (max-width: 1000px) {
  .services, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services li, .steps li { padding-left: 0 !important; border-left: 0 !important; padding-right: 24px; }
  .services li:nth-child(even), .steps li:nth-child(even) { padding-left: 24px !important; border-left: 1px solid var(--line) !important; }
}
@media (max-width: 600px) {
  .services, .steps { grid-template-columns: 1fr; }
  .services li, .steps li,
  .services li:nth-child(even), .steps li:nth-child(even) { padding: 24px 0 28px !important; border-left: 0 !important; }
  .num { margin-bottom: 14px; }
}

/* ---------- Agencies (dark) ---------- */
.agencies { background: var(--dark); color: var(--on-dark); }
.agencies .eyebrow, .agencies .lede { color: var(--on-dark-muted); }
.agencies-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.agencies-inner > div { display: grid; gap: 22px; justify-items: start; }
.agency-points { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line-dark); }
.agency-points li { padding: 24px 20px 28px 0; border-bottom: 1px solid var(--line-dark); }
.agency-points li:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line-dark); }
.agency-points h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.agency-points p { color: var(--on-dark-muted); font-size: 0.95rem; }
@media (max-width: 900px) { .agencies-inner { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .agency-points { grid-template-columns: 1fr; }
  .agency-points li:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.about-photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--paper-2); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-copy { display: grid; gap: 18px; }
.about-copy p:not(.eyebrow) { max-width: 58ch; }
.facts { margin-top: 12px; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 9rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 550; }
.facts span { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-top: 0.3em; font-weight: 400; }
@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 420px; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Contact (dark) ---------- */
.contact { background: var(--dark); color: var(--on-dark); padding: clamp(80px, 12vw, 160px) 0; border-bottom: 1px solid var(--line-dark); }
.contact .eyebrow { color: var(--on-dark-muted); margin-bottom: 24px; }
.contact .lede { color: var(--on-dark-muted); margin-top: 28px; }
.contact .btn-ghost { --b: var(--on-dark); }
.contact .btn-ghost:hover { color: var(--dark); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.contact-phone { margin-top: 24px; color: var(--on-dark-muted); }
.contact-phone a { color: var(--on-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: var(--on-dark-muted); padding: 40px 0; font-size: 0.92rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.footer-badge { color: var(--on-dark); }
.badge { height: 52px; width: auto; display: block; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--on-dark); }

/* ---------- Project page ---------- */
.page-hero { padding: clamp(40px, 7vw, 96px) 0 clamp(32px, 5vw, 64px); }
.page-hero .eyebrow { margin-bottom: 18px; }
.page-hero .lede { margin-top: 24px; }
.page-hero .lede a { color: var(--ink); }
.back { display: inline-block; font-family: var(--mono); font-size: 0.8rem; text-decoration: none; color: var(--muted); margin-bottom: clamp(28px, 5vw, 56px); }
.back:hover { color: var(--ink); }
.project-title { max-width: 18ch; font-size: clamp(2.3rem, 5.6vw, 5rem); }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px 32px; margin-top: clamp(32px, 5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
.meta dt { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
.meta dd { font-weight: 600; }
.project-hero-img { border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.case { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 5vw, 72px) clamp(32px, 6vw, 96px); }
.case-block { display: grid; gap: 14px; align-content: start; }
.case-block:first-child { grid-column: 1 / -1; }
.case-block:first-child .lede { max-width: 52ch; color: var(--ink); font-size: clamp(1.25rem, 2.2vw, 1.75rem); line-height: 1.4; }
.case-block p { max-width: 58ch; }
.checklist li { position: relative; padding: 10px 0 10px 28px; border-bottom: 1px solid var(--line); }
.checklist li::before { content: ''; position: absolute; left: 2px; top: 1.05em; width: 12px; height: 2px; background: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(16px, 2vw, 28px); padding-bottom: clamp(48px, 6vw, 88px); }
.gallery figure { border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
@media (max-width: 760px) { .case { grid-template-columns: 1fr; } }

.next { border-top: 1px solid var(--line); }
.next-link { display: grid; gap: 10px; padding: clamp(40px, 6vw, 80px) 0; text-decoration: none; }
.next-name { display: inline-flex; align-items: center; gap: 0.3em; font-weight: 850; font-stretch: 112%; font-size: clamp(2.2rem, 6vw, 5rem); letter-spacing: -0.035em; line-height: 1; }
.next-name .arrow { width: 0.7em; height: 0.7em; transition: transform 0.25s ease; }
.next-link:hover .next-name { color: var(--accent); }
.next-link:hover .arrow { transform: translateX(8px); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- More work ---------- */
.archive { margin-top: clamp(56px, 7vw, 96px); }
.archive .eyebrow { margin-bottom: 16px; }
.archive-list { border-top: 1px solid var(--line); }
.archive-list a {
  display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr auto 1em; gap: 24px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.archive-name { font-weight: 750; font-stretch: 106%; font-size: 1.2rem; letter-spacing: -0.015em; }
.archive-summary { color: var(--muted); font-size: 0.98rem; }
.archive-platform { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.archive-list .arrow { width: 1em; height: 1em; transition: transform 0.2s ease; }
.archive-list a:hover .archive-name { color: var(--accent); }
.archive-list a:hover .arrow { transform: translateX(4px); }
@media (max-width: 700px) {
  .archive-list a { grid-template-columns: 1fr 1em; gap: 4px 16px; }
  .archive-summary, .archive-platform { grid-column: 1; }
  .archive-list .arrow { grid-column: 2; grid-row: 1; }
}
