/* ============================================================
   David Kempert portfolio
   Palette: sand/greige accent and off-white surfaces. Black is used
   sparingly: buttons, the case study hero tile and the footer.
   Header is frosted. Corners slightly tighter than before.
   ============================================================ */

:root {
  /* Surfaces */
  --bg-page: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-contact: #F2F1EF;
  --border-card: #E4E2DD;
  --border-hairline: #E4E2DD;

  /* Frosted header */
  --frost-bg: rgba(250, 250, 250, 0.72);
  --frost-bg-scrolled: rgba(250, 250, 250, 0.9);
  --frost-border: rgba(0, 0, 0, 0.07);

  /* Black surfaces */
  --black: #0B0B0B;
  --black-2: #1C1C1C;
  --black-border: transparent;
  --on-black: #FFFFFF;
  --on-black-soft: #E2E2E2;
  --on-black-muted: #A3A3A3;
  --line-on-black: #2B2B2B;

  /* Text */
  --text-primary: #4A4A4A;
  --text-heading: #1A1A1A;
  --text-muted: #666C6E;
  --text-on-accent: #FFFFFF;

  /* Accent (sand / greige) */
  --accent: #A69679;
  --accent-hover: #927F62;
  --accent-strong: #75654B;
  --accent-strong-hover: #5E5039;
  --accent-on-black: #C4B598;

  /* Buttons */
  --btn-bg: #85735A;
  --btn-fg: #FFFFFF;
  --btn-bg-hover: #0B0B0B;
  --btn-fg-hover: #FFFFFF;

  /* Small black accents (arrow, verify pill) */
  --pill-bg: #0B0B0B;
  --pill-fg: #FFFFFF;
  --pill-hover: #85735A;

  --gutter: clamp(16px, 4vw, 20px);

  /* Type */
  --font-heading: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-bold: 700;
  --leading-body: 1.5;
  --leading-heading: 1.15;

  /* Layout */
  --container-max: 920px;
  --grid-gap: 24px;

  /* Radii (tighter than before) */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card-hover: 0 12px 24px -8px rgba(0, 0, 0, 0.22);
  --shadow-photo: 0 8px 20px -6px rgba(46, 37, 34, 0.15);
  --shadow-form: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.12);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 200ms;
  --duration-base: 300ms;
  --duration-slow: 400ms;
}

[data-theme="dark"] {
  --bg-page: #0E0E0E;
  --bg-card: #171717;
  --bg-contact: #121212;
  --border-card: #2A2A2A;
  --border-hairline: #2A2A2A;

  --black: #000000;
  --black-2: #171717;
  --black-border: #262626;
  --line-on-black: #262626;

  --text-primary: #E4E4E4;
  --text-heading: #FFFFFF;
  --text-muted: #9AA0A2;

  --accent: #B8A98D;
  --accent-hover: #C7BAA1;
  --accent-strong: #8C7A5E;
  --accent-strong-hover: #9C8A6D;

  --btn-bg: #B8A98D;
  --btn-fg: #0B0B0B;
  --btn-bg-hover: #D6C9AE;
  --btn-fg-hover: #0B0B0B;

  --pill-bg: #B8A98D;
  --pill-fg: #0B0B0B;
  --pill-hover: #D6C9AE;

  --shadow-form: none;

  --frost-bg: rgba(14, 14, 14, 0.72);
  --frost-bg-scrolled: rgba(14, 14, 14, 0.9);
  --frost-border: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Fonts (self-hosted)
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/inter-tight-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/inter-tight-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ============================================================
   Base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--duration-slow) var(--ease-out), color var(--duration-slow) var(--ease-out);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 20px);
}

/* ============================================================
   Navbar (frosted)
   ============================================================ */

.page-shell {
  background: var(--bg-page);
  min-height: 100vh;
  padding-top: 14px;
  transition: background-color var(--duration-base) var(--ease-out);
}

.navbar-shell {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--container-max) - 2 * 20px);
  margin: 0 auto;
  border-radius: var(--radius-lg);
  position: sticky;
  top: 14px;
  z-index: 20;
}

.navbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 20px);
  border-radius: var(--radius-lg);
  background: var(--frost-bg);
  border: 1px solid var(--frost-border);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  transition: background-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}

