/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: none; }

/* ---------- Theme tokens ---------- */
:root {
  --bg: #faf6ef;
  --bg-elevated: #f2ead9;
  --surface: #ede3cf;
  --border: #ded0b4;
  --text: #201b14;
  --text-muted: #6f6252;
  --accent: #b63c1b;
  --accent-dark: #a9371a;
  --accent-ink: #fff6ee;
  --header-bg: rgba(250, 246, 239, 0.92);
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --container-width: 1160px;
  --radius: 10px;
  --radius-full: 999px;
}

:root[data-theme="dark"] {
  --bg: #16130e;
  --bg-elevated: #1f1a13;
  --surface: #241e15;
  --border: #3a3122;
  --text: #f3ece0;
  --text-muted: #a89b87;
  --accent: #e8734a;
  --accent-dark: #f28a63;
  --accent-ink: #16130e;
  --header-bg: rgba(22, 19, 14, 0.9);
}

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
  border-bottom: 1px solid var(--border);
}

.section-alt { background: var(--bg-elevated); }

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: inline-block;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
}

.placeholder {
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(199, 67, 30, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; transition: opacity 0.4s ease; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--text);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  flex-shrink: 0;
}

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

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

.theme-toggle .icon-dark { display: none; }

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  gap: 16px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a {
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-links a:hover::after { width: 100%; }

.nav-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 3px;
}

.nav-cta {
  padding: 11px 20px;
  background: var(--text);
  border-radius: var(--radius);
  color: var(--bg) !important;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.nav-cta:hover { background: var(--accent); transform: translateY(-2px); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  display: none;
}

@media (max-width: 760px) {
  .bottom-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 4px;
  }

  .bottom-nav-links {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 20px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }

  .bottom-nav-links::-webkit-scrollbar { display: none; }

  .bottom-nav-links a { min-height: 44px; display: inline-flex; align-items: center; }

  .bottom-nav a.bottom-nav-cta { flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; }

  .bottom-nav a {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    white-space: nowrap;
  }

  .bottom-nav a.bottom-nav-cta {
    color: var(--accent-ink);
    background: var(--accent);
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 96px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 24px;
}

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

.hero-tags {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-dark);
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-photo-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transform: rotate(2deg);
  padding: 12px;
}

.hero-photo-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  transform: rotate(-4deg);
  z-index: -1;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
}

.hero-photo-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
}

/* ---------- Methodology ---------- */
.how-intro {
  max-width: 640px;
  margin-bottom: 48px;
}

.how-intro p {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.how-questions {
  margin: 20px 0;
  color: var(--text-muted);
  font-style: italic;
}

.how-questions li { margin-bottom: 6px; }

.how-result {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.3rem;
  max-width: 640px;
}

.flow-diagram {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.flow-step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 3px 3px 0 var(--border);
  text-align: center;
  animation-name: flowPulse;
  animation-duration: 10s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.flow-step:nth-child(1) { animation-delay: 0s; }
.flow-step:nth-child(3) { animation-delay: 1.6s; }
.flow-step:nth-child(5) { animation-delay: 3.2s; }
.flow-step:nth-child(7) { animation-delay: 4.8s; }
.flow-step:nth-child(9) { animation-delay: 6.4s; }

.flow-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.7;
}

.flow-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
}

.flow-arrow {
  flex: 0 0 auto;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  animation-name: flowArrowPulse;
  animation-duration: 10s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.flow-arrow:nth-child(2) { animation-delay: 0.8s; }
.flow-arrow:nth-child(4) { animation-delay: 2.4s; }
.flow-arrow:nth-child(6) { animation-delay: 4s; }
.flow-arrow:nth-child(8) { animation-delay: 5.6s; }

@keyframes flowPulse {
  0%, 14%, 100% {
    background: var(--bg);
    color: var(--text);
    box-shadow: 3px 3px 0 var(--border);
    border-color: var(--border);
  }
  6% {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 3px 3px 0 var(--accent-dark);
    border-color: var(--accent);
  }
}

@keyframes flowArrowPulse {
  0%, 14%, 100% { color: var(--border); transform: scale(1); }
  6% { color: var(--accent); transform: scale(1.35); }
}

@keyframes flowArrowPulseVertical {
  0%, 14%, 100% { color: var(--border); transform: rotate(90deg) scale(1); }
  6% { color: var(--accent); transform: rotate(90deg) scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
  .flow-step, .flow-arrow { animation: none; }
}

@media (max-width: 760px) {
  .flow-diagram { flex-direction: column; }
  .flow-step { width: 100%; }
  .flow-arrow { width: 100%; padding: 2px 0; animation-name: flowArrowPulseVertical; }
}

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

.method-card {
  border-top: 2px solid var(--text);
  padding-top: 20px;
}

.method-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.method-card h3 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.method-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 56px;
}

.about-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.about-body p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1.05rem;
  max-width: 640px;
}

