@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ─── Password Gate ──────────────────────────────────────────────────── */
#pw-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg, #141414);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

#pw-gate.hidden { display: none; }

.pw-gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 340px;
  padding: 0 24px;
}

.pw-gate-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent, #C4B5E8);
  margin-bottom: 8px;
}

.pw-gate-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted, #504D4A);
  text-align: center;
}

.pw-gate-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card, #1C1C1C);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 3px;
  color: var(--fg, #F2F0EC);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 0.1em;
}

.pw-gate-input:focus {
  border-color: var(--accent, #C4B5E8);
}

.pw-gate-error {
  font-size: 12px;
  color: #e07070;
  min-height: 16px;
  text-align: center;
}

.pw-gate-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent, #C4B5E8);
  color: var(--bg, #141414);
  border: none;
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pw-gate-btn:hover { opacity: 0.85; }

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

/* ─── Design Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:              #141414;
  --bg-card:         #1C1C1C;
  --accent:          #C4B5E8;
  --accent-subtle:   rgba(196,181,232,0.08);
  --fg:              #F2F0EC;
  --fg-secondary:    #8A8580;
  --fg-muted:        #504D4A;
  --border:          rgba(255,255,255,0.08);
  --border-emphasis: rgba(196,181,232,0.25);
}

[data-theme="light"] {
  --bg:              #F5F3EE;
  --bg-card:         #EDEAE3;
  --accent:          #5C4FA0;
  --accent-subtle:   rgba(92,79,160,0.08);
  --fg:              #1A1814;
  --fg-secondary:    #6B6560;
  --fg-muted:        #9E9A95;
  --border:          rgba(26,24,20,0.10);
  --border-emphasis: rgba(92,79,160,0.30);
}

/* ─── Base ───────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
}

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

/* ─── Typography ─────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
}

h2 {
  font-family: 'DM Sans', sans-serif;
}

a { color: inherit; }

/* ─── Container ──────────────────────────────────────────────────────── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ─── Nav ────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  background: rgba(20, 20, 20, 0.82);
  transition: background 0.4s ease, border-color 0.4s ease;
}

[data-theme="light"] .nav {
  background: rgba(245, 243, 238, 0.82);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.4s ease;
  letter-spacing: -0.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: color 0.4s ease;
  font-weight: 400;
}

.nav-links a:hover {
  color: var(--fg);
}

.theme-toggle {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border-emphasis);
  background: var(--accent-subtle);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
  white-space: nowrap;
}

.theme-toggle:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ─── Hero ───────────────────────────────────────────────────────────── */
.hero {
  padding: 156px 0 88px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.eyebrow-line {
  width: 32px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
  transition: background 0.4s ease;
}

.eyebrow-text {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  transition: color 0.4s ease;
}

.hero h1 {
  font-size: clamp(48px, 6.5vw, 72px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--fg);
  max-width: 820px;
  margin-bottom: 28px;
  transition: color 0.4s ease;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
  transition: color 0.4s ease;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--fg-secondary);
  max-width: 480px;
  margin-bottom: 40px;
  font-weight: 300;
  line-height: 1.7;
  transition: color 0.4s ease;
}

.hero-cta {
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--accent);
  transition: transform 0.3s ease, color 0.4s ease, text-decoration-color 0.4s ease;
  display: inline-block;
}

.hero-cta:hover {
  transform: translateX(7px);
}

/* ─── Stats Row ──────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 48px 0;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.stat-item {
  padding: 36px 40px;
  border-right: 1px solid var(--border);
  transition: border-color 0.4s ease;
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(32px, 3.5vw, 42px);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
  transition: color 0.4s ease;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--fg-secondary);
  font-weight: 300;
  line-height: 1.5;
  transition: color 0.4s ease;
  max-width: 200px;
}

/* ─── Section Divider ────────────────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 2px;
  transition: border-color 0.4s ease;
}

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  transition: color 0.4s ease;
}

/* ─── Work Grid ──────────────────────────────────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 80px;
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: border-color 0.4s ease, background 0.4s ease;
}

.work-card:hover {
  border-color: var(--border-emphasis);
}

.work-card.featured {
  grid-column: 1 / -1;
  background: #202020;
}

[data-theme="light"] .work-card.featured {
  background: #E5E2DB;
}

/* ─── Card Image Area ────────────────────────────────────────────────── */
.work-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.4s ease;
}

[data-theme="light"] .work-card-image {
  background: #D8D5CE;
}

.work-card.featured .work-card-image {
  aspect-ratio: 21 / 8;
}

.work-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.work-card-image-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  transition: color 0.4s ease;
}

/* ─── Card Body ──────────────────────────────────────────────────────── */
.work-card-body {
  padding: 24px 28px 28px;
}

.work-card.featured .work-card-body {
  padding: 26px 32px 32px;
}

.work-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent);
  transition: background 0.4s ease, color 0.4s ease;
}

.work-card-company {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-bottom: 8px;
  transition: color 0.4s ease;
}

.work-card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--fg);
  margin-bottom: 10px;
  line-height: 1.3;
  transition: color 0.4s ease;
}

.work-card-desc {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  font-weight: 300;
  line-height: 1.65;
  transition: color 0.4s ease;
}

/* ─── Testimonials ───────────────────────────────────────────────────── */
.testimonials-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.4s ease;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-top: 36px;
}

.testimonial-card {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  transition: border-color 0.4s ease;
}

.testimonial-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--fg);
  line-height: 1.7;
  margin-bottom: 18px;
  transition: color 0.4s ease;
}

.testimonial-attribution {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--fg-secondary);
  font-weight: 400;
  transition: color 0.4s ease;
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.4s ease;
}

