/* =========================================================
   Zobrist Key — Services landing page
   Design tokens & styles per handoff SPEC.md
   ========================================================= */

:root {
  --bg: #010102;
  --bg-alt: #111315;
  --ink: #F3F5F8;
  --text-2: #ADB2B6;
  --text-3: #81878C;
  --accent: #84CBDC;
  --hairline: rgba(243, 245, 248, .14);

  --container: 1080px;
  --pad-x: clamp(20px, 5vw, 56px);
  --section-y: clamp(64px, 9vw, 88px);
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: opacity .2s ease; }
a:hover { opacity: .7; }

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

img { max-width: 100%; display: block; }

/* ---------- Knight mark (mask-tinted, decorative) ----------
   Mirrored (scaleX(-1)) to match the knight's orientation in the pitch deck. */
.kn {
  -webkit-mask: url("assets/knight-black.svg") center / contain no-repeat;
          mask: url("assets/knight-black.svg") center / contain no-repeat;
  display: inline-block;
  flex: none;
  background: var(--ink);
  transform: scaleX(-1);
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--hairline);
}

.section--split {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 5vw, 56px);
}

/* Eyebrow / overline label */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section__aside {
  flex: 1 1 220px;
  max-width: 280px;
}

.section__body {
  flex: 3 1 460px;
}

/* Section headings */
.h2 {
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}

.lead {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .35s ease, border-color .35s ease,
              backdrop-filter .35s ease, -webkit-backdrop-filter .35s ease;
}

.site-header.is-scrolled {
  background: rgba(1, 1, 2, .72);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
          backdrop-filter: saturate(140%) blur(16px);
  border-bottom-color: rgba(243, 245, 248, .1);
}

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: padding .35s ease;
}
.site-header.is-scrolled .site-header__inner { padding-top: 13px; padding-bottom: 13px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.brand:hover { opacity: 1; }

.brand__mark {
  width: 27px;
  height: 35px;
  background: var(--ink);
  transition: width .35s ease, height .35s ease;
}
.site-header.is-scrolled .brand__mark { width: 22px; height: 28px; }

.brand__word {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1;
  transition: font-size .35s ease;
}
.site-header.is-scrolled .brand__word { font-size: 17px; }

.nav {
  display: flex;
  gap: clamp(16px, 3vw, 34px);
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav a { color: var(--text-2); }
.nav a.is-cta { color: var(--accent); }

/* On narrow screens the four inline links can't fit without pushing the
   sole CTA off-screen. Keep only Contact — the single CTA per spec. */
@media (max-width: 560px) {
  .nav a:not(.is-cta) { display: none; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: clamp(72px, 12vw, 120px) 0 clamp(64px, 10vw, 104px);
}

.hero__watermark {
  position: absolute;
  top: 24px;
  right: clamp(-40px, -2vw, 0px);
  width: min(38vw, 360px);
  height: min(50vw, 470px);
  background: rgba(243, 245, 248, .09);
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
}

/* A narrow, cool-toned highlight is clipped by the knight's mask, so the
   light only travels across the mark itself. Most of the cycle is a pause —
   the glint should feel occasional and deliberate, not like a loading state. */
.hero__watermark::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -70%;
  width: 42%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(132, 203, 220, .06) 18%,
    rgba(132, 203, 220, .42) 42%,
    rgba(255, 255, 255, .78) 50%,
    rgba(132, 203, 220, .34) 58%,
    transparent 100%
  );
  filter: blur(4px);
  opacity: 0;
  transform: translate3d(0, 0, 0) skewX(-16deg);
  animation: hero-knight-glint 6.5s linear 1s infinite;
  will-change: transform, opacity;
}

@keyframes hero-knight-glint {
  0%, 42% {
    opacity: 0;
    transform: translate3d(0, 0, 0) skewX(-16deg);
  }
  48% {
    opacity: .55;
    transform: translate3d(115%, 0, 0) skewX(-16deg);
  }
  62% {
    opacity: 1;
    transform: translate3d(250%, 0, 0) skewX(-16deg);
  }
  78%, 100% {
    opacity: 0;
    transform: translate3d(430%, 0, 0) skewX(-16deg);
  }
}

.hero__eyebrow {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(24px, 4vw, 34px);
}

.hero__title {
  position: relative;
  font-size: clamp(44px, 9vw, 88px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -.03em;
  margin: 0;
  max-width: 900px;
}
.hero__title em { font-style: normal; font-weight: 600; }

.hero__lead {
  font-size: clamp(17px, 2.2vw, 19px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 620px;
  margin: clamp(36px, 6vw, 52px) 0 0;
}

/* =========================================================
   Problem
   ========================================================= */
.problem__title {
  margin-bottom: clamp(28px, 4vw, 40px);
  max-width: 660px;
}

.problem__cols {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 4vw, 44px);
}
.problem__cols p {
  flex: 1 1 280px;
  margin: 0;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-2);
}

/* =========================================================
   Approach / Why us
   ========================================================= */
.approach__title { margin-bottom: 24px; max-width: 640px; }

.approach__intro {
  max-width: 680px;
  margin: 0 0 clamp(32px, 5vw, 44px);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-2);
}

