/* Core theme tokens for colors, spacing, and motion */
:root {
  --bg: #f4f6f8;
  --bg-2: #e9edf2;
  --fg: #17212b;
  --muted: #4f5f72;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #d6dee8;
  --accent: #2563eb;
  --maxw: 1100px;

  /* Shared animation curves and timing values */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
  --reveal-duration: 0.75s;
  --reveal-delay-base: 0ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01","cv11";
  overflow-x: hidden;
  padding-top: 0;
}

/* Animated background orbs */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, hsla(210,85%,58%,.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, hsla(240,60%,55%,.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 60% 30%, hsla(190,70%,50%,.05) 0%, transparent 60%);
  animation: bgPulse 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes bgPulse {
  0%   { opacity: 1; transform: scale(1) translateY(0); }
  33%  { opacity: .85; transform: scale(1.04) translateY(-12px); }
  66%  { opacity: .92; transform: scale(0.98) translateY(8px); }
  100% { opacity: 1; transform: scale(1.02) translateY(-4px); }
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
::selection { background: hsla(210,85%,58%,.25); }

/* Page layout helpers and section spacing */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px){ .container { padding: 0 40px; } }
.narrow { max-width: 640px; }
.center { text-align: center; }
.section { padding: 96px 0; }
@media (min-width: 768px){ .section { padding: 144px 0; } }
.section--surface { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__head { max-width: 640px; margin-bottom: 64px; }
.hairline { width: 48px; height: 1px; background: var(--border); margin: 0 auto 40px; transition: width 0.6s var(--ease-out-expo); }
.narrow.center.is-visible .hairline { width: 96px; }

/* Typography scale and text utilities */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 28px; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.125rem; }
p { color: var(--fg); }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); font-weight: 500; margin-bottom: 24px; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 560px; line-height: 1.65; margin-bottom: 40px; }
.prose { color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.statement { font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 500; letter-spacing: -0.01em; color: var(--fg); margin-top: 16px; }

/* About section typography refinements */
#about .prose { font-size: 1.2rem; line-height: 1.8; }
#about .statement { font-size: clamp(1.5rem, 2.6vw, 1.85rem); }
#about .eyebrow { font-size: 1rem; letter-spacing: 0.22em; font-weight: 700; }
#about { padding-top: 48px; }
@media (min-width: 768px) { #about { padding-top: 64px; } }

/* Reusable icon sizing styles */
.ico { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico--sm { width: 16px; height: 16px; }

/* Top navigation bar, desktop links, and mobile menu */
.nav {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 50;
  transition: transform 0.4s var(--ease-out-expo),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}
.nav .container { max-width: none; padding-left: 12px; padding-right: 24px; }
@media (min-width: 768px){ .nav .container { padding-left: 20px; padding-right: 40px; } }
.nav--hidden { transform: translateY(-100%); }
.nav--scrolled {
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 32px hsla(215,60%,10%,0.5);
}

.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav__brand { font-size: .875rem; font-weight: 600; letter-spacing: -0.01em; display: block; width: 210px; height: 52px; }
.nav__brand span { color: #8b99b0; font-weight: 400; }
.nav__brand img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Hamburger toggle — dark theme */
.nav__toggle {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.nav__toggle span {
  width: 18px;
  height: 2px;
  background: #f0f6ff;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav.menu-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Desktop nav links — light on dark */
.nav__links { display: none; gap: 32px; font-size: .875rem; color: #8b99b0; }
.nav__links a {
  transition: color .2s;
  position: relative;
  padding-bottom: 2px;
  color: #8b99b0;
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #4d9fff;
  transition: width 0.3s var(--ease-out-expo);
}
.nav__links a:hover { color: #f0f6ff; }
.nav__links a:hover::after,
.nav__links a.is-active::after { width: 100%; }
.nav__links a.is-active { color: #f0f6ff; }

/* CTA button — dark theme */
.nav__cta {
  font-size: .875rem;
  border: 1px solid rgba(255,255,255,0.14);
  color: #f0f6ff;
  padding: 6px 12px;
  transition: border-color .2s, background .2s, color .2s;
}
.nav__cta:hover {
  border-color: #4d9fff;
  background: rgba(77,159,255,0.12);
  color: #f0f6ff;
}

/* Mobile dropdown — dark theme */
.mobile-menu {
  display: grid;
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  background: #0d1117;
  transition: max-height 0.3s var(--ease-out-expo), border-color 0.3s ease;
}
.mobile-menu a {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: #8b99b0;
}
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu a:hover { color: #f0f6ff; background: rgba(255,255,255,0.04); }
.nav.menu-open .mobile-menu {
  max-height: 480px;
  border-top-color: rgba(255,255,255,0.07);
}
@media (min-width: 768px){
  .nav__toggle { display: none; }
  .nav__links { display: flex; }
  .mobile-menu { display: none; }
}
@media (max-width: 767px){
  .nav__cta { display: none; }
}

/* Button variants and hover interactions */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-row--center { justify-content: center; margin-bottom: 48px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease-out-quart), box-shadow .2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::before { opacity: 0.05; }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: hsl(0 0% 100%); }
.btn--primary:hover { background: hsl(210 85% 42%); color: hsl(0 0% 100%); box-shadow: 0 4px 16px hsla(210,85%,48%,.3); }
.btn--ghost { border-color: var(--border); color: var(--fg); }
.btn--ghost:hover { border-color: var(--fg); }

/* Small arrow movement on primary button hover */
.btn--primary:hover .ico--sm { transform: translateX(3px); }
.btn--primary .ico--sm { transition: transform 0.2s var(--ease-out-expo); }

/* Word-by-word headline reveal animation */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.word-inner {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.7s var(--ease-out-expo), opacity 0.5s ease;
}
.words-ready .word-wrap .word-inner {
  transform: translateY(0);
  opacity: 1;
}
.words-ready .word-wrap:nth-child(1) .word-inner { transition-delay: 0ms; }
.words-ready .word-wrap:nth-child(2) .word-inner { transition-delay: 60ms; }
.words-ready .word-wrap:nth-child(3) .word-inner { transition-delay: 120ms; }
.words-ready .word-wrap:nth-child(4) .word-inner { transition-delay: 180ms; }
.words-ready .word-wrap:nth-child(5) .word-inner { transition-delay: 240ms; }
.words-ready .word-wrap:nth-child(6) .word-inner { transition-delay: 300ms; }
.words-ready .word-wrap:nth-child(7) .word-inner { transition-delay: 360ms; }
.words-ready .word-wrap:nth-child(8) .word-inner { transition-delay: 420ms; }
.words-ready .word-wrap:nth-child(9) .word-inner { transition-delay: 480ms; }

/* Shared reveal targets used by scroll-triggered animations */
.hero__text,
.hero__image,
.tag-strip,
.section__head,
.service-card,
.work__row,
.diff li,
.community__image,
.community > div:not(.community__image),
#research .narrow,
#contact .narrow

/* Elements once the visible state class is applied */
.hero__text.is-visible,
.hero__image.is-visible,
.tag-strip.is-visible,
.section__head.is-visible,
.service-card.is-visible,
.work__row.is-visible,
.diff li.is-visible,
.community__image.is-visible,
.community > div:not(.community__image).is-visible,
#research .narrow.is-visible,
#contact .narrow.is-visible

/* Hero canvas animated background */
.hero { position: relative; }
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.hero .container,
.hero > .container {
  position: relative;
  z-index: 1;
}
.hero .tag-strip {
  position: relative;
  z-index: 1;
}

/* Hero section layout and entrance effects */
.hero { padding-top: 64px; padding-bottom: 56px; }
@media (min-width: 768px){ .hero { padding-top: 72px; padding-bottom: 80px; } }
.hero__grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 768px){
  .hero__grid { grid-template-columns: 7fr 5fr; gap: 48px; }
}

/* Hero text enters from the left */
.hero__text {
  transform: translateX(-32px) translateY(0px);
  opacity: 0;
  transition:
    opacity 0.85s var(--ease-out-expo),
    transform 0.85s var(--ease-out-expo);
}
.hero__text.is-visible { opacity: 1; transform: translateX(0) translateY(0); }

.hero .lead {
  font-size: 1.35rem;
}

@media (max-width: 767px) {
  .hero .lead {
    font-size: 1.2rem;
  }
}

/* Hero image enters from the right with a fade */
.hero__image {
  transform: translateX(32px) translateY(0);
  opacity: 0;
  transition:
    opacity 0.85s 0.15s var(--ease-out-expo),
    transform 0.85s 0.15s var(--ease-out-expo);
  /* Remove old border/bg/overflow — watch-frame handles everything */
  border: none;
  background: none;
  box-shadow: none;
  overflow: visible;
  border-radius: 0;
  aspect-ratio: unset;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__image.is-visible { opacity: 1; transform: translateX(0); }

/* ══════════════════════════════════════════════
   SWISS WATCH PORTRAIT FRAME
══════════════════════════════════════════════ */
.watch-frame {
  position: relative;
  width: min(360px, 88vw);
  height: min(360px, 88vw);
  margin: 0 auto;
  /* Slow levitation */
  animation: watchFloat 6s ease-in-out infinite;
}

@keyframes watchFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

/* Outer bezel — slow clockwise spin */
.watch-bezel--outer {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  animation: watchRotateCW 60s linear infinite;
}
.watch-bezel__svg {
  width: 100%;
  height: 100%;
}

/* Roman numeral ring — very slow CCW, sits outside tick marks */
.watch-numerals {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  animation: watchRotateCCW 120s linear infinite;
  pointer-events: none;
  z-index: 5;
}
.watch-numerals__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.roman-numeral {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  font-size: 14px;
  font-weight: 700;
  fill: #4d9fff;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(77,159,255,0.6);
  dominant-baseline: middle;
}

/* Tick marks ring — same slow CW as bezel */
.watch-ticks-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  animation: watchRotateCW 60s linear infinite;
}
.watch-ticks__svg {
  width: 100%;
  height: 100%;
}

/* Inner decorative ring */
.watch-inner-ring {
  position: absolute;
  inset: 38px;
  border-radius: 50%;
  border: 1px solid rgba(77,159,255,0.25);
  box-shadow:
    inset 0 0 20px rgba(77,159,255,0.08),
    0 0 20px rgba(77,159,255,0.12);
  animation: ringPulse 4s ease-in-out infinite alternate;
}

@keyframes ringPulse {
  0%   { box-shadow: inset 0 0 20px rgba(77,159,255,0.08), 0 0 20px rgba(77,159,255,0.12); }
  100% { box-shadow: inset 0 0 32px rgba(77,159,255,0.18), 0 0 40px rgba(77,159,255,0.28); }
}

/* Portrait circle */
.watch-portrait {
  position: absolute;
  inset: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(77,159,255,0.4);
  box-shadow:
    0 0 0 4px rgba(13,17,23,0.9),
    0 0 60px rgba(77,159,255,0.35),
    inset 0 0 20px rgba(0,0,0,0.4);
  transition: box-shadow 0.6s ease;
}
.watch-portrait:hover {
  box-shadow:
    0 0 0 4px rgba(13,17,23,0.9),
    0 0 90px rgba(77,159,255,0.55),
    inset 0 0 20px rgba(0,0,0,0.3);
}
.watch-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: grayscale(20%) contrast(1.08);
  transition: filter 0.7s ease, transform 0.9s var(--ease-out-quart);
  transform-origin: center 25%;
}
.watch-portrait:hover img {
  filter: grayscale(0%) contrast(1.05);
  transform: scale(1.06);
}

/* 12 o'clock crown marker */
.watch-crown {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 18px;
  background: linear-gradient(180deg, #7dc3ff 0%, #2563eb 100%);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 12px rgba(77,159,255,0.7);
  z-index: 10;
}
.watch-crown::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #2563eb;
}

/* Floating orbital dots */
.watch-dot {
  position: absolute;
  border-radius: 50%;
  background: #4d9fff;
}
.watch-dot--1 {
  width: 8px; height: 8px;
  top: 50%; left: -4px;
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(77,159,255,0.9);
  animation: orbitPulse 2.4s ease-in-out infinite;
}
.watch-dot--2 {
  width: 5px; height: 5px;
  bottom: 12%; right: 6%;
  box-shadow: 0 0 8px rgba(77,159,255,0.7);
  animation: orbitPulse 3.1s ease-in-out infinite 0.8s;
}
.watch-dot--3 {
  width: 6px; height: 6px;
  top: 12%; right: 8%;
  box-shadow: 0 0 9px rgba(77,159,255,0.8);
  animation: orbitPulse 2.7s ease-in-out infinite 1.5s;
}

@keyframes orbitPulse {
  0%, 100% { opacity: 0.5; transform: translateY(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateY(-50%) scale(1.6); }
}
.watch-dot--2, .watch-dot--3 {
  animation-name: dotPulse;
}
@keyframes dotPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.7); }
}

/* Rotation keyframes */
@keyframes watchRotateCW  { from { transform: rotate(0deg); }   to { transform: rotate(360deg); } }
@keyframes watchRotateCCW { from { transform: rotate(0deg); }   to { transform: rotate(-360deg); } }

/* Outer glow behind the whole frame */
.watch-frame::before {
  content: '';
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77,159,255,0.15) 0%, transparent 70%);
  animation: watchGlow 4s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}
@keyframes watchGlow {
  0%   { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 1;   transform: scale(1.05); }
}

/* Responsive sizing */
@media (min-width: 768px) {
  .watch-frame {
    width: min(400px, 42vw);
    height: min(400px, 42vw);
  }
}
@media (max-width: 767px) {
  .watch-frame {
    width: min(300px, 80vw);
    height: min(300px, 80vw);
  }
  .roman-numeral { font-size: 11px; }
}

/* Tag strip line and staggered label reveal */
.tag-strip {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  min-height: 84px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  column-gap: 32px;
  row-gap: 8px;
  text-align: center;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s 0.3s var(--ease-out-expo), transform 0.6s 0.3s var(--ease-out-expo);
}
.tag-strip.is-visible { opacity: 1; transform: translateY(0); }
.tag-strip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  padding: 2px 0;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}
.tag-strip.is-visible span:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.35s; }
.tag-strip.is-visible span:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.45s; }
.tag-strip.is-visible span:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.55s; }
.tag-strip.is-visible span:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.65s; }
.tag-strip.is-visible span:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 0.75s; }

