/* =========================================
   1. CUSTOM PROPERTIES
   ========================================= */
:root {
  --color-bg: #ffffff;
  --color-surface: #f5f5f4;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-accent: #1a1a1a;
  --color-accent-hover: #404040;
  --color-border: #e5e7eb;

  /* Brand accent — tied to the `ce` monogram teal (#00897B) */
  --brand: #00897B;
  --brand-ink: #004D43;
  --brand-wash: #E6F4F1;
  --brand-border: #B8DED7;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.5rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --max-width: 1100px;
  --max-width-text: 680px;
  --nav-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* =========================================
   3. TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p { color: var(--color-text); }

.text-muted { color: var(--color-text-muted); }

/* Prose — long-form text in case studies */
.prose {
  max-width: var(--max-width-text);
}
.prose p { margin-bottom: 1.5em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 {
  margin-top: 3em;
  margin-bottom: 0.75em;
  font-size: var(--text-2xl);
}
.prose h3 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-size: var(--text-xl);
}
.prose ul {
  list-style: disc;
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}
.prose ul li { margin-bottom: 0.4em; }
.prose img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 2.5em 0;
}
.prose strong { font-weight: 600; }

/* =========================================
   4. LAYOUT UTILITIES
   ========================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

/* =========================================
   5a. HEADER / NAVIGATION
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}

.nav-logo img {
  height: 20px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* =========================================
   5b. FOOTER
   ========================================= */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-copy {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* =========================================
   5c. BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-outline {
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: transparent;
}
.btn-outline:hover { background: var(--color-surface); }

/* =========================================
   5d. PROJECT CARDS (work grid)
   ========================================= */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

.project-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--color-bg);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: var(--brand);
}

.project-card:hover .tag {
  background: var(--brand-wash);
  color: var(--brand-ink);
}

.project-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 32 / 25;
  background: var(--color-surface);
  overflow: hidden;
}

.project-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.project-card:hover .project-card-cover img {
  transform: scale(1.03);
}

/* Lock badge for password-protected cards */
.project-card-lock {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 100px;
  padding: 4px 10px 4px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  pointer-events: none;
}

.project-card-lock svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

/* Placeholder when no image yet */
.project-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-card-body {
  padding: var(--space-6);
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  padding: 2px var(--space-3);
  border-radius: 100px;
  transition: background 0.2s ease-out, color 0.2s ease-out;
}

.project-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.project-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Featured work grid — promoted top cards */
.work-grid-featured {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: var(--space-6);
}

.project-card--featured .project-card-cover {
  aspect-ratio: 16 / 9;
}

.project-card--featured .project-card-body {
  padding: var(--space-8);
}

.project-card--featured .project-card-title {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

.project-card--featured .project-card-desc {
  font-size: var(--text-base);
  line-height: 1.55;
}

/* =========================================
   5e. CASE STUDY ARTICLE
   ========================================= */
.case-study-hero {
  padding: var(--space-16) 0 var(--space-6);
}

.case-study-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.case-study-title {
  font-size: var(--text-4xl);
  max-width: 800px;
  margin-bottom: var(--space-6);
}

.case-study-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: var(--space-12) 0;
  overflow: hidden;
  background: var(--color-surface);
}

.case-study-cover img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}

.case-study-body {
  padding-bottom: var(--space-32);
}

.case-study-section {
  display: flex;
  gap: var(--space-12);
  align-items: flex-start;
  margin: var(--space-16) 0;
}

.case-study-section:nth-child(even) {
  flex-direction: row-reverse;
}

.case-study-section-img {
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.case-study-section-img img {
  width: 100%;
  object-fit: cover;
}

.case-study-section-text {
  flex: 1;
}

/* Prev/Next navigation */
.case-study-nav {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-8);
  margin-top: var(--space-16);
}

.case-study-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.case-study-nav a:hover { color: var(--color-text); }

/* =========================================
   6a. HOME HERO
   ========================================= */
.hero {
  padding: var(--space-32) 0 var(--space-24);
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

#about-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}

.hero-eyebrow {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: var(--text-5xl);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
  max-width: 680px;
}

.hero-body {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 520px;
  line-height: 1.65;
  margin-bottom: var(--space-8);
}

.work-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.work-section-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================
   6b. ABOUT PAGE
   ========================================= */
.about-hero {
  padding: var(--space-16) 0;
  display: flex;
  gap: var(--space-16);
  align-items: flex-start;
}

.about-photo {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-photo svg {
  width: 100%;
  height: auto;
}

.about-content {
  flex: 1;
  max-width: var(--max-width-text);
}

.about-content h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-6);
}

