/* =============================================
   VUI CASE STUDY — Styles
   Voice Interface Design for Automobile
   ============================================= */

/* 1. TOKENS — VUI is always dark, so we bake dark values directly into :root */
:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "DM Sans", system-ui, sans-serif;

  --bg:       #0E0E0D;
  --bg-alt:   #161615;
  --bg-dark:  #07080A;
  --surface:  #1A1A18;
  --surface-2:#222220;

  --text-1:   #F0EDE8;
  --text-2:   #C4C0B9;
  --text-3:   #8A8780;

  --accent:   #5B99E8;
  --accent-2: #4A86D4;

  --border:    rgba(240,237,232,0.08);
  --border-2:  rgba(240,237,232,0.04);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;

  --shadow:    0 4px 24px rgba(0,0,0,0.40);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.55);

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);

  --topbar-h:  68px;
  --container: 1100px;
  --gutter:    clamp(1.25rem, 5vw, 2rem);
}

/* 2. RESET ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.1; }
.skip-link { position: absolute; left: -9999px; top: 1rem; z-index: 9999; background: var(--text-1); color: var(--bg); padding: .4em 1em; border-radius: var(--radius-sm); font-size: .875rem; }
.skip-link:focus { left: 1rem; }

/* 3. LAYOUT ──────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section--alt  { background: var(--bg-alt); }
.section--dark {
  background: var(--bg-dark);
  --text-2: #B0ACA5;
  --text-3: #6A6760;
  --border: rgba(255,255,255,0.08);
}
.section--dark { background: #07080A; }

/* 4. SCROLL BAR ─────────────────────────────── */
#scroll-bar {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width .1s linear;
}

/* 5. TOPBAR ─────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 900;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}
.brand {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 600;
  letter-spacing: -0.02em; color: var(--text-1);
}
.brand-dot { color: var(--accent); }
.topnav { display: flex; gap: 2rem; }
.topnav a {
  font-size: .875rem; font-weight: 500;
  color: var(--text-2); transition: color .2s;
  position: relative; padding-bottom: 4px;
}
.topnav a:hover,
.topnav a[aria-current="page"] { color: var(--text-1); }
.topnav a[aria-current="page"]::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.topbar-controls { display: flex; align-items: center; gap: 1rem; }
.theme-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2); transition: background .2s, color .2s;
}
.theme-btn:hover { background: var(--surface-2); color: var(--text-1); }
.theme-btn svg { width: 18px; height: 18px; }
/* No theme toggle on this page */
.menu-btn {
  display: none; flex-direction: column; gap: 5px;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.menu-btn span {
  display: block; width: 20px; height: 1.5px;
  background: var(--text-1); border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

/* 6. REVEAL ──────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

/* 7. HERO ────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg-dark);
  color: #F0EDE8;
  display: flex;
  align-items: center;
  padding-top: var(--topbar-h);
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.hero-glow--l {
  width: 50vw; height: 50vw;
  max-width: 600px; max-height: 600px;
  bottom: -10%; left: -10%;
  background: radial-gradient(circle, rgba(50, 114, 200, 0.18), transparent 70%);
}
.hero-glow--r {
  width: 40vw; height: 40vw;
  max-width: 500px; max-height: 500px;
  top: -5%; right: -5%;
  background: radial-gradient(circle, rgba(30, 60, 120, 0.15), transparent 70%);
}
.hero .container { position: relative; z-index: 1; padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.hero-tags {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1.75rem;
}
.htag {
  font-size: .75rem; font-weight: 500;
  padding: .3em .85em;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(240,237,232,0.7);
}
.htag--research {
  background: rgba(50, 114, 200, 0.2);
  border-color: rgba(50, 114, 200, 0.4);
  color: #8EC4FF;
}
.hero h1 {
  font-size: clamp(3.2rem, 10vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: .95;
  margin-bottom: 1.5rem;
  color: #F0EDE8;
}
.h1-stroke {
  -webkit-text-stroke: 1.5px rgba(240,237,232,0.3);
  color: transparent;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(240,237,232,0.65);
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}
.hero-sub em { color: rgba(240,237,232,0.9); font-style: italic; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.meta-label {
  font-size: .73rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(240,237,232,0.35);
  margin-bottom: .3rem;
}
.meta-val {
  font-size: .9rem; font-weight: 500;
  color: rgba(240,237,232,0.75);
}

/* 8. SECTION LABELS ─────────────────────────── */
.section-label {
  font-size: .8125rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75rem;
}
.section-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.08; margin-bottom: 1.5rem;
}
.section--dark .section-title { color: #F0EDE8; }
.section-lead {
  font-size: 1.0625rem; color: var(--text-2);
  max-width: 680px; line-height: 1.75;
  margin-bottom: 3rem;
}

/* 9. CONTEXT ────────────────────────────────── */
.context-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.context-text h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}
.context-text p {
  font-size: .9375rem; color: var(--text-2);
  line-height: 1.75; margin-bottom: 1rem;
}
.context-text strong { color: var(--text-1); }
.context-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.cstat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.cstat-n {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700; letter-spacing: -0.04em;
  color: var(--accent); line-height: 1; margin-bottom: .4rem;
}
.cstat-unit { font-size: .6em; }
.cstat-l { font-size: .8125rem; color: var(--text-2); line-height: 1.45; }

/* 10. PAIN POINTS ───────────────────────────── */
.pain-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-bottom: 3rem;
}
.pain-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 1.75rem;
  transition: border-color .25s;
}
.pain-card:hover { border-color: rgba(50,114,200,0.5); }
.pain-n {
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 700;
  letter-spacing: -0.05em; color: rgba(255,255,255,0.1);
  line-height: 1; margin-bottom: .75rem;
}
.pain-card h3 {
  font-size: .9375rem; font-weight: 700;
  margin-bottom: .6rem; color: #F0EDE8;
}
.pain-card p { font-size: .875rem; color: rgba(240,237,232,0.55); line-height: 1.7; }
.insight-quote {
  background: rgba(50,114,200,0.1);
  border: 1px solid rgba(50,114,200,0.25);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.75rem 2rem;
  max-width: 780px; margin: 0 auto;
}
.insight-quote blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 600; letter-spacing: -0.01em;
  font-style: italic; line-height: 1.55;
  color: #F0EDE8; margin-bottom: .6rem;
}
.insight-quote cite { font-size: .8125rem; color: rgba(240,237,232,0.45); font-style: normal; }

