/* ============================================
   David Dale — Portfolio
   Minimal & editorial · dark/light themes
   ============================================ */

/* Brand color tokens */
:root {
  --ember: #eb5939;
  --cream: #b7ab98;
}

/* Ember Light — warm parchment counterpart to Ember */
:root {
  --bg: #f4efe5;
  --bg-elevated: #fcf9f2;
  --bg-subtle: #ece5d6;
  --text: #211c15;
  --text-secondary: #5c5547;
  --text-tertiary: #8d8474;
  --accent: #eb5939;
  --accent-soft: rgba(235, 89, 57, 0.08);
  --border: rgba(33, 28, 21, 0.1);
  --border-strong: rgba(33, 28, 21, 0.22);
  --particle: 33, 28, 21;
  --shadow: 0 1px 2px rgba(33, 28, 21, 0.04), 0 8px 32px rgba(33, 28, 21, 0.07);
  --shadow-hover: 0 2px 4px rgba(33, 28, 21, 0.06), 0 16px 48px rgba(33, 28, 21, 0.13);
}

/* Ember — #0D0D0D · #B7AB98 · #EB5939 */
[data-theme="dark"] {
  --bg: #0d0d0d;
  --bg-elevated: #171514;
  --bg-subtle: #121110;
  --text: #b7ab98;
  --text-secondary: #8c816f;
  --text-tertiary: #645b4d;
  --accent: #eb5939;
  --accent-soft: rgba(235, 89, 57, 0.1);
  --border: rgba(183, 171, 152, 0.12);
  --border-strong: rgba(183, 171, 152, 0.26);
  --particle: 183, 171, 152;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 48px rgba(0, 0, 0, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 20px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection { background: var(--accent); color: var(--bg); }

h1, h2, h3, .serif {
  font-family: "Work Sans", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  transition: background 0.4s ease;
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: "Work Sans", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.nav-logo .logo-david { color: var(--text); }
.nav-logo .logo-dale { color: var(--accent); }

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

.nav-links a {
  font-family: "Work Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  position: relative;
}

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

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

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, background 0.4s;
}

.theme-toggle:hover {
  transform: rotate(15deg) scale(1.08);
  border-color: var(--border-strong);
}

.theme-toggle svg { width: 18px; height: 18px; }

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.hero-content {
  position: relative;
  z-index: 2;
  pointer-events: none;
  padding-top: 60px;
}

.hero-content a, .hero-content .btn { pointer-events: auto; }

.hero-eyebrow {
  font-family: "Work Sans", sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(48px, 8.5vw, 104px);
  max-width: 18ch;
  text-wrap: balance;
  margin-bottom: 32px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-family: "Work Sans", sans-serif;
  font-size: clamp(18px, 2.1vw, 22px);
  color: var(--text-secondary);
  max-width: 52ch;
  margin-bottom: 40px;
}

.hero-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-tertiary);
  animation: floaty 2.8s ease-in-out infinite;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: color 0.25s ease;
}

.hero-hint:hover { color: var(--accent); }

.hero-hint svg { width: 24px; height: 24px; }

@keyframes floaty {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -8px); }
}

/* ---------- Buttons ---------- */
.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  font-family: "Work Sans", sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}

/* Registered property so the radiating fill can animate */
@property --btn-r {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

.btn-primary {
  --btn-r: 0%;
  background-color: var(--text);
  background-image: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    var(--accent) calc(var(--btn-r) - 1%),
    transparent var(--btn-r)
  );
  color: var(--bg);
  transition:
    --btn-r 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.3s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s;
}

@media (hover: hover) {
  .btn-primary:hover {
    --btn-r: 170%;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
  }
}

.btn-ghost {
  --btn-r: 0%;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background-image: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    var(--accent) calc(var(--btn-r) - 1%),
    transparent var(--btn-r)
  );
  transition:
    --btn-r 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .btn-ghost:hover {
    --btn-r: 170%;
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
  }
}

.btn svg { width: 16px; height: 16px; transition: transform 0.25s ease; }
@media (hover: hover) {
  .btn:hover svg { transform: translateX(3px); }
}

/* ---------- Sections ---------- */
section { padding: 110px 0; }

.section-label {
  font-family: "Work Sans", sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(32px, 4.5vw, 52px);
  max-width: 20ch;
  margin-bottom: 20px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 22px;
  max-width: 56ch;
}

/* ---------- Featured shots slideshow ---------- */
.featured-shots { padding: 110px 0 0; }

.slideshow {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.slide.active { opacity: 1; }

@media (max-width: 860px) {
  .slideshow { aspect-ratio: 4 / 3; border-radius: 16px; }
}

/* ---------- Stats strip ---------- */
.stats-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 56px 0;
  transition: background 0.4s ease;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
}

.stat-num {
  font-family: "Work Sans", sans-serif;
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.stat-num sup { font-size: 0.5em; color: var(--accent); }

.stat-label {
  font-family: "Work Sans", sans-serif;
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--text-secondary);
}

/* ---------- Work cards ---------- */
.work-grid {
  display: grid;
  gap: 32px;
  margin-top: 64px;
}

