@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  --bone: #F6F3EE;
  --bone-2: #EDE8DF;
  --ink: #16151A;
  --ink-muted: #6B6862;
  --line: #DEDACF;
  --accent: #E5482F;
  --accent-ink: #F6F3EE;
  --surface: #FFFFFF;

  --bg: var(--bone);
  --bg-2: var(--bone-2);
  --fg: var(--ink);
  --fg-muted: var(--ink-muted);
  --border: var(--line);
  --card-bg: var(--surface);

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'SFMono-Regular', Consolas, monospace;

  --max-w: 1180px;
  --gutter: clamp(24px, 6vw, 64px);
  --radius: 4px;
}

:root[data-theme="dark"] {
  --bg: #131217;
  --bg-2: #1B1A20;
  --fg: #F2EFE9;
  --fg-muted: #94908A;
  --border: #2C2A31;
  --card-bg: #1B1A20;
  --accent: #FF5B3D;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131217;
    --bg-2: #1B1A20;
    --fg: #F2EFE9;
    --fg-muted: #94908A;
    --border: #2C2A31;
    --card-bg: #1B1A20;
    --accent: #FF5B3D;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 20px;
  z-index: 999;
  font-size: 0.9rem;
}
.skip-link:focus { left: 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.nav-logo { font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 30px; font-size: 0.92rem; }
.nav-links a { position: relative; color: var(--fg-muted); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--fg); }
.nav-right { display: flex; align-items: center; gap: 18px; }

.theme-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--fg-muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.nav-cta {
  border: 1px solid var(--fg);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-cta:hover { background: var(--fg); color: var(--bg); }

.nav-mobile-toggle { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; }
.nav-mobile-toggle svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero {
  padding-top: 96px;
  padding-bottom: 88px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 22px;
}
.hero-eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}
.hero h1 {
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 17ch;
}
.hero h1 .accent-word { color: var(--accent); }
.hero p.lede {
  margin-top: 26px;
  font-size: 1.18rem;
  color: var(--fg-muted);
  max-width: 52ch;
  line-height: 1.6;
}
.hero-actions { margin-top: 38px; display: flex; gap: 16px; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 14px 26px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 0.94rem;
  display: inline-block;
  transition: opacity 0.15s ease;
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 14px 26px;
  border-radius: 30px;
  font-size: 0.94rem;
  transition: border-color 0.15s ease;
}
.btn-secondary:hover { border-color: var(--fg); }

.hero-strip {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 32px;
  font-family: var(--font-mono);
}
.hero-stat { }
.hero-stat .num { font-size: 1.5rem; font-weight: 500; color: var(--fg); display: block; }
.hero-stat .label { font-size: 0.78rem; color: var(--fg-muted); margin-top: 4px; display: block; }