.navbar.is-scrolled {
  background: var(--frost-bg-scrolled);
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.18);
}

.navbar-logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  color: var(--text-heading);
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar-logo:hover { color: var(--text-heading); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--accent-strong); }
.nav-links a.is-active,
.nav-links a.active,
.nav-links a[aria-current] { color: var(--text-heading); }

/* Theme switch (premium toggle) */
.theme-toggle {
  position: relative;
  flex-shrink: 0;
  width: 52px; height: 28px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-pill);
  background: #E9E4DA;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: background-color var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out);
}
.theme-toggle .knob {
  position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFFFF, #ECEAE6);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition: transform var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out);
}
[data-theme="dark"] .theme-toggle {
  background: #161B26;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .theme-toggle .knob {
  transform: translateX(24px);
  background: conic-gradient(from 210deg, #F1DFA6, #B8944A, #F7E9BB, #B8944A, #F1DFA6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.theme-toggle:hover { filter: brightness(0.97); }

.mobile-controls { display: none; align-items: center; gap: 14px; }

.hamburger {
  border: none; background: none; cursor: pointer;
  padding: 4px; position: relative; width: 24px; height: 16px; flex-shrink: 0;
}
.ham-line {
  display: block; height: 2px; border-radius: 2px;
  background: var(--text-heading);
  transition: all var(--duration-fast) var(--ease-out);
  transform-origin: center;
  position: absolute; left: 0;
}
.ham-line-1 { top: 0; width: 14px; }
.ham-line-2 { top: 7px; width: 22px; }
.ham-line-3 { top: 14px; width: 18px; }
.hamburger[aria-expanded="true"] .ham-line-1 { width: 20px; top: 7px; transform: rotate(45deg); }
.hamburger[aria-expanded="true"] .ham-line-2 { opacity: 0; }
.hamburger[aria-expanded="true"] .ham-line-3 { width: 20px; top: 7px; transform: rotate(-45deg); }

/* Mobile nav overlay */
.mobile-backdrop {
  position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
  background: transparent;
  transition: opacity var(--duration-base) var(--ease-out);
  z-index: 18;
  opacity: 0;
  pointer-events: none;
}
.mobile-backdrop.is-open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed;
  top: calc(14px + 64px + 10px);
  left: clamp(16px, 4vw, 20px);
  right: clamp(16px, 4vw, 20px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--frost-border);
  background: var(--frost-bg-scrolled);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.25);
  padding: 10px;
  display: flex; flex-direction: column; gap: 2px;
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
  z-index: 19;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
.mobile-menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.mobile-menu a {
  display: block; padding: 12px 14px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  color: var(--text-heading); text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.mobile-menu a:hover { color: var(--accent-strong); background: rgba(0, 0, 0, 0.04); }

@media (max-width: 700px) {
  .nav-links.desktop-only { display: none; }
  .mobile-controls { display: flex; }
  .mobile-controls .theme-toggle { display: flex; }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  padding: clamp(0.75rem, 1.5vw, 1rem) clamp(1.25rem, 3vw, 1.5rem);
  transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), border-color 180ms ease, color 180ms ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--btn-fg-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text-heading);
  border-color: var(--text-heading);
}
.btn-secondary:hover { background: var(--text-heading); color: var(--bg-page); }

.btn-contact {
  width: 100%;
  padding: clamp(0.85rem, 1.6vw, 1rem) 1.5rem;
}
.btn[disabled] { opacity: 0.65; cursor: default; }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding: clamp(56px, 10vw, 104px) 0 clamp(40px, 8vw, 72px);
  display: flex; flex-direction: column; align-items: flex-start;
  gap: clamp(16px, 3vw, 24px);
}

