/* Kodelab — shared stylesheet. Tokens sourced from brand-spec.md (derived from the real Logo.svg fills). */

:root {
  --bg: oklch(99% 0 0);
  --surface: oklch(96% 0 0);
  --fg: oklch(32% 0 0);
  --muted: oklch(56% 0.008 19);
  --border: oklch(88.5% 0 0);
  --accent: oklch(74% 0.22 136);
  --accent-hover: oklch(66% 0.2 136);
  --accent-soft: oklch(96% 0.05 136);

  --dark-bg: oklch(22% 0 0);
  --dark-surface: oklch(27% 0 0);
  --dark-border: oklch(38% 0 0);
  --dark-muted: oklch(70% 0 0);

  --font-display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --container: 1180px;
  --radius: 10px;
  --radius-lg: 18px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 4.4vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 46ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.section-dark .eyebrow { color: var(--dark-muted); }

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 15px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--fg);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--fg); background: var(--surface); }

.section-dark .btn-ghost {
  border-color: var(--dark-border);
  color: var(--bg);
}
.section-dark .btn-ghost:hover { border-color: var(--bg); background: var(--dark-surface); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
}
.link-arrow:hover { border-color: var(--fg); }
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.15s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2.5px solid var(--fg);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 3px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand-mark { display: inline-block; height: 26px; width: auto; }
.brand-mark img { display: block; height: 100%; width: auto; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.nav-cta { display: flex; align-items: center; gap: 18px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--fg);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--dark-bg);
  color: var(--dark-muted);
  padding: 72px 0 32px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--dark-surface);
}

.footer-top .brand-mark { height: 24px; margin-bottom: 18px; }
.footer-top p { color: color-mix(in oklch, var(--dark-muted) 85%, transparent); max-width: 32ch; }

.footer-col h4 {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: color-mix(in oklch, var(--dark-muted) 90%, transparent); }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 0.85rem;
  color: color-mix(in oklch, var(--dark-muted) 75%, transparent);
}

/* ---------- Sections ---------- */

section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-dark { background: var(--dark-bg); color: var(--bg); }
.section-surface { background: var(--surface); }

.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Hero ---------- */

.hero { padding: 76px 0 96px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 36px; flex-wrap: wrap; }

.hero-panel {
  background: var(--dark-bg);
  border-radius: var(--radius-lg);
  padding: 40px;
  color: var(--bg);
  position: relative;
  overflow: hidden;
}
.hero-panel .stack-badge { border-color: var(--dark-surface); color: var(--dark-muted); }
.hero-panel-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dark-muted);
  margin-bottom: 22px;
}
.hero-panel .stack-row { margin-top: 8px; }
.hero-panel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.hero-panel-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-surface);
  font-family: var(--font-display);
  font-weight: 600;
}
.hero-panel-list li:first-child { border-top: none; padding-top: 0; }
.hero-panel-list span { font-family: var(--font-mono); font-weight: 400; font-size: 0.82rem; color: var(--dark-muted); }

/* ---------- Cards / grids ---------- */

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

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--muted); transform: translateY(-2px); }
.card .card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.card .card-icon .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.card .card-icon.step { font-family: var(--font-mono); font-weight: 600; font-size: 0.9rem; color: var(--fg); }
.stack-col { display: grid; gap: 16px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.96rem; }
.card .link-arrow { margin-top: auto; padding-top: 18px; font-size: 0.92rem; }

/* ---------- Tech stack badges ---------- */

.stack-row { display: flex; flex-wrap: wrap; gap: 12px; }
.stack-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  color: var(--fg);
  background: var(--bg);
}

/* ---------- Service detail blocks ---------- */

.service-block {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  padding: 64px 0;
  border-top: 1px solid var(--border);
}
.service-block:first-of-type { border-top: none; }
.service-index { font-family: var(--font-mono); color: var(--accent-hover); font-size: 0.9rem; margin-bottom: 14px; }
.service-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.service-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--fg);
  font-size: 0.98rem;
}
.service-list li::before {
  content: "";
  flex-shrink: 0;
  margin-top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--dark-bg);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cta-band h2 { color: var(--bg); margin-bottom: 8px; }
.cta-band p { color: var(--dark-muted); }

/* ---------- Forms ---------- */

.form-grid { display: grid; gap: 22px; max-width: 560px; }
.field { display: grid; gap: 8px; }
.field label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent-hover);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: 0.82rem; color: var(--muted); }
.field.has-error input,
.field.has-error textarea { border-color: #b3261e; }
.field .error-msg { font-size: 0.82rem; color: #b3261e; display: none; }
.field.has-error .error-msg { display: block; }

.form-status {
  margin-top: 18px;
  font-size: 0.92rem;
  padding: 12px 16px;
  border-radius: 8px;
  display: none;
}
.form-status.visible { display: block; }
.form-status.success { background: var(--accent-soft); color: var(--fg); }

/* Spam honeypot: fully hidden so browser autofill skips it; only bots fill it in. */
.hp-field { display: none; }

.contact-direct {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 48px;
}
.contact-direct .card-icon { margin-bottom: 0; flex-shrink: 0; }
.contact-direct .email-link { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; border-bottom: 1.5px solid var(--accent); padding-bottom: 1px; }

/* ---------- Page hero (secondary pages) ---------- */

.page-hero { padding: 64px 0 72px; border-bottom: 1px solid var(--border); }
.page-hero .lede { max-width: 60ch; }

/* ---------- Error page ---------- */

.error-hero {
  padding: 96px 0;
  text-align: center;
  border-bottom: none;
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 14vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--border);
  margin-bottom: 4px;
}
.error-hero .eyebrow { justify-content: center; }
.error-hero .lede { max-width: 48ch; margin: 0 auto; }
.error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-panel { order: -1; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .service-block { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  section { padding: 64px 0; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .main-nav { position: relative; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    position: absolute;
    top: 64px;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 220px;
    box-shadow: 0 12px 30px oklch(0% 0 0 / 0.1);
  }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 28px; flex-direction: column; align-items: flex-start; text-align: left; }
}