/* Section heading animation sequence */
.section__head {
  max-width: 640px;
  margin-bottom: 64px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.section__head.is-visible { opacity: 1; transform: translateY(0); }
.section__head .eyebrow {
  display: inline-block;
  transform: translateX(-8px);
  opacity: 0;
  transition: opacity 0.5s 0.1s var(--ease-out-expo), transform 0.5s 0.1s var(--ease-out-expo);
}
.section__head.is-visible .eyebrow { transform: translateX(0); opacity: 1; }
.section__head h2 {
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.6s 0.2s var(--ease-out-expo), transform 0.6s 0.2s var(--ease-out-expo);
}
.section__head.is-visible h2 { transform: translateY(0); opacity: 1; }

/* Services grid structure and card behavior */
.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background: transparent;
  border: 0;
}
@media (min-width: 640px){ .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px){
  .services { grid-template-columns: repeat(6, 1fr); }
  .service-card:nth-child(1) { grid-column: span 2; }
  .service-card:nth-child(2) { grid-column: span 2; }
  .service-card:nth-child(3) { grid-column: span 2; }
  .service-card:nth-child(4) { grid-column: 2 / span 2; }
  .service-card:nth-child(5) { grid-column: 4 / span 2; }
}

.service-card {
  background: var(--surface);
  padding: 64px 32px 36px;
  border: 1px solid var(--border);
  min-height: 380px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition:
    background 0.25s ease,
    transform 0.3s var(--ease-out-expo),
    box-shadow 0.3s ease,
    opacity var(--reveal-duration) var(--ease-out-expo);
  transform-style: preserve-3d;
  will-change: transform;
  opacity: 0;
  transform: translateY(32px);
}
.service-card > * {
  transform: translateY(24px);
}
@media (max-width: 639px){
  .service-card {
    padding-top: 52px;
    min-height: 340px;
  }
  .service-card > * {
    transform: translateY(16px);
  }
}
/* Stagger card entrance timing with the --card-i variable */
.service-card.is-visible {
  opacity: 1;
  transform: translateY(0) perspective(600px) rotateX(0) rotateY(0);
  transition-delay: calc(var(--card-i, 0) * 80ms);
}
.service-card:hover { background: var(--surface-2); box-shadow: 0 8px 32px hsla(215,45%,20%,0.06); }
.service-card .ico { color: var(--accent); margin-bottom: 24px; transition: transform 0.3s var(--ease-out-expo); }
.service-card:hover .ico { transform: scale(1.06) rotate(-2deg); }
.service-card h3 { margin-bottom: 8px; letter-spacing: -0.01em; }
.service-card > p { font-size: .875rem; color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.service-card ul { display: flex; flex-direction: column; gap: 8px; }
.service-card li {
  font-size: .875rem;
  color: var(--muted);
  display: flex;
  gap: 12px;
  transform: translateX(0);
  transition: transform 0.2s var(--ease-out-expo);
}
.service-card:hover li { transform: translateX(4px); }
.service-card li::before {
  content: "";
  margin-top: 8px;
  width: 12px;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
  display: block;
  transition: background 0.2s, width 0.2s var(--ease-out-expo);
}
.service-card:hover li::before { background: var(--accent); width: 16px; }

/* Work showcase rows and hover accents */
.work { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.work__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateX(-24px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo),
    border-color 0.3s ease;
  transition-delay: calc(var(--row-i, 0) * 90ms);
  position: relative;
}
.work__row::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out-expo);
}
.work__row:hover::after { width: 100%; }
.work__row:last-child { border-bottom: none; }
.work__row:last-child::after { display: none; }
.work__row.is-visible { opacity: 1; transform: translateX(0); }

