/* ============================================================
   Christian Carvalho — Portfolio
   Design system: "Sinal / Ruído" (Signal from Noise)
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--signal); color: #fff; }

/* ---------- Tokens ---------- */
:root {
  --paper:    #E8E4DB;
  --paper-2:  #F1EEE7;
  --paper-3:  #DED9CE;
  --ink:      #17140F;
  --ink-2:    #201B15;
  --ink-3:    #2B241C;
  --ash:      #6B6459;
  --ash-2:    #8C8578;
  --line:     #D2CBBC;
  --line-2:   #C4BCAA;
  --line-dark: rgba(255,255,255,.10);
  --signal:   #FF4D2E;
  --signal-2: #E23A1C;
  --halo:     #F9E4DB;

  /* per-project accents — tuned to read on both the dark hero and the light paper body */
  --p-titan:    #7A45E0;
  --p-siem:     #7E901F;
  --p-hermes:   #B26E09;
  --p-lumi:     #A32B57;
  --p-cropscan: #3C7D41;

  --maxw: 1200px;
  --gut: clamp(20px, 5vw, 72px);

  --f-display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* ---------- Base ---------- */
body {
  font-family: var(--f-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

/* film-grain / noise texture over whole page */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.eyebrow {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ash);
  display: inline-flex; align-items: center; gap: .55em;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal); flex: none;
  box-shadow: 0 0 0 0 var(--signal);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,77,46,.5); }
  70% { box-shadow: 0 0 0 7px rgba(255,77,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,77,46,0); }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gut);
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s, color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.nav.on-dark:not(.scrolled) { color: var(--paper); }
.brand {
  font-family: var(--f-mono); font-weight: 700; font-size: .92rem;
  letter-spacing: .02em; display: inline-flex; align-items: center; gap: .6em;
  white-space: nowrap;
}
/* logo inherits the nav's colour, so it flips light/dark with the nav state */
.brand-logo { height: 21px; width: auto; aspect-ratio: 73.32 / 93.3; flex: none; fill: currentColor; transition: fill .4s var(--ease); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.nav-links a {
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .05em;
  text-transform: uppercase; position: relative; padding: 4px 0;
}
.nav-links a.link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0;
  background: var(--signal); transition: width .35s var(--ease);
}
.nav-links a.link:hover::after { width: 100%; }
.lang {
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em;
  border: 1px solid currentColor; border-radius: 100px; padding: 5px 11px;
  display: inline-flex; gap: 6px; opacity: .9; cursor: pointer; background: none;
  transition: opacity .3s;
}
.lang:hover { opacity: 1; }
.lang b { color: var(--signal); }
.nav-links a.nav-cta {
  border: 1px solid currentColor; border-radius: 100px; padding: 7px 15px;
}
.nav-links a.nav-cta::after { display: none; }
.nav-links a.nav-cta:hover { background: var(--signal); color: #fff; border-color: var(--signal); }

/* ============================================================
   HERO — the signature "noise resolves into signal"
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden; padding-top: 120px; padding-bottom: clamp(84px, 14vh, 128px);
}
/* Unicorn-Studio-style flowing gradient background */
.hero-fluid { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  filter: blur(66px) saturate(120%); opacity: .92; }
.hero-fluid .blob { position: absolute; border-radius: 50%; mix-blend-mode: screen; will-change: transform; }
.hero-fluid .b1 { width: 64vw; height: 64vw; left: -14%; top: 0%;
  background: radial-gradient(circle at 45% 45%, rgba(255,77,46,.60), rgba(255,77,46,0) 66%);
  animation: fluid1 20s ease-in-out infinite; }
.hero-fluid .b2 { width: 54vw; height: 54vw; right: -16%; top: -10%;
  background: radial-gradient(circle at 50% 50%, rgba(226,58,28,.52), rgba(226,58,28,0) 65%);
  animation: fluid2 27s ease-in-out infinite; }
.hero-fluid .b3 { width: 60vw; height: 60vw; left: 22%; bottom: -30%;
  background: radial-gradient(circle at 50% 50%, rgba(150,44,22,.58), rgba(120,36,18,0) 64%);
  animation: fluid3 31s ease-in-out infinite; }
.hero-fluid .b4 { width: 36vw; height: 36vw; right: 6%; bottom: -12%;
  background: radial-gradient(circle at 50% 50%, rgba(255,128,64,.42), rgba(255,128,64,0) 62%);
  animation: fluid1 24s ease-in-out infinite reverse; }
@keyframes fluid1 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(16%,10%) scale(1.18); } 66% { transform: translate(-8%,18%) scale(.92); } }
@keyframes fluid2 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(-14%,12%) scale(1.1); } 66% { transform: translate(10%,-9%) scale(1.22); } }
@keyframes fluid3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(12%,-14%) scale(1.16); } }

