/* ================================================================
   ABHISHEKVISHWAKARMA.COM
   Aesthetic: Editorial Authority — Fraunces serif + warm cream palette
================================================================ */

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Cream base */
  --cream:       #f5f0e8;
  --cream-2:     #ede8de;
  --cream-3:     #e3ddd2;
  --border:      #d8d2c8;

  /* Dark (hero / contact) */
  --ink:         #131109;
  --ink-2:       #1d1912;
  --ink-3:       #27231a;
  --dk-border:   rgba(255,255,255,0.07);

  /* Text */
  --text:        #1e1c15;
  --text-60:     #5a5446;
  --text-40:     #918879;
  --text-white:  #ffffff;
  --text-w70:    rgba(255,255,255,0.70);
  --text-w40:    rgba(255,255,255,0.40);
  --text-w20:    rgba(255,255,255,0.20);

  /* Gold accent */
  --gold:        #c09020;
  --gold-h:      #a87a18;
  --gold-bg:     rgba(192,144,32,0.08);
  --gold-bd:     rgba(192,144,32,0.22);

  /* Green */
  --green:       #2e9e6e;
  --green-bg:    rgba(46,158,110,0.09);
  --green-bd:    rgba(46,158,110,0.22);

  /* Typography */
  --serif:  'Fraunces', Georgia, serif;
  --sans:   'DM Sans', -apple-system, sans-serif;
  --mono:   'DM Mono', 'Courier New', monospace;

  /* Layout */
  --max-w:   1100px;
  --gutter:  48px;
  --section: 112px;

  /* Radius */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  22px;
  --r-pill:100px;

  /* Transitions */
  --t:  200ms ease;
  --ts: 380ms ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }

/* ========== LAYOUT ========== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section) 0; }

/* ========== TYPE ========== */
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.eyebrow-light { color: rgba(192,144,32,0.65); }

.section-head { margin-bottom: 64px; }

.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--cream-2);
  color: var(--text-60);
  border: 1px solid var(--border);
}

.badge-gold {
  background: var(--gold-bg);
  color: var(--gold);
  border-color: var(--gold-bd);
}

.badge-live {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green-bd);
}

.live-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.4; transform:scale(0.7); }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 28px;
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--t);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 4px 20px rgba(192,144,32,0.28);
}
.btn-gold:hover {
  background: var(--gold-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(192,144,32,0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-w70);
  border: 1px solid rgba(255,255,255,0.14);
}
.btn-ghost:hover {
  color: var(--text-white);
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.05);
}

.btn-full { width: 100%; }

/* Text link */
.text-link {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--t), opacity var(--t);
}
.text-link:hover { opacity:0.7; gap:8px; }

/* ========== SCROLL REVEAL ========== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ========== NAV ========== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  transition: background var(--ts), border-color var(--ts), padding var(--ts),
              backdrop-filter var(--ts);
}

.nav.on-light {
  background: rgba(245,240,232,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding var(--ts);
}
.nav.on-light .nav-inner { padding-top:16px; padding-bottom:16px; }

.nav-logo {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.02em;
  transition: color var(--t);
}
.nav.on-light .nav-logo { color: var(--text); }
.nav-logo:hover { color: var(--gold) !important; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-menu a {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-w70);
  transition: color var(--t);
}
.nav.on-light .nav-menu a { color: var(--text-60); }
.nav-menu a:hover { color: var(--text-white) !important; }
.nav.on-light .nav-menu a:hover { color: var(--text) !important; }

.nav-cta {
  color: var(--text-white) !important;
  background: var(--gold);
  padding: 9px 20px;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  box-shadow: 0 3px 14px rgba(192,144,32,0.28);
  transition: background var(--t), transform var(--t), box-shadow var(--t) !important;
}
.nav.on-light .nav-cta { color: var(--text-white) !important; }
.nav-cta:hover {
  background: var(--gold-h) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(192,144,32,0.36) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-white);
  border-radius: 2px;
  transition: all var(--t);
}
.nav.on-light .nav-toggle span { background: var(--text); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== HERO ========== */
.hero {
  position: relative;
  background: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Warm gradient atmosphere */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% -15%, rgba(192,144,32,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 90% 90%, rgba(192,100,20,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 5% 80%, rgba(90,60,20,0.07) 0%, transparent 50%);
  pointer-events: none;
}

/* Fine dot grid */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 176px var(--gutter) 136px;
}

/* Hero entrance animations */
.hero-label   { animation: heroIn 0.7s ease both; animation-delay: 0.1s; }
.hero-h1      { animation: heroIn 0.8s ease both; animation-delay: 0.28s; }
.hero-sub     { animation: heroIn 0.7s ease both; animation-delay: 0.46s; }
.hero-actions { animation: heroIn 0.7s ease both; animation-delay: 0.60s; }
.hero-proof   { animation: heroIn 0.6s ease both; animation-delay: 0.72s; }

@keyframes heroIn {
  from { opacity:0; transform: translateY(22px); }
  to   { opacity:1; transform: none; }
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 40px;
  padding: 8px 18px 8px 14px;
  background: rgba(192,144,32,0.09);
  border: 1px solid rgba(192,144,32,0.2);
  border-radius: var(--r-pill);
}

