:root {
  --bg: #ffffff;
  --bg-alt: #f6f7fa;
  --text: #0e1220;
  --muted: #5b6478;
  --brand: #1b4bd8;
  --brand-ink: #12379e;
  --brand-wash: #eef2fd;
  --border: #e4e7ee;
  --border-strong: #cfd5e2;
  --radius: 12px;
  --maxw: 1140px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { left: 24px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.13rem; font-weight: 680; letter-spacing: -0.015em; }

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 14px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled { box-shadow: 0 1px 14px rgba(14, 18, 32, 0.07); }

.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }

.brand { font-weight: 800; font-size: 1.22rem; letter-spacing: -0.035em; }
.brand span { color: var(--brand); }

.nav-links { list-style: none; display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 0.95rem; transition: color 0.18s; }
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--brand);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.18s;
}
.nav-cta:hover { background: var(--brand-ink); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.97rem;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 9vh, 104px) 0 clamp(64px, 10vh, 112px); }
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 { max-width: 15ch; }
.hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 22px 0 32px;
  max-width: 52ch;
}
.hero-actions { display: flex; gap: 13px; flex-wrap: wrap; }

.platforms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.platforms li { display: flex; align-items: center; gap: 8px; }
.platforms li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

/* ---------- Hero device (pure CSS wireframe) ---------- */
.device { display: flex; justify-content: center; }
.device-frame {
  width: 252px;
  aspect-ratio: 10 / 20;
  border: 1.5px solid var(--border-strong);
  border-radius: 32px;
  padding: 14px 13px;
  background: var(--bg);
  box-shadow: 0 22px 50px -28px rgba(14, 18, 32, 0.4);
  animation: float 7s ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translateY(-6px); }
  to   { transform: translateY(6px); }
}
.device-notch {
  display: block;
  width: 56px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--border-strong);
}
.device-screen { display: flex; flex-direction: column; gap: 11px; height: calc(100% - 19px); }

.scr-bar { display: flex; align-items: center; gap: 9px; }
.scr-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-wash); }
.scr-title { height: 8px; width: 84px; border-radius: 4px; background: var(--brand-wash); }
.scr-panel {
  height: 86px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand), #4f7bf0);
}
.scr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.scr-grid i {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafbfe;
}
.scr-line { height: 8px; border-radius: 4px; background: var(--brand-wash); }
.scr-line.short { width: 58%; }
.scr-cta {
  margin-top: auto;
  height: 34px;
  border-radius: 9px;
  border: 1.5px solid var(--brand);
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vh, 104px) 0; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 640px; margin: 0 0 52px; }
.section-sub { color: var(--muted); margin-top: 16px; font-size: 1.03rem; }

/* ---------- Grid + cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 12px 28px -20px rgba(27, 75, 216, 0.55);
}
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--brand-wash);
  color: var(--brand);
  margin-bottom: 18px;
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.96rem; }

/* ---------- Process ---------- */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 26px;
}
.step { border-top: 2px solid var(--border); padding-top: 22px; position: relative; }
.step::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.step-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 10px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat { border-left: 2px solid var(--brand); padding-left: 20px; }
.stat-num {
  display: block;
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
}
.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Work ---------- */
.case {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.case:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 28px -22px rgba(14, 18, 32, 0.45);
}
.case-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand);
  margin-bottom: 10px;
}
.case h3 { margin-bottom: 16px; }
.case-problem, .case-result { color: var(--muted); font-size: 0.94rem; }
.case-problem { margin-bottom: 12px; }
.case-problem strong, .case-result strong { color: var(--text); font-weight: 650; }

/* ---------- Stack ---------- */
.stack {
  margin-top: 44px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
  display: grid;
  gap: 18px;
}
.stack-row { display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: start; }
.stack-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  padding-top: 7px;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-family: var(--mono);
  font-size: 0.79rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
}

/* ---------- About ---------- */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.split p { color: var(--muted); margin-top: 18px; }

.feature-list { list-style: none; display: grid; gap: 12px; }
.feature-list li {
  border: 1px solid var(--border);
  border-left: 2px solid var(--brand);
  border-radius: 10px;
  padding: 16px 20px;
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--bg);
}
.feature-list strong { color: var(--text); font-weight: 650; }

/* ---------- Contact ---------- */
.contact-inner { text-align: center; max-width: 600px; margin: 0 auto; }
.contact-inner p { color: var(--muted); margin: 16px 0 30px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-inner p { color: var(--muted); font-size: 0.88rem; }

/* ---------- Reveal ----------
   Elements only start hidden when scripting is available (html.js is set by an
   inline script in <head>). With JS disabled the page renders fully visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero h1 { max-width: 20ch; }
  .device-frame { width: 224px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
  }
  .nav-links.open { max-height: 340px; }
  .nav-links li { width: 100%; border-top: 1px solid var(--border); }
  .nav-links a { display: block; padding: 14px 24px; }
  .nav-cta {
    border-radius: 0;
    background: transparent;
    color: var(--brand) !important;
  }
  .nav-cta:hover { background: transparent; }

  .grid-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stack-row { grid-template-columns: 1fr; gap: 10px; }
  .stack-label { padding-top: 0; }
  .section-head { margin-bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .device-frame { animation: none; }
  .btn:hover, .card:hover { transform: none; }
}
