:root {
  --bg:      #0C0C0C;
  --surface: #141414;
  --text:    #F3F3F3;
  --muted:   #B2B2B2;
  --line:    #2A2A2A;
  --line-2:  #444444;

  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "Inter", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", "Courier New", monospace;

  --col: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: #c17cfd; color: #000; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 2px; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--col); margin: 0 auto; padding: 0 32px; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

.link {
  font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px;
  transition: text-decoration-thickness .15s ease; white-space: nowrap;
}
.link:hover { text-decoration-thickness: 3px; }
.link.muted { color: var(--muted); }
.link.muted:hover { color: var(--text); }

/* NAV */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 12, 12, 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 34px; }
.nav-links a {
  font-family: var(--body); font-size: 13px; font-weight: 500;
  letter-spacing: 0.01em; color: var(--muted); transition: color .2s ease;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 1.5px;
  background: var(--text); transition: width .2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text); padding: 4px; margin: -4px;
  align-items: center; justify-content: center;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle.open .icon-menu { display: none; }
.nav-toggle.open .icon-close { display: block; }
@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 66px; left: 0; right: 0;
    background: rgba(12,12,12,0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 4px 20px 20px;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 15px 0; font-size: 15px; border-bottom: 1px solid var(--line); color: var(--muted); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a::after { display: none; }
  .nav-links a:hover { color: var(--text); }
}

/* ==========================================
   INDEX: HERO
   ========================================== */
header.hero { min-height: 80vh; display: flex; flex-direction: column; padding: 0; }
.hero .wrap { flex: 1; display: flex; flex-direction: column; padding-top: 98px; padding-bottom: 48px; }
.hero-cta { margin-top: 32px; }
.hero .eyebrow { margin-bottom: 40px; }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(40px, 6.6vw, 82px); line-height: 1.0; letter-spacing: -0.03em;
  margin: 0 0 40px; max-width: 19ch;
}
.hero .lede { font-size: 19px; color: var(--muted); max-width: 52ch; margin: 0 0 44px; line-height: 1.7; }
.cta-row { display: flex; gap: 32px; flex-wrap: wrap; align-items: center; }

/* INDEX: SECTIONS */
section { padding: 82px 0; scroll-margin-top: 66px; }
.sec-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 32px; }
.sec-head .num { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
.sec-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 54px); margin: 0; letter-spacing: -0.02em; }

/* INDEX: WORK ROWS */
.work-row { display: grid; grid-template-columns: 1fr 380px; gap: 64px; padding: 48px 0; border-top: 1px solid var(--line); align-items: start; }
.sec-head + .work-row { border-top: none; padding-top: 8px; }
@media (max-width: 860px) { .work-row { grid-template-columns: 1fr; gap: 32px; } .work-row-img { order: -1; } }
.work-row-text { display: flex; flex-direction: column; gap: 20px; }
.work-title { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 44px); letter-spacing: -0.02em; margin: 0; }
.work-title a { color: inherit; text-decoration: none; }
.work-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.work-role { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.work-desc { color: var(--muted); font-size: 16px; line-height: 1.7; margin: 0; }
.work-row-img .shot { width: 100%; }
.work-row .cs-stats { margin-bottom: 0; }

/* INDEX: WORK CAROUSEL */
.carousel-outer { overflow: hidden; }
.carousel-track {
  display: flex; gap: 20px;
  padding-left: max(32px, calc((100vw - 1080px) / 2));
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.wc-card {
  flex: 0 0 min(460px, calc(100vw - 80px));
  display: block; text-decoration: none; color: inherit; outline: none;
  scroll-snap-align: center;
}

/* Full-bleed image with all text overlaid */
.wc-img {
  position: relative; aspect-ratio: 3/4; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 12px;
}
.wc-bg { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 16px 18px; }

/* Top scrim keeps the metadata legible */
.wc-img::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 62%;
  background: linear-gradient(to bottom, rgba(12,12,12,0.84) 0%, rgba(12,12,12,0.18) 70%, transparent 100%);
  z-index: 1; pointer-events: none;
}

/* Top-left metadata — always visible */
.wc-meta { position: absolute; top: 0; left: 0; padding: 24px 28px; z-index: 2; }
.wc-eyebrow {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(243,243,243,0.68); margin-bottom: 8px;
}
.wc-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(20px, 2.8vw, 36px); line-height: 1.0; letter-spacing: -0.025em;
  margin: 0 0 8px; color: var(--text);
}
.wc-role-line {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(243,243,243,0.52);
}