.hero-label-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: livePulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
.hero-label-sep { opacity: 0.35; }

.hero-h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 6.5vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text-white);
  margin-bottom: 32px;
  max-width: 760px;
}

.hero-h1 em {
  font-style: italic;
  color: var(--gold);
  display: block;
  font-size: 1.08em;
}

.hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-w70);
  line-height: 1.82;
  max-width: 520px;
  margin-bottom: 52px;
}
.hero-br { display: block; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.hero-proof {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-w20);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Scroll line */
.hero-scroll {
  position: absolute;
  bottom: 48px;
  left: var(--gutter);
}
.hero-scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, rgba(192,144,32,0.5), transparent);
  animation: scrollIn 2s ease-in-out infinite;
}
@keyframes scrollIn {
  0%,100% { transform: scaleY(1); opacity:0.5; }
  50%      { transform: scaleY(0.55); opacity:1; }
}

/* ========== WORK / CASE STUDIES ========== */
.work { background: var(--cream); }

/* Featured case study */
.case-feature {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 56px;
  margin-bottom: 22px;
  transition: border-color var(--ts), box-shadow var(--ts);
}
.case-feature:hover {
  border-color: var(--gold-bd);
  box-shadow: 0 24px 64px rgba(192,144,32,0.07);
}

.case-feature-top {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.case-feature-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-40);
  letter-spacing: 0.1em;
  margin-right: 4px;
}

.case-feature-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1;
}

.case-feature-client {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-40);
  letter-spacing: 0.06em;
}

.case-feature-body {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 56px;
  align-items: start;
}

.case-feature-copy h3 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 18px;
}
.case-feature-copy h3 span {
  display: block;
  font-weight: 400;
  font-style: italic;
  color: var(--text-60);
  font-size: 0.85em;
}

.case-feature-copy p {
  font-size: 0.95rem;
  color: var(--text-60);
  line-height: 1.82;
  margin-bottom: 26px;
}

/* Stats */
.case-feature-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.case-stat {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 16px;
  text-align: center;
  transition: border-color var(--t);
}
.case-stat:hover { border-color: var(--gold-bd); }

.case-stat-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--gold);
  line-height: 1.05;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.case-stat-label {
  font-size: 0.72rem;
  color: var(--text-60);
  line-height: 1.4;
  font-weight: 500;
}

/* Secondary cards */
.case-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.case-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px;
  transition: border-color var(--ts), box-shadow var(--ts), transform var(--ts);
}
.case-card:hover {
  border-color: var(--gold-bd);
  box-shadow: 0 14px 44px rgba(192,144,32,0.07);
  transform: translateY(-3px);
}

.case-card-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-40);
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}

.case-card-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.case-card h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 7px;
  line-height: 1.25;
}

.case-card-client {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-40);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.case-card p {
  font-size: 0.88rem;
  color: var(--text-60);
  line-height: 1.78;
  margin-bottom: 16px;
}

.case-card-tagline {
  font-family: var(--serif);
  font-size: 0.9rem !important;
  font-style: italic;
  color: var(--text) !important;
  margin-bottom: 0 !important;
  opacity: 0.65;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ========== SERVICES ========== */
.services {
  background: var(--cream-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.services-list {
  border-top: 1px solid var(--border);
  margin-bottom: 52px;
}

.service-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 32px;
  align-items: start;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.service-item:hover { background: rgba(192,144,32,0.02); }

.service-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-40);
  letter-spacing: 0.1em;
  padding-top: 4px;
}

.service-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.service-body h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.service-best {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-40);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.service-body p {
  font-size: 0.92rem;
  color: var(--text-60);
  line-height: 1.78;
  max-width: 680px;
}

.services-footer { text-align: center; }

.engagement-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--text-40);
}
.engagement-sep { opacity: 0.4; }

/* ========== ABOUT ========== */
.about { background: var(--cream); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 88px;
  align-items: start;
}

.about-left .eyebrow { margin-bottom: 24px; }

.about-quote {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-style: italic;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.02em;
  padding-left: 24px;
  border-left: 3px solid var(--gold);
  margin-bottom: 36px;
}

.about-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.about-photo-area {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 36px;
}

.about-photo-wrap {
  position: relative;
  width: 148px;
  flex-shrink: 0;
}

.about-photo {
  width: 148px;
  height: 148px;
  object-fit: cover;
  object-position: center top;
  border-radius: 10px;
  display: block;
  filter: sepia(12%) contrast(1.06) brightness(0.97) saturate(0.88);
  border: 1px solid rgba(192,144,32,0.22);
  box-shadow: 0 8px 32px rgba(19,17,9,0.14), 0 2px 8px rgba(19,17,9,0.08);
  transition: filter 0.4s ease, box-shadow 0.4s ease;
}
.about-photo:hover {
  filter: sepia(6%) contrast(1.04) brightness(1.0) saturate(0.95);
  box-shadow: 0 12px 40px rgba(19,17,9,0.18), 0 2px 8px rgba(19,17,9,0.1);
}