/* custom cursor — accent ball */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor { position: fixed; top: 0; left: 0; width: 15px; height: 15px; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 16px rgba(255,77,46,.5); pointer-events: none;
  z-index: 10000; will-change: transform;
  transition: width .28s var(--ease), height .28s var(--ease), background .28s var(--ease), box-shadow .28s; }
.cursor.big { width: 46px; height: 46px; background: rgba(255,77,46,.16); box-shadow: 0 0 26px rgba(255,77,46,.3); }
.cursor.down { width: 11px; height: 11px; }

.hero-inner { position: relative; z-index: 5; width: 100%; }
.hero-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: clamp(28px, 6vh, 70px); flex-wrap: wrap;
}
.hero-tag { max-width: 30ch; }
.hero-tag .eyebrow { color: var(--paper); }
.hero-readout {
  font-family: var(--f-mono); font-size: .74rem; color: var(--ash-2);
  text-align: right; line-height: 1.9; min-width: 210px;
}
.hero-readout .rk { color: rgba(244,240,233,.45); }
.hero-readout .rv { color: var(--paper); }
.hero-readout .sig { color: var(--signal); }

.hero-name {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(3.1rem, 12vw, 10.5rem); line-height: .9;
  letter-spacing: -.02em; text-transform: none;
}
.hero-name .word { display: block; overflow: hidden; }
.hero-name .char { display: inline-block; will-change: transform, filter, opacity; }
.hero-sub {
  margin-top: clamp(20px, 4vh, 40px);
  display: flex; align-items: baseline; gap: 16px 26px; flex-wrap: wrap;
}
.hero-role {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.9rem); letter-spacing: -.01em;
}
.hero-role .sig { color: var(--signal); }
.hero-desc { max-width: 46ch; color: rgba(244,240,233,.66); font-size: 1.02rem; }

/* Sasha-style single-statement hero */
.hero-statement {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2rem, 5.4vw, 4.9rem); line-height: 1.07; letter-spacing: -.025em;
  max-width: 20ch; text-wrap: balance;
  opacity: 0; transform: translateY(28px);
  animation: heroFallback 0s linear 3s forwards;
}
@keyframes heroFallback { to { opacity: 1; transform: none; } }
.hero-statement .sig { color: var(--signal); }
.hero.play .hero-statement {
  opacity: 1; transform: none;
  transition: opacity 1s var(--ease-out) .35s, transform 1s var(--ease-out) .35s;
}

.hero-actions { margin-top: clamp(30px, 5vh, 48px); display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  opacity: 0; transform: translateY(20px); animation: heroFallback 0s linear 3s forwards; }
.hero.play .hero-actions { opacity: 1; transform: none; transition: opacity .9s var(--ease-out) .62s, transform .9s var(--ease-out) .62s; }
.btn {
  display: inline-flex; align-items: center; gap: .7em;
  font-family: var(--f-mono); font-size: .82rem; letter-spacing: .04em;
  text-transform: uppercase; padding: 13px 22px; border-radius: 100px;
  border: 1px solid var(--signal); background: var(--signal); color: #fff;
  cursor: pointer; transition: transform .3s var(--ease), background .3s, box-shadow .3s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--signal); }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translate(3px,-3px); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn.ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); box-shadow: none; }

.hero-scrollcue {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ash-2); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero-scrollcue .bar { width: 1px; height: 34px; background: linear-gradient(var(--signal), transparent); animation: cue 2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0%,100%{ transform: scaleY(.4); opacity:.4;} 50%{ transform: scaleY(1); opacity:1;} }