/* 11. METHOD BLOCKS ─────────────────────────── */
.method-block {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}
.method-block:last-child { border-bottom: 1px solid var(--border); }
.method-block--alt { background: var(--bg-alt); }
.method-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem); align-items: start;
}
.method-grid--flip { direction: rtl; }
.method-grid--flip > * { direction: ltr; }
.method-label {
  font-size: .8rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75rem;
}
.method-text h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700; letter-spacing: -0.025em;
  margin-bottom: 1rem;
}
.method-text p {
  font-size: .9375rem; color: var(--text-2);
  line-height: 1.75; margin-bottom: .85rem;
}
.method-text strong { color: var(--text-1); }
.method-text em { color: var(--accent); font-style: italic; }
.finding-list {
  list-style: none; margin: 1rem 0 1rem;
}
.finding-list li {
  font-size: .9rem; color: var(--text-2);
  padding: .45rem 0; border-bottom: 1px solid var(--border-2);
  line-height: 1.5;
  display: flex; gap: .5rem;
}
.finding-list li::before { content: '→'; color: var(--accent); flex-shrink: 0; }
.finding-list li:last-child { border-bottom: none; }
.finding-list strong { color: var(--text-1); }

.expectation-list { display: flex; flex-direction: column; gap: .85rem; margin-top: 1.25rem; }
.expectation {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.exp-n {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: -0.04em; color: var(--border);
  line-height: 1; flex-shrink: 0; margin-top: -.1rem;
}
.expectation h4 {
  font-size: .9375rem; font-weight: 700; margin-bottom: .35rem;
}
.expectation p { font-size: .85rem; color: var(--text-2); line-height: 1.65; }

/* 12. CASE STUDY FIGURES ───────────────────── */
.cs-fig {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: box-shadow .25s, transform .25s var(--ease-out);
  margin-bottom: 1rem;
}
.cs-fig:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.cs-fig img {
  display: block; width: 100%; height: auto;
  transition: transform .4s var(--ease-out);
}
.cs-fig:hover img { transform: scale(1.02); }

/* Hide the image when it fails to load — show placeholder instead */
.cs-fig.img-missing img { display: none; }
.cs-fig img + .fig-placeholder { display: none; }
.cs-fig.img-missing .fig-placeholder { display: flex; }

.fig-placeholder {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: .8125rem;
  text-align: center;
  padding: 2rem;
  cursor: default;
}
.fig-placeholder--sm { min-height: 140px; }
.fig-placeholder-hint { font-size: .73rem; opacity: .7; }

.cs-fig--sm { }
.cs-fig--full { width: 100%; }
.cs-fig-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-top: 1rem;
}
.cs-fig--third { margin-bottom: 0; }