.about-content p {
  font-size: var(--text-lg);
  line-height: 1.75;
  margin-bottom: var(--space-4);
}

.about-content p:last-child {
  margin-bottom: 0;
}

.experience-list {
  border-top: 1px solid var(--color-border);
}

.experience-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-8);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-border);
}

.experience-date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-top: 2px;
}

.experience-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.experience-company {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.experience-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* =========================================
   7. RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  .hero-title { font-size: var(--text-3xl); }
  .case-study-title { font-size: var(--text-3xl); }

  /* Mobile nav */
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--space-4) 0;
  }

  .nav-links.nav-open { display: flex; }

  .nav-links a {
    padding: var(--space-3) var(--space-6);
    width: 100%;
    font-size: var(--text-base);
  }

  .work-grid,
  .work-grid-featured {
    grid-template-columns: 1fr;
  }

  .project-card--featured .project-card-body {
    padding: var(--space-6);
  }

  .project-card--featured .project-card-title {
    font-size: var(--text-xl);
  }

  .case-study-section,
  .case-study-section:nth-child(even) {
    flex-direction: column;
  }

  .about-hero {
    flex-direction: column;
    gap: var(--space-8);
  }

  .about-photo { width: 120px; }

  .experience-item {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .hero { padding: var(--space-16) 0; }
  .section { padding: var(--space-16) 0; }
}

/* =========================================
   8. HERO LOGO STRIP ("Currently at …")
   ========================================= */
.hero-logos {
  margin-top: var(--space-12);
  max-width: 720px;
}

.hero-logos-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.hero-logos-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
  row-gap: var(--space-4);
}

.hero-logos-strip .hero-logo {
  display: inline-flex;
  align-items: center;
  height: 28px;
  color: #3f3f3f;
  opacity: 0.7;
  transition: opacity 0.2s ease-out, color 0.2s ease-out;
}

.hero-logos-strip .hero-logo svg {
  height: 100%;
  width: auto;
  display: block;
}

.hero-logos-strip .hero-logo:hover {
  opacity: 1;
  color: var(--brand-ink);
}

/* =========================================
   9. CASE STUDY COMPONENTS
   ========================================= */

/* Impact banner — sits under case-study title */
.case-impact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-8);
  background: var(--brand-wash);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
  margin: var(--space-8) 0 var(--space-4);
}

.case-impact-item {
  min-width: 0;
}

.case-impact-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: var(--space-2);
}

.case-impact-value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}

@media (max-width: 900px) {
  .case-impact { grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
}
@media (max-width: 480px) {
  .case-impact { grid-template-columns: 1fr; padding: var(--space-5) var(--space-6); }
}

/* Metric callout — inline in prose */
.case-metric {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-8);
  border-left: 3px solid var(--brand);
  background: var(--color-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--space-8) 0;
}

.case-metric-number {
  font-size: var(--text-4xl);
  font-weight: 600;
  color: var(--brand-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}

.case-metric-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Row of metric chips (3–4 in a row) */
.case-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

.case-metrics-row .case-metric {
  margin: 0;
}

/* Pull-quote — editorial style */
.case-pullquote {
  border-left: 3px solid var(--brand);
  padding: var(--space-2) var(--space-8);
  margin: var(--space-12) 0;
  font-size: var(--text-2xl);
  line-height: 1.35;
  font-style: italic;
  color: var(--color-text);
  letter-spacing: -0.01em;
  max-width: var(--max-width-text);
}

.case-pullquote cite {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  font-style: normal;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* Process-artifacts gallery */
.case-artifacts {
  margin: var(--space-12) 0;
}

.case-artifacts-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.case-artifacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.case-artifact {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.case-artifact img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.case-artifact figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Public-summary block — shown above password gate on locked cases */
.case-public-summary {
  padding: var(--space-8) 0 var(--space-16);
}

.case-public-summary-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-16);
  align-items: start;
}

.case-public-summary h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.case-public-summary h2:not(:first-child) {
  margin-top: var(--space-8);
}

.case-public-summary p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  line-height: 1.7;
}

.case-public-summary ul {
  list-style: disc;
  padding-left: 1.25em;
  color: var(--color-text-muted);
}

.case-public-summary ul li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

.case-public-summary-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--brand-wash);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.case-public-summary-aside .case-impact-label {
  margin-top: var(--space-2);
}

.case-public-summary-aside .case-impact-label:first-child {
  margin-top: 0;
}

.case-locked-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
  padding: var(--space-6);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: #fafaf9;
}

.case-locked-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--brand);
}

@media (max-width: 768px) {
  .case-public-summary-grid { grid-template-columns: 1fr; gap: var(--space-8); }
}
