/* ── RESET + TOKENS ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --void: #0a0b2e;
  --solstice: #6b3fa0;
  --lumina: #c4a8ff;
  --gold: #d4a847;
  --iris: #8de8d8;
  --stardust: #f0ecff;
  --muted: #7a6e9a;
  --border: rgba(196,168,255,0.13);
}

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--stardust);
  font-family: sans-serif;
  overflow-x: hidden;
  cursor: none;
}

/* ── CURSOR ── */
.cursor {
  position: fixed;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(196,168,255,0.75);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  mix-blend-mode: screen;
  transition: transform .15s;
}
.cursor.hovering { transform: translate(-50%,-50%) scale(2.2); }
.trail-dot {
  position: fixed;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(196,168,255,0.45);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%);
}

/* ── CANVAS ── */
#bgCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── NAV ── */
nav {
  position: relative;
  z-index: 1000;
  padding: 1.4rem 4rem;
  background: transparent;
  border-bottom: none;
}
.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--stardust);
  text-decoration: none;
}
.nav-logo span { color: var(--lumina); }
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  font-size: .7rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  font-family: sans-serif;
  transition: color .2s;
  position: relative;
}
.nav-links a:hover { color: var(--lumina); }
/* Active state — distinct from hover via ::after dot */
.nav-links a.active { color: var(--lumina); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--lumina);
}
.nav-cta {
  padding: .55rem 1.4rem;
  border: 1px solid rgba(196,168,255,.35);
  border-radius: 30px;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lumina);
  background: transparent;
  cursor: pointer;
  font-family: sans-serif;
  transition: background .2s, transform .15s;
}
.nav-cta:hover { background: rgba(196,168,255,.09); transform: translateY(-1px); }

/* ── SHARED TYPOGRAPHY ── */
.sec-eyebrow {
  font-size: .6rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--lumina);
  font-family: sans-serif;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.sec-eyebrow::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 1px;
  background: linear-gradient(to right, var(--lumina), rgba(196,168,255,0));
  flex-shrink: 0;
}
.sec-body {
  font-size: 1rem;
  color: rgba(240,236,255,.88);
  line-height: 1.85;
  font-family: sans-serif;
  font-weight: 300;
}
/* First paragraph in a section gets a slightly larger lead style */
.cs-section > .sec-body:first-of-type {
  font-size: 1.05rem;
}
/* margin: 2rem 0 intentionally overrides index.html's margin: 0 — provides prose spacing between sections */
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* .case-tag resting state (matches index.html) — adds display:inline-block, transition, and :hover not present on index.html */
.case-tag {
  font-size: .58rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: .22rem .65rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: sans-serif;
  transition: color .2s, border-color .2s;
  display: inline-block;
}
/* Hover — new rule in case-study.css only; index.html's .case-tag is not modified */
.case-tag:hover {
  color: var(--lumina);
  border-color: rgba(196,168,255,.4);
}

/* ── PAGE LAYOUT ── */
.cs-page {
  position: relative;
  z-index: 1;
  padding: 2rem 2rem 4rem;
  min-height: 100vh;
}
.cs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 3rem 6rem;
  display: flex;
  gap: 4rem;
  background: rgba(8, 6, 35, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(196,168,255,0.12);
  border-radius: 20px;
  box-shadow: 0 0 80px rgba(107,63,160,0.18), inset 0 1px 0 rgba(196,168,255,0.07);
  align-items: flex-start;
}

/* ── SIDEBAR ── */
.cs-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cs-sidebar-back {
  font-size: .66rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  font-family: sans-serif;
  transition: color .2s;
  margin-bottom: .3rem;
  display: inline-block;
}
.cs-sidebar-back:hover { color: var(--lumina); }