/* marquee strip */
.marquee {
  background: var(--ink); color: var(--paper); border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark); overflow: hidden; padding: 16px 0;
}
.marquee-track { display: flex; gap: 46px; width: max-content; animation: marq 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  font-family: var(--f-mono); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(244,240,233,.55); display: inline-flex; align-items: center; gap: 46px;
}
.marquee span::after { content: "◆"; color: var(--signal); font-size: .6rem; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(70px, 12vh, 150px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(38px, 7vh, 78px); }
.section-title {
  font-family: var(--f-display); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(2rem, 5vw, 4rem); line-height: .98; max-width: 16ch;
}
.section-title .sig { color: var(--signal); }
.section-note { font-family: var(--f-mono); font-size: .74rem; color: var(--ash); text-align: right; max-width: 26ch; line-height: 1.8; }
.section-index { font-family: var(--f-mono); font-size: .74rem; color: var(--ash); letter-spacing: .1em; }

/* reveal animation */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }


/* ============================================================
   WORK INDEX
   ============================================================ */
.work-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.work-item {
  position: relative; display: block; border-bottom: 1px solid var(--line);
  padding: clamp(26px, 4.5vh, 52px) 0;
  transition: padding .5s var(--ease);
}
.work-item:hover { padding-left: 14px; padding-right: 14px; }
.work-bg {
  position: absolute; inset: 0; z-index: 0; opacity: 0;
  background: var(--acc, var(--signal)); transition: opacity .5s var(--ease);
  mix-blend-mode: multiply;
}
.work-row { position: relative; z-index: 2; display: grid; grid-template-columns: 64px 1fr auto; gap: clamp(16px, 3vw, 40px); align-items: center; }
.work-num { font-family: var(--f-mono); font-size: .8rem; color: var(--ash); padding-top: 6px; }
.work-num .acc { color: var(--acc, var(--signal)); }
.work-main { min-width: 0; }
.work-cat {
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ash); display: inline-flex; gap: 10px; align-items: center; margin-bottom: 10px;
}
.work-cat .chip { color: var(--acc, var(--signal)); border: 1px solid currentColor; border-radius: 100px; padding: 2px 9px; font-size: .64rem; }
.work-name {
  font-family: var(--f-display); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(1.9rem, 5.4vw, 4.4rem); line-height: .96;
  transition: transform .5s var(--ease), color .4s;
}
.work-item:hover .work-name { transform: translateX(6px); }
.work-desc { color: var(--ash); max-width: 52ch; margin-top: 12px; font-size: 1rem; }
.work-meta { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; text-align: right; }
.work-metric { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 2.4rem); line-height: 1; letter-spacing: -.02em; color: var(--acc, var(--signal)); }
.work-metric small { display: block; font-family: var(--f-mono); font-size: .64rem; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--ash); margin-top: 7px; }
.work-go { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; opacity: 0; transform: translateX(-8px); transition: opacity .4s var(--ease), transform .4s var(--ease); white-space: nowrap; }
.work-item:hover .work-go { opacity: 1; transform: none; }

/* floating preview thumb that follows cursor */
.work-thumb {
  position: fixed; top: 0; left: 0; z-index: 60; width: min(30vw, 340px); aspect-ratio: 4/3;
  border-radius: 16px; overflow: hidden; pointer-events: none;
  opacity: 0; transform: translate(-50%,-50%) scale(.9); transition: opacity .35s var(--ease), transform .35s var(--ease);
  box-shadow: 0 28px 60px -18px rgba(23,20,15,.42), inset 0 0 0 1px rgba(255,255,255,.45);
}
.work-thumb.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
/* frosted-glass card: screens float whole (never cropped) over blurred page content */
.thumb-stage {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 18px;
  background: linear-gradient(140deg, rgba(255,255,255,.60), rgba(255,255,255,.30));
  -webkit-backdrop-filter: blur(22px) saturate(165%);
          backdrop-filter: blur(22px) saturate(165%);
}
/* top light-catch, so it reads as glass rather than a flat panel */
.thumb-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 42%);
}
.thumb-stage img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 7px; box-shadow: 0 16px 32px -10px rgba(0,0,0,.55);
}
.thumb-stage.duo img { max-width: 44%; }
.thumb-stage.duo img:first-child { transform: translateY(-7px); }
.thumb-stage.duo img:last-child { transform: translateY(7px); }
.thumb-stage img[hidden] { display: none; }

