/* Topolyz — landing page
   Visual language shared with the product: blueprint ink, teal = source fact, amber = what the AI / the view decides. */

:root {
  --ink: #0b1017;
  --ink-2: #0e1520;
  --panel: #101926;
  --grid: rgba(120, 160, 210, 0.05);
  --line: #1b2737;
  --line-strong: #2a3b52;
  --text: #e6edf5;
  --text-dim: #93a4b8;
  --text-faint: #5d6f85;
  --blue: #5aa9ff;
  --teal: #35d0ba;
  --amber: #ffb547;
  --red: #ff6b5a;
  --display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

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

a { color: inherit; }
::selection { background: rgba(90, 169, 255, 0.35); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px;
  background: var(--blue); color: #06121f; border-radius: 6px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.wrap.narrow { width: min(780px, 100% - 48px); }

/* ------------------------------------------------------------------ navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  /* same horizontal bounds as the hero, so the logo sits exactly above the headline */
  padding: 12px max(24px, calc((100% - 1320px) / 2));
  background: rgba(9, 13, 19, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap; }
.brand svg { width: 36px; height: 36px; color: var(--blue); flex: none; }
.brand svg path { stroke-width: 1.9; }
.brand-name { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.brand-name b { color: var(--blue); font-weight: inherit; }
.brand-by { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--text-faint); padding-top: 8px; }

.nav nav { display: flex; gap: 26px; margin-left: auto; }
.nav nav a { font-size: 14.5px; color: var(--text-dim); text-decoration: none; transition: color 0.15s; }
.nav nav a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 14px; }

.lang {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--text-dim); text-decoration: none;
  padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 5px; transition: color 0.15s, border-color 0.15s;
}
.lang:hover { color: var(--text); border-color: var(--text-faint); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 8px;
  font-family: var(--display); font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: #06121f; background: linear-gradient(180deg, #8ccaff, #4f9cf0);
  box-shadow: 0 0 0 1px rgba(140, 202, 255, 0.35), 0 12px 40px rgba(79, 156, 240, 0.28);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(140, 202, 255, 0.6), 0 18px 50px rgba(79, 156, 240, 0.42); }
.btn.small { padding: 8px 16px; font-size: 14px; box-shadow: none; }
.btn.small:hover { transform: none; filter: brightness(1.1); box-shadow: none; }
.btn.large { padding: 17px 38px; font-size: 18px; }
.btn.ghost { color: var(--text); background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--text-faint); transform: none; }

/* ------------------------------------------------------------------ typography */
.kicker {
  margin: 0 0 16px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue);
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.022em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(38px, 4.6vw, 60px); line-height: 1.04; }
h1 em { font-style: normal; color: var(--teal); }
h2 { font-size: clamp(29px, 3.2vw, 42px); line-height: 1.1; max-width: 22ch; }
h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.012em; }

.sub { margin: 24px 0 0; font-size: 19px; line-height: 1.6; color: var(--text-dim); max-width: 54ch; }
.lead { margin: 20px 0 0; font-size: 19px; color: var(--text-dim); max-width: 62ch; }
.fineprint { margin: 18px 0 0; font-family: var(--mono); font-size: 12px; color: var(--text-faint); }

.principle {
  margin: 34px 0 0; padding-left: 16px; border-left: 2px solid var(--line-strong);
  font-family: var(--display); font-size: 19px; line-height: 1.4; color: var(--text);
}
.principle b { font-weight: 600; }
.principle.center { margin: 56px auto 0; padding: 0; border: 0; text-align: center; font-size: clamp(21px, 2.4vw, 28px); }
.amber { color: var(--amber); }
.teal { color: var(--teal); }