@media (min-width: 768px){
  .work__row { grid-template-columns: 2fr 5fr 5fr; gap: 24px; padding: 48px 0; }
}
.work__num {
  font-size: .875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.work__row:hover .work__num { color: var(--accent); }
.work__title h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.01em; }
.work__body p { color: var(--muted); line-height: 1.7; margin-bottom: 20px; }
.work__body ul { display: flex; flex-direction: column; gap: 8px; font-size: .875rem; }
.work__body li { display: flex; gap: 12px; }
.work__body li::before {
  content: "";
  margin-top: 8px;
  width: 12px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
  display: block;
  transition: width 0.25s var(--ease-out-expo);
}
.work__row:hover .work__body li::before { width: 18px; }

/* Differentiator list layout and reveal motion */
.diff { display: flex; flex-direction: column; gap: 0; margin-top: 32px; }
.diff li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.65s var(--ease-out-expo),
    transform 0.65s var(--ease-out-expo);
  transition-delay: calc(var(--li-i, 0) * 100ms);
}
.diff li:last-child { border-bottom: none; }
.diff li.is-visible { opacity: 1; transform: translateY(0); }
@media (min-width: 768px){
  .diff li { grid-template-columns: 60px 1fr; gap: 24px; padding-bottom: 32px; margin-bottom: 32px; align-items: baseline; }
}
.diff__num {
  font-size: .875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.diff li:hover .diff__num { color: var(--accent); }
.diff li p {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  transition: transform 0.3s var(--ease-out-expo);
}
.diff li:hover p { transform: translateX(6px); }

/* Community section split layout and media effects */
.community { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
@media (min-width: 768px){ .community { grid-template-columns: 1fr 1fr; gap: 64px; } }

.community__image {
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
  overflow: hidden;
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.community__image.is-visible { opacity: 1; transform: translateX(0); }
.community__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter 0.7s ease, transform 1s var(--ease-out-quart);
}
.community__image:hover img { filter: grayscale(0%); transform: scale(1.04); }

.community > div:not(.community__image) {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.8s 0.15s var(--ease-out-expo), transform 0.8s 0.15s var(--ease-out-expo);
}
.community > div:not(.community__image).is-visible { opacity: 1; transform: translateX(0); }
.community h2 { margin-bottom: 24px; }

/* About section center-column reveal choreography */
#about .container {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
#about .container.is-visible { opacity: 1; transform: translateY(0); }
#about .eyebrow {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s 0.1s ease, transform 0.5s 0.1s ease;
}
#about .container.is-visible .eyebrow { opacity: 1; transform: translateY(0); }
#about .prose {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
#about .container.is-visible .prose:nth-of-type(2) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
#about .container.is-visible .prose:nth-of-type(3) { opacity: 1; transform: translateY(0); transition-delay: 0.32s; }
#about .statement {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s 0.44s var(--ease-out-expo), transform 0.6s 0.44s var(--ease-out-expo);
}
#about .container.is-visible .statement { opacity: 1; transform: translateY(0); }

