/* =========================================================
   Etouch Portfolio — local preview
   palette: ink + paper + 1 acid accent
   type:    Instrument Serif (display) + Inter (body)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --ink:        #0B0B0B;
  --ink-2:      #141414;
  --ink-3:      #1F1F1F;
  --paper:      #F4F1EA;
  --paper-2:    #E9E4D8;
  --line:       rgba(244,241,234,0.12);
  --line-2:     rgba(244,241,234,0.22);
  --accent:     #C6F24E;     /* acid lime, not the default vermilion */
  --accent-2:   #9EE53D;
  --muted:      #9A968D;
  --fg:         #F4F1EA;
  --maxw:       1280px;
  --gutter:     clamp(20px, 4vw, 56px);

  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --sans:  'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--ink); color: var(--fg); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.hr   { height: 1px; background: var(--line); border: 0; margin: 0; }
.hr.b { background: var(--line-2); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(120%);
  background: rgba(11,11,11,0.72);
  border-bottom: 1px solid var(--line);
}
.topbar .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  max-width: var(--maxw); margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em;
}
.brand .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent); color: var(--ink);
  display: grid; place-items: center; font-family: var(--serif); font-size: 18px; line-height: 1;
  transform: rotate(-4deg);
}
.navlinks { display: flex; gap: 24px; font-size: 14px; color: var(--muted); }
.navlinks a:hover { color: var(--fg); }
.navlinks .pill {
  color: var(--ink); background: var(--accent);
  padding: 7px 13px; border-radius: 999px; font-weight: 500;
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(72px, 12vw, 160px) var(--gutter) clamp(56px, 8vw, 96px);
  max-width: var(--maxw); margin: 0 auto;
}
.hero .eyebrow {
  display: flex; gap: 14px; align-items: center;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 28px;
}
.hero .eyebrow .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px rgba(198,242,78,0.18); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 132px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero .lede {
  font-family: var(--serif);
  font-size: clamp(20px, 2.3vw, 28px);
  line-height: 1.35;
  max-width: 720px;
  color: var(--paper-2);
  font-weight: 400;
  margin: 0 0 48px;
}
.hero .lede em { color: var(--accent); font-style: italic; }

.hero .meta {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 24px;
  border-top: 1px solid var(--line-2);
  padding-top: 28px;
  max-width: 920px;
}
.hero .meta .k { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.hero .meta .v { font-family: var(--serif); font-size: clamp(20px, 2.2vw, 28px); line-height: 1.1; }
.hero .meta .v em { color: var(--accent); font-style: italic; }

/* ---------- offer strip ---------- */
.offer {
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(40px, 6vw, 72px) var(--gutter);
}
.offer .grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: clamp(28px, 4vw, 56px);
}
.offer h2 {
  font-family: var(--sans); font-weight: 600; font-size: 14px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.offer p {
  font-family: var(--serif); font-size: clamp(20px, 2vw, 26px); line-height: 1.3;
  margin: 0; color: var(--paper);
}

/* ---------- case study index ---------- */
.cases {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) var(--gutter);
}
.cases-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: clamp(40px, 6vw, 72px); gap: 32px; flex-wrap: wrap;
}
.cases-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5vw, 64px); line-height: 1;
  letter-spacing: -0.02em; margin: 0;
  max-width: 16ch;
}
.cases-head .right {
  max-width: 380px; color: var(--muted); font-size: 15px; line-height: 1.55;
}

/* one big case, magazine style */
.case {
  display: grid; grid-template-columns: 220px 1fr;
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(40px, 6vw, 72px) 0;
  border-top: 1px solid var(--line-2);
  align-items: start;
}
.case:first-of-type { padding-top: 0; border-top: 0; }
.case .num {
  font-family: var(--serif);
  font-size: clamp(72px, 11vw, 160px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--accent);
  font-style: italic;
}
.case .num .slash { color: var(--ink-3); font-style: normal; padding-right: 8px; }
.case .num .word {
  display: block;
  font-family: var(--sans); font-size: 11px; font-style: normal;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  margin-top: 12px;
}
.case .body h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.6vw, 48px); line-height: 1.05;
  letter-spacing: -0.015em; margin: 0 0 6px;
}
.case .body h3 .accent { color: var(--accent); font-style: italic; }
.case .body .role {
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 28px;
}
.case .body .role strong { color: var(--paper); font-weight: 500; }