.hero-photo {
  width: clamp(120px, 26vw, 176px);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-photo);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.hero .hero-status {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 20px;
  padding: 7px 15px 7px 12px;
  border: 1px solid #CDC3AE;
  border-radius: var(--radius-pill);
  background: rgba(166, 150, 121, 0.08);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent-strong);
}
.hero-status-dot {
  position: relative;
  width: 8px; height: 8px; border-radius: 50%;
  background: #7E8B3F;
  box-shadow: 0 0 0 3px rgba(126, 139, 63, 0.2);
}
[data-theme="dark"] .hero .hero-status { border-color: #4A4338; background: rgba(184, 169, 141, 0.08); color: var(--accent); }
.hero .hero-skills {
  margin: 16px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.hero-skills span { color: var(--accent); margin: 0 6px; font-weight: 700; }

.hero h1 {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 38ch;
  margin: 0;
}
.hero p {
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.1875rem);
  color: var(--text-primary);
  max-width: clamp(280px, 90vw, 560px);
  margin: 0;
}

.hero-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; margin-top: 4px; width: max-content; max-width: 100%; }
.hero-actions .btn { min-width: 150px; white-space: nowrap; }
.hero-br { display: none; }
@media (min-width: 700px) { .hero-br { display: inline; } }

/* ============================================================
   Sections / headings
   ============================================================ */

section { padding: clamp(32px, 6vw, 48px) 0; }
section h2 {
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.3125rem);
  margin: 0 0 24px;
}
#services, #work, #certifications, #contact { scroll-margin-top: 90px; }

/* ============================================================
   Work grid / cards (light card, screenshot peeking at the bottom)
   ============================================================ */

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 32px);
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); color: inherit; }

.card-body {
  padding: clamp(28px, 5vw, 48px) clamp(24px, 5vw, 48px) clamp(28px, 4.5vw, 40px);
  display: flex; flex-direction: column; gap: 12px;
}
.card-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }

.card-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}
.card-title {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.25;
}
.card-arrow {
  flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--pill-bg); color: var(--pill-fg);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.card:hover .card-arrow { background: var(--pill-hover); color: var(--pill-fg); transform: translate(2px, -2px); }
.card-arrow svg { width: 15px; height: 15px; }

.card-excerpt {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text-primary);
  margin: 4px 0 0;
  line-height: 1.55;
  max-width: 54ch;
}

/* Avoid a single word left alone on the last line of short text blocks */
.card-excerpt, .card-title, .proj-lead, .proj-article li, .proj-article p, .proj-figure figcaption { text-wrap: pretty; }

.card-stats {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.card-stats li {
  font-size: 13px; color: var(--text-primary);
  background: var(--bg-contact);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
}
.card-stats strong { color: var(--text-heading); font-weight: 600; margin-right: 4px; }

.card-media {
  background: var(--bg-contact);
  padding: clamp(24px, 5vw, 40px) clamp(24px, 5vw, 48px) 0;
  border-top: 1px solid var(--border-card);
}
.card-image {
  width: 100%;
  /* Each card image keeps its own proportions (set by its width and height), so nothing gets cropped */
  aspect-ratio: auto;
  display: block;
  height: auto;
  background-color: var(--bg-card);
  object-fit: cover;
  object-position: top left;
  border: 1px solid var(--border-card);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: 0 -4px 24px -12px rgba(0, 0, 0, 0.18);
}

/* ============================================================
   Certifications
   ============================================================ */

.cert-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cert-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(22px, 4vw, 30px) clamp(20px, 4vw, 32px);
  border-bottom: 1px solid var(--border-card);
}
.cert-item:last-child { border-bottom: none; }

.cert-info { display: flex; align-items: center; gap: 12px; }
.cert-icon { color: var(--accent); display: flex; }
.cert-icon svg { width: 18px; height: 18px; }
.cert-name { font-family: var(--font-body); font-weight: 600; font-size: 15px; color: var(--text-heading); }

.verify-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: max-content; white-space: nowrap;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  background: var(--pill-bg);
  color: var(--pill-fg);
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.verify-pill:hover {
  transform: translateY(-2px);
  background: var(--pill-hover);
  color: var(--pill-fg);
}

/* ============================================================
   Services
   ============================================================ */

.services-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.service-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: clamp(22px, 4vw, 30px) clamp(20px, 4vw, 32px);
  border-bottom: 1px solid var(--border-card);
}
.service-item:last-child { border-bottom: none; }

.service-icon { color: var(--accent); display: flex; flex-shrink: 0; margin-top: 2px; }
.service-icon svg { width: 18px; height: 18px; }