.about-photo-glow {
  position: absolute;
  inset: -1px;
  border-radius: 11px;
  background: transparent;
  border: 1px solid rgba(192,144,32,0.15);
  pointer-events: none;
}

/* Tech ticker */
.tech-ticker {
  display: flex;
  gap: 6px;
  height: 148px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
}
.tech-ticker-col { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.tech-ticker-track {
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: tc-up 18s linear infinite;
  will-change: transform;
}
.tech-ticker-track--dn { animation: tc-dn 22s linear infinite; }
@keyframes tc-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes tc-dn  { from { transform: translateY(-50%); } to { transform: translateY(0); } }
.tc {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  color: rgba(192,144,32,0.6);
  background: rgba(192,144,32,0.05);
  border: 1px solid rgba(192,144,32,0.14);
  border-radius: 4px;
  padding: 3px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s, background 0.2s;
}
.tech-ticker:hover .tech-ticker-track { animation-play-state: paused; }
.tech-ticker:hover .tc { color: rgba(192,144,32,0.85); background: rgba(192,144,32,0.09); }

.about-bio {
  font-size: 0.97rem;
  color: var(--text-60);
  line-height: 1.82;
  margin-bottom: 16px;
}

.about-numbers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.about-number-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.about-number-item:last-child { border-bottom: none; }

.about-number {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: -0.03em;
  min-width: 90px;
}

.about-number-label {
  font-size: 0.83rem;
  color: var(--text-60);
  line-height: 1.4;
}

/* ========== STACK DIAGRAM ========== */
.stack-diagram {
  margin-top: 5rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border);
}

.stack-header {
  margin-bottom: 2.5rem;
}

.stack-sub {
  font-size: 0.97rem;
  color: var(--text-60);
  line-height: 1.7;
  margin-top: 0.5rem;
  max-width: 480px;
}

.stack-frame {
  position: relative;
  padding-left: 1.25rem;
}

.stack-spine {
  position: absolute;
  left: 0;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(192,144,32,0.25) 12%,
    rgba(192,144,32,0.85) 35%,
    rgba(192,144,32,0.85) 58%,
    rgba(192,144,32,0.25) 78%,
    transparent 100%
  );
  border-radius: 2px;
}

.stack-layer {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem 2rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background var(--t);
}
.stack-layer:first-of-type { border-top: 1px solid var(--border); }
.stack-layer:hover { background: rgba(192,144,32,0.025); }

.stack-layer--ai {
  background: rgba(192,144,32,0.04);
  border: 1px solid rgba(192,144,32,0.18);
  border-radius: 6px;
  margin: 0.35rem 0;
}
.stack-layer--ai:hover { background: rgba(192,144,32,0.07); }

.stack-layer-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stack-layer-num {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-40);
  letter-spacing: 0.1em;
}

.stack-layer-name {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.stack-layer--ai .stack-layer-name { color: var(--gold); }

.stack-layer-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(192,144,32,0.12);
  border: 1px solid rgba(192,144,32,0.25);
  padding: 0.15em 0.55em;
  border-radius: 3px;
  margin-top: 0.3rem;
  width: fit-content;
}

.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stack-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--text-60);
  background: var(--cream-2);
  padding: 0.28em 0.7em;
  border-radius: 3px;
  border: 1px solid var(--border);
  transition: color var(--t), border-color var(--t), background var(--t);
}
.stack-chip:hover {
  color: var(--text);
  border-color: rgba(192,144,32,0.3);
  background: rgba(192,144,32,0.04);
}

.stack-chip--gold {
  color: var(--gold);
  background: rgba(192,144,32,0.06);
  border-color: rgba(192,144,32,0.22);
}
.stack-chip--gold:hover {
  background: rgba(192,144,32,0.12);
  border-color: rgba(192,144,32,0.45);
}

/* ========== WRITING ========== */
.writing {
  background: var(--cream-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.writing-list {
  border-top: 1px solid var(--border);
  margin-bottom: 48px;
}

.writing-item { border-bottom: 1px solid var(--border); }

.writing-link-wrap {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 36px 0;
  transition: background var(--t);
  cursor: pointer;
}
.writing-link-wrap:hover { background: rgba(192,144,32,0.025); }

.writing-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-40);
  letter-spacing: 0.1em;
}

.writing-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.writing-tag {
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.writing-sep { color: var(--text-40); font-size: 0.7rem; }

.writing-body h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.35;
}

.writing-arrow {
  font-size: 1.1rem;
  color: var(--text-40);
  transition: color var(--t), transform var(--t);
  flex-shrink: 0;
}
.writing-link-wrap:hover .writing-arrow {
  color: var(--gold);
  transform: translateX(4px);
}

.writing-footer { text-align: center; }

/* ========== CONTACT ========== */
.contact {
  background: var(--ink-2);
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Subtle warm glow */
.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 110%, rgba(192,100,20,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.contact { position: relative; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 88px;
  align-items: start;
}

.contact-h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-white);
  margin-bottom: 22px;
}
.contact-h2 em {
  font-style: italic;
  color: var(--gold);
}