figcaption {
  font-size: .78125rem; color: var(--text-3);
  text-align: center; padding: .6rem .75rem .75rem;
  background: var(--surface);
  border-top: 1px solid var(--border-2);
}

/* Clickable indicator */
.cs-fig[data-lightbox]::after {
  content: '';
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") no-repeat center / 16px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity .22s;
}
.cs-fig[data-lightbox]:hover::after,
.cs-fig[data-lightbox]:focus-within::after { opacity: 1; }
.cs-fig.img-missing[data-lightbox] { cursor: default; }
.cs-fig.img-missing[data-lightbox]::after { display: none; }

/* Method visuals column */
.method-visuals { display: flex; flex-direction: column; gap: 1rem; }

/* 13. TOOLKIT BLOCKS ────────────────────────── */
.toolkit-block {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}
.toolkit-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.toolkit-n {
  display: inline-block;
  font-size: .73rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75rem;
}
.toolkit-header { margin-bottom: 2rem; max-width: 720px; }
.toolkit-header h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700; letter-spacing: -0.025em;
  margin-bottom: 1rem;
}
.toolkit-header p {
  font-size: .9375rem; color: var(--text-2);
  line-height: 1.75; margin-bottom: .75rem;
}

/* 14. REFLECTION ────────────────────────────── */
.reflection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.reflection-item {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem 1.75rem;
  background: var(--surface);
}
.ref-n {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.07em;
  color: rgba(91,153,232,0.18);
  line-height: 1;
}
.ref-body { display: flex; flex-direction: column; gap: .6rem; }
.reflection-item h4 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.reflection-item p { font-size: .875rem; color: var(--text-2); line-height: 1.75; }
@media (max-width: 700px) {
  .reflection-grid { grid-template-columns: 1fr; }
}

/* 15. LIGHTBOX ──────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.lightbox[hidden] { display: none; }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lb-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: .75rem;
  max-width: min(1200px, 96vw);
  animation: lb-in .22s var(--ease-out);
}
@keyframes lb-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
.lb-close {
  position: absolute; top: -48px; right: 0;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #fff; display: grid; place-items: center;
  transition: background .2s;
}
.lb-close:hover { background: rgba(255,255,255,0.2); }
.lb-img {
  max-height: min(80vh, 900px);
  width: auto; max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.lb-caption {
  font-size: .8125rem; color: rgba(255,255,255,0.55);
  text-align: center; max-width: 640px; line-height: 1.5;
}

/* 16. FOOTER ────────────────────────────────── */
.footer {
  background: var(--bg-dark); padding: 2.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.footer-back {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; font-weight: 500;
  color: rgba(240,237,232,0.45);
  transition: color .2s;
}
.footer-back:hover { color: rgba(240,237,232,0.85); }
.footer-copy { font-size: .8125rem; color: rgba(240,237,232,0.3); }

/* 17. RESPONSIVE ────────────────────────────── */
@media (max-width: 860px) {
  .context-grid { grid-template-columns: 1fr; }
  .context-stats { grid-template-columns: 1fr 1fr; }
  .pain-grid { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid--flip { direction: ltr; }
  .cs-fig-row { grid-template-columns: 1fr 1fr; }
  .reflection-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topnav { display: none; }
  .menu-btn { display: flex; }
  .topnav.open {
    display: flex; flex-direction: column;
    position: fixed; top: var(--topbar-h);
    left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 1.25rem var(--gutter) 1.75rem;
    gap: 1rem; z-index: 850;
  }
  .cs-fig-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.6rem, 14vw, 5rem); }
  .reflection-item { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
