/* KPEK INC
   Layout: left-aligned 1200px measure, white paper with cool mist bands and a deep-ink band;
   one teal accent reserved for actions, markers and the hero curve. */
:root {
  --paper: #FFFFFF;
  --mist: #EEF2F3;
  --ink: #0F1B24;
  --muted: #4A5A64;
  --line: #D5DDE0;
  --accent: #0B6E70;
  --accent-strong: #08585A;
  --on-accent: #FFFFFF;
  --band: #0F1B24;
  --band-fg: #E7EEF0;
  --band-muted: #A9BAC2;
  --band-line: #2A3A44;
  --band-accent: #5CC9C3;
  --on-band-accent: #05201F;

  --display: "Spectral", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 1200px;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1319;
    --mist: #111C23;
    --ink: #E4EBEE;
    --muted: #9BAEB7;
    --line: #24343D;
    --accent: #4FBDB7;
    --accent-strong: #79D2CD;
    --on-accent: #05201F;
    --band: #15242D;
    --band-fg: #E4EBEE;
    --band-muted: #9BAEB7;
    --band-line: #2C3E48;
    --band-accent: #5CC9C3;
    --on-band-accent: #05201F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0B1319;
  --mist: #111C23;
  --ink: #E4EBEE;
  --muted: #9BAEB7;
  --line: #24343D;
  --accent: #4FBDB7;
  --accent-strong: #79D2CD;
  --on-accent: #05201F;
  --band: #15242D;
  --band-fg: #E4EBEE;
  --band-muted: #9BAEB7;
  --band-line: #2C3E48;
  --band-accent: #5CC9C3;
  --on-band-accent: #05201F;
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--paper);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.5rem, 5.2vw, 4.25rem); }
h2 { font-size: clamp(1.85rem, 3.2vw, 2.75rem); }
h3 { font-size: 1.4rem; line-height: 1.25; }
p { margin: 0; }
.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 38em;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--paper); color: var(--ink); padding: 8px 12px; }

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 14px;
  height: 14px;
  align-self: center;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 45% 100%, 0 55%);
}
.brand-name { font-family: var(--display); font-size: 1.6rem; font-weight: 500; letter-spacing: 0.06em; line-height: 1; }
.brand-inc { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding-block: 6px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--line); color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.site-nav a.btn { color: var(--on-accent); border-bottom: 1px solid var(--accent); padding: 10px 18px; }
.site-nav a.btn:hover { color: var(--on-accent); border-bottom-color: var(--accent-strong); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--ink);
    font-family: var(--body);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
  }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding-block: 8px 20px;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding-block: 14px; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--line); }
  .site-nav a.btn { margin-top: 16px; justify-content: center; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 15px 24px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.more { font-weight: 600; font-size: 0.95rem; text-decoration: none; }

/* Sections */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section--mist { background: var(--mist); }
.section--band { background: var(--band); color: var(--band-fg); }
.section--band .eyebrow { color: var(--band-accent); }
.section-head { display: grid; gap: 16px; max-width: 46rem; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head p { color: var(--muted); }
.section-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 16px 64px;
}
.section-head--split > div { display: grid; gap: 16px; }
@media (max-width: 860px) { .section-head--split { grid-template-columns: 1fr; } }

/* Hero */
.hero { padding-block: clamp(56px, 8vw, 104px) clamp(56px, 7vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.hero-copy { display: grid; gap: 24px; min-width: 0; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .actions { margin-top: 8px; }
.hero-figure { margin: 0; min-width: 0; display: grid; gap: 12px; }
.hero-figure figcaption { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted); }
.fig-frame { fill: var(--mist); stroke: var(--line); }
.fig-grid { stroke: var(--line); stroke-width: 1; }
.fig-phase { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.fig-axis { stroke: var(--muted); stroke-width: 1; }
.fig-area { fill: var(--accent); opacity: 0.09; }
.fig-curve {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 1.8s cubic-bezier(.3,.7,.2,1);
}
.fig-dot { fill: var(--accent); }
.fig-start { fill: var(--paper); stroke: var(--muted); stroke-width: 2; }
.fig-label { fill: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; }
.fig-label--strong { fill: var(--ink); }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

/* Capabilities */
.cap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 40px; }
.cap { display: grid; gap: 12px; align-content: start; padding-top: 20px; border-top: 1px solid var(--ink); }
.cap h3 a { color: var(--ink); text-decoration: none; }
.cap h3 a:hover { color: var(--accent); }
.cap p { color: var(--muted); }
@media (max-width: 960px) { .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cap-grid { grid-template-columns: 1fr; gap: 36px; } }

/* Phases */
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.phase { display: grid; gap: 12px; align-content: start; padding-top: 20px; border-top: 3px solid var(--accent); }
.phase-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.phase-num { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); letter-spacing: 0.1em; }
.phase-when { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.phase p { color: var(--muted); }
.note { font-size: 0.9rem; color: var(--muted); margin-top: 32px; }
@media (max-width: 860px) { .phases { grid-template-columns: 1fr; gap: 32px; } }

/* Industry list (home) */
.ind-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-top: 1px solid var(--line);
}
.ind-list li { border-bottom: 1px solid var(--line); }
.ind-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 18px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.3rem;
}
.ind-list a:hover { color: var(--accent); }
.ind-list .arrow { color: var(--accent); font-family: var(--body); font-size: 1rem; }
@media (max-width: 700px) { .ind-list { grid-template-columns: 1fr; } }

/* Insight cards */
.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.insight {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.tag { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.insight h3 a { color: var(--ink); text-decoration: none; }
.insight h3 a:hover { color: var(--accent); }
.insight p { color: var(--muted); font-size: 1rem; }
.meta { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; }
@media (max-width: 960px) { .insight-grid { grid-template-columns: 1fr; } }

/* CTA band */
.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 64px; align-items: center; }
.cta-copy { display: grid; gap: 14px; }
.cta h2 { color: var(--band-fg); }
.cta p { color: var(--band-muted); max-width: 36em; }
.section--band .btn { background: var(--band-accent); border-color: var(--band-accent); color: var(--on-band-accent); }
.section--band .btn:hover { background: var(--band-fg); border-color: var(--band-fg); color: var(--band); }
@media (max-width: 760px) { .cta { grid-template-columns: 1fr; } }

/* Sub-page hero */
.page-hero { padding-block: clamp(56px, 7vw, 96px) clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.page-hero .wrap { display: grid; gap: 20px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.jump a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.jump a:hover { border-color: var(--accent); color: var(--accent); }

/* Shared detail lists */
.detail-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  line-height: 1.4;
}
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 20px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 9px; height: 2px; background: var(--accent); }

/* Services */
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 32px 64px;
  padding-block: clamp(48px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}
.service:last-child { border-bottom: 0; }
.service-intro { display: grid; gap: 14px; align-content: start; }
.service-intro p { color: var(--muted); }
.service-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 900px) { .service { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .service-detail { grid-template-columns: 1fr; } }

/* Industries */
.industry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 48px;
  padding-block: 40px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}
.industry:last-child { border-bottom: 0; }
.industry h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
.industry p { color: var(--muted); }
@media (max-width: 860px) { .industry { grid-template-columns: 1fr; } }

/* Articles */
.article {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 40rem);
  gap: 20px 72px;
  padding-block: clamp(48px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}
.article:last-child { border-bottom: 0; }
.article-meta { display: grid; gap: 8px; align-content: start; }
.article-body { display: grid; gap: 20px; }
.article-body h2 { margin-bottom: 4px; }
.article-body ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
@media (max-width: 860px) { .article { grid-template-columns: 1fr; } }

/* About */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; }
.principle { display: grid; gap: 10px; align-content: start; padding-top: 20px; border-top: 1px solid var(--ink); }
.principle p { color: var(--muted); }
.models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.model { display: grid; gap: 12px; align-content: start; padding: 28px; background: transparent; border: 1px solid var(--line); }
.model p { color: var(--muted); }
.term { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 860px) { .principles, .models { grid-template-columns: 1fr; } }