.contact-intro {
  font-size: 0.95rem;
  color: var(--text-w70);
  line-height: 1.82;
  margin-bottom: 40px;
}

.contact-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.contact-step {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-w70);
}

.contact-step-num {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--gold);
  padding: 5px 9px;
  background: rgba(192,144,32,0.1);
  border: 1px solid rgba(192,144,32,0.2);
  border-radius: 5px;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
  letter-spacing: 0.06em;
}

.contact-who-label {
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-w40);
  margin-bottom: 12px;
}

.contact-who-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-who-list span {
  padding: 5px 14px;
  border: 1px solid var(--dk-border);
  border-radius: var(--r-pill);
  font-size: 0.77rem;
  color: var(--text-w40);
  font-weight: 500;
  background: rgba(255,255,255,0.03);
}

/* Form */
.form {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--dk-border);
  border-radius: var(--r-lg);
  padding: 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--text-w40);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--dk-border);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text-white);
  transition: border-color var(--t), background var(--t);
  outline: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255,255,255,0.18);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(192,144,32,0.45);
  background: rgba(192,144,32,0.04);
}

.form-note {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-w20);
  text-align: center;
  letter-spacing: 0.04em;
  margin-top: -4px;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--ink);
  border-top: 1px solid var(--dk-border);
  padding: 44px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--dk-border);
}

.footer-name {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.footer-role {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-w20);
  letter-spacing: 0.06em;
}

.footer-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.82rem;
  color: var(--text-w40);
  transition: color var(--t);
}
.footer-nav a:hover { color: var(--text-white); }

.footer-copy {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.15);
  letter-spacing: 0.04em;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  :root { --gutter: 32px; --section: 88px; }

  .case-feature-body {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .case-feature-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 60px;
  }
  .tech-ticker { display: none; }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .writing-link-wrap {
    grid-template-columns: 48px 1fr auto;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  :root { --gutter: 24px; --section: 72px; }

  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 0; right: -100%; bottom: 0;
    width: 280px;
    background: rgba(19, 17, 9, 0.97);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-left: 1px solid var(--dk-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 112px 32px 48px;
    gap: 24px;
    transition: right var(--ts);
    box-shadow: -32px 0 80px rgba(0,0,0,0.7);
  }
  .nav-menu.open { right: 0; }
  .nav.on-light .nav-menu a { color: var(--text-w70); }
  .nav.on-light .nav-menu a:hover { color: var(--text-white) !important; }
  .nav-cta { padding: 12px 24px !important; margin-top: 8px; }

  .hero-inner { padding: 150px 24px 96px; }
  .hero-h1 { font-size: clamp(2.6rem, 8vw, 3.5rem); }
  .hero-sub { font-size: 1rem; }
  .hero-br { display: none; }

  .case-feature { padding: 32px; }
  .case-feature-top { flex-direction: column; align-items: flex-start; }
  .case-feature-stats { grid-template-columns: 1fr 1fr; }

  .case-grid { grid-template-columns: 1fr; }

  .service-item { grid-template-columns: 44px 1fr; gap: 20px; padding: 32px 0; }
  .service-head { flex-direction: column; gap: 6px; }
  .service-best { white-space: normal; }

  .writing-link-wrap {
    grid-template-columns: 1fr auto;
    padding: 28px 0;
  }
  .writing-num { display: none; }

  .form { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-nav { gap: 18px; }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: 2.4rem; }
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
  .case-feature-stats { grid-template-columns: 1fr 1fr; }
  .about-numbers { gap: 0; }
  .stack-layer {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .stack-spine { display: none; }
  .stack-frame { padding-left: 0; }
}

/* ================================================================
   PREMIUM 3D & MOTION ENHANCEMENTS
================================================================ */

/* ── Hero section bottom rule ────────────────────────────────── */
.work {
  border-top: 1px solid var(--gold-bd);
}

/* ── Hero floating 3D proof cards ────────────────────────────── */
.hero-peek {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 3;
  pointer-events: none;
  animation: heroIn 1s ease both;
  animation-delay: 0.9s;
}

.peek-card {
  background: rgba(25, 21, 12, 0.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(192, 144, 32, 0.2);
  border-radius: 16px;
  padding: 22px 24px;
  width: 240px;
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: cardFloat 5s ease-in-out infinite;
}

.peek-card--chips {
  width: 212px;
  margin-left: 28px;
  padding: 18px 20px;
  animation-duration: 5.5s;
  animation-delay: 0.6s;
}

@keyframes cardFloat {
  0%, 100% { transform: perspective(800px) rotateY(-7deg) rotateX(4deg) translateY(0px); }
  50%       { transform: perspective(800px) rotateY(-7deg) rotateX(4deg) translateY(-11px); }
}

.peek-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.peek-client {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
}

.peek-project {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.peek-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.peek-metric {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}

.peek-metric-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: -0.03em;
  margin-bottom: 3px;
}

.peek-metric-label {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.3;
}

/* Progress bar */
.peek-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.peek-progress-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.peek-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.peek-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-h), var(--gold));
  border-radius: 2px;
  width: 0;
  animation: fillBar 2s ease 1.4s forwards;
}