.footer-email {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  transition: color 0.4s ease;
}

.footer-email:hover {
  color: var(--accent);
}

.footer-location {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-secondary);
  transition: color 0.4s ease;
}

/* ─── Scroll Reveal ──────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Case Study Pages ───────────────────────────────────────────────── */
.case-header-spacer {
  padding-top: 80px;
}

.back-link {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-secondary);
  text-decoration: none;
  margin-bottom: 48px;
  transition: color 0.4s ease;
}

.back-link:hover {
  color: var(--accent);
}

.case-hero {
  padding-bottom: 64px;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.case-company {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-bottom: 14px;
  transition: color 0.4s ease;
}

.case-title {
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--fg);
  margin-bottom: 16px;
  max-width: 780px;
  transition: color 0.4s ease;
}

.case-year {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-bottom: 24px;
  transition: color 0.4s ease;
}

.case-impact {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent);
  line-height: 1.5;
  transition: color 0.4s ease;
}

.case-section {
  padding: 52px 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.4s ease;
}

.case-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-bottom: 20px;
  transition: color 0.4s ease;
}

.case-section p {
  color: var(--fg-secondary);
  font-weight: 300;
  line-height: 1.8;
  max-width: 100%;
  margin-bottom: 16px;
  transition: color 0.4s ease;
}

.case-section p:last-child {
  margin-bottom: 0;
}

.case-section ul {
  list-style: none;
  padding: 0;
  max-width: 100%;
}

.case-section ul li {
  color: var(--fg-secondary);
  font-weight: 300;
  padding: 7px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.65;
  transition: color 0.4s ease;
}

.case-section section {
  margin-top: 32px;
}

.case-section section h3 {
  margin-bottom: 12px;
}

.case-section ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  transition: color 0.4s ease;
}

/* ─── About Meta Grid ───────────────────────────────────────────────── */
.about-meta {
  display: flex;
  flex-direction: column;
  margin-top: 40px;
}

.case-section--no-border {
  border-top: none;
  padding-top: 0;
}

.about-meta-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.about-meta-item {
  border-top: 1px solid var(--border);
  padding: 20px 0 24px 0;
  transition: border-color 0.4s ease;
}

.about-meta-item .case-section-label {
  margin-bottom: 10px;
}

.about-meta-item p:not(.case-section-label) {
  color: var(--fg-secondary);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.65;
  transition: color 0.4s ease;
}

.about-meta-item ul {
  list-style: none;
  padding: 0;
  max-width: none;
}

.about-meta-item ul li {
  color: var(--fg-secondary);
  font-weight: 300;
  font-size: 0.9rem;
  padding: 4px 0 4px 18px;
  position: relative;
  line-height: 1.65;
  transition: color 0.4s ease;
}

.about-meta-item ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  transition: color 0.4s ease;
}

/* ─── Decisions Grid ─────────────────────────────────────────────────── */
.decisions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.decision-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 28px;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.decision-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 14px;
  transition: color 0.4s ease;
}

.decision-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  margin-bottom: 10px;
  line-height: 1.3;
  transition: color 0.4s ease;
}

.decision-text {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  font-weight: 300;
  line-height: 1.7;
  transition: color 0.4s ease;
}

/* ─── Image Placeholders ─────────────────────────────────────────────── */
.img-placeholder {
  width: 100%;
  background: var(--bg-card);
  border: 1px dashed var(--border-emphasis);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.img-placeholder img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}

.img-placeholder span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  transition: color 0.4s ease;
}

.img-placeholders-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

/* Standalone placeholder after a row gets the same 20px gap above */
.img-placeholders-row + .img-placeholder {
  margin-top: 0;
}

/* ─── Outcome Stats (case study) ─────────────────────────────────────── */
.outcome-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 24px;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.outcome-stats--two-col {
  grid-template-columns: repeat(2, 1fr) !important;
}

.outcome-stat {
  padding: 32px 36px;
  border-right: 1px solid var(--border);
  transition: border-color 0.4s ease;
}

.outcome-stat:last-child {
  border-right: none;
}

.outcome-stat .stat-number {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

/* ─── Lightbox ───────────────────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

#lightbox.lb-open {
  display: flex;
}

.lb-content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lb-placeholder {
  width: 800px;
  max-width: 90vw;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 4px;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lb-close,
.lb-prev,
.lb-next {
  position: fixed;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 20px;
  padding: 12px;
  transition: color 0.2s;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  color: #fff;
}

.lb-close { top: 20px; right: 24px; font-size: 22px; }
.lb-prev  { left: 24px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.lb-next  { right: 24px; top: 50%; transform: translateY(-50%); font-size: 28px; }

.lb-counter {
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .container { padding: 0 24px; }
  .nav { padding: 0 24px; }

  .hero { padding: 120px 0 64px; }
  .hero h1 { font-size: 40px; }

  .stats-row,
  .outcome-stats { grid-template-columns: 1fr; }
  .stat-item,
  .outcome-stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child,
  .outcome-stat:last-child { border-bottom: none; }

  .work-grid { grid-template-columns: 1fr; }
  .work-card.featured { grid-column: 1; }
  .work-card.featured .work-card-image { aspect-ratio: 16 / 9; }

  .testimonials-grid { grid-template-columns: 1fr; }
  .decisions-grid { grid-template-columns: 1fr; }
  .img-placeholders-row { grid-template-columns: 1fr; }

  .footer { flex-direction: column; gap: 12px; align-items: flex-start; }

  .nav-links { display: none; }
  .case-title { font-size: 32px; }
}
