/* =========================================================
   Top Notch Programming — styles
   Colours are tokens on :root; dark theme overrides below.
   ========================================================= */

:root {
  --accent: #2563ff;
  --accent-strong: #1a4fe0;
  --accent-soft: rgba(37, 99, 255, 0.1);
  --accent-glow: rgba(37, 99, 255, 0.35);

  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --border: #e3e8f0;
  --text: #0e1526;
  --text-muted: #5a6478;
  --hero-bg: #f3f6fd;
  --grid-line: rgba(14, 21, 38, 0.06);
  --code-bg: #0b1020;
  --shadow: 0 1px 2px rgba(14, 21, 38, 0.04), 0 8px 24px rgba(14, 21, 38, 0.06);

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #4d7fff;
    --accent-strong: #6b95ff;
    --accent-soft: rgba(77, 127, 255, 0.14);
    --accent-glow: rgba(77, 127, 255, 0.45);
    --bg: #0b1020;
    --bg-alt: #0f1529;
    --surface: #121a31;
    --border: #1f2945;
    --text: #e8ecf6;
    --text-muted: #98a3bd;
    --hero-bg: #0b1020;
    --grid-line: rgba(232, 236, 246, 0.05);
    --code-bg: #070b17;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --accent: #4d7fff;
  --accent-strong: #6b95ff;
  --accent-soft: rgba(77, 127, 255, 0.14);
  --accent-glow: rgba(77, 127, 255, 0.45);
  --bg: #0b1020;
  --bg-alt: #0f1529;
  --surface: #121a31;
  --border: #1f2945;
  --text: #e8ecf6;
  --text-muted: #98a3bd;
  --hero-bg: #0b1020;
  --grid-line: rgba(232, 236, 246, 0.05);
  --code-bg: #070b17;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: .7em 1.2em; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 20px -6px var(--accent-glow); }
.btn--primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: .5em 1em; font-size: .88rem; }
.btn--lg { padding: .9em 1.5em; font-size: 1rem; }
.btn--block { width: 100%; }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* theme icon swap */
.icon-moon { display: none !important; }
:root[data-theme="dark"] .icon-sun { display: none !important; }
:root[data-theme="dark"] .icon-moon { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none !important; }
  :root:not([data-theme="light"]) .icon-moon { display: block !important; }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; color: var(--text); letter-spacing: -0.01em; text-decoration: none !important; white-space: nowrap; }
.brand__mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brand__light { font-weight: 500; color: var(--text-muted); }
.brand--sm .brand__mark { width: 24px; height: 24px; }

.nav__links { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav__links a:not(.btn) { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
.nav__links a:not(.btn):hover { color: var(--text); text-decoration: none; }
.nav__actions { display: flex; gap: 8px; }
.nav__burger { display: none; }

@media (max-width: 860px) {
  .nav__actions { margin-left: auto; }
  .nav__burger { display: inline-grid; }
  .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.is-open { display: flex; }
  .nav__links a:not(.btn) { padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .nav__links .btn { margin-top: 16px; }
}
@media (max-width: 400px) { .brand__light { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--hero-bg); padding: 96px 0 110px; overflow: hidden; }
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; width: 640px; height: 640px; right: -180px; top: -260px;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%); opacity: .55; pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; text-align: center; }
.hero h1 { max-width: 14ch; margin: 0 auto .35em; }
.accent { color: var(--accent); white-space: nowrap; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 46rem; margin: 0 auto 2rem; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 28px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }

.hero__code {
  margin: 64px auto 0; max-width: 680px; text-align: left;
  background: var(--code-bg); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius); box-shadow: 0 30px 60px -20px rgba(11, 16, 32, .45);
  overflow: hidden;
}
.code__bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.code__bar span { width: 11px; height: 11px; border-radius: 50%; background: #2a3350; }
.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: 10px; font-style: normal; font-family: var(--mono); font-size: .78rem; color: #7d89a8; }
.hero__code pre { margin: 0; padding: 20px 22px 24px; overflow-x: auto; }
.hero__code code { font-family: var(--mono); font-size: .88rem; line-height: 1.8; color: #d6ddf0; }
.c-k { color: #7aa2ff; } .c-f { color: #5eead4; } .c-s { color: #fbbf77; } .c-c { color: #6b7799; }

@media (max-width: 600px) {
  .hero { padding: 64px 0 72px; }
  .hero__code { margin-top: 44px; }
  .hero__code code { font-size: .74rem; }
}

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--tight { padding: 80px 0; }
@media (max-width: 600px) { .section { padding: 72px 0; } .section--tight { padding: 56px 0; } }

.section__head { max-width: 640px; margin-bottom: 52px; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; margin-bottom: 36px; }
.section__sub { color: var(--text-muted); font-size: 1.08rem; }
.kicker {
  font-family: var(--mono); font-size: .8rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent); margin-bottom: .8em;
}

/* ---------- Service cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card p { color: var(--text-muted); }
.card__icon {
  width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 20px;
  background: var(--accent-soft); color: var(--accent); border-radius: 12px;
}
.card__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ticks { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--border); padding-top: 16px; }
.ticks li { position: relative; padding-left: 26px; margin: 8px 0; font-size: .95rem; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

/* ---------- Process ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: none; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 26px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step p { color: var(--text-muted); font-size: .96rem; margin: 0; }
.step__num {
  display: inline-block; font-family: var(--mono); font-size: .85rem; font-weight: 500;
  color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 8px; margin-bottom: 16px;
}

/* ---------- Stack ---------- */
.stack { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 860px; }
.stack li {
  font-family: var(--mono); font-size: .88rem; color: var(--text);
  padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  transition: border-color .15s, color .15s;
}
.stack li:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 320px 1fr; gap: 64px; align-items: center; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 36px; } }
.about__photo { position: relative; }
.about__photo img {
  display: block; width: 100%; height: auto; max-width: 320px; aspect-ratio: 1; border-radius: 24px; object-fit: cover;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
@media (max-width: 860px) { .about__photo img { max-width: 220px; } }
.about__role { font-family: var(--mono); font-size: .9rem; color: var(--text-muted); margin-top: -.4em; }
.about__body p:not(.kicker):not(.about__role) { color: var(--text-muted); }
.about__links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* ---------- Contact ---------- */
.contact__inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
@media (max-width: 900px) { .contact__inner { grid-template-columns: 1fr; gap: 36px; } }
.contact__points { list-style: none; padding: 0; margin: 28px 0 0; }
.contact__points li { position: relative; padding-left: 28px; margin: 10px 0; color: var(--text); }
.contact__points li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

.form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow); display: grid; gap: 18px;
}
@media (max-width: 600px) { .form { padding: 22px 18px; } }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 6px; }
.form label > span { font-size: .88rem; font-weight: 600; }
.form label em { font-style: normal; font-weight: 400; color: var(--text-muted); }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: .98rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.form textarea { resize: vertical; min-height: 120px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.form__status { margin: 0; font-size: .95rem; min-height: 1.4em; text-align: center; }
.form__status.is-ok { color: #16a34a; }
.form__status.is-err { color: #dc2626; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0; background: var(--bg-alt); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.footer__top { font-size: .9rem; color: var(--text-muted); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