/* Team */
.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.person { display: grid; gap: 12px; align-content: start; padding-top: 20px; border-top: 3px solid var(--accent); }
.person h3 { font-size: clamp(1.6rem, 2.4vw, 2rem); }
.placeholder { color: var(--muted); font-style: italic; font-size: 0.95rem; padding: 12px 14px; border: 1px dashed var(--line); background: var(--mist); }
@media (max-width: 860px) { .team { grid-template-columns: 1fr; gap: 32px; } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px 80px; align-items: start; }
.contact-info { display: grid; gap: 40px; align-content: start; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.email { font-family: var(--display); font-size: 1.6rem; color: var(--ink); overflow-wrap: anywhere; }
.copy-btn {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 600;
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  padding: 6px 12px;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 8px; counter-increment: step; color: var(--muted); }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 0.85rem; color: var(--accent); padding-top: 3px; }
.form { display: grid; gap: 20px; padding: clamp(24px, 4vw, 40px); background: var(--mist); border: 1px solid var(--line); }
.field { display: grid; gap: 8px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field input, .field select, .field textarea {
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px 14px;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 160px; resize: vertical; }
.form-note { font-size: 0.88rem; color: var(--muted); }
.form-status { font-size: 0.92rem; color: var(--ink); padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--paper); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* 404 */
.notfound { display: grid; gap: 20px; padding-block: clamp(80px, 12vw, 160px); }

/* Footer */
.site-footer { background: var(--band); color: var(--band-fg); padding-block: 64px 32px; border-top: 1px solid var(--band-line); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-grid h2 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--band-muted);
  margin-bottom: 16px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { color: var(--band-fg); text-decoration: none; font-size: 0.95rem; }
.footer-grid a:hover { color: var(--band-accent); }
.site-footer .brand, .site-footer .brand:hover { color: var(--band-fg); }
.site-footer .brand-inc { color: var(--band-muted); }
.site-footer .brand-mark { background: var(--band-accent); }
.footer-blurb { color: var(--band-muted); margin-top: 16px; max-width: 22em; font-size: 0.95rem; }
.footer-base {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--band-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--band-muted);
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