.work-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  border: 1px solid transparent;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-elevated);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.35s, background 0.4s;
}

.work-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.work-card-visual {
  min-height: 320px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.visual-magical { background: linear-gradient(135deg, #7c2d12 0%, #c2410c 50%, #fb923c 100%); }
.visual-shelby { background: linear-gradient(135deg, #1e3a5f 0%, #2d6a8f 55%, #7dd3fc 100%); }
.visual-misc { background: linear-gradient(135deg, #3f3f46 0%, #71717a 60%, #d4d4d8 100%); }
.visual-frost { background: linear-gradient(135deg, #16243d 0%, #3b5a8a 55%, #f3dcc4 100%); }

.work-card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.25), transparent 55%);
}

.work-card-visual.has-img::after { display: none; }

.work-card-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-card:hover .work-card-visual img { transform: scale(1.04); }

.visual-mark {
  font-family: "Work Sans", sans-serif;
  font-size: clamp(72px, 9vw, 120px);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.92);
  z-index: 1;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-card:hover .visual-mark { transform: scale(1.08) rotate(-3deg); }

.work-card-body {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.work-card-body .work-tag, .project-card-body .work-tag, .work-tag {
  font-family: "Work Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 14px;
}

.work-card-body h3 {
  font-size: clamp(26px, 3vw, 34px);
  margin-bottom: 12px;
}

.work-card-body p {
  color: var(--text-secondary);
  font-size: 20px;
  margin-bottom: 24px;
}

.work-metrics {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.work-metric strong {
  display: block;
  font-family: "Work Sans", sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.work-metric span {
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  color: var(--text-tertiary);
}

.text-link {
  font-family: "Work Sans", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
  width: fit-content;
}

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

/* ---------- Principles ---------- */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 56px;
}

.principle {
  padding: 36px 32px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: var(--bg-elevated);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.3s, background 0.4s;
}

.principle:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.principle-num {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--accent);
  margin-bottom: 18px;
}

.principle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.principle-head .principle-num { margin-bottom: 0; }

.principle-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s;
}

.principle:hover .principle-icon { transform: scale(1.1) rotate(-4deg); }

.principle-icon svg { width: 21px; height: 21px; }

.principle h3 { font-size: 21px; margin-bottom: 10px; }

.principle p { color: var(--text-secondary); font-size: 20px; }

/* ---------- Project grid (work page) ---------- */
.project-grid-wrap { padding-top: 0; }

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-bottom: 90px;
}

@media (max-width: 860px) { .project-grid { grid-template-columns: 1fr; } }

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-elevated);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.35s, background 0.4s;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.project-card-visual {
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.25), transparent 55%);
}

.project-card-visual .visual-mark { font-size: clamp(56px, 6vw, 80px); }

.project-card-visual.has-img::after { display: none; }

.project-card-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .project-card-visual img { transform: scale(1.04); }

.project-card:hover .visual-mark { transform: scale(1.08) rotate(-3deg); }

.project-card-body { padding: 32px; }

.project-card-body h3 { font-size: clamp(22px, 2.6vw, 28px); margin-bottom: 8px; }

.project-card-body .work-tag { margin-bottom: 12px; }

.project-card-body p {
  font-family: "Newsreader", Georgia, serif;
  color: var(--text-secondary);
  font-size: 20px;
  margin-bottom: 20px;
}

/* ---------- Case studies (work page) ---------- */
.page-header {
  padding: 180px 0 80px;
}

.page-header h1 {
  font-size: clamp(44px, 7vw, 88px);
  max-width: 20ch;
  text-wrap: balance;
  margin-bottom: 24px;
}

.page-header h1 em { font-style: normal; color: var(--accent); }

.case-study {
  border-top: 1px solid var(--border);
  padding: 90px 0;
}

.case-hero {
  border-radius: 24px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 56px;
  position: relative;
  overflow: hidden;
}

.case-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 75% 25%, rgba(255,255,255,0.25), transparent 55%);
}

.case-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 64px;
}

.case-meta h2 {
  font-size: clamp(30px, 4vw, 42px);
  margin-bottom: 14px;
}

.case-tagline {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 28px;
}

.case-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-chip {
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-subtle);
  transition: background 0.4s, border-color 0.4s;
}

.case-body h4 {
  font-family: "Work Sans", sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin: 36px 0 16px;
}

.case-body h4:first-child { margin-top: 0; }

.case-body p { color: var(--text-secondary); margin-bottom: 14px; max-width: 62ch; }

.contrib-list { list-style: none; }

.contrib-list li {
  padding: 12px 0 12px 28px;
  position: relative;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 20px;
}

.contrib-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.impact-card {
  padding: 24px 20px;
  border-radius: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  transition: background 0.4s, border-color 0.4s;
}

.impact-card strong {
  display: block;
  font-family: "Work Sans", sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.impact-card span { font-family: "Work Sans", sans-serif; font-size: 14.5px; color: var(--text-secondary); }

/* ---------- Experience timeline ---------- */
.timeline { margin-top: 56px; }

.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 36px 0;
  border-top: 1px solid var(--border);
}

