/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

:root {
  --bg: #0a0a0b;
  --bg-elevated: #101012;
  --surface: #131316;
  --border: #232327;
  --border-soft: #1b1b1f;
  --text: #f2f2f0;
  --text-dim: #9a9a96;
  --text-faint: #5c5c58;
  --accent: #5b8cff;
  --accent-dim: #2c3a63;
  --header-bg: rgba(10, 10, 11, 0.85);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed", var(--sans);
  --container: 1180px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fafaf9;
    --bg-elevated: #f2f2f0;
    --surface: #ffffff;
    --border: #e3e3e0;
    --border-soft: #ebebe8;
    --text: #131316;
    --text-dim: #5c5c58;
    --text-faint: #8f8f8a;
    --accent: #3457d5;
    --accent-dim: #dfe6fb;
    --header-bg: rgba(250, 250, 249, 0.85);
  }
}

:root[data-theme="light"] {
  --bg: #fafaf9;
  --bg-elevated: #f2f2f0;
  --surface: #ffffff;
  --border: #e3e3e0;
  --border-soft: #ebebe8;
  --text: #131316;
  --text-dim: #5c5c58;
  --text-faint: #8f8f8a;
  --accent: #3457d5;
  --accent-dim: #dfe6fb;
  --header-bg: rgba(250, 250, 249, 0.85);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

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

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

/* ===== Typography helpers ===== */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.eyebrow .num { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.1; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; }
h3, h4 { font-weight: 600; letter-spacing: -0.02em; }

h2.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin-top: 14px;
}
.section-head { margin-bottom: 56px; }
.section-head p { color: var(--text-dim); margin-top: 14px; max-width: 560px; font-size: 1rem; }