/* Shared animation rules for research and contact blocks */
#research .narrow,
#contact .narrow {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease-out-expo), transform 0.75s var(--ease-out-expo);
}
#research .narrow.is-visible,
#contact .narrow.is-visible { opacity: 1; transform: translateY(0); }

#research h2,
#contact .contact__h {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s 0.15s var(--ease-out-expo), transform 0.65s 0.15s var(--ease-out-expo);
}
#research .narrow.is-visible h2,
#contact .narrow.is-visible .contact__h { opacity: 1; transform: translateY(0); }

#research .prose,
#contact .prose {
  opacity: 0;
  transform: translateY(12px);
}
#research .narrow.is-visible .prose:nth-of-type(2) { opacity: 1; transform: translateY(0); transition: opacity 0.6s 0.28s var(--ease-out-expo), transform 0.6s 0.28s var(--ease-out-expo); }
#research .narrow.is-visible .prose:nth-of-type(3) { opacity: 1; transform: translateY(0); transition: opacity 0.6s 0.38s var(--ease-out-expo), transform 0.6s 0.38s var(--ease-out-expo); }
#contact .narrow.is-visible .prose { opacity: 1; transform: translateY(0); transition: opacity 0.6s 0.25s var(--ease-out-expo), transform 0.6s 0.25s var(--ease-out-expo); }