.about-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Standards ---------- */
/* ---------- Experience ---------- */
.experience-list { max-width: 820px; }

.experience-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  margin-bottom: 20px;
  overflow: hidden;
}

.experience-item:last-child { margin-bottom: 0; }

.experience-item summary {
  cursor: pointer;
  list-style: none;
  padding: 24px 32px;
}

.experience-item summary::-webkit-details-marker { display: none; }
.experience-item summary::marker { content: ''; }

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.experience-title h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.experience-company {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.experience-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.experience-dates {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.experience-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.experience-item[open] .experience-chevron { transform: rotate(180deg); }

.experience-details {
  padding: 0 32px 28px;
  animation: experienceFadeIn 0.25s ease;
}

@keyframes experienceFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.experience-details p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

/* ---------- Skills ---------- */
.skills-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.skill-group h3 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-chip {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  background: var(--bg);
}

.skill-chip-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
}

.skill-chip-logo img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
}

/* Monochrome black marks need inverting to stay legible on the dark theme */
:root[data-theme="dark"] .skill-chip-logo img[src$="codex.svg"] {
  filter: invert(1);
}

.stack-note {
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stack-note strong { color: var(--text); }

/* ---------- Services ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.service-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(32, 27, 20, 0.08);
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.service-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: 2px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.service-cta:hover { color: var(--accent); }

.service-card p:last-child { margin-bottom: 0; }

/* ---------- Best fit ---------- */
.fit-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fit-label::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--border);
}

.fit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.fit-card {
  border: 1px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius);
  padding: 16px 14px;
  background: var(--bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(32, 27, 20, 0.08);
}

.fit-card h4 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}

.fit-card p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ---------- Work / Case studies ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.work-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(32, 27, 20, 0.08);
}

.work-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
}

.work-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.work-title-caps {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.work-title-caps:has(+ .work-subtitle) {
  margin-bottom: 4px;
}

.work-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.work-block { margin-bottom: 14px; }

.work-block-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.work-block p { font-size: 0.92rem; }

.work-result {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-dark);
}

.work-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 24px;
}

.work-tools-label {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.work-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.work-tool-chip img {
  width: 12px;
  height: 12px;
  object-fit: contain;
  border-radius: 2px;
}

.work-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.work-video-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.work-header .work-tag { margin-bottom: 0; }

.work-video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

/* ---------- Work media (screenshot carousel) ---------- */
.work-card { position: relative; }

.work-media {
  position: relative;
  margin: 20px -32px 20px;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
}

.work-card > .work-media:first-child {
  margin-top: -32px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: none;
}

.work-media img.is-active,
.work-media .photo-placeholder.is-active {
  display: flex;
}

.work-media .photo-placeholder {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 0;
  display: none;
}

.work-media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(20, 16, 10, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.work-media-prev { left: 10px; }
.work-media-next { right: 10px; }

.work-media-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.work-media-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.work-media-dot.is-active { background: #fff; }

.work-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  width: 100%;
  justify-content: center;
  cursor: pointer;
}

.work-expand-btn:hover { color: var(--accent); }

/* ---------- Case study modal ---------- */
.case-modal {
  margin: auto;
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 780px;
  width: 92vw;
  max-height: 88vh;
  background: var(--bg);
  color: var(--text);
}

.case-modal::backdrop {
  background: rgba(10, 8, 5, 0.6);
  backdrop-filter: blur(2px);
}

.case-modal-inner {
  overflow-y: auto;
  max-height: 88vh;
  padding: 0 36px 36px;
}

.case-modal .work-media {
  margin: 0 -36px 24px;
  border-radius: 0;
  aspect-ratio: auto;
  overflow: visible;
}

.case-modal .work-media img {
  height: auto;
  display: none;
}

.case-modal .work-media img.is-active {
  display: block;
}

.case-modal .work-header {
  clear: both;
}

.case-modal-close {
  position: sticky;
  top: 16px;
  float: right;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.case-modal h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  clear: both;
}

.case-modal .work-subtitle {
  margin-bottom: 20px;
}

.case-modal h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 28px 0 10px;
}

.case-modal p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.work-block ul,
.case-modal ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.work-block ul li,
.case-modal ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.work-block ul li { font-size: 0.92rem; }
.case-modal ul li { font-size: 0.95rem; }

.work-block ul li::before,
.case-modal ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.case-modal .flow-line {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-align: center;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.case-modal .work-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 18px;
}

.case-modal .work-stats .stat-number {
  font-size: 1.6rem;
}

.case-modal h5 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-dark);
  margin: 18px 0 8px;
}

