/* ==========================================================================
   Reset, typography, shared components
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) - 1rem);
  background: var(--bg-deep);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none; /* Instrument Serif has a single weight — never fake bold */
  overflow-x: hidden;
}

/* film grain over the whole page — very quiet, gives the dark areas texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: rgba(71, 123, 255, 0.45); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 200;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg-deep);
  font-size: 0.85rem;
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

.h2,
.intro__title,
.contact__title {
  font-family: var(--serif);
  font-weight: 340;
  font-size: clamp(2.5rem, 5.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.h2 em,
.contact__title em,
.why__title em {
  font-style: italic;
  font-weight: 320;
  color: var(--blue-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: '';
  width: 2.25rem;
  height: 1px;
  background: linear-gradient(90deg, var(--blue), transparent);
}

.section { position: relative; padding-block: var(--section-y); }
.section--deep { background: var(--bg-deep); }

.section-head { display: grid; gap: 1.5rem; margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.section-head--split > div { display: grid; gap: 1.5rem; justify-items: start; }
.section-head--split {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(1.5rem, 5vw, 5rem);
}
.section-head__note {
  max-width: 38ch;
  color: var(--muted);
  font-size: 1rem;
  justify-self: end;
}
@media (max-width: 860px) {
  .section-head--split { grid-template-columns: 1fr; }
  .section-head__note { justify-self: start; }
}

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */

.btn {
  --pad-x: 1.7rem;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 3.25rem;
  padding: 0 var(--pad-x);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s, color 0.4s;
  will-change: transform;
}
.btn--sm { min-height: 2.6rem; --pad-x: 1.25rem; font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; }
.btn--lg { min-height: 3.75rem; --pad-x: 2.2rem; font-size: 0.95rem; }

.btn__label, .btn__arrow { position: relative; z-index: 2; }
.btn__arrow { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease); }

/* light sweep that travels across on hover */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #5b8aff 0%, var(--blue) 45%, #3a5fe0 100%);
  box-shadow: 0 0 0 1px rgba(143, 176, 255, 0.35) inset, 0 10px 40px -10px rgba(71, 123, 255, 0.75);
}
.btn--primary:hover { box-shadow: 0 0 0 1px rgba(190, 210, 255, 0.55) inset, 0 16px 56px -8px rgba(71, 123, 255, 0.95); }

.btn--outline {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
}
.btn--outline:hover { border-color: rgba(143, 176, 255, 0.7); background: rgba(71, 123, 255, 0.1); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding-block: 0.6rem;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}
.link-arrow svg {
  width: 2.3rem; height: 0.65rem;
  fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.5s var(--ease);
}
.link-arrow:hover svg { transform: translateX(8px); }

/* availability indicator */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.status__dot {
  position: relative;
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.8);
}
.status__dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(74, 222, 128, 0.55);
  animation: ping 2.8s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(0.6); opacity: 1; } 70%, 100% { transform: scale(1.8); opacity: 0; } }

/* --------------------------------------------------------------------------
   Scroll reveal — only active when JS is running
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 1s var(--ease) var(--d, 0s), transform 1.1s var(--ease) var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* scroll-linked word highlight */
.js [data-words] .w { color: rgba(245, 247, 255, 0.16); transition: color 0.45s ease; }
.js [data-words] .w.is-lit { color: var(--text); }

/* animations pause while their section is off screen (see modules/perf.js) */
.js [data-live]:not(.is-live),
.js [data-live]:not(.is-live) *,
.js [data-live]:not(.is-live)::before,
.js [data-live]:not(.is-live)::after,
.js [data-live]:not(.is-live) *::before,
.js [data-live]:not(.is-live) *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .js [data-words] .w { color: var(--text); }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