/* sidebar meta blocks — same visual treatment as .skill-card in index.html, renamed to avoid collision */
.cs-sidebar-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  transition: border-color .3s, background .3s;
}
.cs-sidebar-card:hover {
  border-color: rgba(196,168,255,.35);
  background: rgba(107,63,160,.12);
}
.cs-sidebar-card-title {
  font-size: .65rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--lumina);
  font-family: sans-serif;
  margin-bottom: .5rem;
}
.cs-sidebar-card-body {
  font-size: .78rem;
  color: rgba(240,236,255,0.72);
  line-height: 1.6;
  font-family: sans-serif;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── MAIN COLUMN ── */
.cs-main { flex: 1; min-width: 0; overflow: hidden; }

/* All media stays inside the glass card */
.cs-main img,
.cs-main canvas,
.cs-main video,
.cs-main iframe { max-width: 100%; display: block; }
.cs-hero,
.cs-browser,
.cs-swiper,
.cs-work-grid,
.cs-swiper-row { max-width: 100%; }

.cs-title {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 200;
  letter-spacing: .06em;
  color: var(--stardust);
  line-height: 1.15;
  margin-bottom: .8rem;
}
.cs-tags {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}

/* ── HERO IMAGE ── */
.cs-hero {
  width: 100%;
  height: clamp(260px, 45vh, 460px);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  transition: box-shadow .3s, border-color .3s;
}
.cs-hero:hover {
  box-shadow: 0 0 40px rgba(196,168,255,.22);
  border-color: rgba(196,168,255,.28);
}
.cs-hero-canvas {
  flex: 0 0 58%;
  position: relative;
  overflow: hidden;
}
.cs-hero-canvas canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.cs-hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.4rem 2.8rem;
  background: rgba(6,4,24,0.78);
  backdrop-filter: blur(16px);
  border-left: 1px solid rgba(196,168,255,0.1);
}
.cs-hero-eyebrow {
  font-size: .56rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--lumina);
  font-family: sans-serif;
  margin-bottom: .9rem;
}
.cs-hero-title {
  font-size: clamp(1.1rem, 2.2vw, 1.9rem);
  font-weight: 200;
  color: var(--stardust);
  letter-spacing: .04em;
  line-height: 1.2;
  margin-bottom: 1.2rem;
  font-family: Georgia, serif;
}
.cs-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
@media (max-width: 640px) {
  .cs-hero { flex-direction: column; height: auto; }
  .cs-hero-canvas { flex: 0 0 180px; width: 100%; }
  .cs-hero-text { padding: 1.5rem; }
}

/* ── SECTIONS ── */
.cs-section { margin-top: 3rem; }

/* ── BRAND COLORS ── */
.cs-colors { display: flex; gap: .75rem; flex-wrap: wrap; }
.cs-swatch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  flex: 1;
  min-width: 60px;
}
.cs-swatch {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(196,168,255,.25);
}
.cs-swatch-hex {
  font-size: .63rem;
  letter-spacing: .15em;
  color: var(--muted);
  font-family: sans-serif;
  text-align: center;
}

/* ── WORK GRID ── */
.cs-work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.cs-work-img {
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  font-size: .6rem;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
  transition: transform .2s, border-color .2s;
  background-size: cover;
  background-position: center;
}
.cs-work-img:hover {
  transform: translateY(-3px);
  border-color: rgba(196,168,255,.3);
}

/* ── CASE NAVIGATION ── */
.cs-case-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.cs-nav-link {
  font-size: .66rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  font-family: sans-serif;
  transition: color .2s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.cs-nav-link:hover { color: var(--lumina); }
.cs-nav-arrow { transition: transform .2s; display: inline-block; }
.cs-nav-link.next:hover .cs-nav-arrow { transform: translateX(4px); }
.cs-nav-link.prev:hover .cs-nav-arrow { transform: translateX(-4px); }

/* ── PDF SWIPER ── */
.cs-swiper-label {
  font-size: .65rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--lumina);
  font-family: sans-serif;
  margin: 1.4rem 0 .6rem;
}
.cs-swiper {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255,255,255,.02);
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.cs-swiper-track {
  display: flex;
  transition: transform .35s ease;
}
.cs-swiper-slide {
  flex-shrink: 0;
  width: 100%;
}
.cs-swiper-slide canvas {
  width: 100%;
  display: block;
}
.cs-swiper-loading {
  padding: 4rem 2rem;
  text-align: center;
  font-size: .72rem;
  font-family: sans-serif;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-swiper-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(4,5,26,.8);
  color: var(--lumina);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
  z-index: 10;
  line-height: 1;
}
.cs-swiper-btn:hover { background: rgba(107,63,160,.35); border-color: rgba(196,168,255,.4); }
.cs-swiper-btn:disabled { opacity: .2; cursor: default; pointer-events: none; }
.cs-swiper-prev { left: .6rem; }
.cs-swiper-next { right: .6rem; }
.cs-swiper-dots {
  display: flex;
  justify-content: center;
  gap: .45rem;
  padding: .65rem 0;
  border-top: 1px solid var(--border);
}
.cs-swiper-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(196,168,255,.22);
  cursor: pointer;
  transition: background .2s, transform .2s;
  padding: 0;
}
.cs-swiper-dot.active { background: var(--lumina); transform: scale(1.4); }

/* ── SWIPER ROW (side-by-side) ── */
.cs-swiper-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}
.cs-swiper-row .cs-swiper {
  max-width: none;
  margin: 0;
}
.cs-swiper-col {
  display: flex;
  flex-direction: column;
}
.cs-swiper-col .cs-swiper-label {
  margin-top: 0;
}