/* Bottom description band — revealed on hover */
.wc-desc-band {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 48px 28px 26px;
  background: linear-gradient(to top, rgba(12,12,12,0.95) 0%, rgba(12,12,12,0.62) 60%, transparent 100%);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2; pointer-events: none;
}
.wc-card:hover .wc-desc-band { opacity: 1; transform: translateY(0); }
.wc-desc-band p { font-size: 15px; line-height: 1.6; color: var(--text); margin: 0; }
@media (hover: none) { .wc-desc-band { display: none; } }

.carousel-controls { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; }
.car-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: none; border: 1px solid var(--line-2); cursor: pointer;
  color: var(--text); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.car-btn:hover:not(:disabled) { background: var(--surface); border-color: var(--muted); }
.car-btn:disabled { opacity: 0.3; cursor: default; }
.car-dots { display: flex; gap: 8px; align-items: center; }
.car-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-2); border: none; padding: 0; cursor: pointer;
  transition: background 0.2s, width 0.25s ease, border-radius 0.25s ease;
}
.car-dot.active { background: var(--text); width: 24px; border-radius: 3px; }
.shot { aspect-ratio: 4/3; border: 1px solid var(--line-2); background: var(--surface); display: flex; align-items: flex-end; padding: 20px 22px; border-radius: 12px; }
.shot-label { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.8; }

.wc-card--placeholder { cursor: default; }
.wc-card--placeholder .wc-img { background: transparent; border-style: dashed; }
.wc-card--placeholder .wc-img::before { display: none; }
.wc-placeholder-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 32px; text-align: center;
}
.wc-card--placeholder .wc-eyebrow { color: var(--line-2); }
.wc-card--placeholder .wc-title { color: var(--muted); margin: 0; }

/* INDEX: ABOUT */
.about-grid { display: grid; grid-template-columns: 0.65fr 1fr; gap: 60px; align-items: start; }
@media (max-width: 780px) { .about-grid { grid-template-columns: 1fr; gap: 36px; } }
.portrait { aspect-ratio: 1; border: 1px solid var(--line-2); background: var(--surface); display: flex; align-items: flex-end; padding: 20px; border-radius: 12px; }
.portrait-label { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.about-body p { color: var(--muted); max-width: 58ch; font-size: 18px; }
.about-body p + p { margin-top: 20px; }
.about-body p.big { font-family: var(--display); font-weight: 500; color: var(--text); font-size: clamp(20px, 2.4vw, 28px); line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 28px; max-width: 26ch; }

/* INDEX: AI PRACTICE */
.ai-line { font-family: var(--display); font-weight: 500; color: var(--text); font-size: clamp(20px, 2.4vw, 28px); line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 56px; max-width: 56ch; }
.tools { display: grid; grid-template-columns: repeat(2,1fr); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
@media (max-width: 600px) { .tools { grid-template-columns: 1fr; } }
.tool { padding: 32px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .25s ease; }
.tool:hover { background: rgba(243, 243, 243, 0.04); }
.tool:nth-child(2n) { border-right: none; }
.tool:nth-last-child(-n+2) { border-bottom: none; }
@media (max-width: 600px) {
  .tool { border-right: none; border-bottom: 1px solid var(--line); }
  .tool:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .tool:last-child { border-bottom: none; }
}
.tool h4 { font-family: var(--body); font-size: 14px; font-weight: 600; letter-spacing: 0.01em; color: var(--text); margin: 0 0 10px; }
.tool p { margin: 0; font-size: 15px; color: var(--muted); }
.note-fill { margin-top: 32px; padding: 20px 24px; border: 1px dashed var(--line-2); font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.6; border-radius: 12px; }

/* INDEX: ARTIFACT */
.artifact { border: 1px solid var(--line-2); padding: 48px; background: var(--surface); display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; border-radius: 12px; }
@media (max-width: 700px) { .artifact { grid-template-columns: 1fr; padding: 32px; } }
.artifact .eyebrow { margin-bottom: 14px; }
.artifact h3 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 16px; letter-spacing: -0.02em; }
.artifact p { color: var(--muted); margin: 0 0 26px; max-width: 46ch; }

/* INDEX: CONTACT */
.closing { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 7.2vw, 88px); line-height: 0.98; letter-spacing: -0.03em; max-width: 15ch; margin: 0 0 64px; }
.contact-row { display: flex; gap: 56px; flex-wrap: wrap; align-items: flex-start; }
.contact-item .eyebrow { display: block; margin-bottom: 12px; }
.contact-item a.big { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; border-bottom: 1.5px solid var(--line-2); padding-bottom: 3px; transition: border-color .2s; }
.contact-item a.big:hover { border-color: var(--text); }
.copy-btn { font-family: var(--mono); font-size: 11px; color: var(--muted); background: none; border: none; cursor: pointer; margin-left: 14px; text-decoration: underline; text-underline-offset: 4px; transition: color .2s; letter-spacing: 0.06em; }
.copy-btn:hover { color: var(--text); }

