/* ============ Tokens ============ */
:root {
  --paper: #f3f0e8;
  --paper-2: #e9e5d9;
  --card: #fbfaf6;
  --ink: #0e0e0c;
  --ink-2: #33332e;
  --muted: #6b6a61;
  --line: rgba(14, 14, 12, 0.12);
  --fresh: #c8f53c;
  --fresh-ink: #1a2400;
  --dark: #0e0e0c;
  --dark-2: #1a1a17;
  --dark-line: rgba(243, 240, 232, 0.12);
  --dark-muted: #a3a197;

  --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; }
p { margin: 0; }
::selection { background: var(--fresh); color: var(--fresh-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.9em 1.4em;
  border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: transform 0.3s var(--ease), background 0.2s, color 0.2s;
}
.btn span { transition: transform 0.3s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover span { transform: translateX(3px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--small { padding: 0.6em 1.1em; font-size: 0.9rem; }
.btn--fresh { background: var(--fresh); color: var(--fresh-ink); border-color: var(--fresh); }
.btn--big { font-size: 1.15rem; padding: 1.05em 1.8em; }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, 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.3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.nav__links { display: flex; gap: 32px; }
.nav__links a { text-decoration: none; font-size: 0.95rem; color: var(--ink-2); position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em;
  text-decoration: none;
}
.brand__mark {
  width: 14px; height: 14px; border-radius: 4px;
  background: var(--fresh); box-shadow: inset 0 0 0 2px var(--ink);
  transform: rotate(45deg);
}
.brand--light { color: var(--paper); }
.brand--light .brand__mark { box-shadow: none; }

/* ============ Hero ============ */
.hero { padding: clamp(48px, 9vw, 120px) 0 clamp(56px, 8vw, 104px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-2);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3dbb4c; position: relative; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #3dbb4c;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse { to { transform: scale(3); opacity: 0; } }

.hero__title {
  margin: clamp(24px, 4vw, 40px) 0 clamp(32px, 5vw, 56px);
  font-size: clamp(3rem, 11vw, 10rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }

/* The old-to-new "websites" swap */
.swap { position: relative; display: inline-grid; vertical-align: top; cursor: default; }
.swap > span { grid-area: 1 / 1; }
.swap__old {
  font-family: "Times New Roman", Times, serif;
  font-weight: 400; letter-spacing: 0; text-transform: none;
  color: #0000ee; text-decoration: underline; text-decoration-thickness: 0.05em; text-underline-offset: 0.08em;
  clip-path: inset(0 0 0 0);
}
.swap__new { clip-path: inset(0 100% 0 0); }
.swap__bar {
  position: absolute; top: 4%; bottom: 4%; left: 0; width: 0.08em;
  background: var(--fresh); box-shadow: 0 0 24px var(--fresh);
  border-radius: 99px; opacity: 0; pointer-events: none;
}
.swap.is-new .swap__old { clip-path: inset(0 0 0 100%); transition: clip-path 0.9s var(--ease); }
.swap.is-new .swap__new { clip-path: inset(0 0 0 0); transition: clip-path 0.9s var(--ease); }
.swap.is-new .swap__bar { animation: sweep 0.9s var(--ease) forwards; }
@keyframes sweep {
  0% { left: 0; opacity: 1; }
  85% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.hl {
  background: linear-gradient(transparent 12%, var(--fresh) 12%, var(--fresh) 92%, transparent 92%);
  color: inherit; padding: 0 0.06em; margin: 0 -0.02em;
  background-size: 0% 100%; background-repeat: no-repeat;
  transition: background-size 0.9s var(--ease) 0.6s;
}
.is-ready .hero .hl, .contact .is-in .hl { background-size: 100% 100%; }

.hero__foot {
  display: grid; grid-template-columns: minmax(0, 1.3fr) auto; gap: 32px 64px; align-items: end;
  padding-top: clamp(24px, 3vw, 36px); border-top: 1px solid var(--line);
}
.hero__lede { max-width: 56ch; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--ink-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ============ Ticker ============ */
.ticker {
  background: var(--ink); color: var(--paper);
  overflow: hidden; padding: 18px 0;
  transform: rotate(-1.2deg); margin: 0 -2%;
}
.ticker__track {
  display: flex; gap: 28px; width: max-content; align-items: center;
  animation: ticker 36s linear infinite;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.1rem, 2vw, 1.6rem);
  letter-spacing: -0.01em; white-space: nowrap;
}
.ticker__track i { font-style: normal; color: var(--fresh); font-size: 0.8em; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ============ Sections ============ */
.section { padding: clamp(80px, 11vw, 150px) 0; }
.section--dark { background: var(--dark); color: var(--paper); }
.section--tint { background: var(--paper-2); }
.section__head { margin-bottom: clamp(40px, 6vw, 72px); max-width: 900px; }
.section__sub { margin-top: 20px; max-width: 54ch; font-size: 1.1rem; color: var(--dark-muted); }

.label {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
.label--light { color: var(--dark-muted); }
.h2 { font-size: clamp(2.2rem, 5.6vw, 4.6rem); line-height: 0.98; }
.br-lg { display: inline; }

/* ============ Work ============ */
.group + .group { margin-top: clamp(56px, 8vw, 96px); }
.group__label { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.group__note { font-size: 0.95rem; color: var(--muted); }
.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--fresh); color: var(--fresh-ink); border: 1.5px solid var(--ink);
}
.chip--alt { background: var(--ink); color: var(--paper); }

.grid-work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px); }

.frame {
  display: block; overflow: hidden; border-radius: var(--radius); text-decoration: none;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 20px 40px -24px rgba(14,14,12,0.35);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.frame__bar {
  display: flex; align-items: center; gap: 6px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.frame__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.frame__bar span {
  margin-left: 10px; flex: 1; max-width: 260px;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
  padding: 3px 12px; border-radius: 6px; background: var(--paper);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.frame--dark, .frame--dark .frame__bar { background: #15151a; border-color: rgba(255,255,255,0.08); }
.frame--dark .frame__bar i { background: #2a2a31; box-shadow: none; }
.frame--dark .frame__bar span { background: #0c0c10; color: #8b8b95; }
.frame img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform 0.8s var(--ease); }
.frame:hover { transform: translateY(-6px); box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 36px 60px -28px rgba(14,14,12,0.45); }
.frame:hover img { transform: scale(1.03); }

.project__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 22px; }
.project h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.1; }
.project__type { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); margin-top: 6px; letter-spacing: 0.02em; }
.project__desc { margin-top: 14px; color: var(--ink-2); max-width: 52ch; }
.visit {
  flex-shrink: 0; text-decoration: none; font-weight: 600; font-size: 0.9rem;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--ink);
  transition: background 0.2s, color 0.2s;
}
.visit:hover { background: var(--ink); color: var(--paper); }

/* ============ Versus ============ */
.versus { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.versus__col { border-radius: var(--radius); padding: clamp(28px, 4vw, 48px); }
.versus__col--old { border: 1px dashed var(--dark-line); color: var(--dark-muted); }
.versus__col--new { background: var(--fresh); color: var(--fresh-ink); }
.versus__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 3.2vw, 2.6rem); letter-spacing: -0.03em; margin-bottom: 20px; }
.versus__col--old .versus__title {
  font-family: "Times New Roman", Times, serif; font-weight: 400; letter-spacing: 0;
  color: #8f8dff; text-decoration: underline; text-decoration-thickness: 1px;
}
.versus ul { list-style: none; margin: 0; padding: 0; }
.versus li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 20%, transparent); font-size: 1.05rem; }
.versus li::before { flex-shrink: 0; font-family: var(--font-mono); font-weight: 500; }
.versus__col--old li::before { content: "×"; }
.versus__col--new li::before { content: "✓"; }
.versus__col--new li { font-weight: 500; }

/* ============ Services ============ */
.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); }
.service { padding: 32px 28px 8px 0; }
.service + .service { padding-left: 28px; border-left: 1px solid var(--line); }
.service__num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }
.service h3 { font-size: 1.6rem; line-height: 1.1; margin: 48px 0 14px; }
.service p { color: var(--ink-2); font-size: 1rem; }

/* ============ Process ============ */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform 0.4s var(--ease), border-color 0.3s;
}
.step:hover { transform: translateY(-4px); border-color: var(--ink); }
.step__num {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink); color: var(--fresh);
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
}
.step h3 { font-size: 1.4rem; margin: 40px 0 10px; line-height: 1.1; }
.step p { color: var(--ink-2); font-size: 1rem; }