@keyframes fillBar {
  to { width: 95%; }
}

.peek-progress-val {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

/* Chips card */
.peek-chips-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  display: block;
  margin-bottom: 12px;
}

.peek-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.peek-chips span {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  padding: 4px 10px;
  background: rgba(192, 144, 32, 0.1);
  border: 1px solid rgba(192, 144, 32, 0.18);
  border-radius: 20px;
}

/* Only show on wide screens */
@media (max-width: 1260px) {
  .hero-peek { display: none; }
}

/* ── Card shine (3D tilt reflection layer) ───────────────────── */
.card-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: overlay;
  transition: background 0.1s ease;
}

/* ── Custom cursor glow ──────────────────────────────────────── */
#cursor-glow {
  position: fixed;
  top:  -180px;
  left: -180px;
  width:  360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 144, 32, 0.06) 0%, transparent 68%);
  pointer-events: none;
  z-index: 9998;
  will-change: transform;
  transition: width 0.35s ease, height 0.35s ease;
}

#cursor-glow.cursor-large {
  width:  520px;
  height: 520px;
  top:  -260px;
  left: -260px;
  background: radial-gradient(circle, rgba(192, 144, 32, 0.045) 0%, transparent 65%);
}

/* ── Active nav link ─────────────────────────────────────────── */
.nav-active {
  color: var(--text-white) !important;
}
.nav.on-light .nav-active {
  color: var(--text) !important;
}

/* ── Service item left border on hover ───────────────────────── */
.service-item {
  position: relative;
}
.service-item::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 40px; bottom: 40px;
  width: 2px;
  background: var(--gold);
  border-radius: 2px;
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}
.service-item:hover::before {
  transform: scaleY(1);
}

/* ── Writing item number highlight on hover ──────────────────── */
.writing-link-wrap:hover .writing-num {
  color: var(--gold);
  transition: color 0.2s ease;
}

/* ── Contact section (ensure position:relative for ::before) ─── */
.contact { isolation: isolate; }

/* ── Smooth hero inner text on scroll ───────────────────────── */
.hero-inner { will-change: transform, opacity; }

/* ================================================================
   A — ANIMATED HERO BLOBS
================================================================ */

.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  filter: blur(72px);
  mix-blend-mode: screen;
}

.hero-blob-1 {
  width: 640px; height: 420px;
  background: radial-gradient(ellipse, rgba(192,144,32,0.1) 0%, transparent 70%);
  top: -8%; left: 18%;
  animation: blob1 16s ease-in-out infinite;
}

.hero-blob-2 {
  width: 480px; height: 560px;
  background: radial-gradient(ellipse, rgba(180,90,20,0.07) 0%, transparent 70%);
  bottom: 5%; right: 2%;
  animation: blob2 20s ease-in-out infinite;
}

.hero-blob-3 {
  width: 360px; height: 360px;
  background: radial-gradient(ellipse, rgba(100,60,20,0.08) 0%, transparent 70%);
  top: 35%; left: -4%;
  animation: blob3 24s ease-in-out infinite;
}

@keyframes blob1 {
  0%,100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(40px, -30px) scale(1.08); }
  50%      { transform: translate(15px, 20px) scale(0.96); }
  75%      { transform: translate(-25px, -10px) scale(1.04); }
}

@keyframes blob2 {
  0%,100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-40px, -28px) scale(1.1); }
  66%      { transform: translate(20px, 18px) scale(0.94); }
}

@keyframes blob3 {
  0%,100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  40%      { transform: translate(24px, -18px) scale(1.14); opacity: 1; }
  80%      { transform: translate(-16px, 12px) scale(0.9); opacity: 0.7; }
}

/* ================================================================
   B — SVG PROGRESS RINGS (replaces flat case-stat boxes)
================================================================ */

.case-feature-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-width: 300px;
}

.ring-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 12px 14px;
  transition: border-color var(--t), box-shadow var(--t);
}

.ring-stat:hover {
  border-color: var(--gold-bd);
  box-shadow: 0 4px 20px rgba(192,144,32,0.07);
}

.ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.ring-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-track {
  fill: none;
  stroke: var(--cream-3);
  stroke-width: 5;
}

.ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 5;
  stroke-linecap: round;
  /* r=38, circumference = 2π*38 = 238.76 */
  stroke-dasharray: 238.76;
  stroke-dashoffset: 238.76;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-num {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: -0.03em;
  line-height: 1;
}

.ring-label {
  font-size: 0.7rem;
  color: var(--text-60);
  line-height: 1.35;
  font-weight: 500;
  text-align: center;
}

/* ================================================================
   C — READING PROGRESS BAR
================================================================ */

.read-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-h) 0%, var(--gold) 60%, rgba(192,144,32,0.4) 100%);
  border-radius: 0 2px 2px 0;
  z-index: 10;
  opacity: 0;
  transition: width 0.08s linear, opacity 0.4s ease;
}

