/* ============================================================
   TimelyNodes — marketing site
   Design system: dark, gradient-accented, glass, motion.
   ============================================================ */

:root {
  --bg:        #08080e;
  --bg-2:      #0c0c16;
  --surface:   rgba(255,255,255,0.03);
  --surface-2: rgba(255,255,255,0.05);
  --border:    rgba(255,255,255,0.08);
  --border-2:  rgba(255,255,255,0.14);

  --text:      #eef0f6;
  --muted:     #9aa0b5;
  --faint:     #6b7186;

  --violet:    #7c5cff;
  --indigo:    #5b8cff;
  --cyan:      #34e3d0;
  --pink:      #ff6ba9;

  --grad:      linear-gradient(100deg, #8a6bff 0%, #5b8cff 45%, #34e3d0 100%);
  --grad-soft: linear-gradient(100deg, rgba(138,107,255,.18), rgba(52,227,208,.14));

  --radius:   18px;
  --radius-s: 12px;
  --maxw:     1160px;
  --ease:     cubic-bezier(.22,.61,.36,1);
  --shadow:   0 24px 60px -24px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
/* scroll-padding keeps anchored sections clear of the sticky nav */
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, #17142e 0%, transparent 55%),
              radial-gradient(900px 700px at -10% 10%, #0d1b2e 0%, transparent 50%),
              var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* `clip` prevents horizontal scroll WITHOUT creating a scroll container —
     `hidden` here would break the sticky nav. */
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { line-height: 1.1; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
code, pre, .brand-name span, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Background canvas + ambient glows */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .55; pointer-events: none; }
.glow { position: fixed; z-index: 0; border-radius: 50%; filter: blur(90px); opacity: .5; pointer-events: none; }
.glow-1 { width: 46vw; height: 46vw; left: -12vw; top: -8vw; background: radial-gradient(circle, rgba(124,92,255,.5), transparent 65%); animation: float 22s var(--ease) infinite; }
.glow-2 { width: 40vw; height: 40vw; right: -14vw; top: 20vh; background: radial-gradient(circle, rgba(52,227,208,.35), transparent 65%); animation: float 26s var(--ease) infinite reverse; }
@keyframes float { 0%,100%{ transform: translate(0,0) } 50%{ transform: translate(4vw,5vh) } }

main, .nav, .footer { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  --pad: 11px 18px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: var(--pad); border-radius: 999px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
  white-space: nowrap;
}
.btn-lg { --pad: 15px 26px; font-size: 16px; }
.btn-primary { background: var(--grad); color: #0a0a12; box-shadow: 0 10px 30px -10px rgba(124,92,255,.6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px -12px rgba(124,92,255,.75); }
.btn-ghost { border-color: var(--border-2); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--violet); transform: translateY(-2px); background: var(--surface-2); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px;
  max-width: var(--maxw); margin: 0 auto; padding: 18px 24px;
  transition: padding .3s var(--ease);
}
.nav.scrolled {
  padding: 10px 24px; margin-top: 8px;
  background: rgba(10,10,18,.7); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 999px; max-width: calc(var(--maxw) - 40px);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--grad); position: relative; box-shadow: 0 0 20px rgba(124,92,255,.6); }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 3px; background: var(--bg); }
.brand-name { font-size: 18px; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 26px; margin-left: 12px; margin-right: auto; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; gap: 10px; }
.nav-burger { display: none; background: none; border: 0; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.nav-burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s var(--ease); }

/* ---------- Layout helpers ---------- */
.band { max-width: var(--maxw); margin: 0 auto; padding: 96px 24px; }
.band-center { text-align: center; }
.section-head { max-width: 720px; margin: 0 auto 48px; }
.band:not(.band-center) .section-head { margin-left: 0; }
.section-head h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 16px; }
.kicker { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 600; color: var(--cyan); margin-bottom: 14px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto; padding: 70px 24px 40px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface); padding: 6px 14px; border-radius: 999px; margin-bottom: 24px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 2.4s infinite; }
@keyframes blink { 50% { opacity: .35 } }
.hero h1 { font-size: clamp(38px, 6vw, 68px); font-weight: 800; margin-bottom: 22px; }
.lede { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 540px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }
.hero-stats { display: flex; gap: 38px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 30px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats span { font-size: 13px; color: var(--faint); }

/* Hero grid demo (JS-driven "solving" timetable) */
.hero-visual { position: relative; }
.grid-demo {
  --cols: 6; --rows: 5;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-auto-rows: 46px; gap: 8px;
  padding: 18px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.cell { border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid var(--border); transition: all .5s var(--ease); position: relative; }
.cell.block { border-color: transparent; color: #05050a; font: 600 10px/1 'JetBrains Mono', monospace; display: flex; align-items: center; justify-content: center; }
.cell.clash { animation: clash 1.1s var(--ease); }
@keyframes clash { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,169,0); } 40% { box-shadow: 0 0 0 3px rgba(255,107,169,.7); transform: translateY(-2px); } }
.grid-caption { display: flex; align-items: center; gap: 9px; margin-top: 16px; font: 500 13px 'JetBrains Mono', monospace; color: var(--muted); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: blink 1.6s infinite; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.card {
  padding: 30px 26px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--border-2); background: var(--surface-2); }
.card h3 { font-size: 19px; margin: 18px 0 10px; }
.card p { color: var(--muted); font-size: 15px; }
.card-ic { width: 46px; height: 46px; border-radius: 13px; background: var(--grad-soft); border: 1px solid var(--border-2); position: relative; }
.card-ic::after { content: ""; position: absolute; inset: 12px; border-radius: 6px; background: var(--grad); opacity: .9; }
.ic-b::after { border-radius: 50%; }
.ic-c::after { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }

/* ---------- Steps ---------- */
.steps { display: flex; align-items: stretch; gap: 12px; margin-bottom: 44px; }
.step { flex: 1; padding: 28px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step h3 { font-size: 18px; margin: 16px 0 8px; }
.step p { color: var(--muted); font-size: 14.5px; }
.step-node { display: inline-flex; align-items: center; justify-content: center; padding: 7px 15px; border-radius: 999px; font: 600 12px 'JetBrains Mono', monospace; }
.step-node.var { background: rgba(52,227,208,.14); color: var(--cyan); border: 1px solid rgba(52,227,208,.35); }
.step-node.con { background: rgba(124,92,255,.16); color: #b3a4ff; border: 1px solid rgba(124,92,255,.4); }
.step-node.res { background: rgba(91,140,255,.16); color: #a9c1ff; border: 1px solid rgba(91,140,255,.4); }
.step-arrow { align-self: center; width: 34px; height: 2px; background: linear-gradient(90deg, var(--border-2), transparent); position: relative; }
.step-arrow::after { content: ""; position: absolute; right: 0; top: -3px; border-left: 7px solid var(--border-2); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }

/* ---------- Code blocks ---------- */
.code {
  margin: 0; padding: 24px; border-radius: var(--radius); overflow-x: auto;
  background: linear-gradient(180deg, #0b0b16, #090912); border: 1px solid var(--border);
  font: 400 13.5px/1.7 'JetBrains Mono', monospace; color: #c7cbe0; box-shadow: var(--shadow);
}
.c-key { color: var(--cyan); } .c-str { color: #b3a4ff; } .c-num { color: #ffb37a; } .c-cmt { color: var(--faint); }

/* ---------- Feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.feat { padding: 26px 24px; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--border); transition: transform .3s var(--ease), border-color .3s; position: relative; overflow: hidden; }
.feat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.feat:hover { transform: translateY(-4px); border-color: var(--border-2); }
.feat:hover::before { transform: scaleX(1); }
.feat h3 { font-size: 17px; margin-bottom: 9px; }
.feat p { color: var(--muted); font-size: 14.5px; }

/* ---------- Benchmarks ---------- */
.bench { display: inline-flex; gap: 20px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.bench-item { padding: 30px 40px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); min-width: 200px; }
.bench-item b { display: block; font-size: 44px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bench-item span { color: var(--muted); font-size: 14px; }

/* ---------- Split (API) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split-copy h2 { font-size: clamp(26px,3.5vw,38px); margin: 12px 0 16px; }
.ticks { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: var(--muted); font-size: 15px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 6px; background: var(--grad-soft); border: 1px solid var(--border-2); }
.ticks li::after { content: "✓"; position: absolute; left: 4px; top: 3px; font-size: 11px; color: var(--cyan); }
code:not(pre code) { background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; font-size: 13px; color: #b3a4ff; }

/* ---------- CTA ---------- */
.cta { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 110px; }
.cta-card {
  text-align: center; padding: 64px 32px; border-radius: 28px; position: relative; overflow: hidden;
  background: radial-gradient(600px 300px at 50% -20%, rgba(124,92,255,.28), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--border-2); box-shadow: var(--shadow);
}
.cta-card h2 { font-size: clamp(28px,4.5vw,48px); margin-bottom: 14px; }
.cta-card .muted { max-width: 520px; margin: 0 auto 30px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 20px; }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 56px 24px 30px; display: grid; grid-template-columns: 1.3fr 2fr; gap: 40px; }
.foot-brand .brand-name { display: inline-block; margin: 12px 0 8px; }
.foot-brand .brand-mark { display: inline-block; vertical-align: middle; margin-right: 8px; }
.foot-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.foot-cols h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 14px; }
.foot-cols a { display: block; color: var(--muted); font-size: 14.5px; margin-bottom: 10px; transition: color .2s; }
.foot-cols a:hover { color: var(--text); }
.foot-bottom { max-width: var(--maxw); margin: 0 auto; padding: 22px 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }

/* ---------- Modal / waitlist ---------- */
.modal {
  width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border-2);
  border-radius: 22px; background: linear-gradient(180deg, #12121e, #0b0b14); color: var(--text);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.8); overflow: hidden; position: fixed; inset: 0; margin: auto;
}
.modal::backdrop { background: rgba(6,6,12,.66); backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn .3s var(--ease); }
.modal[open]::backdrop { animation: fadeIn .3s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes fadeIn { from { opacity: 0; } }
.modal-body, .modal-success { padding: 34px 30px 30px; }
.modal-body h3 { font-size: 24px; margin-bottom: 8px; }
.modal-body .kicker { margin-bottom: 10px; }
.modal-body > .muted { font-size: 14.5px; margin-bottom: 22px; }
.modal-close { position: absolute; top: 14px; right: 16px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; transition: .2s; }
.modal-close:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }

#waitlistForm { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field .opt { color: var(--faint); font-weight: 400; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 11px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, background .2s;
}
.field input::placeholder { color: var(--faint); }
.field input:focus, .field select:focus { outline: none; border-color: var(--violet); background: var(--surface-2); box-shadow: 0 0 0 3px rgba(124,92,255,.16); }
.field input:invalid:not(:placeholder-shown) { border-color: rgba(255,107,169,.55); }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa0b5' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.field select option { background: #12121e; }
#w-submit { margin-top: 4px; justify-content: center; }
#w-submit[disabled] { opacity: .6; cursor: progress; }
.form-note { font-size: 13px; min-height: 18px; margin: 2px 0 0; }
.form-note.err { color: #ff8bb5; }
.modal-success { text-align: center; }
.success-check { width: 60px; height: 60px; margin: 4px auto 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; color: #05050a; background: var(--grad); box-shadow: 0 0 30px rgba(52,227,208,.5); animation: pop .4s var(--ease); }
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.12); } }
.modal-success h3 { font-size: 24px; margin-bottom: 8px; }
.modal-success .btn { margin-top: 20px; }
body.modal-lock { overflow: hidden; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.cards .reveal:nth-child(2) { transition-delay: .08s; }
.cards .reveal:nth-child(3) { transition-delay: .16s; }
.feature-grid .reveal:nth-child(2){transition-delay:.05s}.feature-grid .reveal:nth-child(3){transition-delay:.1s}
.feature-grid .reveal:nth-child(4){transition-delay:.15s}.feature-grid .reveal:nth-child(5){transition-delay:.2s}.feature-grid .reveal:nth-child(6){transition-delay:.25s}
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .cards, .feature-grid { grid-template-columns: 1fr; }
  .steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); margin: 4px auto; }
  .split { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr; }
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .nav.mobile-open { flex-wrap: wrap; }
  .nav.mobile-open .nav-links { display: flex; flex-direction: column; width: 100%; gap: 4px; margin: 12px 0 0; }
  .nav.mobile-open .nav-cta { display: flex; width: 100%; }
  .nav.mobile-open .nav-cta .btn { flex: 1; justify-content: center; }
}
@media (max-width: 560px) {
  .band { padding: 64px 20px; }
  .hero-stats { gap: 24px; }
  .foot-cols { grid-template-columns: repeat(2,1fr); }
}