.service-body { display: flex; flex-direction: column; gap: 6px; }
.service-name { font-family: var(--font-body); font-weight: 600; font-size: 15px; color: var(--text-heading); margin: 0; }
.service-desc { font-family: var(--font-body); font-size: 15px; color: var(--text-primary); margin: 0; line-height: 1.5; max-width: 54ch; }
.service-tag {
  display: inline-flex; align-items: center; width: max-content;
  font-size: 13px; color: var(--text-primary);
  background: var(--bg-contact);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  margin-top: 2px;
}


/* ============================================================
   Contact (same page background, white form card, content width)
   ============================================================ */

#contact {
  padding: clamp(40px, 7vw, 64px) 0 clamp(56px, 9vw, 88px);
}
#contact h2 { margin: 0 0 24px; }

.contact-success {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  width: 100%;
}

.contact-form {
  display: flex; flex-direction: column; gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-form);
  padding: clamp(24px, 5vw, 40px);
  width: 100%;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-error {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 15px;
}

.contact-form label {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  color: var(--text-heading);
  display: flex; flex-direction: column; gap: 8px;
}

.contact-form input,
.contact-form textarea {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  width: 100%;
}
.contact-form textarea { resize: vertical; }

/* ============================================================
   Testimonial (light card, sand accent bar)
   ============================================================ */

.proof { padding: clamp(32px, 6vw, 48px) 0; }
.proof h2 { margin: 0 0 24px; }

.testimonial blockquote { margin: 0; }
.testimonial {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px) clamp(24px, 4.5vw, 40px);
  margin: 0;
}
.testimonial p {
  font-style: italic;
  font-size: 17px;
  color: var(--text-primary);
  line-height: 1.65;
  margin: 0 0 16px;
  max-width: 72ch;
}
.testimonial-attribution {
  font-style: normal;
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
  font-size: 15px;
  margin-top: 20px;
}
.testimonial-attribution span {
  display: block;
  font-weight: var(--weight-regular);
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ============================================================
   Footer (black, roomy, aligned to content)
   ============================================================ */

footer {
  background: var(--black);
  margin-top: clamp(24px, 5vw, 48px);
  padding: clamp(48px, 8vw, 72px) 0;
}
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 20px);
  display: flex; flex-direction: column; gap: clamp(32px, 6vw, 48px);
}
.footer-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 28px 48px;
}
.footer-name {
  font-family: var(--font-heading);
  font-weight: 600; font-size: 17px;
  color: var(--on-black);
}
.footer-tagline {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--on-black-muted);
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 14px 28px;
  font-size: 15px; font-weight: 600;
}
.footer-links a { color: var(--on-black-soft); text-decoration: none; }
.footer-links a:hover { color: var(--accent-on-black); }
.footer-copy {
  width: 100%;
  border-top: 1px solid var(--line-on-black);
  padding-top: 24px;
  font-size: 13px;
  color: var(--on-black-muted);
}

/* ============================================================
   Accessibility
   ============================================================ */

input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Case study pages
   ============================================================ */

.proj-wrap { max-width: none; margin: 0 auto; }
.proj-article p, .proj-article ul { max-width: 72ch; }

.proj-breadcrumb {
  padding: clamp(28px, 6vw, 44px) 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
}
.proj-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.proj-breadcrumb a:hover { color: var(--accent); }

/* Hero tile: identical light card to the home page tile */
.proj-hero {
  margin: clamp(16px, 3vw, 24px) 0 0;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  color: var(--text-heading);
  display: flex; flex-direction: column; gap: 0;
}
.proj-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}
.proj-hero h1 {
  color: var(--text-heading);
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0;
}
.proj-chips {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.proj-chips li {
  font-size: 13px; color: var(--text-primary);
  background: var(--bg-contact);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
}
.proj-chips strong { color: var(--text-heading); font-weight: 600; margin-right: 4px; }

/* Meta row (light) under the tile */
.proj-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 24px;
  margin: 0 0 clamp(28px, 5vw, 40px);
  padding: 22px 0;
  border-bottom: 1px solid var(--border-hairline);
}
.proj-meta dt { font-size: 13px; color: var(--text-muted); margin: 0 0 4px; }
.proj-meta dd { font-size: 15px; font-weight: 600; color: var(--text-heading); margin: 0; }
@media (max-width: 600px) { .proj-meta { grid-template-columns: 1fr 1fr; } }

.proj-lead { margin: 0 0 20px; }