.timeline-role {
  font-family: "Work Sans", sans-serif;
  font-size: 15px;
  color: var(--text-tertiary);
  padding-top: 4px;
}

.timeline-body h3 { font-size: 24px; margin-bottom: 8px; }

.timeline-body p { color: var(--text-secondary); font-size: 20px; max-width: 60ch; }

/* ---------- About page ---------- */
.about-intro {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 72px;
  align-items: start;
}

.about-portrait {
  aspect-ratio: 3/4;
  border-radius: 24px;
  background: linear-gradient(160deg, var(--accent-soft), var(--bg-subtle));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 120px;
  transition: background 0.4s, border-color 0.4s;
}

.about-portrait span {
  font-family: "Work Sans", sans-serif;
  font-weight: 800;
  letter-spacing: -0.05em;
  font-size: 96px;
  color: var(--accent);
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: inherit;
  display: block;
}

.lede {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 18px;
  max-width: 62ch;
}

.quote-block {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 32px;
  margin: 64px 0;
}

.quote-block blockquote {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.45;
  margin-bottom: 12px;
}

.quote-block cite {
  font-family: "Work Sans", sans-serif;
  font-style: normal;
  font-size: 15px;
  color: var(--text-tertiary);
}

.strengths-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}

.strengths-cloud .theme-chip { font-size: 14px; padding: 10px 20px; }

/* ---------- CTA / Footer ---------- */
.cta {
  text-align: center;
  padding: 130px 0;
  border-top: 1px solid var(--border);
}

.cta h2 {
  font-size: clamp(36px, 5.5vw, 64px);
  max-width: 18ch;
  margin: 0 auto 20px;
}

.cta h2 em { font-style: normal; color: var(--accent); }

.cta p { color: var(--text-secondary); margin-bottom: 36px; }

.cta .btn-row { justify-content: center; }

footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}

.footer-inner {
  font-family: "Work Sans", sans-serif;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14.5px;
  color: var(--text-tertiary);
}

.footer-inner a { color: var(--text-secondary); transition: color 0.2s; }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(8px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, filter;
}

.reveal.visible { opacity: 1; transform: none; filter: none; }

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---------- Hero entrance sequence ---------- */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(32px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

.hero-content > * {
  opacity: 0;
  animation: hero-in 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.24s; }
.hero-content > *:nth-child(3) { animation-delay: 0.38s; }
.hero-content > *:nth-child(4) { animation-delay: 0.52s; }

@keyframes hint-in { from { opacity: 0; } to { opacity: 1; } }

.hero-hint {
  opacity: 0;
  animation: hint-in 0.9s ease 1.1s forwards, floaty 2.8s ease-in-out infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  /* Guard against horizontal scroll (safe here — sticky sidebars are disabled at this width) */
  html, body { overflow-x: hidden; }
  section { padding: 72px 0; }
  .page-header { padding: 140px 0 56px; }
  .work-card { grid-template-columns: 1fr; }
  .work-card-visual { min-height: 220px; }
  .work-card-body { padding: 32px 28px; }
  .case-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-intro { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 320px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .nav-links { gap: 18px; }
  .nav-links a:not(.theme-toggle) { font-size: 13.5px; }
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  body { font-size: 18px; }
  .container { padding: 0 20px; }
  .nav-inner { padding: 14px 20px; }
  .nav-logo { font-size: 22px; }
  .nav-links { gap: 14px; }
  .theme-toggle { width: 36px; height: 36px; }
  section { padding: 56px 0; }
  .page-header { padding: 116px 0 44px; }
  .page-header h1 { font-size: clamp(30px, 8.5vw, 44px); }
  .hero h1 { font-size: clamp(34px, 10vw, 60px); }
  .hero-sub { font-size: 17px; margin-bottom: 32px; }
  .section-title { font-size: clamp(26px, 7.5vw, 40px); }
  .section-sub { font-size: 18px; }
  .btn { padding: 12px 22px; font-size: 15px; }
  .work-card-body { padding: 28px 22px; }
  .work-metrics { gap: 20px; }
  .quote-block blockquote { font-size: clamp(19px, 5.5vw, 24px); }
}

/* ---------- Small phones ---------- */
@media (max-width: 400px) {
  .container { padding: 0 16px; }
  .nav-inner { padding: 12px 16px; }
  .nav-logo { font-size: 20px; }
  .nav-links { gap: 12px; }
  .nav-links a:not(.theme-toggle) { font-size: 13px; }
  .btn { padding: 11px 18px; }
}

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

/* ---------- Image lightbox ---------- */
.zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.lightbox.open { opacity: 1; visibility: visible; }

.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
  transform: scale(0.96);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.open img { transform: scale(1); }

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 26px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.24); }

/* Disable sticky case-study sidebars on mobile (higher specificity than per-page .cs-sticky) */
@media (max-width: 860px) {
  .cs-grid .cs-sticky { position: static; top: auto; }
}

/* Keep 2-column image rows as 2 columns on mobile (overrides per-page collapse; leaves 3-col rows untouched) */
@media (max-width: 700px) {
  .container .img-row:not(.cols-3) { grid-template-columns: 1fr 1fr; }
}