.contact__links a {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo), color 0.2s;
}
#contact .narrow.is-visible .contact__links a:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.45s; }
#contact .narrow.is-visible .contact__links a:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.55s; }

/* Contact heading and link presentation */
.contact__h { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 24px; }
.contact__links { display: flex; flex-direction: column; align-items: center; gap: 16px; font-size: .875rem; color: var(--muted); }
@media (min-width: 640px){ .contact__links { flex-direction: row; justify-content: center; gap: 32px; } }
.contact__links a { display: inline-flex; align-items: center; gap: 8px; transition: color .2s, transform .2s; }
.contact__links a:hover { color: var(--fg); transform: translateY(-2px); }

/* Footer spacing and responsive alignment */
.footer { border-top: 1px solid var(--border); padding: 40px 0; }
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: .875rem;
  color: var(--muted);
  text-align: center;
}
@media (min-width: 768px){ .footer__inner { flex-direction: row; text-align: left; } }

/* Surface section styling with gentle background transition */
.section--surface {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

/* Thin progress bar that tracks page scroll */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  z-index: 100;
  animation: scrollProgress linear;
  animation-timeline: scroll(root block);
}

@keyframes scrollProgress {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Section-level spacing and entry setup */
.section {
  padding: 72px 0;
  --section-fade: 0;
}
main section { scroll-margin-top: 88px; }
@media (min-width: 768px){ .section { padding: 144px 0; } }

@media (max-width: 767px) {
  body { padding-top: 0; }
  .container { padding-left: 20px; padding-right: 20px; }
  .section { padding: 64px 0; }
  .hero { padding-top: 72px; padding-bottom: 48px; }
  .hero__grid { gap: 32px; }
  .hero__image { order: -1; min-height: 320px; }
  .tag-strip {
    min-height: auto;
    padding: 14px 0;
    column-gap: 18px;
    row-gap: 10px;
  }
  .btn-row { justify-content: center; }
  .btn { width: 100%; justify-content: center; padding: 14px 20px; }
  .btn-row .btn { max-width: 100%; }
  .service-card { padding: 40px 18px 28px; min-height: auto; }
  .work__row { padding: 28px 0; }
  .diff li { padding-bottom: 18px; margin-bottom: 18px; }
  .community { gap: 28px; }
  .contact__links { gap: 14px; }
  .contact__links a { justify-content: center; }
  .footer__inner { padding-left: 20px; padding-right: 20px; }
}


/* Fun Facts grid */
.funfacts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 640px) { .funfacts { grid-template-columns: repeat(2, 1fr); gap: 32px; } }