/* ============ Contact ============ */
.contact { background: var(--dark); color: var(--paper); padding: clamp(96px, 14vw, 180px) 0; text-align: center; overflow: hidden; }
.contact .label { margin-bottom: 28px; }
.contact__title { font-size: clamp(3rem, 10vw, 8.5rem); line-height: 0.92; letter-spacing: -0.045em; text-transform: uppercase; }
.contact .hl { color: var(--fresh-ink); padding: 0 0.12em 0 0.06em; }
.contact__sub { max-width: 52ch; margin: 32px auto 0; color: var(--dark-muted); font-size: 1.1rem; }
.contact__cta { margin-top: 44px; }

/* ============ Footer ============ */
.footer { background: var(--dark); color: var(--dark-muted); border-top: 1px solid var(--dark-line); padding: 32px 0; font-size: 0.9rem; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 24px; }
.footer__links a { text-decoration: none; }
.footer__links a:hover, .footer__links a[aria-current] { color: var(--paper); }

/* ============ Legal pages ============ */
.legal { padding: clamp(56px, 8vw, 104px) 0 clamp(80px, 10vw, 140px); }
.legal__wrap { max-width: 820px; }
.legal__title { font-size: clamp(2.8rem, 8vw, 5.5rem); line-height: 0.95; letter-spacing: -0.045em; }
.legal__updated { margin-top: 16px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }
.legal__short {
  margin: 40px 0 16px; padding: clamp(24px, 4vw, 36px);
  background: var(--fresh); color: var(--fresh-ink); border-radius: var(--radius);
}
.legal__short-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; margin-bottom: 12px; }
.legal__short ul { margin: 0; padding-left: 1.2em; }
.legal__short li { margin: 6px 0; font-weight: 500; }
.legal section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.legal h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.1; margin-bottom: 16px; }
.legal h3 { font-size: 1.2rem; letter-spacing: -0.02em; margin: 28px 0 8px; }
.legal section p, .legal section li { color: var(--ink-2); }
.legal section p + p { margin-top: 14px; }
.legal section ul { padding-left: 1.2em; margin: 14px 0; }
.legal section li { margin: 8px 0; }
.legal section a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal section a:hover { background: var(--fresh); }
.legal__table { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.legal table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 14px 18px; }
.legal th { font-family: var(--font-mono); font-weight: 500; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); border-bottom: 1.5px solid var(--ink); }
.legal td { border-top: 1px solid var(--line); color: var(--ink-2); }
.legal tbody tr:first-child td { border-top: 0; }
.legal td:first-child { font-weight: 600; color: var(--ink); }
@media (max-width: 560px) {
  .legal table { min-width: 0; }
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .legal tr, .legal td { display: block; }
  .legal tr { padding: 16px 18px; border-top: 1px solid var(--line); }
  .legal tbody tr:first-child { border-top: 0; }
  .legal td { padding: 0; border: 0; }
  .legal td + td { margin-top: 10px; }
  .legal td:first-child { font-size: 1.05rem; }
  .legal td + td::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  }
}