.case .story {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 32px;
  margin: 28px 0 32px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.case .story .col .label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.case .story .col p {
  font-size: 15.5px; line-height: 1.55; color: var(--paper);
  margin: 0;
}

.case .shot {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin: 24px 0 24px;
}
.case .shot figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--ink-2);
  overflow: hidden;
  border-radius: 4px;
}
.case .shot figure img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  display: block; aspect-ratio: 16 / 10;
}
.case .shot figure figcaption {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--ink);
}

.case .actions {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  margin-top: 12px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--line-2);
  color: var(--paper);
  background: transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.btn:hover { background: var(--ink-3); border-color: var(--paper); }
.btn.primary {
  background: var(--accent); color: var(--ink); border-color: var(--accent);
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn .arr { font-family: var(--serif); font-size: 16px; line-height: 1; transform: translateY(-1px); }
.case .meta-row {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin-bottom: 18px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.case .meta-row .chip {
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
}

/* ---------- testimonials / proof strip ---------- */
.proof {
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: clamp(56px, 8vw, 96px) var(--gutter);
  background: var(--ink-2);
}
.proof .grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 48px;
}
.proof .quote {
  font-family: var(--serif); font-size: clamp(20px, 2vw, 26px); line-height: 1.35;
  margin: 0 0 16px;
}
.proof .who { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.proof .who strong { color: var(--paper); font-weight: 500; }

/* ---------- closing cta ---------- */
.cta {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(96px, 14vw, 180px) var(--gutter) clamp(72px, 10vw, 120px);
}
.cta .label {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 24px;
}
.cta h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 7vw, 96px); line-height: 0.98; letter-spacing: -0.02em;
  margin: 0 0 36px;
  max-width: 14ch;
}
.cta h2 em { color: var(--accent); font-style: italic; }
.cta .row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.cta .small { color: var(--muted); font-size: 13px; margin-top: 24px; max-width: 540px; }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 32px var(--gutter);
  font-size: 13px; color: var(--muted);
}
.foot .row {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.foot a:hover { color: var(--paper); }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 40px;
  cursor: zoom-out;
}
.lb.open { display: flex; }
.lb img {
  max-width: 95vw; max-height: 90vh;
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.lb .close {
  position: absolute; top: 20px; right: 28px;
  color: var(--paper); font-family: var(--serif); font-size: 36px; line-height: 1;
  cursor: pointer; user-select: none;
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .hero .meta { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .offer .grid { grid-template-columns: 1fr; }
  .case { grid-template-columns: 1fr; gap: 16px; }
  .case .num { display: flex; align-items: baseline; gap: 18px; }
  .case .num .slash { display: none; }
  .case .story { grid-template-columns: 1fr; gap: 22px; }
  .case .shot { grid-template-columns: 1fr; }
  .proof .grid { grid-template-columns: 1fr; gap: 32px; }
  .navlinks .nav-text { display: none; }
}

/* ---------- reveal (motion) ----------
   Built from canva-style-animations primitives:
   - masked-line  (progressive enhancement, default visible)
   - counter-val  (count-up on intersection)
   - magnet-btn   (cursor-pulled CTAs)
   - spark        (rotating conic-gradient ring on .spark-card)
   - cinematic reveal on .reveal + .reveal-group (with stagger)
*/

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* base cinematic reveal — orphan + group child */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 1s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0ms),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0ms);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* masked text reveal (progressive enhancement — defaults visible) */
.masked-line {
  display: block;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s cubic-bezier(0.83, 0, 0.17, 1);
  will-change: clip-path;
}
.masked-line[data-prep] {
  clip-path: inset(0 100% 0 0);
}

/* count-up numbers inherit color/size from parent */
.counter-val {
  font-variant-numeric: tabular-nums;
}

/* magnetic CTA — content drifts toward cursor, hit-area stays put */
.magnet-btn {
  position: relative;
}
.magnet-btn .magnet-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* spark border — conic gradient rotating around the card edge.
   border-radius defaults to 18px but is overridden per card via --spark-radius. */
.spark-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--spark-radius, 18px);
}
.spark-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--spark-radius, 18px) + 1px);
  padding: 1px;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    transparent 60%,
    rgba(198,242,78,0.0) 65%,
    rgba(198,242,78,0.9) 70%,
    rgba(255,255,255,0.95) 73%,
    rgba(198,242,78,0.9) 76%,
    rgba(198,242,78,0.0) 81%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: spark 6s linear infinite;
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
}
.spark-card:hover::after { animation-duration: 3s; }
@keyframes spark { to { transform: rotate(360deg); } }