/* ============================================================
   ABOUT
   ============================================================ */
.about { background: var(--paper-2); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(34px, 6vw, 90px); align-items: start; }
.about-quote {
  font-family: var(--f-display); font-weight: 500; letter-spacing: -.015em;
  font-size: clamp(1.55rem, 3.4vw, 2.9rem); line-height: 1.16;
}
.about-quote .sig { color: var(--signal); }
.about-quote .qmark { color: var(--signal); }
.about-body { color: var(--ash); font-size: 1.06rem; }
.about-body p + p { margin-top: 1.1em; }
.about-body strong { color: var(--ink); font-weight: 600; }
.about-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 34px; border-top: 1px solid var(--line); padding-top: 26px; }
/* flex column + margin-top:auto keeps the labels aligned even when a value wraps to two lines */
.about-stat { display: flex; flex-direction: column; }
.about-stat .n { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.6rem,3.6vw,2.6rem); letter-spacing: -.02em; line-height: 1.02; }
.about-stat .l { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ash); margin-top: auto; padding-top: 8px; }
.skills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.skills .s { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .04em; border: 1px solid var(--line-2); border-radius: 100px; padding: 6px 13px; color: var(--ash); transition: all .3s; }
.skills .s:hover { border-color: var(--signal); color: var(--signal); }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.contact .eyebrow { color: var(--paper); }
.contact-big {
  font-family: var(--f-display); font-weight: 700; letter-spacing: -.025em;
  font-size: clamp(2.6rem, 9vw, 8rem); line-height: .92; margin: 18px 0 8px;
}
.contact-big a { transition: color .3s; }
.contact-big a:hover { color: var(--signal); }
.contact-row { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px; margin-top: clamp(40px, 8vh, 90px); border-top: 1px solid var(--line-dark); padding-top: 26px; }
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; }
.contact-links a { font-family: var(--f-mono); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line-dark); border-radius: 100px; padding: 10px 18px; transition: all .3s; }
.contact-links a:hover { background: var(--signal); border-color: var(--signal); color: #fff; transform: translateY(-2px); }
.foot-meta { font-family: var(--f-mono); font-size: .72rem; color: var(--ash-2); letter-spacing: .04em; }

/* ============================================================
   CASE STUDY PAGES
   ============================================================ */
.case { --acc: var(--signal); }
.case-hero { background: var(--ink); color: var(--paper); padding: 150px 0 70px; position: relative; overflow: hidden; }
.case-hero-grid { background-image: linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 70px 70px; position: absolute; inset: 0; -webkit-mask-image: radial-gradient(100% 80% at 70% 20%, #000, transparent 75%); mask-image: radial-gradient(100% 80% at 70% 20%, #000, transparent 75%); }
.case-back { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ash-2); display: inline-flex; gap: 8px; align-items: center; position: relative; z-index: 3; transition: color .3s, gap .3s; }
.case-back:hover { color: var(--paper); gap: 12px; }
.case-hero-inner { position: relative; z-index: 3; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(30px,5vw,70px); align-items: center; margin-top: 40px; }
.case-cat { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); display: inline-flex; gap: 10px; align-items: center; }
.case-cat .chip { border: 1px solid currentColor; border-radius: 100px; padding: 3px 10px; font-size: .64rem; }
.case-title { font-family: var(--f-display); font-weight: 800; letter-spacing: -.03em; font-size: clamp(3rem, 9vw, 7.5rem); line-height: .9; margin: 20px 0 22px; }
.case-lead { font-size: clamp(1.05rem, 1.8vw, 1.35rem); color: rgba(244,240,233,.72); max-width: 44ch; line-height: 1.5; }
/* height-capped so portrait phone screens don't blow up the hero */
.case-hero-media { display: flex; justify-content: center; align-items: center; }
.case-hero-media img {
  max-width: 100%; max-height: 62vh; width: auto; height: auto;
  border-radius: 14px; box-shadow: 0 30px 60px -24px rgba(0,0,0,.7);
}
.case-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); border-radius: 12px; overflow: hidden; margin-top: clamp(34px,6vh,64px); position: relative; z-index: 3; }
.case-fact { background: var(--ink); padding: 20px 22px; }
.case-fact .k { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ash-2); }
.case-fact .v { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; margin-top: 8px; }
.case-fact .v .sig { color: var(--acc); }