/* ------------------------------------------------------------------ hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr); gap: 56px; align-items: center;
  padding: 84px max(24px, calc((100% - 1320px) / 2)) 96px;
  background:
    radial-gradient(900px 480px at 78% 8%, rgba(90, 169, 255, 0.1), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 36px 36px;
  border-bottom: 1px solid var(--line);
}
.hero-copy { animation: rise 0.7s ease-out both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.demo {
  margin: 0; padding: 16px 16px 12px;
  background: linear-gradient(180deg, rgba(16, 25, 38, 0.92), rgba(11, 16, 23, 0.92));
  border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(90, 169, 255, 0.05);
  animation: rise 0.7s 0.15s ease-out both;
}
.demo-bar {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 6px 6px 14px;
  background: #0a0f16; border: 1px solid var(--line-strong); border-radius: 8px;
}
.demo-caret { font-family: var(--mono); font-size: 18px; color: var(--blue); line-height: 1; }
.demo-prompt { flex: 1; min-width: 0; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-prompt::after { content: ''; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.16em; background: var(--blue); animation: blink 1s steps(2) infinite; }
.demo-button { flex: none; padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; color: #06121f; background: linear-gradient(180deg, #7cc0ff, #4f9cf0); }

.demo-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 30px; margin: 10px 2px 2px; }
.demo-chips .label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); margin-right: 4px; }
.demo-chips .chip {
  padding: 2px 9px; border-radius: 4px; font-size: 12px; color: #d9fff8;
  border: 1px solid rgba(53, 208, 186, 0.5); background: rgba(53, 208, 186, 0.1);
  animation: pop 0.3s ease-out both;
}

#demo-svg { display: block; width: 100%; height: auto; margin-top: 4px; }
#demo-svg .site { fill: rgba(15, 24, 37, 0.75); stroke: #2a3b52; stroke-width: 1; transition: opacity 0.7s, stroke-dasharray 0.4s; }
#demo-svg .site.transit { stroke-dasharray: 5 5; }
#demo-svg .site-label { font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; fill: #a9bbd0; text-anchor: middle; transition: opacity 0.7s; }
#demo-svg .hair { stroke: #5b7390; stroke-width: 0.75; opacity: 0.75; }
#demo-svg .wan { fill: none; stroke: #9bd8ff; stroke-width: 2; transition: opacity 0.7s; }
#demo-svg .link { stroke: #4f8fd1; stroke-width: 1.4; transition: opacity 0.6s; }
#demo-svg .link.agg { stroke: var(--amber); stroke-dasharray: 5 4; stroke-width: 2; }
#demo-svg .dot { transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.7s; }
#demo-svg .dot circle { fill: #111b29; stroke-width: 1.8; transition: stroke 0.5s, r 0.5s, fill 0.5s; }
#demo-svg .dot.agg circle { stroke: var(--amber); stroke-dasharray: 3.5 2.5; fill: #1d1a12; }

.demo-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; min-height: 28px; padding: 6px 4px 0; border-top: 1px solid var(--line); }
.demo-count { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--text); }
.demo-note { font-family: var(--mono); font-size: 11.5px; color: var(--teal); }
.demo-note.raw { color: #ff9d8f; }
.demo-note.derived { color: var(--amber); }
figcaption { margin-top: 10px; font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--text-faint); }

/* ------------------------------------------------------------------ sections */
section { padding: 104px 0; }
.band { background: var(--ink-2); border-block: 1px solid var(--line); }