.read-progress.active {
  opacity: 1;
}

/* ================================================================
   D — WORK SECTION PROJECT TIMELINE CONNECTOR
================================================================ */

.case-connector {
  display: flex;
  padding-left: 40px;
  height: 36px;
  align-items: center;
  margin: 0;
}

.case-connector-line {
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, var(--border), transparent);
}

/* ================================================================
   E — SECTION BACKGROUND NUMBERS
================================================================ */

.section-head {
  position: relative;
  overflow: visible;
}

.section-head[data-num]::before {
  content: attr(data-num);
  position: absolute;
  top: -0.28em;
  left: -0.06em;
  font-family: var(--mono);
  font-size: 9.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.1em;
  color: var(--text);
  opacity: 0;
  transform: translateX(-18px);
  transition: opacity 1s ease 0.2s, transform 1s ease 0.2s;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.section-head[data-num].visible::before {
  opacity: 0.04;
  transform: translateX(0);
}

/* Keep section-head children above the number */
.section-head > * {
  position: relative;
  z-index: 1;
}

/* ================================================================
   F — BACK TO TOP BUTTON
================================================================ */

/* ================================================================
   AI CHAT
================================================================ */

.ai-chat-btn {
  position: fixed;
  bottom: 36px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px 0 13px;
  height: 46px;
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: 23px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  z-index: 998;
  box-shadow: 0 4px 24px rgba(192,144,32,0.38);
  opacity: 0;
  transform: translateY(14px) scale(0.88);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.ai-chat-btn.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.ai-chat-btn:hover {
  background: var(--gold-h);
  transform: translateY(-2px);
  box-shadow: 0 6px 32px rgba(192,144,32,0.5);
}

/* Modal overlay */
.ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19,17,9,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.ai-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal box */
.ai-modal {
  width: 100%;
  max-width: 520px;
  height: min(580px, 85vh);
  background: var(--ink-2);
  border: 1px solid rgba(192,144,32,0.22);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.45), 0 0 0 1px rgba(192,144,32,0.08);
  transform: translateY(28px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34,1.4,0.64,1);
}
.ai-modal-overlay.open .ai-modal { transform: none; }

/* Header */
.ai-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(192,144,32,0.05);
  flex-shrink: 0;
}
.ai-modal-title { display: flex; flex-direction: column; gap: 4px; }
.ai-modal-name {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: -0.02em;
}
.ai-modal-badge {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
}
.ai-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(245,240,232,0.55);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.ai-modal-close:hover { background: rgba(255,255,255,0.12); color: var(--cream); }
.ai-modal-actions { display: flex; align-items: center; gap: 0.4rem; }
.ai-clear-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(245,240,232,0.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.ai-clear-btn:hover { background: rgba(220,60,60,0.15); color: rgba(220,80,80,0.9); border-color: rgba(220,60,60,0.25); }

/* Messages */
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.ai-messages::-webkit-scrollbar { width: 3px; }
.ai-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.ai-msg { display: flex; }
.ai-msg--user { justify-content: flex-end; }
.ai-msg--ai   { justify-content: flex-start; }

.ai-bubble {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.65;
  white-space: pre-wrap;
}
.ai-msg--user .ai-bubble {
  background: var(--gold);
  color: var(--ink);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.ai-msg--ai .ai-bubble {
  background: rgba(255,255,255,0.07);
  color: rgba(245,240,232,0.88);
  border: 1px solid rgba(255,255,255,0.07);
  border-bottom-left-radius: 4px;
}

/* Markdown inside AI bubbles */
.ai-msg--ai .ai-bubble p { margin: 0 0 0.45em; }
.ai-msg--ai .ai-bubble p:last-child { margin-bottom: 0; }
.ai-msg--ai .ai-bubble ul { margin: 0.3em 0; padding-left: 1.1em; }
.ai-msg--ai .ai-bubble li { margin-bottom: 0.2em; }
.ai-msg--ai .ai-bubble strong { color: rgba(245,240,232,1); font-weight: 600; }
.ai-msg--ai .ai-bubble code { font-family: var(--mono); font-size: 0.78em; background: rgba(255,255,255,0.08); padding: 0.1em 0.35em; border-radius: 3px; }
.ai-msg--ai .ai-bubble a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* Typing cursor */
.ai-bubble.typing::after {
  content: '▋';
  color: var(--gold);
  animation: cur-blink 0.75s step-end infinite;
}
@keyframes cur-blink { 0%,100%{opacity:1} 50%{opacity:0} }
.ai-bubble.thinking::before {
  content: 'Thinking…';
  font-style: italic;
  font-size: 0.78rem;
  color: rgba(192,144,32,0.55);
  animation: cur-blink 1.2s step-end infinite;
}

/* Status messages */
.ai-status {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  border-radius: 8px;
  line-height: 1.55;
  text-align: center;
}
.ai-status--info {
  color: rgba(245,240,232,0.55);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ai-status--error {
  color: rgba(255,120,100,0.9);
  background: rgba(255,100,80,0.07);
  border: 1px solid rgba(255,100,80,0.18);
}

.ai-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(192,144,32,0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: ai-spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-status--info .ai-status-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-progress {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ai-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Footer / input */
.ai-modal-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 14px 16px 12px;
  flex-shrink: 0;
}
.ai-input-wrap { display: flex; gap: 8px; align-items: center; }
.ai-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ai-input::placeholder { color: rgba(245,240,232,0.28); }
.ai-input:focus { border-color: rgba(192,144,32,0.5); background: rgba(255,255,255,0.09); }
.ai-input:disabled { opacity: 0.35; cursor: not-allowed; }

.ai-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--ink);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}
.ai-send:hover { background: var(--gold-h); transform: scale(1.06); }
.ai-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.ai-disclaimer {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.18);
  text-align: center;
  margin-top: 9px;
}

@media (max-width: 640px) {
  .ai-chat-btn { bottom: 24px; left: 20px; }
  .ai-modal { border-radius: 12px; height: min(520px, 88vh); }
}

.back-top {
  position: fixed;
  bottom: 36px;
  right: 36px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 800;
  opacity: 0;
  transform: translateY(14px) scale(0.88);
  transition: opacity 0.35s ease, transform 0.35s ease,
              background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(192,144,32,0.32);
  pointer-events: none;
}

.back-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-top:hover {
  background: var(--gold-h);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(192,144,32,0.45);
}

.back-top:active {
  transform: scale(0.94);
}

@media (max-width: 768px) {
  .back-top { bottom: 24px; right: 20px; width: 40px; height: 40px; }
  .hero-blob { filter: blur(56px); }
  .hero-blob-1 { width: 400px; height: 280px; }
  .hero-blob-2 { width: 320px; height: 380px; }
  .hero-blob-3 { width: 240px; height: 240px; }
  .case-feature-stats { grid-template-columns: 1fr 1fr; min-width: unset; }
  .ring-wrap { width: 80px; height: 80px; }
  .ring-num { font-size: 0.9rem; }
  .section-head[data-num]::before { font-size: 6rem; }
}

/* ================================================================
   CASE STUDY PAGE
================================================================ */

.cs-hero {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  padding: 176px var(--gutter) 96px;
}

.cs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(192,144,32,0.11) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 92% 88%, rgba(192,100,20,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.cs-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.cs-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
}

.cs-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-w40);
  margin-bottom: 40px;
  transition: color var(--t), gap var(--t);
}
.cs-breadcrumb:hover { color: var(--gold); gap: 12px; }

