/* ============================================================
   AlgoStudio — showcase landing
   Brand tokens live in :root so a style guide drops in cleanly.
   ============================================================ */

:root {
  /* color — brand palette: green #22C55E, black #0D0D0D, white #FFFFFF.
     Page lifts off pure black into neutral grays; #0D0D0D kept for deep insets. */
  --bg: #161616;
  --bg-2: #101010;
  --surface: #202020;
  --surface-2: #282828;
  --border: #333333;
  --border-soft: #292929;
  --green: #22c55e;
  --green-bright: #2ed673;
  --green-dim: rgba(34, 197, 94, 0.1);
  --green-line: rgba(34, 197, 94, 0.28);
  --text: #ffffff;
  --text-2: #c4c4c4;
  --text-muted: #8c8c8c;

  /* type — Inter is the brand typeface; mono only for actual code */
  --font-display: "Inter", system-ui, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;

  /* shape */
  --radius: 12px;
  --radius-lg: 18px;
  --maxw: 1120px;
  --pad: 40px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

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

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

em { font-style: normal; color: var(--green); }

::selection { background: var(--green); color: #04140a; }

/* ── shared layout ── */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px var(--pad);
  position: relative;
  z-index: 2;
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--green);
  margin-bottom: 18px;
}

.section-heading {
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 600;
}

.section-sub {
  font-size: 17px;
  color: var(--text-2);
  max-width: 540px;
  margin-top: 16px;
}

