/* ============================================================
   KAIRNS SOLUTIONS — v2 design system
   Void dark · Emerald fills · Burnt-orange keystone
   Sora (display) · Manrope (body) · JetBrains Mono (labels)
   ============================================================ */

:root {
  --void: #0a0e0c;
  --moss: #101815;
  --moss-2: #16221d;
  --line: rgba(236, 242, 239, 0.08);
  --text: #ecf2ef;
  --dim: #93a59b;

  --emerald: #00674f;      /* fills, panels */
  --emerald-deep: #00473a;
  --emerald-hi: #50c878;   /* luminous text & lines */

  --ember: #cc5500;        /* keystone · CTAs · fills */
  --ember-deep: #a84600;
  --ember-hi: #f0813f;     /* small text accents */

  --ring: #45564e;         /* the Fit ring on dark */

  --font-display: "Sora", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --max-w: 1160px;
  --r: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--emerald-hi); text-decoration: none; }
a:hover { color: var(--text); }

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

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.8vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.16rem; line-height: 1.35; }

.lede {
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  color: var(--dim);
  max-width: 58ch;
}

.hi-e { color: var(--emerald-hi); }
.hi-o { color: var(--ember-hi); }

/* eyebrow: mono label with a tiny ring-dot bullet */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--emerald-hi);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.eyebrow .bullet { flex: none; }
.eyebrow.ember { color: var(--ember-hi); }
.eyebrow.center { justify-content: center; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 14, 12, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 78px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
}
.brand:hover { color: var(--text); }
.brand .sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--dim);
  margin-top: 1px;
}

.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; }
.nav-links a { color: var(--dim); font-size: 0.94rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom: 2px solid var(--ember); padding-bottom: 4px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--ember); color: #fff; }
.btn-primary:hover { background: var(--ember-deep); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: rgba(80, 200, 120, 0.4); color: var(--emerald-hi); background: transparent; }
.btn-ghost:hover { border-color: var(--emerald-hi); color: var(--text); }
.btn-on-fill { background: var(--ember); color: #fff; }
.btn-on-fill:hover { background: #b34a00; color: #fff; transform: translateY(-1px); }
.btn-sm { padding: 10px 19px; font-size: 0.88rem; }

/* ---------- hero ---------- */

.hero { position: relative; overflow: hidden; padding: clamp(72px, 10vw, 128px) 0 clamp(56px, 8vw, 96px); }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(620px 460px at 82% 30%, rgba(0, 103, 79, 0.22), transparent 68%),
    radial-gradient(420px 340px at 88% 12%, rgba(204, 85, 0, 0.12), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}
.hero-copy h1 { margin-bottom: 26px; }
.hero-copy .lede { margin-bottom: 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-mark { display: flex; justify-content: center; }

/* page heroes */
.page-hero { padding: clamp(64px, 9vw, 104px) 0 clamp(40px, 5vw, 60px); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(520px 300px at 90% 0%, rgba(0, 103, 79, 0.18), transparent 70%);
  pointer-events: none;
}
.page-hero .wrap { position: relative; }
.page-hero .lede { margin-top: 20px; }

/* ---------- ticker ---------- */

.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--moss);
  overflow: hidden;
  padding: 15px 0;
}
.ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: tick 30s linear infinite;
}
.ticker span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 26px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 26px;
}
.ticker i { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); flex: none; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */

.section { padding: clamp(64px, 9vw, 110px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 56px; max-width: 660px; }
.section-head .lede { margin-top: 18px; }
.band { background: var(--moss); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- cards / bento ---------- */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.card {
  background: var(--moss);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 34px 30px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: rgba(80, 200, 120, 0.45); transform: translateY(-2px); }
.card h3 { margin: 16px 0 10px; }
.card p { color: var(--dim); font-size: 0.97rem; }

.card.fill-emerald {
  background: linear-gradient(155deg, var(--emerald), var(--emerald-deep));
  border-color: rgba(80, 200, 120, 0.35);
}
.card.fill-emerald h3, .card.fill-emerald .num { color: #fff; }
.card.fill-emerald p { color: rgba(255, 255, 255, 0.85); }
.card.fill-emerald:hover { border-color: rgba(255, 255, 255, 0.45); }

.card .num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  color: var(--ember-hi);
}

/* bento: what we examine */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile {
  background: var(--moss);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 24px;
  transition: border-color 0.2s ease;
}
.tile:hover { border-color: rgba(240, 129, 63, 0.5); }
.tile h3 { font-size: 1.02rem; margin: 12px 0 6px; }
.tile p { color: var(--dim); font-size: 0.9rem; }
.tile-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.tile-icon.e { background: rgba(0, 103, 79, 0.28); color: var(--emerald-hi); }
.tile-icon.o { background: rgba(204, 85, 0, 0.2); color: var(--ember-hi); }

/* ---------- flagship band ---------- */

.flagship {
  background: linear-gradient(150deg, var(--emerald) 0%, var(--emerald-deep) 70%);
  border-top: 1px solid rgba(80, 200, 120, 0.35);
  border-bottom: 1px solid rgba(80, 200, 120, 0.35);
  position: relative;
  overflow: hidden;
}
.flagship::after {
  content: "";
  position: absolute;
  right: -140px; top: 50%;
  width: 460px; height: 460px;
  transform: translateY(-50%);
  border: 44px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}
.flagship .wrap { position: relative; display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 48px; align-items: center; padding-top: clamp(56px, 7vw, 88px); padding-bottom: clamp(56px, 7vw, 88px); }
.flagship .eyebrow { color: #ffd9bf; }
.flagship h2 { color: #fff; margin-bottom: 16px; }
.flagship p { color: rgba(255, 255, 255, 0.86); max-width: 54ch; margin-bottom: 30px; }
.flagship-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.flagship .btn-ghost { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.flagship .btn-ghost:hover { border-color: #fff; }

/* ---------- process: the seating sequence ---------- */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step {
  background: var(--moss);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 30px 28px;
}
.step .frame { height: 56px; margin-bottom: 18px; }
.step .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-hi);
  margin-bottom: 8px;
}
.step h3 { margin-bottom: 8px; font-size: 1.08rem; }
.step p { color: var(--dim); font-size: 0.93rem; }

/* ---------- services ---------- */

.service {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 48px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.service:first-of-type { border-top: none; }
.service .num {
  font-family: var(--font-mono);
  color: var(--ember-hi);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  display: block;
  margin-bottom: 14px;
}
.service .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ember);
  border-radius: 999px;
  padding: 5px 12px;
  margin-top: 12px;
}
.service h3 { font-size: 1.5rem; margin-bottom: 12px; }
.service > div > p { color: var(--dim); margin-bottom: 20px; max-width: 62ch; }
.points { list-style: none; display: grid; gap: 9px; }
.points li { position: relative; padding-left: 24px; color: var(--dim); font-size: 0.96rem; }
.points li::before {
  content: "";
  position: absolute; left: 0; top: 8px;
  width: 12px; height: 12px;
  border: 2.5px solid var(--emerald-hi);
  border-radius: 50%;
}
.points li.seated::before { background: var(--ember); border-color: var(--ember); }

/* ---------- about ---------- */

.bio-grid { display: grid; grid-template-columns: 320px 1fr; gap: 72px; align-items: start; }
.portrait {
  background: var(--moss);
  border: 1px solid var(--line);
  border-radius: var(--r);
  aspect-ratio: 4 / 5;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.portrait .ph { text-align: center; color: var(--dim); font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; }
.portrait .ph svg { margin: 0 auto 18px; }
.bio-copy p { color: var(--dim); margin-bottom: 18px; max-width: 62ch; }
.bio-copy p strong { color: var(--text); }
.bio-copy h2 { margin-bottom: 22px; }

/* etymology */
.etym { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.etym-card { border-radius: var(--r); padding: 38px 34px; }
.etym-card.ember { background: linear-gradient(155deg, var(--ember), var(--ember-deep)); }
.etym-card.emerald { background: linear-gradient(155deg, var(--emerald), var(--emerald-deep)); }
.etym-card .word { font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; color: #fff; margin-bottom: 4px; }
.etym-card .origin { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.72); display: block; margin-bottom: 16px; }
.etym-card p { color: rgba(255, 255, 255, 0.9); font-size: 0.98rem; }
.etym-card p b { color: #fff; }
.equation {
  margin-top: 52px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.35;
}
.equation .k { color: var(--ember-hi); }
.equation .m { color: var(--emerald-hi); }

/* ---------- cta band ---------- */

.cta-band { text-align: center; padding: clamp(72px, 10vw, 120px) 28px; position: relative; overflow: hidden; }
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(480px 320px at 50% 100%, rgba(204, 85, 0, 0.14), transparent 70%);
  pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 { margin-bottom: 16px; }
.cta-band .lede { margin: 0 auto 36px; }

/* ---------- contact ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.contact-card { background: var(--moss); border: 1px solid var(--line); border-radius: var(--r); padding: 38px 34px; }
.contact-card h3 { margin-bottom: 10px; }
.contact-card p { color: var(--dim); margin-bottom: 22px; font-size: 0.97rem; }
.contact-card .detail { font-family: var(--font-mono); font-size: 0.86rem; color: var(--emerald-hi); display: block; margin-top: 14px; }
.contact-card.primary { border-color: rgba(204, 85, 0, 0.55); background: linear-gradient(160deg, rgba(204, 85, 0, 0.1), var(--moss) 55%); }

form { display: grid; gap: 16px; }
label { font-size: 0.85rem; font-weight: 700; display: grid; gap: 7px; }
input, textarea {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.96rem;
  padding: 13px 15px;
}
input:focus, textarea:focus { outline: 2px solid var(--ember-hi); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; min-height: 130px; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 64px 0 40px; background: var(--moss); }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.footer-brand { max-width: 340px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--dim); font-size: 0.92rem; }
.footer-brand p em { font-style: normal; color: var(--ember-hi); font-weight: 600; }
.footer-nav { list-style: none; display: grid; gap: 10px; }
.footer-nav a { color: var(--dim); font-size: 0.93rem; }
.footer-nav a:hover { color: var(--text); }
.footer-nav li { color: var(--dim); font-size: 0.93rem; }
.footer-meta {
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  color: var(--dim); font-size: 0.82rem; font-family: var(--font-mono);
}

/* ---------- the Fit: hero animation ---------- */

.fit-hero .ring { stroke-dasharray: 124; stroke-dashoffset: 0; }
.fit-hero .dot { opacity: 1; }
.fit-hero .pulse { opacity: 0; }
.fit-hero.play .ring { animation: fitDraw 0.7s ease both; }
.fit-hero.play .dot { animation: fitDrop 0.85s cubic-bezier(0.34, 0.9, 0.32, 1.25) 0.55s both; }
.fit-hero.play .pulse { animation: fitPulse 0.55s ease-out 1.28s; }

@keyframes fitDraw { from { stroke-dashoffset: 124; } to { stroke-dashoffset: 0; } }
@keyframes fitDrop {
  0% { opacity: 0; transform: translateY(-34px); }
  35% { opacity: 1; }
  72% { transform: translateY(6px); }
  88% { transform: translateY(-2px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fitPulse { 0% { opacity: 0.5; transform: scale(0.4); } 100% { opacity: 0; transform: scale(2.4); } }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .fit-hero.play .ring, .fit-hero.play .dot, .fit-hero.play .pulse { animation: none; }
  .fit-hero .pulse { opacity: 0; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .tile { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-mark { max-width: 300px; margin: 0 auto; }
  .grid-3, .bento, .steps { grid-template-columns: 1fr 1fr; }
  .grid-2, .etym, .contact-grid { grid-template-columns: 1fr; }
  .flagship .wrap { grid-template-columns: 1fr; }
  .service { grid-template-columns: 1fr; gap: 18px; padding: 44px 0; }
  .bio-grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait { max-width: 300px; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute; top: 78px; left: 0; right: 0;
    background: var(--moss);
    border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start;
    padding: 22px 28px; gap: 18px;
  }
  .nav-links.open { display: flex; }
}

@media (max-width: 580px) {
  .grid-3, .bento, .steps { grid-template-columns: 1fr; }
}