/* ---------- Reviews ---------- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--bg-elevated);
}

.review-rating {
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.review-rating span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0;
  margin-left: 8px;
}

.review-quote {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}

.review-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.review-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.review-name { font-weight: 600; font-size: 0.92rem; }
.review-role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  transition: border-color 0.15s ease;
}

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

.form-field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-field input,
.form-field textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
}

.form-field textarea { resize: vertical; min-height: 120px; }

.form-status {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: none;
}

.form-status:not(:empty) { display: block; }
.form-status.is-success { color: var(--accent-dark); }
.form-status.is-error { color: #c0392b; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0;
  color: var(--text-muted);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  gap: 20px;
}

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

/* ---------- Blog ---------- */
.blog-hero {
  padding: 72px 0 56px;
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 600;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(32, 27, 20, 0.08);
}

.blog-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
}

.blog-tag { color: var(--accent); }

.blog-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.blog-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.read-more {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

/* Post page */
.post-header { padding: 72px 0 40px; border-bottom: 1px solid var(--border); }
.post-header .blog-meta { margin-bottom: 20px; }
.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
  line-height: 1.25;
  max-width: 800px;
}

.post-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px;
}

.post-body p {
  margin-bottom: 24px;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.post-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 40px 0 16px;
  color: var(--text);
}