.proj-image-frame {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}
.proj-image-frame img {
  max-width: 100%;
  max-height: 640px;
  width: auto;
  height: auto;
  display: block;
  cursor: zoom-in;
  object-fit: contain;
  border-radius: 4px;
}
.proj-image-frame picture { display: contents; }
/* Tall screenshots (with a phone version) show at full width instead of being capped in height */
.proj-image-frame--tall img { max-height: none; width: 100%; }

.proj-article {
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-primary);
}
.proj-article p { margin: 0 0 24px; }
.proj-article h2 {
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
  margin: 24px 0 20px;
}
.proj-article h2 .when { font-weight: 400; color: var(--text-muted); font-size: 0.8em; }
.proj-article h3 { font-size: 1.0625rem; font-weight: 600; margin: 8px 0 12px; }
.proj-article ul { margin: 0 0 32px; padding-left: 22px; }
.proj-article ul li { margin-bottom: 12px; }

.proj-figure { margin: 0 0 clamp(40px, 7vw, 64px); }
.proj-figure figcaption {
  font-family: var(--font-body); font-size: 13px; color: var(--text-muted); margin-top: 10px;
}

.proj-divider { height: 1px; background: var(--border-card); margin: clamp(32px, 6vw, 48px) 0; }

.proj-author {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
  padding-bottom: clamp(24px, 4vw, 32px);
}
.proj-author-photo { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-photo); }
.proj-author-photo img { width: 100%; height: 100%; object-fit: cover; }
.proj-author-name { font-family: var(--font-heading); font-weight: 600; font-size: 18px; color: var(--text-heading); }
.proj-author .btn { margin-top: 6px; }

.proj-back-link { padding: 0 0 clamp(56px, 9vw, 88px); }
.proj-back-link a {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  color: var(--text-primary); text-decoration: none;
}
.proj-back-link a:hover { color: var(--accent); }

/* Lightbox */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(10,10,10,0.92); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 32px;
  cursor: zoom-out;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-overlay img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: var(--radius-sm); box-shadow: 0 20px 60px rgba(0,0,0,0.5); cursor: default;
}
.lightbox-close {
  position: fixed; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.15); color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Case study: specificity fixes for lead, testimonial and stats inside the article */
.proj-article .proj-lead { margin: 0 0 24px; }
.proj-article .testimonial { margin-top: 16px; }
.proj-article .testimonial p { margin: 0 0 16px; }
.proj-article .testimonial-attribution { margin-top: 20px; }

/* Dark mode refinements */
[data-theme="dark"] .card-arrow {
  background: #B8A98D;
  color: #0B0B0B;
  border: none;
}
[data-theme="dark"] .card:hover .card-arrow { background: #D6C9AE; color: #0B0B0B; }
[data-theme="dark"] footer {
  background: var(--bg-page);
  border-top: 1px solid var(--border-hairline);
}

/* Testimonial profile link */
.testimonial-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  font-size: 15px; font-weight: 600;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--duration-fast) var(--ease-out);
}
.testimonial-link:hover { color: var(--text-heading); }
.proj-live { margin: 0 0 40px; }
.testimonial-link svg { transition: transform var(--duration-fast) var(--ease-out); }
.testimonial-link:hover svg { transform: translate(2px, -2px); }
[data-theme="dark"] .testimonial-link { color: var(--accent); }
[data-theme="dark"] .testimonial-link:hover { color: var(--text-heading); }

/* Dark mode: beige label and chips */
[data-theme="dark"] .proj-eyebrow { color: var(--accent); }
[data-theme="dark"] .proj-chips li,
[data-theme="dark"] .card-stats li {
  background: rgba(184, 169, 141, 0.1);
  border: 1px solid rgba(184, 169, 141, 0.32);
  color: var(--accent);
}
[data-theme="dark"] .proj-chips strong,
[data-theme="dark"] .card-stats strong { color: #E3D8BF; }

/* Accessibility helpers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 1000; padding: 10px 16px; border-radius: 8px; background: #0B0B0B; color: #fff; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
[data-theme="dark"] .btn-secondary:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); color: #0B0B0B; }
.mobile-menu:not(.is-open) { visibility: hidden; }
[data-theme="dark"] .mobile-menu a:hover { background: rgba(255, 255, 255, 0.06); color: var(--accent); }
