/* Kevbyte — design tokens + landing page styles
   Palette, type and spacing are defined once here; nothing below invents a value. */

:root {
  /* Ink (near-black, cool cast) */
  --ink-900: #0C1015;
  --ink-800: #131923;
  --ink-700: #1E2632;

  /* Light surfaces */
  --paper: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #FBFCFD;

  /* Hairlines */
  --line: #E2E5EA;
  --line-soft: #EDEFF2;
  --line-strong: #D6DBE2;
  --line-ink: rgba(255, 255, 255, 0.11);

  /* Text */
  --text: #0C1015;
  --text-soft: #3C4551;
  --text-muted: #5C6673;
  --text-faint: #666E7A;
  --text-ink: #FFFFFF;
  --text-ink-soft: #C3C9D1;
  --text-ink-faint: #7C8794;

  /* Accent — "byte" teal, one accent only */
  --accent: #1C6B78;
  --accent-dark: #12525C;
  --accent-light: #5FC2CE;

  /* Type */
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-display: clamp(2.5rem, 6.4vw, 4.75rem);
  --fs-h2: clamp(1.75rem, 3.4vw, 2.75rem);
  --fs-h3: clamp(1.1875rem, 1.5vw, 1.375rem);
  --fs-h4: 1.0625rem;
  --fs-lead: clamp(1.0625rem, 1.5vw, 1.3125rem);
  --fs-body: 0.96875rem;
  --fs-body-lg: clamp(1rem, 1.25vw, 1.125rem);
  --fs-mono: 0.78125rem;
  --fs-mono-sm: 0.6875rem;

  /* Space scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --gutter: clamp(20px, 4vw, 40px);
  --container: 1240px;
  --band-y: clamp(64px, 8.5vw, 124px);

  --radius: 4px;
  --radius-lg: 8px;
  --ease: cubic-bezier(0.22, 0.68, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
::selection { background: var(--accent); color: #fff; }

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

summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

section[id], [id="top"] { scroll-margin-top: 92px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: var(--s-4);
  top: var(--s-3);
  z-index: 120;
  background: var(--ink-900);
  color: var(--text-ink);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

/* ---------- Layout frame: continuous vertical hairlines down the page ---------- */
.frame {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.band { border-top: 1px solid var(--line); }
.band--paper { background: var(--paper); }
.band--surface { background: var(--surface); }
.band--ink { background: var(--ink-900); color: var(--text-ink); border-top: 0; }
.band--ink .frame { border-color: var(--line-ink); }
.band > .frame { padding-top: var(--band-y); padding-bottom: var(--band-y); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: clamp(64px, 7vw, 78px);
}

.wordmark {
  font-size: clamp(1.1875rem, 2vw, 1.3125rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

/* One implementation, two colour variants (light / --ink). Interaction states change
   opacity only — never the Kev/byte colours — so neither half can vanish, and the
   global `a:hover` colour is explicitly overridden. */
.wordmark span { color: var(--accent); }
.wordmark--ink { color: var(--text-ink); }
.wordmark--ink span { color: var(--accent-light); }

a.wordmark { transition: opacity 0.2s var(--ease); }
a.wordmark:visited { color: var(--text); }
a.wordmark:hover,
a.wordmark:focus-visible,
a.wordmark:active { color: var(--text); opacity: 0.72; }
a.wordmark:visited span,
a.wordmark:hover span,
a.wordmark:focus-visible span,
a.wordmark:active span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 36px);
}

.nav > a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.nav > a:hover { color: var(--accent); }
.nav > a.btn {
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--text-ink);
}

.nav > a.btn:hover { color: var(--text-ink); }

/* Mobile menu (no JS required to open) */
.menu { display: none; position: relative; }

.menu__bars {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
}

.menu__bars i { width: 22px; height: 1.5px; background: var(--text); }
.menu__bars i:last-child { width: 14px; background: var(--accent); }

.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(72vw, 260px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 18px 40px -20px rgba(12, 16, 21, 0.28);
  padding: var(--s-2);
  display: flex;
  flex-direction: column;
}

.menu__panel > a {
  padding: 14px;
  font-size: 0.9375rem;
  color: var(--text);
  border-radius: var(--radius);
}

.menu__panel > a:hover { background: var(--paper); color: var(--text); }
.menu__panel > .btn { margin-top: var(--s-1); justify-content: center; color: var(--text-ink); }
.menu__panel > .btn:hover { background: var(--accent); color: var(--text-ink); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 14px 26px;
  border-radius: var(--radius);
  font-size: 0.96875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn--sm { min-height: 0; padding: 11px 18px; font-size: 0.875rem; }
.btn--primary { background: var(--ink-900); color: var(--text-ink); }
.btn--primary:hover { background: var(--accent); color: var(--text-ink); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.link {
  color: var(--accent);
  border-bottom: 1px solid rgba(28, 107, 120, 0.3);
  padding-bottom: 1px;
}

.link:hover { border-color: var(--accent-dark); }

/* ---------- Type primitives ---------- */
.h1 {
  font-size: var(--fs-display);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 26ch;
  text-wrap: balance;
}

.h2--ink { color: var(--text-ink); max-width: 24ch; }
.h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.015em; margin-bottom: var(--s-3); }
.h4 { font-size: var(--fs-h4); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 7px; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 56ch;
  text-wrap: pretty;
}

.lead--ink { color: var(--text-ink-soft); max-width: 50ch; }

.body { font-size: var(--fs-body); line-height: 1.65; color: var(--text-muted); text-wrap: pretty; }
.body--sm { font-size: 0.9375rem; line-height: 1.6; }
.body--lg { font-size: var(--fs-body-lg); line-height: 1.7; color: var(--text-soft); max-width: 50ch; margin-top: clamp(18px, 2.2vw, 28px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--s-4);
}

.eyebrow b { font-weight: 400; color: var(--accent); }
.eyebrow--ink { color: var(--text-ink-faint); }
.eyebrow--ink b { color: var(--accent-light); }

/* ---------- Hero ---------- */
.hero { border-top: 0; }

.hero > .frame {
  padding-top: clamp(56px, 9vw, 116px);
  padding-bottom: clamp(48px, 7vw, 96px);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(44px, 6vw, 88px);
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 100px;
  padding: 7px 14px 7px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: clamp(24px, 3vw, 32px);
}

.pill__dot { width: 7px; height: 7px; background: var(--accent); border-radius: 1px; }

.hero .lead { margin-top: clamp(22px, 2.6vw, 30px); }
#contact .lead { margin-top: clamp(20px, 2.2vw, 26px); }

.actions {
  margin-top: clamp(30px, 3.6vw, 42px);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.meta {
  margin-top: clamp(38px, 4.6vw, 56px);
  border-top: 1px solid var(--line);
  padding-top: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) clamp(28px, 4vw, 56px);
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  letter-spacing: 0.04em;
}

.meta > div { display: flex; flex-direction: column; gap: 5px; }
.meta dt { color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--fs-mono-sm); }
.meta dd { color: var(--text); }

/* Byte motif — the letter K as one byte (0100 1011) */
.byte {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.6vw, 30px);
  box-shadow: 0 24px 60px -40px rgba(12, 16, 21, 0.35);
}