/* FOOTER */
footer { padding: 44px 0 64px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer .eyebrow { font-size: 11px; }

/* SCROLL TO TOP */
.back-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 100;
  width: 44px; height: 44px; border-radius: 50%;
  background: #F3F3F3; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #000;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .2s ease;
}
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-2px); }
@media (max-width: 700px) { .back-top { bottom: 20px; right: 20px; } }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ==========================================
   CASE STUDY PAGES
   ========================================== */

.cs-hero { padding: 100px 0 72px; border-bottom: 1px solid var(--line); }
.cs-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 48px;
  transition: color .2s;
}
.cs-back:hover { color: var(--text); }
.cs-hero .eyebrow { margin-bottom: 24px; }
.cs-hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(38px, 6vw, 72px); line-height: 1.0; letter-spacing: -0.03em;
  margin: 0 0 28px; max-width: 22ch;
}
.cs-hero .lede { font-size: 19px; color: var(--muted); max-width: 60ch; margin: 0; line-height: 1.7; }

.cs-meta { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-meta-item { flex: 1; padding: 24px 24px 24px 0; margin-right: 24px; border-right: 1px solid var(--line); }
.cs-meta-item:last-child { border-right: none; margin-right: 0; }
.cs-meta-item .label { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; display: block; }
.cs-meta-item .value { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
@media (max-width: 600px) { .cs-meta { flex-wrap: wrap; } .cs-meta-item { flex: 1 1 50%; margin-right: 0; border-right: none; border-bottom: 1px solid var(--line); } .cs-meta-item:last-child { border-bottom: none; } }

.cs-section { padding: 80px 0; border-bottom: 1px solid var(--line); }
.cs-section:last-of-type { border-bottom: none; }
.cs-label { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 20px; display: block; }
.cs-section h2 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 44px); letter-spacing: -0.02em; margin: 0 0 20px; }

.cs-body { max-width: 68ch; }
.cs-body p { color: var(--muted); font-size: 18px; line-height: 1.7; margin: 0 0 24px; }
.cs-body p:last-child { margin-bottom: 0; }
.cs-body h3 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; margin: 40px 0 12px; color: var(--text); }
.cs-body h3:first-child { margin-top: 0; }

.img-block { border: 1px solid var(--line-2); background: var(--surface); display: flex; align-items: flex-end; padding: 24px; border-radius: 12px; }
.img-block.wide { aspect-ratio: 16/9; }
.img-block.tall { aspect-ratio: 4/3; }
.img-block.square { aspect-ratio: 1; }
.img-label { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.8; }

.cs-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 780px) { .cs-2col { grid-template-columns: 1fr; gap: 32px; } }