.text-dim { color: var(--text-dim); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  letter-spacing: 0.02em;
  padding: 13px 22px;
  border: 1px solid var(--border);
  border-radius: 2px;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-arrow { transition: transform 0.2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.logo b { font-weight: 700; }

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav a {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.status-badge {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
}
.status-badge .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: #5bff9c;
  box-shadow: 0 0 0 0 rgba(91,255,156,0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(91,255,156,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(91,255,156,0); }
  100% { box-shadow: 0 0 0 0 rgba(91,255,156,0); }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.nav-toggle span { width: 20px; height: 1px; background: var(--text); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-dim);
  transition: border-color 0.2s ease, color 0.2s ease;
  flex: none;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}

/* ===== Hero ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero { padding: 88px 0 0; position: relative; overflow: hidden; }
.hero .eyebrow { animation: fadeUp 0.6s ease both; }
.hero-content { position: relative; z-index: 1; }

.hero-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(18px, -14px) scale(1.06); }
  66% { transform: translate(-14px, 10px) scale(0.96); }
}
.hero-deco .orbit-ring {
  position: absolute; top: -80px; right: -80px;
  width: 340px; height: 340px; border-radius: 50%;
  border: 1px dashed var(--border);
  animation: spin 50s linear infinite;
}
.hero-deco .orbit-ring::before {
  content: ""; position: absolute; top: -3px; left: 50%; margin-left: -3px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.hero-deco .glow {
  position: absolute; top: 4%; right: 2%;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.14; filter: blur(50px);
  animation: blobFloat 12s ease-in-out infinite;
}
.hero-deco .float-dot {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: 0.5;
  animation: floaty 6s ease-in-out infinite;
}
.hero-deco .float-dot.d1 { top: 18%; right: 22%; animation-delay: 0s; }
.hero-deco .float-dot.d2 { top: 48%; right: 6%; animation-delay: 1.4s; }
.hero-deco .float-dot.d3 { top: 72%; right: 28%; animation-delay: 2.8s; }
@media (max-width: 900px) {
  .hero-deco { display: none; }
}
.hero-badges {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 32px;
  animation: fadeUp 0.6s ease both 0.05s;
}
.tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  border: 1px solid var(--border); border-radius: 2px;
  padding: 6px 12px; color: var(--text-dim);
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  max-width: 880px;
  animation: fadeUp 0.7s ease both 0.15s;
}
.hero h1 .accent { color: var(--text-faint); font-weight: 500; }
.hero-sub {
  margin-top: 26px; max-width: 540px; color: var(--text-dim); font-size: 1.05rem;
  animation: fadeUp 0.6s ease both 0.28s;
}
.hero-cta { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; animation: fadeUp 0.6s ease both 0.4s; }

.stat-row {
  margin-top: 88px;
  border-top: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  animation: fadeUp 0.6s ease both 0.5s;
}
.stat-row div {
  padding: 22px 26px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.stat-row div:last-child { border-right: none; }
.stat-row .label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint); margin-bottom: 8px;
}
.stat-row .value { font-size: 14px; color: var(--text); }

/* ===== Sections ===== */
.section { padding: 120px 0; border-bottom: 1px solid var(--border-soft); }
.section:last-of-type { border-bottom: none; }
.section-alt { background: var(--bg-elevated); }

/* Principle / philosophy triad */
.principle-quote {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  max-width: 760px;
  font-weight: 500;
  margin-top: 14px;
}
.principle-grid {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-soft);
}
.principle-grid > div {
  padding: 32px 30px 0;
  border-right: 1px solid var(--border-soft);
}
.principle-grid > div:last-child { border-right: none; }
.principle-grid h4 { font-size: 1.05rem; margin-bottom: 12px; }
.principle-grid p { color: var(--text-dim); font-size: 0.95rem; }

/* Service / feature cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); }
.card {
  background: var(--bg);
  padding: 34px 30px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.card:hover { background: var(--surface); transform: translateY(-3px); }
.card .num { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 22px; display: block; }
.card h3 { font-size: 1.1rem; margin-bottom: 12px; }
.card p { color: var(--text-dim); font-size: 0.92rem; }
.card ul { margin-top: 16px; }
.card ul li {
  font-size: 0.85rem; color: var(--text-dim); padding: 6px 0;
  border-top: 1px solid var(--border-soft);
}
.card ul li:first-child { border-top: none; }

/* Process steps */
.process { margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.process-step { position: relative; padding-top: 24px; border-top: 1px solid var(--border); }
.process-step .num { font-family: var(--mono); color: var(--accent); font-size: 13px; }
.process-step h4 { margin: 14px 0 10px; font-size: 1rem; }
.process-step p { color: var(--text-dim); font-size: 0.88rem; }

/* Case / portfolio cards */
.case-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 30px 0;
  border-top: 1px solid var(--border-soft);
}
.case-list .case-card:last-child { border-bottom: 1px solid var(--border-soft); }
.case-card .code { font-family: var(--mono); color: var(--text-faint); font-size: 13px; }
.case-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.case-card p { color: var(--text-dim); font-size: 0.9rem; max-width: 480px; }
.case-card .tags { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.case-card .stat { text-align: right; font-family: var(--mono); }
.case-card .stat .big { font-size: 1.6rem; color: var(--accent); }
.case-card .stat .small { font-size: 11px; color: var(--text-faint); text-transform: uppercase; margin-top: 4px; }
.case-card .arrow { color: var(--text-faint); }
.case-card { transition: background 0.2s ease, transform 0.2s ease; }
.case-card:hover { background: var(--surface); transform: translateX(4px); }
.case-card:hover .arrow { color: var(--accent); }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); margin-top: 64px; }
.price-card { background: var(--bg); padding: 38px 32px; display: flex; flex-direction: column; transition: transform 0.2s ease; }
.price-card:hover { transform: translateY(-3px); }
.price-card.featured { background: var(--surface); }
.price-card .plan-name { font-family: var(--mono); font-size: 13px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.price-card .plan-badge { font-family: var(--mono); font-size: 11px; color: var(--accent); margin-top: 10px; }
.price-card .price { font-size: 2.2rem; margin: 20px 0 6px; font-weight: 600; }
.price-card .price span { font-size: 0.95rem; color: var(--text-faint); font-weight: 400; }
.price-card .desc { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 26px; }
.price-card ul { flex: 1; margin-bottom: 30px; }
.price-card ul li {
  font-size: 0.88rem; padding: 10px 0; border-top: 1px solid var(--border-soft);
  display: flex; gap: 10px; color: var(--text-dim);
}
.price-card ul li:first-child { border-top: none; }
.price-card ul li::before { content: "—"; color: var(--accent); flex: none; }

/* FAQ */
.faq-item { border-top: 1px solid var(--border-soft); }
.faq-item:last-child { border-bottom: 1px solid var(--border-soft); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 22px 4px; text-align: left; font-size: 1rem;
}
.faq-q .plus { font-family: var(--mono); color: var(--accent); transition: transform 0.2s ease; flex: none; margin-left: 20px; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-a p { padding: 0 4px 22px; color: var(--text-dim); font-size: 0.92rem; max-width: 640px; }

/* Blog */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); margin-top: 64px; }
.post-card { background: var(--bg); padding: 30px; display: flex; flex-direction: column; height: 100%; transition: background 0.2s ease, transform 0.2s ease; }
.post-card:hover { transform: translateY(-3px); }
.post-card:hover { background: var(--surface); }
.post-card .meta { font-family: var(--mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 18px; }
.post-card h3 { font-size: 1.05rem; margin-bottom: 12px; flex: 1; }
.post-card p { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 18px; }
.post-card .read-more { font-family: var(--mono); font-size: 12px; color: var(--accent); }

.article-header { padding: 60px 0 40px; border-bottom: 1px solid var(--border-soft); }
.article-header .meta { font-family: var(--mono); font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 20px; }
.article-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); max-width: 800px; }
.article-body { padding: 56px 0; max-width: 720px; }
.article-body p { color: var(--text-dim); margin-bottom: 22px; font-size: 1rem; line-height: 1.75; }
.article-body h2 { font-size: 1.4rem; margin: 44px 0 18px; color: var(--text); }
.article-body ul { margin: 0 0 22px; }
.article-body ul li { color: var(--text-dim); padding: 6px 0 6px 20px; position: relative; line-height: 1.6; }
.article-body ul li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.article-footer { padding-bottom: 100px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--text-dim); margin-bottom: 40px; }
.back-link:hover { color: var(--accent); }