/* ============ Reveal on scroll ============ */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
/* Hero content is above the fold: show it on load, not on scroll */
.js.is-ready .hero .reveal { opacity: 1; transform: none; }
.hero__foot .reveal { transition-delay: 0.35s; }
.hero__foot .hero__cta { transition-delay: 0.45s; }
.js:not(.is-ready) .hero__title .line { opacity: 0; transform: translateY(40%); }
.hero__title .line { transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.hero__title .line:nth-child(2) { transition-delay: 0.08s; }
.hero__title .line:nth-child(3) { transition-delay: 0.16s; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service:nth-child(3) { padding-left: 0; border-left: 0; }
  .service:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 24px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .nav__links { display: none; }
  .hero__foot { grid-template-columns: 1fr; }
  .grid-work, .versus { grid-template-columns: 1fr; }
  .br-lg { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero__title { font-size: clamp(2.6rem, 14vw, 4rem); }
  .services, .steps { grid-template-columns: 1fr; }
  .service, .service + .service { padding: 28px 0 4px; border-left: 0; }
  .service + .service { border-top: 1px solid var(--line); margin-top: 20px; }
  .service h3, .step h3 { margin-top: 24px; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .project__meta { flex-direction: column; }
  .frame__bar span { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js:not(.is-ready) .hero__title .line { opacity: 1; transform: none; }
  .hl { background-size: 100% 100%; }
}