.section-intro { margin-bottom: 80px; }

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: 14px; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--green);
  color: #04140a;
  box-shadow: 0 0 0 0 var(--green-line);
}
.btn-primary:hover {
  background: var(--green-bright);
  box-shadow: 0 8px 30px -8px var(--green);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); border-color: #34343b; }

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  /* full-width bar, content aligned to the same column as the sections */
  padding: 0 max(var(--pad), calc((100% - var(--maxw)) / 2 + var(--pad)));
  /* same color as the page, no blur/border — just blends in */
  background: var(--bg);
}

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-algo { color: var(--green); }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; }
.brand-mark svg { width: 28px; height: 28px; fill: var(--green); }
.brand-mark.sm { width: 22px; height: 22px; }
.brand-mark.sm svg { width: 22px; height: 22px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin-left: auto;
}
.nav-links a { font-size: 14.5px; color: var(--text-muted); transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav .btn-primary { padding: 8px 16px; }

/* ── HERO ── */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 138px var(--pad) 96px;
  display: grid;
  grid-template-columns: 1fr 1.06fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero-copy { max-width: 540px; }

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(38px, 4.6vw, 60px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero-sub {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--text-2);
  margin-top: 24px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 34px;
}

/* product window mock */
.hero-app {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-2);
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.85);
}
.app-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-mark { width: 18px; height: 18px; display: grid; place-items: center; }
.app-mark svg { width: 18px; height: 18px; fill: var(--green); }
.app-crumb { font-size: 12.5px; color: var(--text-muted); }
.app-crumb strong { color: var(--text-2); font-weight: 600; }
.app-sep { color: #3a3a3a; margin: 0 3px; }
.app-run {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  border: 1px solid var(--green-line);
  border-radius: 7px;
  padding: 4px 11px;
}
.app-code {
  display: flex;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 16px 0;
}
.app-gutter {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  color: #3a3a3a;
  text-align: right;
  user-select: none;
}
.app-code pre { margin: 0; padding: 0 18px; overflow-x: auto; flex: 1; }
.app-code code { color: #cfcfcf; white-space: pre; font-family: inherit; }
.t-kw { color: #c792ea; }
.t-fn { color: #82aaff; }
.t-ty { color: #4fc1ff; }
.t-num { color: #f78c6c; }

.app-tests {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 14px 18px 16px;
}
.app-tests-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.app-pass { font-size: 13px; font-weight: 600; color: var(--text); }
.app-time { font-size: 12px; color: var(--text-muted); }
.app-cases { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.app-cases li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-2);
}
.app-cases .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.app-cases .ok .dot { background: var(--green); }
.app-cases .bad .dot { background: #ef4444; }
.app-cases .bad { color: var(--text-muted); }
.app-detail { color: #ef4444; font-size: 11.5px; margin-left: auto; }

/* ── feature screenshots ── */
.shot-img {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.7);
}

/* ── TRUST ── */
.trust {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px var(--pad) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}
.trust strong { color: var(--text-2); font-weight: 600; }
.trust-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border); }

/* ── PROBLEM ── */
.problem { text-align: center; padding-bottom: 40px; }
.problem-head {
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 700;
  max-width: 760px;
  margin: 0 auto;
}
.problem-sub {
  font-size: 18px;
  color: var(--text-2);
  max-width: 560px;
  margin: 22px auto 0;
}

/* ── FEATURES ── */
.feature {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: center;
  gap: 72px;
  padding: 56px 0;
}
.feature.reverse { grid-template-columns: 1.15fr 0.85fr; }
.feature.reverse .feature-text { order: 2; }
.feature.reverse .feature-media { order: 1; }

.feature-num {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--green);
  margin-bottom: 18px;
  opacity: 0.8;
}
.feature-text h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  margin-bottom: 16px;
}
.feature-text p {
  font-size: 16px;
  color: var(--text-2);
  max-width: 440px;
}

/* ── MINI GRID ── */
.grid-section { padding-top: 40px; }
.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color .2s ease, transform .2s ease;
}
.mini:hover { border-color: var(--green-line); transform: translateY(-3px); }
.mini h4 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.mini p { font-size: 14px; color: var(--text-muted); }

/* ── PHILOSOPHY ── */
.philosophy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.philosophy-text p { font-size: 16px; color: var(--text-2); margin: 18px 0 28px; max-width: 460px; }

.philosophy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.flow { display: flex; flex-direction: column; gap: 8px; }
.flow-step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 18px;
}
.flow-k {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.flow-done { border-color: var(--green-line); color: var(--text); }
.flow-done .flow-k { color: var(--green); background: var(--green-dim); border-color: var(--green-line); }
.flow-arrow { text-align: center; color: var(--text-muted); font-size: 13px; line-height: 1; }

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 44px;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.about-card h3 { font-size: 20px; font-weight: 600; }
.about-card .role { font-family: var(--font-body); font-size: 12.5px; color: var(--green); margin: 6px 0 16px; }
.about-card p { font-size: 15px; color: var(--text-muted); }

/* ── FINAL CTA ── */
.cta-section { max-width: var(--maxw); margin: 0 auto; padding: 60px var(--pad) 120px; position: relative; z-index: 2; }
.cta-box {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 84px 48px;
}
.cta-box h2 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 700; margin-bottom: 16px; }
.cta-box p { font-size: 17px; color: var(--text-2); max-width: 520px; margin: 0 auto 36px; }
.cta-box .hero-ctas { margin-top: 0; justify-content: center; }

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border-soft);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px var(--pad);
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 2;
}
.footer-brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-2); }
.footer-links { display: flex; gap: 22px; list-style: none; margin-left: auto; }
.footer-links a { font-size: 14px; color: var(--text-muted); transition: color .15s; }
.footer-links a:hover { color: var(--text); }
.footer-tag { font-size: 13px; color: var(--text-muted); width: 100%; flex-basis: 100%; order: 3; padding-top: 8px; border-top: 1px solid var(--border-soft); margin-top: 8px; }

/* ── reveal animation (only hides when JS is present, so no-JS shows all) ── */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 120px; }
  .hero-copy { max-width: none; }
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 28px; }
  .feature.reverse .feature-text, .feature.reverse .feature-media { order: initial; }
  .feature-text p { max-width: none; }
  .philosophy { grid-template-columns: 1fr; gap: 36px; }
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  :root { --pad: 22px; }
  .nav-links { display: none; }
  .section { padding: 84px var(--pad); }
  .hero { padding: 140px var(--pad) 60px; }
  .hero-shot { margin-top: 48px; }
  .mini-grid { grid-template-columns: 1fr; }
  .cta-box { padding: 56px 26px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer-links { margin-left: 0; flex-wrap: wrap; }
}
