/* Kyvryn Systems — kyvryn.com
 *
 * Brand palette is sampled directly from the approved logo sheet:
 *   on white  #06a0e9  #00387d  #02193f   (wordmark #001033)
 *   on dark   #039ce7  #0064d9  #004794   (ground   #0b1c33)
 * Everything else is derived from those six values.
 */

@font-face { font-family: "Sora";  src: url("/assets/fonts/sora.woff2")  format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jbmono.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  /* brand */
  --l1: #06a0e9; --l2: #00387d; --l3: #02193f; --ink: #001033;
  --d1: #039ce7; --d2: #0064d9; --d3: #004794; --navy: #0b1c33;

  /* surfaces */
  --night: #071225;
  --paper: #ffffff;
  --mist:  #f3f6fa;

  /* text */
  --on-dark:       #eef3fa;
  --on-dark-2:     #9fb0c8;
  --on-dark-3:     #5f7392;
  --on-light-2:    #475569;
  --on-light-3:    #8391a7;

  --line-dark:  rgba(159, 176, 200, .14);
  --line-light: rgba(0, 16, 51, .09);

  --display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --body:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--on-dark);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -.03em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
::selection { background: var(--d2); color: #fff; }
:focus-visible { outline: 2px solid var(--d1); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--paper); color: var(--ink); font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- Logo mark: palette follows the surface it sits on ---------- */
.m1 { fill: var(--d1); } .m2 { fill: var(--d2); } .m3 { fill: var(--d3); }
[data-surface="light"] .m1 { fill: var(--l1); }
[data-surface="light"] .m2 { fill: var(--l2); }
[data-surface="light"] .m3 { fill: var(--l3); }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark { width: 17px; height: 30px; transition: transform .5s var(--ease); }
.brand:hover .brand__mark { transform: translateX(2px); }
.brand__word { font: 600 22px/1 var(--display); letter-spacing: -.035em; }
.brand--sm .brand__mark { width: 13px; height: 23px; }
.brand--sm .brand__word { font-size: 18px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h);
  color: var(--on-dark);
  transition: background-color .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease);
}
.nav.is-scrolled {
  background: rgba(7, 18, 37, .72);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  box-shadow: 0 1px 0 var(--line-dark);
}
.nav[data-surface="light"] { color: var(--ink); }
.nav[data-surface="light"].is-scrolled { background: rgba(255, 255, 255, .78); box-shadow: 0 1px 0 var(--line-light); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); font-size: 15px; }
.nav__links a:not(.nav__cta) { opacity: .72; transition: opacity .2s; }
.nav__links a:not(.nav__cta):hover { opacity: 1; }
.nav__cta {
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 28%, transparent);
  transition: border-color .2s, background-color .2s;
}
.nav__cta:hover { border-color: currentColor; }
@media (max-width: 560px) { .nav__links a:not(.nav__cta) { display: none; } }

/* ---------- Shared type ---------- */
.eyebrow, .label, .card__tag, .pillars__n, .hero__rail {
  font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow { color: var(--d1); display: inline-flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }

.label { display: flex; align-items: center; gap: 14px; color: var(--on-dark-2); margin-bottom: 28px; }
.label span { color: var(--d1); }
[data-surface="light"] .label { color: var(--on-light-2); }
[data-surface="light"] .label span { color: var(--l1); }

h2 { font-size: clamp(34px, 5vw, 60px); line-height: 1.04; }
.muted { color: var(--on-dark-3); }
.section-lede { margin-top: 28px; max-width: 46ch; font-size: clamp(17px, 1.5vw, 19px); color: var(--on-dark-2); }

.grad {
  background: linear-gradient(90deg, var(--d1) 0%, var(--d2) 55%, #6aa8ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 999px;
  font: 500 16px/1 var(--body); letter-spacing: -.005em;
  transition: transform .3s var(--ease), background-color .3s, box-shadow .3s, border-color .3s;
}
.btn--primary { background: var(--on-dark); color: var(--ink); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(3, 156, 231, .6); }
.btn--ghost { color: var(--on-dark); border: 1px solid var(--line-dark); border-color: rgba(159, 176, 200, .28); }
.btn--ghost:hover { border-color: var(--on-dark-2); }
.btn--ghost span { transition: transform .3s var(--ease); }
.btn--ghost:hover span { transform: translateX(3px); }
.btn--lg { height: 60px; padding: 0 32px; font-size: 18px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100vh, 1040px); min-height: min(100svh, 1040px);
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 48px) 0 40px;
  background:
    radial-gradient(70% 60% at 85% 20%, rgba(0, 100, 217, .22), transparent 70%),
    radial-gradient(50% 50% at 10% 100%, rgba(3, 156, 231, .10), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--navy) 100%);
}
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero__inner { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hero__title {
  margin-top: 28px;
  font-size: clamp(42px, 7.2vw, 104px); line-height: 1; letter-spacing: -.045em;
}
.hero__lede { margin-top: 32px; max-width: 40ch; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--on-dark-2); }
.hero__actions { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero__rail {
  margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--line-dark);
  display: flex; flex-wrap: wrap; gap: 12px 40px; color: var(--on-dark-3);
}
.hero__rail span { display: inline-flex; align-items: center; gap: 10px; }
.hero__rail span::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--d2); transform: rotate(45deg); }