.funfacts--wide .funfact-card {
  max-width: 520px;
  margin: 0 auto;
}
@media (min-width: 640px) { .funfacts--wide .funfact-card { max-width: none; margin: 0; } }

.funfact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out-expo), transform 0.65s var(--ease-out-expo),
              background 0.2s ease, box-shadow 0.2s ease;
  transition-delay: calc(var(--fc-i, 0) * 120ms);
  position: relative;
  overflow: hidden;
}
.funfact-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 0;
  background: var(--accent);
  transition: height 0.5s var(--ease-out-expo);
}
.funfact-card:hover::before { height: 100%; }
.funfact-card.is-visible { opacity: 1; transform: translateY(0); }
.funfact-card:hover {
  background: var(--surface-2);
  box-shadow: 0 8px 40px hsla(210,85%,58%,.1);
}

.funfact-emoji {
  font-size: 2.5rem;
  line-height: 1;
  display: block;
  transition: transform 0.3s var(--ease-out-expo);
}
.funfact-card:hover .funfact-emoji { transform: scale(1.2) rotate(-8deg); }

.ico--fun {
  width: 40px;
  height: 40px;
  color: var(--accent);
  stroke-width: 1.25;
  transition: transform 0.35s var(--ease-out-expo), color 0.2s ease;
  flex-shrink: 0;
}
.funfact-card:hover .ico--fun {
  transform: scale(1.15) rotate(-6deg);
  color: hsl(210 85% 70%);
}