/* ---------- Sections generic ---------- */
section { padding: 100px 0; }
.section-head { margin-bottom: 48px; display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-head h2 {
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.section-index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ---------- About ---------- */
.about { border-top: 1px solid var(--border); }
.about-grid { display: grid; grid-template-columns: 200px 1fr; gap: 56px; align-items: start; }
.about-photo {
  width: 200px; height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-body p { color: var(--fg-muted); font-size: 1.08rem; margin-bottom: 20px; max-width: 62ch; }
.about-body strong { color: var(--fg); font-weight: 500; }
.about-facts {
  margin-top: 28px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.about-facts span { color: var(--fg); }

/* ---------- Services ---------- */
.services { border-top: 1px solid var(--border); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.service-card {
  background: var(--bg);
  padding: 32px 28px;
}
.service-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.service-card p { color: var(--fg-muted); font-size: 0.96rem; }
.investor-line {
  margin-top: 32px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--fg-muted);
}
.investor-line a { color: var(--accent); font-weight: 500; }

/* ---------- Work ---------- */
.work { border-top: 1px solid var(--border); }

.work-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.work-featured:nth-child(odd) .work-visual { order: 2; }
.work-media {
  aspect-ratio: 16/10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  position: relative;
}
.work-media img { width: 100%; height: 100%; object-fit: cover; }
.work-media.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-media.placeholder::before {
  content: attr(data-label);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}
.work-media.placeholder {
  background-image:
    linear-gradient(45deg, var(--border) 1px, transparent 1px),
    linear-gradient(-45deg, var(--border) 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: 0 0;
}

.work-status {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.work-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.work-featured h3 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; margin-bottom: 14px; letter-spacing: -0.02em; }
.work-featured p { color: var(--fg-muted); max-width: 48ch; margin-bottom: 20px; font-size: 1.02rem; }
.work-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; font-family: var(--font-mono); }
.work-tags span { font-size: 0.76rem; color: var(--fg-muted); border: 1px solid var(--border); padding: 4px 10px; border-radius: 20px; }
.work-links { display: flex; gap: 20px; align-items: center; }
.work-link { color: var(--fg); font-size: 0.94rem; font-weight: 500; border-bottom: 1px solid var(--fg); padding-bottom: 2px; }
.work-link.secondary { color: var(--fg-muted); border-bottom-color: var(--border); }

/* Standard (non-featured) work grid */
.work-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.work-card {
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.work-card .work-media { aspect-ratio: 16/10; border-radius: 0; border: none; border-bottom: 1px solid var(--border); }
.work-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.work-card h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.work-card p { color: var(--fg-muted); font-size: 0.92rem; margin-bottom: 16px; flex: 1; }
.work-card .work-link { font-size: 0.88rem; }

/* Confidential entry */
.work-confidential {
  margin-top: 1px;
  padding: 24px 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.work-confidential h4 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.work-confidential p { color: var(--fg-muted); font-size: 0.9rem; }
.work-confidential .meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--fg-muted); white-space: nowrap; }

/* ---------- Skills strip ---------- */
.skills-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
  overflow: hidden;
}
.skills-track {
  display: flex;
  gap: 48px;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--fg-muted);
  animation: marquee 34s linear infinite;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.skills-track span.accent { color: var(--fg); }
@media (prefers-reduced-motion: reduce) {
  .skills-track { animation: none; overflow-x: auto; }
}

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--border); }
.contact h2 {
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  max-width: 16ch;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.contact h2 .accent-word { color: var(--accent); }
.contact-lede { color: var(--fg-muted); max-width: 52ch; font-size: 1.08rem; margin-bottom: 36px; }
.contact-methods { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 44px; }
.contact-social { display: flex; gap: 26px; color: var(--fg-muted); font-size: 0.92rem; }
.contact-social a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Reveal (single hero entrance only) ---------- */
.reveal { opacity: 1; transform: none; }
.js-ready .reveal { opacity: 0; transform: translateY(24px); }

/* ---------- Case study pages ---------- */
.case-hero { padding: 140px 0 56px; border-bottom: 1px solid var(--border); }
.case-back { font-family: var(--font-mono); font-size: 0.85rem; color: var(--fg-muted); margin-bottom: 32px; display: inline-block; }
.case-back:hover { color: var(--fg); }
.case-hero h1 {
  font-weight: 600;
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.case-hero .lede { margin-top: 20px; color: var(--fg-muted); font-size: 1.12rem; max-width: 62ch; }
.case-meta {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}
.case-meta div h5 { font-size: 0.74rem; color: var(--accent); margin-bottom: 8px; font-weight: 500; }
.case-meta div p { font-size: 0.92rem; }
.case-hero-media {
  margin-top: 48px;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-2);
}
.case-hero-media img, .case-hero-media video { width: 100%; height: 100%; object-fit: cover; }
.case-section { padding: 64px 0; border-bottom: 1px solid var(--border); }
.case-section:last-of-type { border-bottom: none; }
.case-section h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 20px; letter-spacing: -0.01em; }
.case-section p { color: var(--fg-muted); max-width: 68ch; margin-bottom: 18px; font-size: 1.02rem; }
.case-section ul { color: var(--fg-muted); max-width: 68ch; padding-left: 20px; margin-bottom: 18px; }
.case-section li { margin-bottom: 10px; }
.case-tradeoff {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-top: 24px;
}
.case-tradeoff h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 12px; }
.case-tradeoff p { margin-bottom: 0; }
.case-diagram { margin-top: 8px; padding: 12px 0; }
.case-nav { display: flex; justify-content: space-between; padding: 56px 0; }
.case-nav a { color: var(--accent); font-size: 0.94rem; font-weight: 500; }
.video-embed {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 8px;
}
.video-embed iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px var(--gutter) 28px;
    gap: 18px;
  }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { width: 120px; height: 120px; }
  .services-grid { grid-template-columns: 1fr; }
  .work-featured { grid-template-columns: 1fr; padding: 40px 0; }
  .work-featured:nth-child(odd) .work-visual { order: 0; }
  .work-grid { grid-template-columns: 1fr; }
  .case-meta { grid-template-columns: repeat(2, 1fr); }
  .hero-strip { grid-template-columns: repeat(2, auto); }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .nav .wrap { height: 64px; }
  .hero { padding-top: 84px; padding-bottom: 64px; }
  .hero h1 { max-width: 13ch; }
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
  section { padding: 64px 0; }
  .contact-methods { flex-direction: column; }
  .contact-methods a { text-align: center; width: 100%; }
  .contact-social { flex-wrap: wrap; gap: 18px; }
  .case-hero { padding: 108px 0 40px; }
  .case-meta { grid-template-columns: 1fr 1fr; gap: 16px; }
}
