/* ---------- Theme tokens ---------- */
:root {
  --bg: #fafafc;
  --bg-alt: #f1f2f7;
  --surface: #ffffff;
  --text: #12131a;
  --muted: #5b5f73;
  --border: #e3e5ee;
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --code-bg: #12131a;
  --shadow: 0 1px 2px rgba(16, 18, 35, 0.04), 0 8px 24px rgba(16, 18, 35, 0.06);
  --radius: 16px;
  color-scheme: light;
}

/* Dark is the default for every visitor. Light only applies when they pick it
   with the theme button (saved as data-theme="light"). */
:root:not([data-theme="light"]) {
  --bg: #0b0c12;
  --bg-alt: #11131b;
  --surface: #161823;
  --text: #eceef6;
  --muted: #9a9fb5;
  --border: #262a3a;
  --accent: #818cf8;
  --accent-2: #22d3ee;
  --accent-soft: rgba(129, 140, 248, 0.12);
  --code-bg: #07080d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.85em 1.5em;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 6px 20px -6px var(--accent);
}
.btn:hover { transform: translateY(-2px); }
.btn-small { padding: 0.6em 1.1em; font-size: 0.875rem; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 0.55em; font-weight: 700; font-size: 1.05rem; }
.logo-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 0.8rem; font-weight: 800;
}
.logo-llc { color: var(--muted); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 1.75rem; font-size: 0.95rem; }
.nav-links a:not(.btn) { color: var(--muted); transition: color 0.15s; }
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
    width: 44px; height: 44px; margin-right: -8px;
    background: none; border: 0; padding: 0; cursor: pointer;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 16px 20px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin-top: 14px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 88px 0 96px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -30% -10% auto; height: 620px;
  background:
    radial-gradient(40% 50% at 30% 40%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
    radial-gradient(35% 45% at 75% 30%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.4em 0.9em; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); font-weight: 800; margin: 0.5em 0 0.4em; }