.funfact-text {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}
.funfact-text strong {
  color: var(--fg);
  font-weight: 600;
}

/* ── DARK HERO SECTION ── */
.hero {
  --hero-bg: #0d1117;
  --hero-surface: #161b22;
  --hero-border: rgba(255,255,255,0.08);
  --hero-fg: #f0f6ff;
  --hero-muted: #8b99b0;
  --hero-accent: #4d9fff;
  background: var(--hero-bg);
  isolation: isolate;
}

/* Subtle dark gradient overlay beneath the canvas */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 15% 20%, hsla(210,90%,50%,.10) 0%, transparent 65%),
    radial-gradient(ellipse 50% 45% at 85% 75%, hsla(240,70%,55%,.09) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 55% 50%, hsla(195,80%,45%,.06) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
}

/* Boost canvas contrast on dark background */
#hero-canvas { mix-blend-mode: screen; opacity: 0.85; }

/* Override text colours inside hero */
.hero .eyebrow {
  color: var(--hero-accent);
  opacity: 0.85;
}
.hero h1 {
  color: var(--hero-fg);
  text-shadow: 0 2px 40px hsla(210,90%,60%,.15);
}
.hero .lead {
  color: var(--hero-muted);
}

/* Ghost button adapts to dark bg */
.hero .btn--ghost {
  border-color: var(--hero-border);
  color: var(--hero-fg);
}
.hero .btn--ghost:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
}

/* Primary button gets a lighter glow on dark */
.hero .btn--primary {
  background: var(--hero-accent);
  box-shadow: 0 0 0 0 transparent;
}
.hero .btn--primary:hover {
  background: hsl(210 95% 60%);
  box-shadow: 0 4px 24px hsla(210,90%,60%,.4);
}

/* Tag strip on dark bg */
.hero .tag-strip {
  border-top-color: var(--hero-border);
  border-bottom-color: var(--hero-border);
  color: var(--hero-muted);
}

/* Hero image frame — handled by watch-frame */
.hero .hero__image {
  border: none;
  background: none;
  box-shadow: none;
}

/* ── END DARK HERO ── */

/* Accessibility: minimize motion for users who prefer reduced animation */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .word-inner { transform: none !important; opacity: 1 !important; }
}