.cs-2col-offset { display: grid; grid-template-columns: 1fr 0.75fr; gap: 56px; align-items: start; }
@media (max-width: 780px) { .cs-2col-offset { grid-template-columns: 1fr; gap: 32px; } }

.cs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); margin-top: 48px; border-radius: 12px; overflow: hidden; }
@media (max-width: 700px) { .cs-grid { grid-template-columns: 1fr; } }
.cs-grid-item { padding: 28px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-grid-item:nth-child(3n) { border-right: none; }
.cs-grid-item:nth-last-child(-n+3) { border-bottom: none; }
@media (max-width: 700px) {
  .cs-grid-item { border-right: none; border-bottom: 1px solid var(--line); }
  .cs-grid-item:last-child { border-bottom: none; }
  .cs-grid-item:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
}
.cs-grid-item h4 { font-family: var(--display); font-weight: 700; font-size: 15px; margin: 0 0 10px; letter-spacing: -0.01em; }
.cs-grid-item p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.6; }
.cs-grid-item .num { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 14px; display: block; }

.cs-stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 1px solid var(--line); margin-top: 48px; border-radius: 12px; overflow: hidden; }
@media (max-width: 900px) { .cs-stages { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 580px) { .cs-stages { grid-template-columns: 1fr; } }
.cs-stage { padding: 28px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-stage:nth-child(5n) { border-right: none; }
@media (max-width: 900px) { .cs-stage:nth-child(5n) { border-right: 1px solid var(--line); } .cs-stage:nth-child(3n) { border-right: none; } }
@media (max-width: 580px) { .cs-stage { border-right: none; } }
.cs-stage:nth-last-child(-n+5) { border-bottom: none; }
@media (max-width: 900px) { .cs-stage:nth-last-child(-n+5) { border-bottom: 1px solid var(--line); } .cs-stage:nth-last-child(-n+3) { border-bottom: none; } }
@media (max-width: 580px) { .cs-stage:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); } .cs-stage:last-child { border-bottom: none; } }
.cs-stage .stage-num { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 16px; display: block; }
.cs-stage h4 { font-family: var(--display); font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.cs-stage p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }
.cs-stage.current { background: rgba(243, 243, 243, 0.04); }
.cs-stage.current .stage-num { color: var(--text); }

.cs-stats { display: flex; gap: 48px; flex-wrap: wrap; margin-bottom: 48px; }
.cs-stat .n { font-family: var(--display); font-weight: 700; font-size: 52px; line-height: 1; letter-spacing: -0.02em; }
.cs-stat .l { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 8px; }

.cs-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; }
.cs-tag { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); padding: 5px 12px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 12px; }

.cs-nav-row { display: flex; justify-content: space-between; padding: 56px 0 0; flex-wrap: wrap; gap: 24px; }
.cs-nav-row a { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--muted); transition: color .2s; letter-spacing: -0.01em; }
.cs-nav-row a:hover { color: var(--text); }

.demo-block { border: 1px solid var(--line-2); background: var(--surface); aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; border-radius: 12px; }
.demo-block .demo-label { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.demo-block .demo-sub { font-family: var(--body); font-size: 14px; color: var(--muted); }

/* ==========================================
   MOBILE — 390px (iPhone 15)
   ========================================== */
@media (max-width: 480px) {
  .wrap { padding: 0 20px; }
  section { padding: 56px 0; }
  header.hero { min-height: 65vh; }
  .hero .wrap { padding-top: 64px; padding-bottom: 32px; }
  .hero .eyebrow { margin-bottom: 24px; }
  .hero h1 { margin-bottom: 24px; }
  .hero-cta { margin-top: 16px; }
  .sec-head { margin-bottom: 16px; }
  .work-row { padding: 36px 0; }
  .ai-line { margin-bottom: 32px; }
  .closing { margin-bottom: 40px; }
  .contact-item a.big { font-size: 17px; }
  .cs-stats { gap: 28px; }
  .cs-hero { padding: 56px 0 40px; }
  .cs-back { margin-bottom: 32px; }
  .cs-section { padding: 52px 0; }
}