.cs-hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.cs-hero-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.09;
  color: var(--text-white);
  max-width: 840px;
  margin-bottom: 24px;
}
.cs-hero-title em {
  font-style: italic;
  color: var(--gold);
}

.cs-hero-sub {
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  color: var(--text-w70);
  line-height: 1.8;
  max-width: 560px;
  margin-bottom: 52px;
}

.cs-hero-meta {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
  padding-top: 36px;
  border-top: 1px solid var(--dk-border);
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 36px;
  margin-right: 36px;
  border-right: 1px solid var(--dk-border);
}
.cs-meta-item:last-child { border-right: none; margin-right: 0; padding-right: 0; }

.cs-meta-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-w20);
}
.cs-meta-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-w70);
}
.cs-meta-value--live {
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Key facts strip */
.cs-brief {
  background: var(--cream-2);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.cs-brief-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-left: 1px solid var(--border);
}

.cs-brief-item {
  padding: 28px 28px 26px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  transition: background var(--t);
}
.cs-brief-item:hover { background: var(--cream); }

.cs-brief-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-40);
  margin-bottom: 9px;
}
.cs-brief-value {
  font-size: 0.91rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

/* Main content layout */
.cs-content {
  background: var(--cream);
}

.cs-section {
  padding: 88px 0;
  border-bottom: 1px solid var(--border);
}
.cs-section:last-child { border-bottom: none; }

.cs-section-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 72px;
  align-items: start;
}

.cs-section-label {
  position: sticky;
  top: 96px;
}
.cs-section-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cs-section-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.25;
}

.cs-body p {
  font-size: 0.97rem;
  color: var(--text-60);
  line-height: 1.88;
  margin-bottom: 20px;
  max-width: 680px;
}
.cs-body p:last-child { margin-bottom: 0; }
.cs-body strong { color: var(--text); font-weight: 600; }

.cs-lead {
  font-size: 1.12rem !important;
  color: var(--text-60) !important;
  line-height: 1.78 !important;
  font-style: italic;
}

.cs-callout {
  background: rgba(192,144,32,0.05);
  border: 1px solid rgba(192,144,32,0.16);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 20px 26px;
  margin: 28px 0;
}
.cs-callout p {
  font-family: var(--serif);
  font-size: 1.02rem !important;
  font-style: italic;
  color: var(--text) !important;
  margin-bottom: 0 !important;
  line-height: 1.6 !important;
  opacity: 0.85;
}