/* case section stepper */
.case-body { padding: clamp(60px,10vh,120px) 0; }
.case-block { display: grid; grid-template-columns: 240px 1fr; gap: clamp(24px,5vw,70px); padding: clamp(40px,7vh,80px) 0; border-top: 1px solid var(--line); align-items: start; }
.case-block:first-child { border-top: none; }
.case-step { position: sticky; top: 100px; }
.case-step .n { font-family: var(--f-mono); font-size: .74rem; color: var(--acc); letter-spacing: .1em; }
.case-step h3 { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.5rem,2.6vw,2.1rem); letter-spacing: -.02em; margin-top: 10px; line-height: 1.05; }
.case-prose { font-size: 1.08rem; color: var(--ink); max-width: 60ch; }
.case-prose.muted { color: var(--ash); }
.case-prose p + p { margin-top: 1.1em; }
.case-prose strong { font-weight: 600; }
.case-prose ul { list-style: none; margin-top: 1em; display: flex; flex-direction: column; gap: 12px; }
.case-prose li { padding-left: 26px; position: relative; color: var(--ash); }
.case-prose li::before { content: "→"; position: absolute; left: 0; color: var(--acc); font-family: var(--f-mono); }

.pull { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.4rem,2.8vw,2.2rem); line-height: 1.2; letter-spacing: -.015em; margin: 8px 0; }
.pull .sig { color: var(--acc); }