/* ── BROWSER MOCKUP ── */
.cs-browser {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1rem;
}
.cs-browser-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--border);
}
.cs-browser-dots {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}
.cs-browser-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(196,168,255,.2);
  display: block;
}
.cs-browser-url {
  flex: 1;
  font-size: .68rem;
  font-family: sans-serif;
  letter-spacing: .04em;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .25rem .85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-browser-open {
  font-size: .63rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--lumina);
  text-decoration: none;
  font-family: sans-serif;
  flex-shrink: 0;
  transition: opacity .2s;
}
.cs-browser-open:hover { opacity: .7; }
.cs-browser-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 3.5rem 2rem;
  background: linear-gradient(135deg,#1a2a1e,#2e4230);
  min-height: 260px;
}
.cs-browser-note {
  font-size: .72rem;
  font-family: sans-serif;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(196,168,255,.5);
}
.cs-live-btn {
  display: inline-block;
  padding: .75rem 2rem;
  border: 1px solid rgba(196,168,255,.4);
  border-radius: 30px;
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lumina);
  text-decoration: none;
  font-family: sans-serif;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.cs-live-btn:hover {
  background: rgba(196,168,255,.1);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(196,168,255,.2);
}

/* ── FEATURE CARDS ── */
.cs-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin-top: .75rem;
}
.cs-feature-card {
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  transition: border-color .3s, background .3s;
}
.cs-feature-card:hover {
  border-color: rgba(196,168,255,.3);
  background: rgba(107,63,160,.1);
}
.cs-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(196,168,255,.1);
  border: 1px solid rgba(196,168,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lumina);
  margin-bottom: .75rem;
}
.cs-feature-label {
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--lumina);
  font-family: sans-serif;
  margin-bottom: .4rem;
}
.cs-feature-desc {
  font-size: .8rem;
  color: rgba(240,236,255,0.75);
  line-height: 1.65;
  font-family: sans-serif;
  font-weight: 300;
}

/* ── TABLET (≤ 900px) — sidebar becomes horizontal meta strip ── */
@media (max-width: 900px) {
  nav { padding: 1.2rem 2rem; }
  .cs-inner { flex-direction: column; gap: 2rem; padding: 2rem 2rem 5rem; }
  .cs-sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .6rem;
  }
  .cs-sidebar-back { width: 100%; margin-bottom: 0; }
  .cs-sidebar-card { flex: 1; min-width: 120px; padding: .7rem .9rem; }
  .cs-swiper-row { grid-template-columns: 1fr; }
}

/* ── MOBILE: below 768px ── */
@media (max-width: 768px) {
  /* System cursor */
  body { cursor: auto; }
  .cursor, .trail-dot { display: none; }

  /* Nav */
  nav { padding: 1rem 1.25rem; }
  .nav-links { display: none; }
  .nav-cta { font-size: .62rem; padding: .48rem 1rem; }

  /* Outer page container — tighter side padding */
  .cs-page { padding: 1rem 0.75rem 3rem; }

  /* Inner card */
  .cs-inner {
    padding: 1.5rem 1.1rem 3rem;
    border-radius: 14px;
    gap: 1.5rem;
  }

  /* Title */
  .cs-title { font-size: clamp(1.4rem, 6vw, 2rem); }

  /* Hero: stack vertically, cap height */
  .cs-hero { flex-direction: column; height: auto; max-width: 100%; overflow: hidden; }
  .cs-hero-canvas { flex: 0 0 160px; width: 100%; overflow: hidden; }
  .cs-hero-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .cs-hero-text { padding: 1.2rem; border-left: none; border-top: 1px solid rgba(196,168,255,.1); }
  .cs-hero-title { font-size: clamp(1rem, 4.5vw, 1.4rem); }

  /* Work grid and features */
  .cs-work-grid { grid-template-columns: 1fr; }
  .cs-features  { grid-template-columns: 1fr; }

  /* Section spacing */
  .cs-section { margin-top: 2rem; }

  /* Case navigation — stack on very narrow */
  .cs-case-nav { flex-direction: column; gap: 1rem; align-items: flex-start; }

  /* Browser mockup */
  .cs-browser-bar { gap: .5rem; padding: .6rem .75rem; }
  .cs-browser-url { font-size: .6rem; }
}

/* ── SMALL MOBILE: below 480px ── */
@media (max-width: 480px) {
  .cs-page  { padding: .75rem 0.5rem 2.5rem; }
  .cs-inner { padding: 1.2rem 1rem 2.5rem; border-radius: 10px; }
  .cs-hero-canvas { flex: 0 0 140px; }
  .cs-sidebar-card { min-width: 100px; }
}