.cs-insight-list {
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-insight-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.cs-insight-num {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  padding: 4px 9px;
  background: rgba(192,144,32,0.08);
  border: 1px solid rgba(192,144,32,0.18);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}
.cs-insight-text {
  font-size: 0.9rem;
  color: var(--text-60);
  line-height: 1.7;
}
.cs-insight-text strong { color: var(--text); font-weight: 600; }

/* Feature grid */
.cs-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.cs-feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  transition: border-color var(--t), box-shadow var(--t), transform var(--ts);
}
.cs-feature-card:hover {
  border-color: var(--gold-bd);
  box-shadow: 0 8px 28px rgba(192,144,32,0.07);
  transform: translateY(-2px);
}

.cs-feature-num {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-40);
  margin-bottom: 14px;
}
.cs-feature-title {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.cs-feature-desc {
  font-size: 0.83rem;
  color: var(--text-60);
  line-height: 1.72;
}

/* Phase list */
.cs-phase-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}
.cs-phase-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.cs-phase-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 2px;
}
.cs-phase-body h4 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.cs-phase-body p {
  font-size: 0.86rem !important;
  margin-bottom: 0 !important;
}

/* Results section (dark) */
.cs-results {
  background: var(--ink-2);
  padding: 96px 0;
  position: relative;
  isolation: isolate;
}
.cs-results::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% -5%, rgba(192,144,32,0.09) 0%, transparent 55%);
  pointer-events: none;
}

.cs-results-intro {
  font-size: 0.95rem;
  color: var(--text-w70);
  line-height: 1.8;
  max-width: 560px;
  margin-top: 16px;
}

.cs-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 52px;
}

.cs-result-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-md);
  padding: 30px 22px;
  text-align: center;
  transition: border-color var(--t), background var(--t), transform var(--ts);
}
.cs-result-item:hover {
  border-color: rgba(192,144,32,0.28);
  background: rgba(192,144,32,0.04);
  transform: translateY(-2px);
}

.cs-result-num {
  display: block;
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 10px;
}
.cs-result-label {
  font-size: 0.78rem;
  color: var(--text-w40);
  line-height: 1.5;
  font-weight: 500;
}

/* Lessons section */
.cs-lessons {
  background: var(--cream-2);
  border-top: 1px solid var(--border);
  padding: 96px 0;
}

.cs-lesson-list {
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.cs-lesson-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 28px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  transition: background var(--t);
  position: relative;
}
.cs-lesson-item::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 36px; bottom: 36px;
  width: 2px;
  background: var(--gold);
  border-radius: 2px;
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}
.cs-lesson-item:hover::before { transform: scaleY(1); }
.cs-lesson-item:hover { background: rgba(192,144,32,0.015); }

.cs-lesson-num {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 500;
  color: rgba(192,144,32,0.18);
  letter-spacing: -0.04em;
  line-height: 1.1;
  padding-top: 3px;
}

.cs-lesson-body h4 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}
.cs-lesson-body p {
  font-size: 0.88rem;
  color: var(--text-60);
  line-height: 1.82;
}

/* CTA strip */
.cs-cta {
  background: var(--ink);
  padding: 88px 0;
  position: relative;
  isolation: isolate;
  text-align: center;
}
.cs-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(192,144,32,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.cs-cta-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(192,144,32,0.6);
  display: block;
  margin-bottom: 18px;
}
.cs-cta h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text-white);
  margin-bottom: 16px;
}
.cs-cta h2 em { font-style: italic; color: var(--gold); }
.cs-cta p {
  font-size: 0.97rem;
  color: var(--text-w70);
  line-height: 1.75;
  max-width: 480px;
  margin: 0 auto 36px;
}
.cs-cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Case study responsive ───────────────────────────────────── */
@media (max-width: 960px) {
  .cs-hero { padding: 160px var(--gutter) 72px; }
  .cs-section-grid { grid-template-columns: 1fr; gap: 36px; }
  .cs-section-label { position: static; }
  .cs-brief-grid { grid-template-columns: 1fr 1fr; }
  .cs-results-grid { grid-template-columns: repeat(3, 1fr); }
  .cs-meta-item { padding-right: 24px; margin-right: 24px; }
}

@media (max-width: 768px) {
  .cs-hero { padding: 140px 24px 64px; }
  .cs-features { grid-template-columns: 1fr; }
  .cs-phase-item { grid-template-columns: 1fr; gap: 6px; padding: 22px 0; }
  .cs-lesson-item { grid-template-columns: 52px 1fr; gap: 18px; }
  .cs-lesson-num { font-size: 1.4rem; }
  .cs-hero-meta { gap: 0; }
  .cs-meta-item {
    padding: 16px 0;
    margin: 0;
    border-right: none;
    border-bottom: 1px solid var(--dk-border);
    width: 100%;
  }
  .cs-meta-item:last-child { border-bottom: none; }
}

@media (max-width: 640px) {
  .cs-brief-grid { grid-template-columns: 1fr; }
  .cs-results-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cs-result-num { font-size: 1.9rem; }
}

@media (max-width: 480px) {
  .cs-results-grid { grid-template-columns: 1fr; }
}
