:root {
  --cream: #faf7f1;
  --ink: #16140f;
  --ink-soft: #4d483d;
  --line: #e3ddd0;
  --accent: #1f4fd8;
  --card: #ffffff;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
nav .logo { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
nav ul { display: flex; gap: 28px; list-style: none; }
nav a { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; }
nav a:hover { color: var(--accent); }

/* Hero */
header.hero { padding: 96px 0 72px; }
.kicker {
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6.5vw, 72px);
  font-weight: 560;
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 900px;
}
.hero p.lede {
  margin-top: 28px; max-width: 640px;
  font-size: 20px; line-height: 1.6; color: var(--ink-soft);
}
.hero .meta { margin-top: 32px; font-size: 14px; color: var(--ink-soft); }
.hero .meta span + span::before { content: "·"; margin: 0 10px; color: var(--line); }

/* Metrics band */
.metrics {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 40px 0;
}
.metrics .wrap {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
}
.metric .num {
  font-family: var(--serif); font-size: 34px; font-weight: 600; letter-spacing: -0.02em;
}
.metric .lbl { font-size: 13.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.45; }

/* Sections */
section { padding: 88px 0; }
.section-head { margin-bottom: 48px; }
.section-head h2 {
  font-family: var(--serif); font-size: 36px; font-weight: 560; letter-spacing: -0.015em;
}
.section-head p { color: var(--ink-soft); margin-top: 10px; max-width: 620px; }

/* Case studies */
.case { border-top: 1px solid var(--line); padding: 64px 0; }
.case-grid { display: grid; grid-template-columns: 380px 1fr; gap: 56px; align-items: start; }
.case h3 { font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.case .tags { margin: 14px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.case .tags span {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 99px; padding: 4px 12px; color: var(--ink-soft);
}
.case p { color: var(--ink-soft); font-size: 16px; }
.case p + p { margin-top: 12px; }
.case .role { margin-top: 18px; font-size: 14px; }
.case .role b { font-weight: 600; color: var(--ink); }

.shots { display: grid; gap: 16px; }
.shots img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.shots.phones { grid-template-columns: repeat(3, 1fr); }
.shots .caption { font-size: 13px; color: var(--ink-soft); margin-top: -6px; }

/* Brand section */
.brand-card {
  background: var(--ink); color: var(--cream);
  border-radius: 16px; padding: 56px;
}
.brand-card h3 { font-family: var(--serif); font-size: 30px; font-weight: 560; }
.brand-card p { margin-top: 16px; max-width: 680px; color: #cfc9bc; }
.brand-card ul { margin: 28px 0 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; }
.brand-card li { font-size: 15.5px; color: #efeadf; padding-left: 20px; position: relative; }
.brand-card li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.brand-card a { color: #fff; }

/* Experience */
.xp-row {
  display: grid; grid-template-columns: 160px 1fr; gap: 24px;
  padding: 20px 0; border-top: 1px solid var(--line); font-size: 15.5px;
}
.xp-row .yrs { color: var(--ink-soft); font-size: 14px; padding-top: 2px; }
.xp-row b { font-weight: 600; }
.xp-row .co { color: var(--ink-soft); }

/* Contact */
.contact { text-align: center; padding: 110px 0 130px; }
.contact h2 { font-family: var(--serif); font-size: clamp(32px, 5vw, 52px); font-weight: 560; letter-spacing: -0.02em; }
.contact p { color: var(--ink-soft); margin-top: 16px; }
.contact .btn {
  display: inline-block; margin-top: 32px;
  background: var(--ink); color: var(--cream);
  padding: 14px 32px; border-radius: 99px;
  text-decoration: none; font-weight: 600; font-size: 15px;
}
.contact .btn:hover { background: var(--accent); }
.contact .links { margin-top: 26px; font-size: 14.5px; }
.contact .links a { color: var(--ink-soft); text-decoration: none; margin: 0 12px; }
.contact .links a:hover { color: var(--accent); }

footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--ink-soft); }
footer .wrap { display: flex; justify-content: space-between; }

@media (max-width: 860px) {
  .metrics .wrap { grid-template-columns: 1fr 1fr; }
  .case-grid { grid-template-columns: 1fr; gap: 32px; }
  .shots.phones { grid-template-columns: 1fr 1fr; }
  .brand-card { padding: 36px 28px; }
  .brand-card ul { grid-template-columns: 1fr; }
  nav ul { display: none; }
}

/* ============ v2: senior enrichment ============ */

/* Credential strip */
.cred { border-bottom: 1px solid var(--line); padding: 22px 0; overflow: hidden; }
.cred .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.cred b { color: var(--ink); font-weight: 600; }
.cred .sep { width: 4px; height: 4px; border-radius: 99px; background: var(--line); }

/* Tools marquee */
.marquee { border-bottom: 1px solid var(--line); padding: 18px 0; background: var(--card); overflow: hidden; white-space: nowrap; }
.marquee .track { display: inline-block; animation: scroll 34s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.marquee span { font-family: var(--serif); font-size: 20px; color: var(--ink-soft); margin: 0 30px; letter-spacing: -0.01em; }
.marquee span b { color: var(--ink); font-weight: 600; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Work filter */
.filter { display: flex; gap: 10px; margin-bottom: 40px; flex-wrap: wrap; }
.filter button {
  font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  border-radius: 99px; padding: 8px 18px; transition: all 0.2s;
}
.filter button:hover { border-color: var(--ink-soft); }
.filter button.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.case.hide { display: none; }

/* Brand gallery */
.gallery { columns: 3; column-gap: 16px; margin-top: 8px; }
.gallery figure { break-inside: avoid; margin: 0 0 16px; cursor: zoom-in; position: relative; }
.gallery img { width: 100%; display: block; border: 1px solid var(--line); border-radius: 10px; transition: transform 0.3s; }
.gallery figure:hover img { transform: scale(1.015); }
.gallery figcaption {
  position: absolute; left: 12px; bottom: 12px; right: 12px;
  font-size: 13px; font-weight: 600; color: #fff;
  opacity: 0; transition: opacity 0.25s;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.gallery figure:hover figcaption { opacity: 1; }

/* Lightbox */
.lb { position: fixed; inset: 0; background: rgba(16,14,11,0.92); z-index: 200; display: none; align-items: center; justify-content: center; padding: 40px; }
.lb.open { display: flex; }
.lb img { max-width: 92vw; max-height: 88vh; border-radius: 10px; }
.lb .x { position: absolute; top: 22px; right: 28px; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; background: none; border: 0; }

@media (max-width: 860px) {
  .gallery { columns: 2; }
}
@media (max-width: 560px) {
  .gallery { columns: 1; }
}

/* ============ v3: motion layer ============ */

/* Scroll progress */
#progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0; z-index: 100; transition: width 0.08s linear; }

/* Custom cursor (fine pointers only) */
@media (pointer: fine) {
  .cur-dot, .cur-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 300; border-radius: 99px; transform: translate(-50%, -50%); }
  .cur-dot { width: 7px; height: 7px; background: var(--accent); }
  .cur-ring { width: 34px; height: 34px; border: 1.5px solid rgba(31, 79, 216, 0.45); transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s; }
  .cur-ring.hov { width: 56px; height: 56px; border-color: rgba(31, 79, 216, 0.9); background: rgba(31, 79, 216, 0.06); }
}

/* Hero load-in */
.hero .kicker, .hero .meta { opacity: 0; animation: riseIn 0.8s ease forwards; }
.hero .kicker { animation-delay: 0.1s; }
.hero .meta { animation-delay: 1s; }
.hero p.lede { opacity: 0; animation: riseIn 0.8s ease 0.75s forwards; }
h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
h1 .w span { display: inline-block; transform: translateY(110%); animation: wordUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes wordUp { to { transform: translateY(0); } }

/* Rotating word */
.rot { display: inline-block; position: relative; color: var(--accent); min-width: 4.2ch; }
.rot span { display: inline-block; }
.rot span.out { animation: rotOut 0.4s ease forwards; }
.rot span.inn { animation: rotIn 0.4s ease forwards; }
@keyframes rotOut { to { opacity: 0; transform: translateY(-70%) rotateX(60deg); } }
@keyframes rotIn { from { opacity: 0; transform: translateY(70%) rotateX(-60deg); } to { opacity: 1; transform: none; } }

/* Nav logo link + underline links */
nav .logo a { color: var(--ink); text-decoration: none; }
nav .logo a:hover { color: var(--accent); }
nav ul a { position: relative; }
nav ul a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 1.5px; width: 0; background: var(--accent); transition: width 0.25s ease; }
nav ul a:hover::after { width: 100%; }

/* Tilt cards */
.tilt { transform-style: preserve-3d; will-change: transform; transition: transform 0.18s ease-out, box-shadow 0.25s; }
.tilt:hover { box-shadow: 0 18px 44px -18px rgba(22, 20, 15, 0.28); }

/* Image wipe reveal */
.wipe { clip-path: inset(0 100% 0 0); transition: clip-path 1s cubic-bezier(0.65, 0, 0.35, 1); }
.wipe.in { clip-path: inset(0 0 0 0); }

/* Magnetic button */
.magnet { display: inline-block; transition: transform 0.2s ease-out; }

/* Reduced motion: kill it all */
@media (prefers-reduced-motion: reduce) {
  .hero .kicker, .hero .meta, .hero p.lede { animation: none; opacity: 1; }
  h1 .w span { animation: none; transform: none; }
  .wipe { clip-path: none; transition: none; }
  .marquee .track { animation: none; }
  .cur-dot, .cur-ring { display: none; }
}

/* v4: mono eyebrows (muzamil grammar) */
:root { --mono: "IBM Plex Mono", ui-monospace, monospace; }
.kicker, .lead-num, .cs-facts .k, .demo-tag, .filter button, .next-case .k, .split .who, .cred .wrap { font-family: var(--mono); }
.kicker, .lead-num { letter-spacing: 0.08em; }

/* Cross-site link button */
nav .xlink { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; background: var(--card); }
nav .xlink::after { display: none; }
nav .xlink:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 860px){ nav ul li:not(:first-child):not(:last-child) { display: none; } }