.grid { display: grid; gap: 22px; margin-top: 52px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.pain { padding: 4px 28px 4px 0; }
.pain + .pain { padding-left: 28px; border-left: 1px solid var(--line); }
.num { display: block; margin-bottom: 18px; font-family: var(--mono); font-size: 13px; color: var(--red); letter-spacing: 0.1em; }
.pain h3 { font-size: 23px; }
.pain p, .card p, .use p, .step p { margin: 12px 0 0; font-size: 16px; color: var(--text-dim); }

.card { padding: 28px 28px 30px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; transition: border-color 0.2s, transform 0.2s; }
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.step { position: relative; padding: 30px 26px 8px 0; border-top: 2px solid var(--amber); counter-increment: step; }
.step.graph { border-top-color: var(--teal); }
.step + .step { padding-left: 26px; }
.step::before { content: counter(step, decimal-leading-zero); position: absolute; top: -13px; left: 0; padding-right: 10px; background: var(--ink); font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.step + .step::before { left: 26px; }
.step-tag { display: inline-block; margin-bottom: 12px; padding: 2px 8px; border-radius: 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(255, 181, 71, 0.4); }
.step.graph .step-tag { color: var(--teal); border-color: rgba(53, 208, 186, 0.4); }

.legend { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px dashed var(--line-strong); display: grid; gap: 8px; font-size: 14px; color: var(--text-dim); }
.legend li { display: flex; align-items: center; gap: 10px; }
.sw { flex: none; width: 14px; height: 14px; border-radius: 4px; background: #111b29; }
.sw.source { border: 2px solid var(--teal); }
.sw.derived { border: 2px dashed var(--amber); background: #1d1a12; }
.sw.transit { border: 2px dotted var(--text-dim); opacity: 0.7; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 64px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat { padding: 30px 28px; background: rgba(11, 16, 23, 0.6); }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: clamp(34px, 3.6vw, 48px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--teal); }
.stat span { display: block; margin-top: 12px; font-size: 15px; color: var(--text-dim); }

.use { padding: 30px 0 6px; border-top: 1px solid var(--line-strong); }
.use h3 { font-size: 22px; }
.use h3::before { content: '→'; margin-right: 12px; color: var(--blue); font-family: var(--mono); font-weight: 400; }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.planned { margin: 34px 0 12px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-faint); }
.connectors { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.connectors li { padding: 8px 16px; font-family: var(--mono); font-size: 13.5px; color: var(--text-dim); border: 1px dashed var(--line-strong); border-radius: 6px; }
.status { padding: 28px; border: 1px dashed rgba(255, 181, 71, 0.45); border-radius: 12px; background: rgba(255, 181, 71, 0.04); }
.status h3 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.status p { margin: 14px 0 0; font-size: 16px; color: #e3d3b4; }

details { border-bottom: 1px solid var(--line-strong); }
details:first-of-type { margin-top: 44px; border-top: 1px solid var(--line-strong); }
summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-family: var(--mono); font-weight: 400; color: var(--blue); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 24px; max-width: 66ch; font-size: 16.5px; color: var(--text-dim); }

.final {
  text-align: center;
  background:
    radial-gradient(700px 320px at 50% 100%, rgba(90, 169, 255, 0.12), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 36px 36px;
}
.final h2 { max-width: none; font-size: clamp(32px, 4vw, 52px); }
.final .lead { margin: 22px auto 38px; }

footer { padding: 30px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-faint); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.foot p { margin: 0; }
.foot a { color: var(--text-dim); }
.foot-links { display: flex; align-items: center; gap: 18px; }

/* ------------------------------------------------------------------ legal notice */
.legal { padding: 72px 0 96px; }
.legal h1 { font-size: clamp(32px, 4vw, 46px); margin-bottom: 8px; }
.legal h2 { margin-top: 48px; font-size: 22px; max-width: none; letter-spacing: -0.012em; }
.legal p { margin: 14px 0 0; font-size: 16.5px; color: var(--text-dim); }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--blue); text-underline-offset: 3px; }
.legal .back { margin-top: 56px; font-family: var(--mono); font-size: 13px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 60px; padding-bottom: 72px; }
  .nav nav { display: none; }
  .nav-actions { margin-left: auto; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .step:nth-child(3) { padding-left: 0; }
  .step:nth-child(3)::before { left: 0; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  section { padding: 72px 0; }
  .wrap, .wrap.narrow { width: calc(100% - 36px); }
  .nav { padding-inline: 18px; gap: 12px; }
  .brand-name { font-size: 26px; }
  .brand svg { width: 32px; height: 32px; }
  .brand-by { display: none; }
  .hero { padding-inline: 18px; }
  .grid.three, .grid.two, .stats { grid-template-columns: 1fr; }
  .pain, .pain + .pain { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .pain:first-child { border-top: 0; padding-top: 0; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .step, .step + .step { padding-left: 0; }
  .step::before, .step + .step::before { left: 0; }
  .demo { padding: 12px 12px 10px; }
  .demo-prompt { font-size: 13px; }
  summary { font-size: 18px; }
}

@media (max-width: 560px) {
  /* the hero call-to-action sits right below: the navigation keeps the brand and the language switch */
  .nav .btn.small { display: none; }
  .hero-actions .btn { flex: 1 1 100%; }
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(0.96); } }
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