.byte__head,
.byte__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.byte__head { border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; }
.byte__bits { color: var(--accent); }

.byte__grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(6px, 0.9vw, 10px);
}

.byte__grid span {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E7EAEE;
  border-radius: 3px;
  background: var(--surface-2);
  color: #B4BBC4;
  font-family: var(--font-mono);
  font-size: clamp(0.8125rem, 1.3vw, 1rem);
}

.byte__grid span.on { border-color: var(--accent); background: var(--accent); color: #fff; }

.byte__foot {
  margin-top: 22px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.byte__foot > span:first-child { font-size: clamp(0.9375rem, 1.6vw, 1.125rem); color: var(--text); }
.byte__tag { text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--fs-mono-sm); }

/* ---------- Services ---------- */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(44px, 5.5vw, 72px);
}

.section-head .h2 { max-width: 20ch; }

.section-head__note {
  font-size: var(--fs-body-lg);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 52ch;
  text-wrap: pretty;
}

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px);
}

.service + .service {
  border-left: 1px solid var(--line);
  padding-left: clamp(28px, 3vw, 44px);
}

.service__num {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: var(--s-4);
}

.tags {
  margin-top: var(--s-5);
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- Split sections ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.split--even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 5.5vw, 88px);
}

.split--contact { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); align-items: end; }

.status {
  margin-top: var(--s-5);
  border-top: 1px solid var(--line-ink);
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-ink-faint);
}

.status__dot { width: 7px; height: 7px; border-radius: 1px; background: var(--accent-light); }

/* ---------- About ---------- */
.signature {
  margin-top: var(--s-6);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.signature span { color: var(--text-faint); }

.principles { border-top: 1px solid var(--line); }

.principles > li {
  border-bottom: 1px solid var(--line);
  padding: clamp(20px, 2.4vw, 26px) 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--s-2);
}

.principles__num {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--accent);
  padding-top: var(--s-1);
}

/* ---------- Contact ---------- */
.contact-cta { margin-top: clamp(28px, 3.4vw, 40px); }
.meta--contact { margin-top: 0; gap: var(--s-4) clamp(24px, 3vw, 44px); }

/* ---------- Footer ---------- */
.footer > .frame {
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(28px, 3vw, 36px);
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-6) clamp(32px, 5vw, 64px);
}

.footer__tag {
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-ink-faint);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) clamp(20px, 3vw, 40px);
  align-items: flex-start;
}

.footer__nav a { font-size: 0.875rem; color: var(--text-ink-soft); }
.footer__nav a:hover { color: var(--accent-light); }

.footer__bottom {
  margin-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--line-ink);
  padding-top: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px var(--s-5);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.08em;
  color: var(--text-ink-faint);
}

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
[data-reveal].is-armed {
  opacity: 0;
  transform: translateY(12px);
}

[data-reveal].is-armed.is-in {
  opacity: 1;
  transform: none;
}

[data-reveal].is-armed {
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

/* ---------- Breakpoints ---------- */
@media (max-width: 1000px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 6vw, 56px); }
  .byte { max-width: 420px; }
  .section-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .section-head .h2 { max-width: 24ch; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service:nth-child(3) { border-left: 0; padding-left: 0; }
  .split, .split--even, .split--contact { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .h2, .h2--ink { max-width: 30ch; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .menu { display: block; }
  section[id], [id="top"] { scroll-margin-top: 76px; }
}

@media (max-width: 640px) {
  .services { grid-template-columns: minmax(0, 1fr); }
  .service + .service {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: var(--s-6);
  }
  .actions .btn { flex: 1 1 100%; }
  .meta { gap: var(--s-5) var(--s-6); }
  .principles > li { grid-template-columns: 36px minmax(0, 1fr); }
  .h1 { letter-spacing: -0.03em; }
}

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

@media print {
  .site-header, .skip, .menu { display: none; }
  body { background: #fff; }
  .band--ink { background: #fff; color: #000; }
  .band--ink .frame { border-color: var(--line); }
  .h2--ink, .lead--ink, .wordmark--ink { color: #000; }
}
