/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }

/* ─── Design tokens ─── */
:root {
  --bg:           #080808;
  --surface:      #0f0f0f;
  --surface-2:    #161616;
  --overlay:      #1e1e1e;
  --border:       #1e1e1e;
  --border-hi:    #2a2a2a;
  --text:         #e8e4dd;
  --text-2:       #ccc8c2;
  --text-3:       #aaa59f;
  --accent:       #ffffff;
  --accent-dim:   #b8b4ae;
  --accent-bg:    #111110;
  --accent-glow:  rgba(255, 255, 255, 0.05);
  --positive:     #4a7c59;
  --font-display: 'Montserrat', system-ui, sans-serif;
  --font-body:    'IBM Plex Mono', 'Courier New', monospace;
  --font-ui:      'DM Sans', system-ui, sans-serif;
}

/* ─── Base ─── */
body {
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#star-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Utility: section label ─── */
.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

/* ─── Buttons ─── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 3px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  cursor: pointer;
  border: none;
  min-height: 44px;
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-hi);
}
.btn-secondary:hover {
  border-color: var(--text-3);
  color: var(--text);
}

/* ─── Nav ─── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-logo {
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-2);
  transition: color 140ms ease;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-hi);
  border-radius: 3px;
  color: var(--text) !important;
  transition: border-color 140ms ease, background 140ms ease !important;
}
.nav-cta:hover {
  border-color: var(--accent) !important;
  background: var(--accent-bg) !important;
}

.site-nav.scrolled {
  border-bottom-color: var(--border-hi);
  background: rgba(8, 8, 8, 0.96);
}

/* ─── Hero ─── */
.hero {
  min-height: 0;
  display: flex;
  align-items: center;
  padding: 8rem 3rem 6rem;
}

.hero-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Pull label tight to headline — they read as one unit */
.hero-content .section-label {
  letter-spacing: 0.18em;
  margin-bottom: 0.65rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.8vw, 3.5rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.75rem;
  text-wrap: balance;
}

.hero-sub {
  font-family: var(--font-ui);
  font-size: clamp(0.95rem, 1.25vw, 1.05rem);
  font-weight: 300;
  line-height: 1.78;
  color: var(--text-2);
  max-width: 46ch;
  margin-bottom: 2.25rem;
  letter-spacing: 0.01em;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── Terminal block ─── */
.hero-terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 0.82rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-hi);
}
.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.terminal-title {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.terminal-body {
  padding: 1.5rem;
  min-height: 200px;
  line-height: 1.8;
}

.terminal-output {
  display: inline;
  color: var(--text-2);
  white-space: pre-wrap;
  font-family: var(--font-body);
  font-size: 0.82rem;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.9em;
  background: var(--accent);
  animation: blink 800ms step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

/* ─── Logo marquee ─── */
.logo-marquee-section {
  margin: 0;
  padding: 1.25rem 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.logo-marquee-label {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 1.25rem;
}

.logo-marquee-wrap {
  overflow: hidden;
  position: relative;
}

.logo-marquee-wrap::before,
.logo-marquee-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5rem;
  z-index: 1;
  pointer-events: none;
}

.logo-marquee-wrap::before {
  left: 0;
  background: linear-gradient(to right, #ffffff, transparent);
}

.logo-marquee-wrap::after {
  right: 0;
  background: linear-gradient(to left, #ffffff, transparent);
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.logo-marquee-track {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  width: max-content;
  padding: 0.25rem 0;
  animation: marquee-scroll 28s linear infinite;
}

.logo-marquee-track:hover {
  animation-play-state: paused;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.logo-item {
  height: 26px;
  width: auto;
  opacity: 0.85;
  transition: opacity 200ms ease;
  flex-shrink: 0;
  display: block;
}

.logo-item:hover {
  opacity: 1;
}

.logo-item--tall {
  height: 34px;
}

@media (prefers-reduced-motion: reduce) {
  .logo-marquee-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    width: 100%;
  }
}

/* ─── Belief quote (inside cal left column) ─── */
.belief-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-2);
  position: relative;
}

.belief-quote::before {
  content: '\201C';
  display: block;
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.25;
  line-height: 0.6;
  margin-bottom: 1rem;
  font-style: normal;
}

/* ─── Work section ─── */
.work-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 3rem 7rem;
}

/* ─── Project cards ─── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2.5rem;
  transition: background 200ms ease, border-color 200ms ease,
              transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms ease;
}

.project-card:not(.project-card--placeholder):hover {
  background: var(--surface-2);
  border-color: var(--border-hi);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.project-card:hover .project-number { color: var(--accent); }

/* Featured card */
.project-card--featured {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.project-number {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-3);
  transition: color 160ms ease;
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.project-body {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 72ch;
}

.card-divider {
  height: 1px;
  background: var(--border);
}

.card-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.result-metric {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-number {
  font-family: var(--font-body);
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  font-weight: 500;
  color: var(--accent);
  line-height: 1.1;
}

.result-desc {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.6;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-link {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--accent);
  transition: color 140ms ease, text-decoration-color 140ms ease;
  text-decoration: none;
}
.card-link:hover {
  color: var(--accent-dim);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
}

/* ─── Inline infrastructure diagram ─── */
.card-diagram {
  overflow-x: auto;
}

.card-diagram-label {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.card-diagram .mermaid svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.result-pubs {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* Tags */
.tag {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.2rem 0.5rem;
}

/* Secondary cards grid */
.project-grid-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.project-card--placeholder {
  opacity: 0.3;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: default;
}

.project-card--placeholder .project-title {
  font-size: 1.2rem;
}

/* ─── Services section ─── */
.services-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 3rem 7rem;
  border-top: 1px solid var(--border);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background 200ms ease, border-color 200ms ease,
              transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
  background: var(--surface-2);
  border-color: var(--border-hi);
  transform: translateY(-2px);
}

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

.service-number {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-3);
  transition: color 160ms ease;
}

.service-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.service-desc {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-2);
  flex: 1;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

/* ─── Services tagline (grid item: fills space next to card 07) ─── */
.services-tagline {
  grid-column: span 2;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 0 4px 4px 0;
  padding: 2rem;
  display: flex;
  align-items: center;
}

/* ─── Flip card ─── */
.flip-card {
  perspective: 1400px;
  background: transparent;
  border: none;
  padding: 0;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 650ms ease-in-out;
}

.flip-card-inner.is-flipped {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 4px;
}

.flip-card-front {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
}

.flip-card-back {
  transform: rotateY(180deg);
  background: var(--text);
  padding: 2.5rem;
  display: flex;
  align-items: flex-start;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .flip-card-inner {
    transition: none;
  }
  .flip-card-inner:not(.is-flipped) .flip-card-front { display: none; }
  .flip-card-inner:not(.is-flipped) .flip-card-back  { transform: none; }
}

.inverted-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.inverted-eyebrow {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #5a5550;
  text-transform: uppercase;
}

.inverted-headline {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--bg);
}

.inverted-body {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.65;
  color: #3a3532;
  max-width: 34ch;
}

.inverted-btn {
  background: var(--bg);
  color: var(--text);
  align-self: flex-start;
  margin-top: 0.5rem;
}
.inverted-btn:hover {
  background: #1a1a1a;
}

/* ─── About ─── */
.about-section {
  background: var(--bg);
  padding: 4rem 3rem 7rem;
  border-top: 1px solid var(--border);
}
.about-section > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.about-content {
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-definition {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.definition-term {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.definition-pos {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-style: italic;
}

.about-image-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-hi);
  margin: 0 auto;
}

.about-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.about-image {
  display: block;
  width: 100%;
  height: auto;
  filter: none;
}

.about-text {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-2);
}

/* ─── Contact ─── */
.contact-section {
  background: var(--surface);
  border-top: 1px solid var(--accent);
  padding: 7rem 3rem;
}

.contact-section .section-label { margin-bottom: 1rem; }

.contact-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1rem;
}

.contact-sub {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-2);
  max-width: 52ch;
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

.contact-email {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.email-address {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.01em;
}

.copy-btn {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: 2px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}
.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.copy-btn.copied {
  color: var(--positive);
  border-color: var(--positive);
}

.contact-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── Footer ─── */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ─── Scroll progress bar ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transform-origin: left;
  pointer-events: none;
}

/* ─── Animations ─── */
.animate-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Reduced motion: respect system preference ─── */
@media (prefers-reduced-motion: reduce) {
  .animate-in {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .scroll-progress {
    display: none;
  }
  .cursor {
    animation: none;
    opacity: 1;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ─── Focus styles ─── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ─── Responsive: tablet (≤900px) ─── */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-terminal {
    display: none;
  }
  .card-result {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  .project-grid-secondary {
    grid-template-columns: 1fr;
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .services-tagline {
    grid-column: span 1;
  }
}

/* ─── Mobile calendar fallback — hidden on desktop ─── */
.cal-mobile-fallback {
  display: none;
}

/* ─── Responsive: mobile (≤768px) ─── */
@media (max-width: 768px) {

  /* ── Nav ── */
  .site-nav {
    padding: 0.75rem 1.25rem;
  }
  .nav-links a:not(.nav-cta) {
    display: none;
  }
  /* Touch target: minimum 44px height */
  .nav-cta {
    font-size: 0.8rem;
    padding: 0 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* ── Hero ── */
  .hero {
    padding: 5rem 1.25rem 3.5rem;
  }
  .hero-headline {
    font-size: clamp(1.85rem, 8vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
  }
  .hero-sub {
    font-size: 1rem;
    max-width: 100%;
    line-height: 1.65;
  }
  .hero-ctas {
    flex-direction: column;
    gap: 0.75rem;
  }
  /* Touch targets: 52px min height for thumb taps */
  .btn-primary,
  .btn-secondary {
    width: 100%;
    min-height: 52px;
    font-size: 0.95rem;
  }

  /* ── Mobile before/after fallback ── */
  .cal-mobile-fallback {
    display: block;
    padding: 3rem 1.25rem;
    border-top: 1px solid var(--border);
  }
  .belief-quote--mobile {
    font-size: clamp(1rem, 4.5vw, 1.25rem);
    margin-bottom: 2rem;
  }
  .cal-mobile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
  .cal-mobile-stat:last-child {
    grid-column: 1 / -1;
  }
  .cal-mobile-stat-num {
    display: block;
    font-family: var(--font-body);
    font-size: clamp(1.4rem, 6vw, 1.8rem);
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 0.35rem;
  }
  .cal-mobile-stat-label {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.55;
    color: var(--text-2);
  }

  /* ── Work section ── */
  .work-section {
    padding: 3rem 1.25rem 3.5rem;
  }
  .section-header {
    margin-bottom: 1.25rem;
  }
  .project-card {
    padding: 1.5rem;
  }
  .project-card--featured {
    gap: 1.25rem;
  }
  .card-result {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .result-number {
    font-size: 2rem;
  }
  .result-desc {
    font-size: 0.875rem;
    line-height: 1.6;
  }
  .project-body {
    font-size: 1rem;
    max-width: 100%;
  }
  .project-grid-secondary {
    gap: 0.75rem;
    margin-top: 0.75rem;
  }
  .project-card--placeholder {
    padding: 1.25rem 1.5rem;
  }

  /* ── Services section ── */
  .services-section {
    padding: 3rem 1.25rem 3.5rem;
  }
  .services-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .service-card {
    padding: 1.25rem 1.5rem;
  }
  /* 16px minimum for body text on mobile */
  .service-desc {
    font-size: 1rem;
    line-height: 1.65;
  }
  .services-tagline {
    grid-column: span 1;
    padding: 1.25rem 1.5rem;
    min-height: 120px;
  }
  .services-tagline--inverted {
    padding: 1.5rem;
    min-height: unset;
  }
  .inverted-body {
    font-size: 1rem;
    max-width: 100%;
  }
  /* Ensure flip-card back button meets touch target */
  .inverted-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* ── About section ── */
  .about-section {
    padding: 3rem 1.25rem 3.5rem;
  }
  .about-content {
    gap: 1.5rem;
  }
  /* Prevent "escapement" from overflowing narrow viewports */
  .definition-term {
    font-size: clamp(1.75rem, 9vw, 2.5rem);
    word-break: break-word;
  }
  .about-text {
    font-size: 1rem;
    line-height: 1.75;
    max-width: 100%;
  }
  /* Taller image gives better sense of the photograph */
  .about-image-wrap {
    max-width: 100%;
    height: 240px;
    margin: 0;
  }
  .about-image {
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
  }

  /* ── Contact section ── */
  .contact-section {
    padding: 3rem 1.25rem 3.5rem;
  }
  .contact-sub {
    font-size: 1rem;
    max-width: 100%;
  }
  .email-address {
    font-size: 0.9rem;
    word-break: break-all;
  }
  .contact-ctas {
    flex-direction: column;
    gap: 0.75rem;
  }
  .contact-ctas .btn-primary,
  .contact-ctas .btn-secondary {
    width: 100%;
    min-height: 52px;
  }

  /* ── Footer ── */
  .site-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    padding: 1.25rem;
  }
}

/* ─── Calendar Scroll Animation ─── */

.cal-scroll-track {
  position: relative;
  height: 220vh;
}

.cal-sticky-scene {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cal-scene-inner {
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: center;
  gap: 5rem;
  width: 100%;
  max-width: 1200px;
  padding: 0 3rem;
}

.cal-quote-col {
  display: flex;
  align-items: center;
}

.cal-content-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.cal-label {
  margin-bottom: 0.75rem;
}

.cal-heading-wrap {
  position: relative;
  height: 1.5rem;
  width: 100%;
  margin-bottom: 1rem;
}

.cal-heading {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.03em;
}

.cal-heading-before { opacity: 1; }
.cal-heading-after  { opacity: 0; }

.cal-widget {
  width: 100%;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
}

.cal-widget-header {
  display: grid;
  grid-template-columns: 44px repeat(5, 1fr);
  border-bottom: 1px solid #222222;
  background: #141414;
}

.cal-time-gutter {
  border-right: 1px solid #222222;
}

.cal-day-name {
  padding: 0.5rem 0;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  color: #aaaaaa;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 1px solid #222222;
}

.cal-widget-body {
  display: grid;
  grid-template-columns: 44px repeat(5, 1fr);
  height: 416px;
  overflow: hidden;
}

.cal-time-axis {
  position: relative;
  border-right: 1px solid #222222;
}

.cal-time-label {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-family: var(--font-ui);
  font-size: 0.58rem;
  color: #aaaaaa;
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.cal-day-col {
  position: relative;
  border-left: 1px solid #222222;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 51px,
    #161616 51px,
    #161616 52px
  );
}

.cal-event {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 3px;
  overflow: hidden;
  padding: 3px 5px;
  box-sizing: border-box;
}

.cal-event--red {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  z-index: 1;
}

.cal-event--green {
  background: rgba(34, 197, 94, 0.1);
  border: 1.5px solid rgba(34, 197, 94, 0.5);
  z-index: 2;
}

.cal-event-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.56rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event--red   .cal-event-label { color: #f87171; }
.cal-event--green .cal-event-label { color: #4ade80; }

.cal-tracker {
  width: 100%;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cal-tracker-item {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.cal-tracker-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cal-tracker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-tracker-dot--red   { background: #dc2626; }
.cal-tracker-dot--green { background: #16a34a; }

.cal-tracker-name {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex: 1;
}

.cal-tracker-val {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
  text-align: right;
}

.cal-tracker-rail {
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.cal-tracker-fill {
  height: 100%;
  border-radius: 3px;
  will-change: width;
}
.cal-tracker-fill--red   { background: rgba(239, 68, 68, 0.65); }
.cal-tracker-fill--green { background: rgba(34, 197, 94, 0.7); }

/* Hide on mobile */
@media (max-width: 768px) {
  .cal-scroll-track { display: none; }
}