/* ---------- Products (light) ---------- */
.products { background: var(--paper); color: var(--ink); padding: clamp(96px, 14vw, 168px) 0; }
.section-head { margin-bottom: clamp(48px, 7vw, 88px); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card {
  position: relative; display: flex; flex-direction: column; padding: clamp(28px, 3.2vw, 44px);
  border-radius: 24px; background: var(--mist);
  border: 1px solid var(--line-light);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), background-color .5s;
}
.card:hover { transform: translateY(-4px); background: #fff; box-shadow: 0 30px 60px -30px rgba(0, 56, 125, .28), 0 0 0 1px rgba(6, 160, 233, .18); }
.card__art {
  aspect-ratio: 2 / 1; margin-bottom: 36px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, #fff 0%, #eaf1f9 100%);
  border: 1px solid var(--line-light);
}
.art { display: block; width: 100%; height: 100%; }
.card__tag { color: var(--l1); margin-bottom: 14px; }
.card h3 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; margin-bottom: 14px; }
.card > p:not(.card__tag) { color: var(--on-light-2); max-width: 46ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 24px; }
.chips li {
  font: 500 12.5px/1 var(--body); padding: 8px 12px; border-radius: 999px;
  color: var(--l2); background: rgba(6, 160, 233, .08); border: 1px solid rgba(0, 56, 125, .10);
}

/* card illustrations */
.art--cluster .n { fill: #dbe5f0; transition: fill .6s; }
.art--cluster .n.on1 { fill: var(--l1); }
.art--cluster .n.on2 { fill: var(--l2); }
.art--cluster .n.on3 { fill: var(--l3); }
.art--waves .lk { stroke: rgba(0, 56, 125, .18); stroke-width: 1; fill: none; }
.art--waves .lk.x { stroke: rgba(6, 160, 233, .55); stroke-dasharray: 3 4; }
.art--waves .w1 { fill: var(--l1); } .art--waves .w2 { fill: var(--l2); } .art--waves .w3 { fill: var(--l3); }
.art--waves .band { fill: none; stroke: rgba(0, 16, 51, .12); stroke-dasharray: 2 4; }
.art--waves .wl { font: 500 8px var(--mono); letter-spacing: .12em; fill: var(--on-light-3); }

/* ---------- Experience (dark) ---------- */
.experience {
  padding: clamp(96px, 14vw, 168px) 0;
  background: linear-gradient(180deg, var(--navy) 0%, var(--night) 100%);
}
.experience .section-head { display: grid; grid-template-columns: 1fr; }
@media (min-width: 980px) {
  .experience .section-head { grid-template-columns: 1.6fr 1fr; column-gap: 64px; align-items: end; }
  .experience .section-head .label { grid-column: 1 / -1; }
  .experience .section-lede { margin-top: 0; }
}
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-dark); }
@media (max-width: 980px) { .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pillars { grid-template-columns: 1fr; } }
.pillars li { position: relative; padding: 32px 28px 8px 0; }
.pillars li::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0;
  background: linear-gradient(90deg, var(--d1), var(--d2));
  transition: width .9s var(--ease);
}
.pillars li.is-in::before { width: 48px; }
.pillars__n { color: var(--on-dark-3); }
.pillars h3 { margin: 22px 0 12px; font-size: 21px; line-height: 1.2; letter-spacing: -.02em; }
.pillars p { color: var(--on-dark-2); font-size: 15.5px; max-width: 30ch; }

/* ---------- Contact ---------- */
.contact {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(112px, 16vw, 200px) 0;
  background: radial-gradient(60% 80% at 80% 50%, rgba(0, 100, 217, .25), transparent 70%), var(--night);
  border-top: 1px solid var(--line-dark);
}
.contact__mark {
  position: absolute; z-index: -1; right: -4vw; top: 50%;
  width: clamp(180px, 24vw, 330px); height: auto; aspect-ratio: 124 / 224;
  transform: translateY(-50%); opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,.1));
  mask-image: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,.1));
}
.contact h2 { font-size: clamp(40px, 7vw, 92px); line-height: 1; letter-spacing: -.045em; max-width: 11ch; }
.contact .section-lede { max-width: 40ch; }
.contact .btn { margin-top: 44px; }
@media (max-width: 720px) { .contact__mark { opacity: .35; right: -30vw; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line-dark); padding: 32px 0 40px; color: var(--on-dark-3); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer .brand { color: var(--on-dark-2); }

/* ---------- Reveal on scroll (JS only; content is visible without it) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .cards .reveal:nth-child(2), .js .pillars .reveal:nth-child(2) { transition-delay: .08s; }
.js .pillars .reveal:nth-child(3) { transition-delay: .16s; }
.js .pillars .reveal:nth-child(4) { transition-delay: .24s; }
/* The hero is above the fold: it animates on load, never waits on an observer. */
.js .hero .reveal { opacity: 1; transform: none; transition: none; animation: rise 1.1s var(--ease) both; }
.js .hero__inner .reveal:nth-child(2) { animation-delay: .1s; }
.js .hero__inner .reveal:nth-child(3) { animation-delay: .2s; }
.js .hero__inner .reveal:nth-child(4) { animation-delay: .3s; }
.js .hero__rail.reveal { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