.post-nav {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo-frame { max-width: 320px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .method-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-groups { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .audience-grid { grid-template-columns: 1fr; }
  .reviews-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .fit-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav {
    height: 68px;
    gap: 10px;
  }

  .logo { font-size: 0.9rem; }

  .nav-links { display: none; }
  .nav-cta { display: none; }
  .theme-toggle { width: 34px; height: 34px; }

  body { padding-bottom: 60px; }

  .hero { padding: 56px 0 64px; }
  .hero h1 { font-size: 2.1rem; }
  .hero-tagline { font-size: 1rem; }

  .section { padding: 56px 0; }
  .section-head { margin-bottom: 36px; }

  .method-grid { grid-template-columns: 1fr; }
  .experience-header { flex-direction: column; align-items: flex-start; }
  .fit-grid { grid-template-columns: 1fr; }

  .work-card,
  .service-card,
  .review-card,
  .blog-card {
    padding: 22px;
  }

  .experience-item summary { padding: 18px 20px; }
  .experience-details { padding: 0 20px 22px; }

  .contact-link { padding: 14px 16px; flex-wrap: wrap; gap: 6px; }

  .post-body { padding: 40px 20px; }
}

@media (max-width: 420px) {
  .fit-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero h1 { font-size: 1.85rem; }
  .flow-step { padding: 18px 10px; }
}

/* ==========================================================
   Motion system
   One authored moment (the hero pipeline), plus quiet feedback.
   ========================================================== */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Themed browser surfaces */
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
html { scroll-behavior: smooth; }

/* ---- Hero intro: content rises out of a mask, the frame fans out ---- */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(14px); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
@keyframes heroFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes frameSettle {
  from { opacity: 0; transform: rotate(0deg) translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: rotate(2deg); }
}
@keyframes frameFan {
  from { transform: rotate(0deg); opacity: 0; }
  to   { transform: rotate(-4deg); opacity: 1; }
}

.js .hero-intro .reveal { opacity: 1; transform: none; transition: none; }
.js .hero-intro .eyebrow,
.js .hero-intro h1,
.js .hero-intro .hero-tags,
.js .hero-intro .hero-tagline,
.js .hero-intro .hero-cta {
  animation: heroRise 0.8s var(--ease-out) both;
}
.js .hero-intro .eyebrow { animation-delay: 0.05s; }
.js .hero-intro h1 { animation-delay: 0.15s; }
.js .hero-intro .hero-tags { animation-delay: 0.35s; }
.js .hero-intro .hero-tagline { animation-delay: 0.45s; }
.js .hero-intro .hero-cta { animation-delay: 0.6s; }
.js .hero-intro .hero-photo-frame { animation: frameSettle 0.9s var(--ease-out) 0.25s both; }
.js .hero-intro .hero-photo-frame::before { animation: frameFan 0.9s var(--ease-out) 0.55s both; }
.js .hero-intro .hero-photo-tag { animation: heroFade 0.6s ease 0.9s both; }

/* ---- Focal moment: a signal travels the pipeline, the customer converts ---- */
.pipe-stage {
  color: var(--text);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  padding-bottom: 1px;
}
.pipe-final { font-weight: 600; }
.pipe-arrow { display: inline-block; color: var(--text-muted); }

@keyframes stageLit {
  0%   { background-size: 0% 2px; color: var(--text); }
  45%  { background-size: 100% 2px; color: var(--accent-dark); }
  100% { background-size: 100% 0px; color: var(--text); }
}
@keyframes stageConvert {
  from { background-size: 0% 2px; }
  to   { background-size: 100% 2px; color: var(--accent-dark); }
}
@keyframes arrowNudge {
  0%, 100% { transform: none; color: var(--text-muted); }
  50% { transform: translateX(3px); color: var(--accent); }
}
.js .hero-intro .pipe-stage { animation: stageLit 0.7s var(--ease-in-out) both; }
.js .hero-intro .pipe-arrow { animation: arrowNudge 0.45s var(--ease-out) both; }
.js .hero-intro .pipe-stage:nth-of-type(1) { animation-delay: 1.0s; }
.js .hero-intro .pipe-arrow:nth-of-type(2) { animation-delay: 1.35s; }
.js .hero-intro .pipe-stage:nth-of-type(3) { animation-delay: 1.5s; }
.js .hero-intro .pipe-arrow:nth-of-type(4) { animation-delay: 1.85s; }
.js .hero-intro .pipe-stage:nth-of-type(5) { animation-delay: 2.0s; }
.js .hero-intro .pipe-arrow:nth-of-type(6) { animation-delay: 2.35s; }
.js .hero-intro .pipe-final { animation: stageConvert 0.6s var(--ease-out) 2.5s both; }

/* ---- Toolstack chips cascade in once their group arrives ---- */
@keyframes chipIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.js .skill-group.in-view .skill-chip {
  animation: chipIn 0.45s var(--ease-out) both;
  animation-delay: calc(120ms + var(--i, 0) * 40ms);
}

/* ---- Feedback ---- */
.btn:active,
.bottom-nav-cta:active,
.work-expand-btn:active,
.work-media-nav:active { transform: scale(0.97); transition-duration: 0.08s; }

@keyframes iconSpin {
  from { opacity: 0; transform: rotate(-90deg) scale(0.6); }
  to   { opacity: 1; transform: none; }
}
.theme-toggle svg { animation: iconSpin 0.4s var(--ease-out); }

/* Carousel slides crossfade in */
@keyframes slideIn {
  from { opacity: 0; transform: scale(1.015); }
  to   { opacity: 1; transform: none; }
}
.work-media img.is-active { animation: slideIn 0.35s var(--ease-out); }
.work-media-dot { transition: background 0.2s ease, transform 0.2s var(--ease-out); }
.work-media-dot.is-active { transform: scale(1.25); }

/* Case study modal opens with depth; closes instantly */
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
.case-modal[open] { animation: modalIn 0.4s var(--ease-out); }
.case-modal[open]::backdrop { animation: backdropIn 0.3s ease; }

/* Form status arrives instead of popping */
@keyframes statusIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.form-status.is-success,
.form-status.is-error { animation: statusIn 0.3s var(--ease-out); }
button[aria-busy="true"] { cursor: progress; opacity: 0.85; }

/* Process loop runs only while visible */
.flow-diagram:not(.is-playing) .flow-step,
.flow-diagram:not(.is-playing) .flow-arrow { animation-play-state: paused; }

/* ---- Reduced motion: keep state and color, drop travel ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero-intro .eyebrow,
  .js .hero-intro h1,
  .js .hero-intro .hero-tags,
  .js .hero-intro .hero-tagline,
  .js .hero-intro .hero-cta,
  .js .hero-intro .hero-photo-tag { animation: heroFade 0.4s ease both; }
  .js .hero-intro .hero-photo-frame,
  .js .hero-intro .hero-photo-frame::before { animation: none; }
  .js .hero-intro .pipe-stage,
  .js .hero-intro .pipe-arrow { animation: none; }
  .js .hero-intro .pipe-final { animation: stageConvert 0.01s linear 0.4s both; }
  .js .skill-group.in-view .skill-chip { animation: heroFade 0.3s ease both; }
  .theme-toggle svg,
  .work-media img.is-active,
  .case-modal[open] { animation: heroFade 0.2s ease; }
  .btn:active, .bottom-nav-cta:active, .work-expand-btn:active, .work-media-nav:active { transform: none; }
}