/* Hairline grids (gap:1px over hairline background) */
.hgrid {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
/* Why-us: four mirrored pairs → a fixed 2×2 so no cell is ever left empty.
   Collapses to a single column on narrow screens. */
.hgrid--pairs { grid-template-columns: repeat(2, 1fr); }
.hgrid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

@media (max-width: 560px) {
  .hgrid--pairs { grid-template-columns: 1fr; }
}

.map-card {
  background: var(--bg);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.map-card__icon { color: var(--accent); margin-bottom: 4px; }
.map-card__icon svg { display: block; }
.map-card__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.map-card__past {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
}
.map-card__now {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--accent);
}

/* =========================================================
   Services
   ========================================================= */
.services__title {
  margin: 0 0 clamp(40px, 6vw, 56px);
  max-width: 640px;
}
.services .eyebrow { margin-bottom: clamp(16px, 2vw, 20px); }

.service-card {
  background: var(--bg);
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.service-card__meta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.service-card__title {
  font-size: clamp(22px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
}
.service-card p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0;
}

/* =========================================================
   Contact
   ========================================================= */
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(40px, 7vw, 96px);
  padding: var(--section-y) 0 clamp(72px, 10vw, 120px);
}
.contact__intro { flex: 1 1 360px; }
.contact__form-wrap { flex: 1 1 380px; }

.contact .eyebrow { margin-bottom: clamp(24px, 4vw, 36px); }

.contact__title {
  font-size: clamp(34px, 5.2vw, 48px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 28px;
  text-wrap: balance;
}
.contact__lead { max-width: 440px; }

.contact__mark {
  width: clamp(72px, 10vw, 104px);
  height: clamp(94px, 13vw, 135px);
  background: rgba(243, 245, 248, .16);
  margin-top: clamp(40px, 6vw, 64px);
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: clamp(26px, 4vw, 34px);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.field input,
.field textarea {
  border: none;
  border-bottom: 1px solid rgba(243, 245, 248, .3);
  background: transparent;
  font-family: inherit;
  font-size: 17px;
  font-weight: 300;
  padding: 10px 0;
  color: var(--ink);
  outline: none;
  transition: border-color .2s ease;
}
.field textarea { resize: vertical; }
.field input:focus,
.field textarea:focus { border-bottom-color: var(--accent); }
.field input::placeholder,
.field textarea::placeholder { color: #5f666b; }

.btn {
  align-self: flex-start;
  background: var(--ink);
  color: var(--bg);
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 19px 48px;
  min-height: 44px;
  cursor: pointer;
  transition: opacity .2s ease;
}
.btn:hover { opacity: .85; }

.form__note {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-3);
  margin: 0;
}

/* Success state */
.form-success {
  border: 1px solid rgba(243, 245, 248, .2);
  padding: clamp(36px, 5vw, 56px) clamp(28px, 4vw, 48px);
}
.form-success__mark {
  width: 36px;
  height: 47px;
  background: var(--accent);
  margin-bottom: 24px;
}
.form-success h3 {
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 16px;
}
.form-success p {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer { border-top: 1px solid var(--hairline); }
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 34px var(--pad-x);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.site-footer__mark { width: 20px; height: 26px; background: var(--ink); }
.site-footer__word { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.site-footer__tag {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: .1em;
  color: var(--text-3);
}

/* =========================================================
   Reveal on scroll — progressive enhancement.

   Content is fully visible by default. The hidden-then-animate state
   applies ONLY when JS is running (html.js, set by an inline head script
   before first paint). So no-JS, a broken script, or a slow observer can
   never leave a section as an empty block — the worst case is "no animation",
   never "invisible content".
   ========================================================= */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.22, .61, .36, 1),
              transform .7s cubic-bezier(.22, .61, .36, 1);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
  .hero__watermark::after { animation: none; }
  html { scroll-behavior: auto; }
}