/* galleries */
.gallery { padding: clamp(30px,6vh,70px) 0; }
.gallery-strip { display: grid; gap: 18px; }
.g-mobile { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g-wide { grid-template-columns: 1fr; }
.g-two { grid-template-columns: 1fr 1fr; }
.g-item { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.g-item.dark { background: var(--ink); border-color: var(--ink-3); }
.g-item img { width: 100%; transition: transform .8s var(--ease); }
.g-item:hover img { transform: scale(1.03); }
.g-cap { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .06em; color: var(--ash); text-transform: uppercase; padding: 12px 16px; border-top: 1px solid var(--line); }
.g-item.dark .g-cap { color: var(--ash-2); border-color: var(--ink-3); }

.case-next { border-top: 1px solid var(--line); }
.case-next a { display: flex; justify-content: space-between; align-items: center; padding: clamp(40px,8vh,90px) 0; gap: 20px; }
.case-next .lbl { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ash); }
.case-next .nm { font-family: var(--f-display); font-weight: 700; font-size: clamp(2rem,6vw,4.5rem); letter-spacing: -.02em; transition: color .3s, transform .4s var(--ease); }
.case-next a:hover .nm { color: var(--signal); transform: translateX(10px); }

/* cropscan ML viz */
.ml-viz { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #0e150e; color: #eaf3ea; padding: clamp(22px,4vw,40px); position: relative; }
.ml-scan-frame { aspect-ratio: 4/3; border-radius: 12px; background: linear-gradient(135deg,#16240f,#0c130b); position: relative; overflow: hidden; border: 1px solid rgba(120,180,90,.25); }
.ml-scan-line { position: absolute; left: 8%; right: 8%; height: 2px; background: var(--p-cropscan); box-shadow: 0 0 18px var(--p-cropscan); top: 10%; animation: mlscan 2.6s var(--ease) infinite; }
@keyframes mlscan { 0%,100%{ top: 12%;} 50%{ top: 84%;} }
.ml-box { position: absolute; border: 1.5px solid var(--p-cropscan); border-radius: 4px; }
.ml-tag { position: absolute; font-family: var(--f-mono); font-size: .62rem; background: var(--p-cropscan); color: #05230a; padding: 2px 6px; border-radius: 3px; letter-spacing: .04em; }
.ml-readout { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px 26px; margin-top: 22px; }
.ml-readout .r { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(255,255,255,.14); padding-bottom: 8px; font-family: var(--f-mono); font-size: .8rem; }
.ml-readout .r b { color: var(--p-cropscan); }
/* the subject being scanned: a sugarcane in white line-art */
.ml-scan-frame .cane { position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%); height: 84%; width: auto; }
.cane path { vector-effect: non-scaling-stroke; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cane .stalk { stroke: rgba(255,255,255,.6); stroke-width: 2; fill: rgba(255,255,255,.04); }
.cane .node  { stroke: rgba(255,255,255,.4);  stroke-width: 1.6; }
.cane .leaf  { stroke: rgba(255,255,255,.55); stroke-width: 1.6; fill: rgba(255,255,255,.05); }
.cane .vein  { stroke: rgba(255,255,255,.28); stroke-width: 1; }

/* ---------- Before / After comparison slider ---------- */
.ba { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: var(--ink); user-select: none; touch-action: pan-y; --pos: 50%; cursor: ew-resize; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; pointer-events: none; }
.ba .ba-before { position: absolute; inset: 0; z-index: 2; clip-path: inset(0 calc(100% - var(--pos)) 0 0); -webkit-clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-tag { position: absolute; top: 14px; z-index: 4; font-family: var(--f-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 100px; background: rgba(0,0,0,.55); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ba-tag.l { left: 14px; } .ba-tag.r { right: 14px; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; z-index: 5;
  background: var(--acc, var(--signal)); box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.ba-grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 42px; height: 42px; border-radius: 50%;
  background: var(--acc, var(--signal)); color: #fff; display: grid; place-items: center; font-size: 1.05rem; font-weight: 700;
  box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.ba:focus-visible { outline: 2px solid var(--acc, var(--signal)); outline-offset: 3px; }
.ba-cap { font-family: var(--f-mono); font-size: .72rem; color: var(--ash); margin-top: 14px; display: flex; align-items: center; gap: 8px; justify-content: center; }
.ba-cap .sig { color: var(--acc, var(--signal)); }

/* ---------- Interactive click-through prototype ---------- */
.proto { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--ink); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.proto-bar { display: flex; align-items: center; gap: 14px; padding: 11px 16px; background: var(--ink-2); border-bottom: 1px solid var(--ink-3); }
.proto-lights { display: inline-flex; gap: 7px; flex: none; }
.proto-lights i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.16); }
.proto-url { font-family: var(--f-mono); font-size: .74rem; color: var(--ash-2); background: rgba(255,255,255,.05); border: 1px solid var(--line-dark);
  border-radius: 100px; padding: 6px 16px; flex: 1; text-align: center; min-width: 0; }
.proto-url b { color: var(--paper); }
.proto-count { font-family: var(--f-mono); font-size: .72rem; color: var(--ash-2); flex: none; }
.proto-stage { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.proto-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .45s var(--ease); }
.proto-stage img.on { opacity: 1; }
.proto-hot { position: absolute; top: 0; bottom: 0; width: 42%; border: none; background: transparent; cursor: pointer; z-index: 3; }
.proto-hot.prev { left: 0; cursor: w-resize; } .proto-hot.next { right: 0; cursor: e-resize; }
.proto-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; border: 1px solid rgba(255,255,255,.22); display: grid; place-items: center; font-size: 1.1rem;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; pointer-events: none; }
.proto:hover .proto-arrow { opacity: .9; }
.proto-arrow.prev { left: 16px; } .proto-arrow.next { right: 16px; }
.proto-foot { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 15px; background: var(--ink-2); border-top: 1px solid var(--ink-3); }
.pd { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.22); border: none; cursor: pointer; padding: 0; transition: width .3s var(--ease), background .3s; }
.pd.active { background: var(--acc, var(--signal)); width: 24px; border-radius: 100px; }
.proto-hint { font-family: var(--f-mono); font-size: .72rem; color: var(--ash); margin-top: 14px; text-align: center; }
.proto-hint .sig { color: var(--acc, var(--signal)); }

/* phone-frame variant (mobile apps) */
.proto-phone { border: none; background: transparent; box-shadow: none; overflow: visible;
  display: flex; flex-direction: column; align-items: center; gap: 22px; }
.proto-device { position: relative; width: min(300px, 76vw); flex: none; border-radius: 46px;
  background: linear-gradient(160deg, #26221c, #17140f); padding: 12px; border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 44px 80px -34px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.03); }
.proto-device .proto-stage { aspect-ratio: 9 / 19.5; border-radius: 36px; }
.proto-device .proto-stage img { object-position: center; }
.proto-notch { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 32%; height: 22px;
  background: #000; border-radius: 100px; z-index: 6; }
.proto-phone .proto-arrow { width: 40px; height: 40px; font-size: 1rem; }
.proto-phone-bar { display: flex; flex-direction: column; align-items: center; gap: 13px; }
.proto-phone .proto-count { font-family: var(--f-mono); font-size: .74rem; color: var(--ash); }
.proto-phone .proto-count b { color: var(--ink); }
.proto-route-tag { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .05em; color: var(--ash); }
.proto-route-tag b { color: var(--acc, var(--signal)); }
.proto-phone .proto-foot { background: transparent; border: none; padding: 0; }

/* real in-app hotspots (tap the actual buttons) */
.proto-hotspots { position: absolute; inset: 0; z-index: 5; }
.proto-spot { position: absolute; background: transparent; border: none; padding: 0; cursor: pointer;
  border-radius: 10px; transition: background .2s, box-shadow .2s; }
.proto-spot:hover { background: rgba(255,77,46,.14); box-shadow: 0 0 0 2px var(--acc, var(--signal)); }
.proto-hotspots.flash .proto-spot { animation: spotFlash 1.1s var(--ease); }
@keyframes spotFlash {
  0%, 100% { background: transparent; box-shadow: 0 0 0 0 transparent; }
  25%, 55% { background: rgba(255,77,46,.16); box-shadow: 0 0 0 2px var(--acc, var(--signal)); }
}
.proto-reset { display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; padding: 6px 14px;
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .04em; color: var(--ash);
  background: transparent; border: 1px solid var(--line-2); border-radius: 100px; cursor: pointer; transition: all .3s; }
.proto-reset:hover { border-color: var(--acc, var(--signal)); color: var(--acc, var(--signal)); }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; z-index: 200; background: var(--ink); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 22px; transition: opacity .7s var(--ease), visibility .7s; animation: loaderAuto 0s linear 3.2s forwards; }
@keyframes loaderAuto { to { opacity: 0; visibility: hidden; } }
.loader.done { opacity: 0; visibility: hidden; }
.loader-bar { width: min(240px, 60vw); height: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--signal); }
.loader.play .loader-bar i { animation: load 1.1s var(--ease) forwards; }
@keyframes load { to { width: 100%; } }
.loader-txt { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ash-2); }
.loader-txt .sig { color: var(--signal); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .about-grid, .case-hero-inner { grid-template-columns: 1fr; }
  .case-block { grid-template-columns: 1fr; }
  .case-step { position: static; }
  .g-two { grid-template-columns: 1fr; }
  .hero-readout { text-align: left; }
}
@media (max-width: 620px) {
  .nav { padding-left: 18px; padding-right: 18px; }
  /* logo alone is the home mark on mobile — the full name is right below in the hero */
  .brand-name { display: none; }
  .brand-logo { height: 22px; }
  .nav-links { gap: 8px; }
  .nav-links a.link, .nav .desktop-only { display: none; }
  /* slimmer, non-wrapping pills */
  .lang { padding: 5px 9px; font-size: .68rem; }
  .nav-links a.nav-cta { padding: 7px 13px; font-size: .68rem; white-space: nowrap; }
  .work-row { grid-template-columns: 40px 1fr; }
  .work-meta { grid-column: 2; align-items: flex-start; text-align: left; flex-direction: row; gap: 18px; margin-top: 14px; }
  .about-stats { grid-template-columns: 1fr; }
  .case-facts { grid-template-columns: 1fr; }
  .work-thumb { display: none; }
  .csd { grid-template-columns: 1fr !important; }
  /* lighter blur keeps the fluid smooth on phones */
  .hero-fluid { filter: blur(42px) saturate(120%); }
  .hero-fluid .b4 { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .noise-token { display: none; }
  .hero-name .char { transform: none !important; filter: none !important; opacity: 1 !important; }
  .loader { display: none; }
}

/* focus */
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 3px; }