/* Contacts */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 60px; }
.contact-grid-single { grid-template-columns: 1fr; max-width: 480px; }
.contact-list { display: flex; flex-direction: column; gap: 0; }
.contact-list a, .contact-list div {
  display: flex; justify-content: space-between; padding: 20px 0; border-top: 1px solid var(--border-soft);
}
.contact-list > *:last-child { border-bottom: 1px solid var(--border-soft); }
.contact-list .label { font-family: var(--mono); font-size: 12px; color: var(--text-faint); text-transform: uppercase; }
.contact-list .value { color: var(--text); font-size: 0.95rem; }
.contact-note { color: var(--text-dim); font-size: 0.92rem; line-height: 1.7; margin-bottom: 28px; }
.contact-note b { color: var(--text); }

.founder-photo-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 4px; padding-top: 12px;
}
.founder-photo-block img {
  width: min(320px, 100%); aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 50%; border: 1px solid var(--border); margin-bottom: 18px;
}
.founder-photo-block .founder-name { font-size: 1.1rem; color: var(--text); font-weight: 600; }
.founder-photo-block .founder-role { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }

.lead-form { display: flex; flex-direction: column; gap: 14px; }
.lead-form .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead-form label {
  display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 8px;
}
.lead-form input, .lead-form textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 2px;
  padding: 12px 14px; color: var(--text); font-family: var(--sans); font-size: 0.95rem;
  transition: border-color 0.2s ease;
}
.lead-form input:focus, .lead-form textarea:focus { outline: none; border-color: var(--accent); }
.lead-form textarea { resize: vertical; min-height: 90px; }
.lead-form .field { display: flex; flex-direction: column; }
.lead-form .form-status { font-size: 0.88rem; min-height: 20px; }
.lead-form .form-status.ok { color: #4fd97a; }
.lead-form .form-status.err { color: #ff6b6b; }
.lead-form button[type="submit"]:disabled { opacity: 0.6; cursor: default; }

/* CTA band */
.cta-band { text-align: center; padding: 100px 0; }
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 620px; margin: 18px auto 0; }
.cta-band .btn { margin-top: 36px; }

/* ===== Footer ===== */
.site-footer { padding: 60px 0 40px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 40px; padding-bottom: 44px; border-bottom: 1px solid var(--border-soft); }
.footer-tagline { color: var(--text-faint); font-size: 0.85rem; margin-top: 10px; max-width: 260px; }
.footer-cols { display: flex; gap: 64px; }
.footer-col h5 { font-family: var(--mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.footer-col a, .footer-col div { display: block; color: var(--text-dim); font-size: 0.9rem; padding: 6px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 28px; font-size: 12px; color: var(--text-faint); font-family: var(--mono); flex-wrap: wrap; gap: 10px; }

/* ===== Reveal on scroll ===== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .status-badge { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-grid > div { border-right: none; border-bottom: 1px solid var(--border-soft); padding-bottom: 32px; margin-bottom: 32px; }
  .grid-3, .pricing-grid, .post-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .case-card { grid-template-columns: 1fr; text-align: left; }
  .case-card .stat { text-align: left; }
  .contact-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-top { flex-direction: column; }
  .footer-cols { gap: 40px; flex-wrap: wrap; }
  .section { padding: 80px 0; }
}

@media (max-width: 600px) {
  .stat-row { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .hero { padding-top: 60px; }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed; inset: 72px 0 0 0; background: var(--bg);
  z-index: 49; padding: 20px 24px; display: none; flex-direction: column; gap: 4px;
  border-top: 1px solid var(--border-soft);
}
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 16px 0; font-size: 1.1rem; border-bottom: 1px solid var(--border-soft); }