.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { max-width: 640px; margin: 0 auto 2em; font-size: clamp(1rem, 2vw, 1.15rem); color: var(--muted); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.code-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.code-bar span { width: 10px; height: 10px; border-radius: 50%; background: #3a3d4f; }
.code-bar span:nth-child(1) { background: #ff5f57; }
.code-bar span:nth-child(2) { background: #febc2e; }
.code-bar span:nth-child(3) { background: #28c840; }
.code-bar em { margin-left: 8px; font-style: normal; font-size: 0.78rem; color: #7d8198; font-family: "JetBrains Mono", monospace; }
.c-muted { color: #6b6f86; }
.c-ok { color: #4ade80; }
.c-accent { color: #a5b4fc; }
.c-link { color: #67e8f9; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-tight { padding: 48px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 620px; margin-bottom: 48px; }
.kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6em; }
.kicker.center { text-align: center; }
.section-sub { color: var(--muted); font-size: 1.05rem; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card p { color: var(--muted); font-size: 0.95rem; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); margin-bottom: 18px;
}
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ticks { list-style: none; padding: 0; margin: 0; font-size: 0.88rem; }
.ticks li { padding: 3px 0 3px 22px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ---------- Work ---------- */
.case {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px; box-shadow: var(--shadow);
  margin-bottom: 20px;
}
@media (max-width: 860px) { .case { grid-template-columns: 1fr; padding: 28px; gap: 28px; } }
.case-tag { font-size: 0.8rem; font-weight: 600; color: var(--accent); margin-bottom: 0.5em; }
.case h3 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
.case-text > p { color: var(--muted); }
.stats { display: flex; gap: 28px; list-style: none; padding: 0; margin: 24px 0; flex-wrap: wrap; }
.stats strong { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.stats span { font-size: 0.82rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-size: 0.78rem; font-weight: 500;
  padding: 0.35em 0.8em; border-radius: 999px;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--muted);
}

.case-visual {
  border-radius: var(--radius); padding: 28px;
  background:
    radial-gradient(60% 60% at 50% 40%, var(--accent-soft), transparent 70%),
    var(--bg-alt);
  border: 1px solid var(--border);
}
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; }
.flow-node {
  padding: 12px 20px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; font-size: 0.95rem; text-align: center;
  box-shadow: var(--shadow);
}
.flow-core { border-color: var(--accent); padding: 16px 28px; }
.flow-core small { display: block; font-weight: 500; font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.flow-arrow { width: 2px; height: 30px; background: linear-gradient(var(--accent), var(--accent-2)); position: relative; }
.flow-arrow::after {
  content: ""; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--accent-2);
}
.flow-targets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; width: 100%; max-width: 280px; }
.flow-targets span {
  text-align: center; font-size: 0.82rem; font-weight: 500;
  padding: 8px; border-radius: 10px;
  background: var(--surface); border: 1px dashed var(--border);
}

.work-thumb {
  height: 140px; border-radius: 12px; margin-bottom: 20px;
  display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 1.1rem;
}
.thumb-a { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.thumb-b {
  background: var(--bg-alt); color: var(--accent);
  border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--border));
  font-size: 2.4rem; font-weight: 400;
}

/* ---------- Process ---------- */
.steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.steps li { position: relative; padding: 28px 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.steps p { color: var(--muted); font-size: 0.93rem; margin: 0; }
.step-num {
  display: block; font: 500 0.85rem "JetBrains Mono", monospace;
  color: var(--accent); margin-bottom: 14px;
}

/* ---------- Tech ---------- */
.tech { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.tech span {
  padding: 0.55em 1.1em; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 500;
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 32px; } }
.about-text p { color: var(--muted); font-size: 1.02rem; }
.values { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.values li {
  padding: 18px 20px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.values strong { display: block; margin-bottom: 2px; }
.values span { color: var(--muted); font-size: 0.92rem; }

/* ---------- Contact ---------- */
.contact-section { padding-top: 0; }
.contact {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px;
  padding: 48px; border-radius: 24px;
  background:
    radial-gradient(60% 80% at 0% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; padding: 28px 20px; gap: 28px; } }
.contact-text p { color: var(--muted); }
.contact-email { font-weight: 600; color: var(--accent); border-bottom: 1px solid currentColor; }
.contact-form { display: grid; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.contact-form label { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; font: inherit; font-weight: 400; font-size: 0.95rem;
  padding: 0.75em 0.9em; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.contact-form .btn { justify-self: start; }
.form-note { font-size: 0.8rem; color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.footer-links { display: flex; gap: 18px; font-size: 0.88rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.theme-toggle {
  font: inherit; font-size: 0.85rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 0.45em 0.9em; border-radius: 999px; cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }

/* ---------- Legal & 404 pages ---------- */
.nav-inner .btn-ghost { box-shadow: inset 0 0 0 1px var(--border); }
.legal { max-width: 760px; padding-top: 64px; padding-bottom: 96px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.legal h2 { font-size: 1.25rem; margin-top: 2.2em; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--text); }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 0.6em; }
.legal a { color: var(--accent); border-bottom: 1px solid currentColor; }
.legal-date { font-size: 0.9rem; }
.footer-links a[aria-current="page"] { color: var(--text); }
mark.todo { background: rgba(245, 158, 11, 0.2); color: inherit; padding: 0 0.3em; border-radius: 4px; }
.notfound { min-height: 70vh; display: grid; place-content: center; text-align: center; padding: 64px 16px; }
.notfound-code { font: 800 clamp(5rem, 20vw, 9rem)/1 "Inter", sans-serif; letter-spacing: -0.05em; margin: 0; }
.notfound p { color: var(--muted); }
.notfound .hero-cta { margin-top: 24px; }

/* ---------- Touch screens: thumb-sized tap targets (~44px) ---------- */
@media (pointer: coarse) {
  .btn, .btn-small { min-height: 44px; }
  .logo { min-height: 44px; }
  .footer-links { gap: 8px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
  .theme-toggle { min-height: 44px; }
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
}
