/* Kept website. Dark, flat, one radius, one button shape. Palette "Ink & sky". */
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --ground: #10181d;
  --panel: #1b262c;
  --panel-2: #223139;
  --ink: #e6f1f7;
  --muted: #a1b5c1;
  --accent: #bbe1fa;
  --on-accent: #1b262c;
  --sky: #3282b8;
  --deep: #0f4c75;
  --light: #e9f3f9;
  --light-ink: #1b262c;
  --light-muted: #4b5f6b;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-small: 15px;
  --t-body: 17px;
  --t-lead: clamp(20px, 1.7vw, 24px);
  --t-head: clamp(28px, 2.8vw, 40px);
  --t-display: clamp(40px, 5vw, 76px);

  --margin: clamp(20px, 2.4vw, 32px);
  --radius: 18px;
  --gap-section: clamp(120px, 14vw, 200px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 450 var(--t-body) / 1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--sky); text-decoration-thickness: 2px; text-underline-offset: 4px; transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease); }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--sky); color: #fff; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
h2 { font-size: var(--t-head); }
h3 { font-size: var(--t-body); letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--accent); color: var(--on-accent); padding: 10px 18px; border-radius: 999px; }
.skip:focus { left: 8px; }

.button {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; text-decoration: none;
  padding: 10px 20px; border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.2s var(--ease);
}
.button:hover { background: #d4edfd; color: var(--on-accent); transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(0.97); }

/* ===== Navigation: plain links, top right ===== */
.nav {
  position: absolute; top: var(--margin); right: var(--margin); z-index: 20;
  display: flex; align-items: center; gap: 28px; font-size: var(--t-small); font-weight: 600;
}
.nav a:not(.button) { text-decoration: none; }
.nav a:not(.button):hover { color: var(--accent); }

/* ===== The split: a fixed stage beside a reading column ===== */
.split { display: grid; grid-template-columns: 47% 53%; }
.stage {
  position: sticky; top: 20px; height: calc(100svh - 40px);
  margin: 20px 0 20px 20px; border-radius: var(--radius); overflow: hidden;
  background: var(--panel);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-mark { position: absolute; width: 46%; left: 27%; top: 50%; transform: translateY(-50%); }
.js .stage-mark.hidden { visibility: hidden; }
.stage-pic {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06); transition: opacity 0.9s var(--ease), transform 6s linear;
}
.stage-pic.on { opacity: 1; transform: scale(1); }
.column { position: relative; padding: 0 var(--margin) 0 clamp(40px, 6vw, 96px); }

.hero { position: relative; min-height: 100svh; }
.lead { position: absolute; top: 34%; left: 0; max-width: 24ch; font-size: var(--t-lead); line-height: 1.35; font-weight: 500; }
.wordmark {
  position: absolute; right: 0; bottom: 40px; z-index: 5;
  width: min(62vw, 92svh); margin-right: calc(-1 * var(--margin) + 4px);
  color: var(--accent); transform-origin: 100% 100%;
}
.wordmark svg { width: 100%; height: auto; }

.intro { max-width: 34ch; padding: 64px 0 160px; display: grid; gap: 24px; }
.intro p { color: var(--muted); }
.intro p:first-child { color: var(--ink); font-size: var(--t-lead); line-height: 1.4; }
.intro strong { font-weight: 600; }

/* ===== Features: small proof beside text ===== */
.features { padding-bottom: var(--gap-section); }
.features h2 { margin-bottom: 64px; }
.module { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 300px); gap: 24px; align-items: start; margin-bottom: 104px; }
.module:last-child { margin-bottom: 0; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 20px; font-size: var(--t-small); line-height: 1.5; overflow: hidden; }
.text { display: grid; gap: 10px; }
.text p { color: var(--muted); font-size: 16px; }

/* Interface fragments (data-ui) keep the product's own look */
.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--muted); }
.tree li { padding-left: 18px; position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 7px; height: 7px; border-radius: 2px; background: var(--panel-2); }
.tree .dir { color: var(--ink); padding-left: 0; font-weight: 600; }
.tree .dir::before { display: none; }
.tree span { color: var(--accent); font-weight: 700; margin-left: 6px; }
.picker, .opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.picker li, .opts li { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.picker i, .opts i { width: 16px; height: 16px; border-radius: 5px; background: var(--ground); flex-shrink: 0; }
.picker .on i, .opts .on i { background: var(--sky); }
.picker span { margin-left: auto; color: var(--muted); }
.opts .name { justify-content: space-between; color: var(--muted); }
.opts b { color: var(--accent); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips span { background: var(--panel-2); border-radius: 999px; padding: 4px 12px; color: var(--muted); }
.chips .on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumbs img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; height: auto; }

/* ===== Showcase: input half, output half ===== */
.showcase { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: 92svh; margin-top: 20px; }
.field { padding: clamp(48px, 9svh, 96px) var(--margin) 180px; }
.field-dark { background: var(--deep); padding-left: clamp(24px, 8vw, 120px); }
.field-light { background: var(--light); color: var(--light-ink); display: flex; justify-content: center; }
.demo-label { display: block; max-width: 34ch; color: var(--ink); font-size: 16px; margin-bottom: 20px; }
#demo-input {
  width: 100%; max-width: 34ch; min-height: 15em; resize: vertical;
  background: transparent; color: var(--ink); border: 0; outline: 0; padding: 0;
  font: 500 clamp(18px, 1.5vw, 22px) / 1.6 var(--font);
  caret-color: var(--accent);
}
#demo-input:focus-visible { outline: 3px solid var(--accent); outline-offset: 10px; }
.chatui { width: min(100%, 480px); align-self: flex-start; background: #fff; border-radius: var(--radius); padding: 16px 16px 20px; color: var(--light-ink); }
.chat-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.chat-name { font-weight: 700; font-size: 16px; flex: 1; }
#demo-search { width: 46%; font: inherit; font-size: 15px; padding: 7px 14px; border-radius: 999px; border: 0; background: var(--light); color: var(--light-ink); }
.chat-day { text-align: center; font-size: 13px; font-weight: 600; color: var(--light-muted); margin: 12px 0; }
.chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 260px; }
.chat-list li { max-width: 78%; padding: 8px 13px; border-radius: 18px; background: var(--light); font-size: 15px; line-height: 1.4; align-self: flex-start; animation: pop 0.45s var(--ease) both; }
.chat-list li.me { align-self: flex-end; background: var(--deep); color: #fff; }
.chat-list li.photo { padding: 4px; background: transparent; }
.chat-list li.photo img { width: 220px; height: auto; border-radius: 14px; }
.chat-list li.dim { opacity: 0.35; }
.chat-list mark { background: #ffe58a; color: inherit; border-radius: 3px; }
.chat-count { font-size: 13px; color: var(--light-muted); margin-top: 12px; text-align: center; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.split-title { position: absolute; left: 0; right: 0; bottom: 32px; display: grid; grid-template-columns: 1fr 1fr; font-size: var(--t-display); letter-spacing: -0.035em; pointer-events: none; }
.split-title .a { padding-left: clamp(24px, 8vw, 120px); color: var(--accent); }
.split-title .b { padding-left: var(--margin); color: var(--light-ink); }

/* ===== How it works: pinned popup, changing state ===== */
.how { display: grid; grid-template-columns: 5fr 1fr 6fr; margin: var(--gap-section) 20px 0; padding: 96px var(--margin) 40px clamp(24px, 8vw, 120px); background: var(--panel); border-radius: var(--radius); }
.how-steps h2 { margin-bottom: 8vh; }
.step { min-height: 56vh; display: grid; align-content: center; gap: 12px; max-width: 30ch; }
.step .big { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; color: var(--muted); transition: color 0.4s var(--ease); }
.step p:last-child { color: var(--muted); }
.step.active .big { color: var(--ink); }
.how-stage { grid-column: 3; }
.popup { position: sticky; top: 16vh; width: min(100%, 360px); margin: 0 auto; background: var(--ground); border-radius: var(--radius); padding: 18px 16px; font-size: 13px; }
.popup-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 14px; color: var(--ink); }
.popup-head svg { width: 18px; height: 18px; color: var(--accent); }
.popup-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--panel); border-radius: 12px; padding: 4px; margin-bottom: 12px; text-align: center; font-weight: 700; color: var(--muted); }
.popup-tabs span { padding: 7px; border-radius: 9px; }
.popup-tabs .on { background: var(--accent); color: var(--on-accent); }
.popup-card { background: var(--panel); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.popup-status { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.popup-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background 0.3s; }
.popup-status span { display: none; }
.popup-count { margin-bottom: 10px; color: var(--muted); }
.popup-count b { font-size: 30px; color: var(--ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.popup-bar { height: 4px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.popup-bar span { display: block; height: 100%; width: 0; background: var(--sky); border-radius: 4px; transition: width 1.2s var(--ease); }
.popup-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-weight: 700; text-align: center; }
.popup-buttons span { padding: 10px; border-radius: 12px; background: var(--panel-2); color: var(--muted); transition: background 0.3s, color 0.3s; }
.popup-buttons .primary { grid-column: 1 / -1; }
.popup[data-state="1"] .s1, .popup[data-state="2"] .s2, .popup[data-state="3"] .s3 { display: inline; }
.popup[data-state="1"] .primary { background: var(--accent); color: var(--on-accent); }
.popup[data-state="2"] .popup-status i { background: var(--sky); animation: pulse 1.4s infinite; }
.popup[data-state="2"] .popup-buttons span:nth-child(2) { background: var(--accent); color: var(--on-accent); }
.popup[data-state="2"] .popup-bar span { width: 62%; }
.popup[data-state="3"] .popup-status i { background: #5fd3a5; }
.popup[data-state="3"] .popup-bar span { width: 100%; }
.popup[data-state="3"] .popup-buttons span:nth-child(3) { background: var(--accent); color: var(--on-accent); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ===== Where it goes: plain names in columns ===== */
.where { display: grid; grid-template-columns: 3fr 1fr 8fr; padding: var(--gap-section) var(--margin) 0 clamp(24px, 8vw, 120px); }
.names { grid-column: 3; columns: 4 170px; column-gap: 32px; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; }
.names p { break-inside: avoid; }
.names .kind { color: var(--muted); break-before: column; }
.names .kind:first-child { break-before: auto; }
.names a { text-decoration: none; color: var(--accent); }
.names a:hover { text-decoration: underline; }

/* ===== Status: sticky check card, active list ===== */
.status { display: grid; grid-template-columns: 5fr 1fr 6fr; padding: var(--gap-section) var(--margin) 0 clamp(24px, 8vw, 120px); align-items: start; }
.status-stage { position: sticky; top: 12vh; }
.check { background: var(--panel); border-radius: var(--radius); padding: 20px; font-size: 14px; max-width: 420px; }
.check-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
.check-head span { color: var(--muted); font-weight: 500; }
.check ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.check li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--muted); transition: background 0.3s var(--ease), color 0.3s; }
.check li i { width: 8px; height: 8px; border-radius: 50%; background: #5fd3a5; flex-shrink: 0; }
.check li.on { background: var(--panel-2); color: var(--ink); }
.status-list { grid-column: 3; }
.status-list h2 { margin-bottom: 20px; }
.status-note { color: var(--muted); max-width: 40ch; margin-bottom: 40px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: 14px 0; cursor: default; }
.rows .row-head { display: flex; justify-content: space-between; gap: 16px; font-size: clamp(19px, 1.5vw, 22px); font-weight: 600; color: var(--muted); transition: color 0.3s var(--ease); }
.rows .row-head span { font-size: var(--t-small); font-weight: 500; white-space: nowrap; padding-top: 4px; }
.rows .row-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease); }
.rows .row-body p { overflow: hidden; color: var(--muted); max-width: 40ch; font-size: 16px; }
.rows li.on .row-head { color: var(--ink); }
.rows li.on .row-head span { color: #5fd3a5; }
.rows li.on .row-body { grid-template-rows: 1fr; }
.rows li.on .row-body p { padding-top: 6px; }

/* ===== Install + the one action ===== */
.install { padding: var(--gap-section) var(--margin) 0 clamp(24px, 8vw, 120px); max-width: calc(46ch + 240px); }
.install h2 { margin-bottom: 28px; }
.install ol { margin: 0 0 24px; padding-left: 1.2em; display: grid; gap: 10px; font-size: var(--t-lead); line-height: 1.4; }
.install ol li::marker { color: var(--accent); font-weight: 700; }
.install-note { color: var(--muted); max-width: 42ch; }
.cta { padding: 22svh 0 4svh; }
.cta p:first-child { font-size: var(--t-lead); max-width: 34ch; }
.cta-actions { display: flex; align-items: center; gap: 24px; margin-top: 24px; flex-wrap: wrap; }

/* ===== FAQ: answers as reading text ===== */
.faq { display: grid; grid-template-columns: 3fr 1fr 8fr; padding: var(--gap-section) var(--margin) 0 clamp(24px, 8vw, 120px); }
.answers { grid-column: 3; columns: 2 300px; column-gap: 56px; }
.answers p { break-inside: avoid; margin-bottom: 20px; }
.answers b { font-weight: 700; }

/* ===== Footer: one quiet line ===== */
.footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: baseline; padding: 30svh var(--margin) 30px; font-size: var(--t-small); color: var(--muted); }
.footer .links { display: flex; gap: 24px; }
.footer p:nth-child(3) { text-align: right; }
.footer .credits { grid-column: 1 / -1; color: var(--muted); max-width: 58ch; padding-top: 24px; }
.footer .credits a { color: var(--ink); }

/* ===== Reading pages (changelog, privacy) ===== */
.page { max-width: 68ch; padding: 140px var(--margin) 0; margin: 0 auto; }
.home { position: absolute; top: var(--margin); left: var(--margin); display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.home svg { width: 26px; height: 26px; color: var(--accent); }
.page h1 { font-size: var(--t-display); letter-spacing: -0.035em; margin-bottom: 40px; }
.page h2 { margin: 72px 0 16px; font-size: var(--t-head); }
.page h3 { margin: 32px 0 8px; font-size: 19px; }
.page p, .page li { color: var(--muted); }
.page p { margin: 0 0 16px; }
.page strong { color: var(--ink); font-weight: 650; }
.page ul, .page ol { padding-left: 1.2em; margin: 0 0 16px; display: grid; gap: 8px; }
.page code { font-size: 0.92em; background: var(--panel); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
.page table { border-collapse: collapse; width: 100%; margin: 0 0 24px; font-size: 16px; }
.page th, .page td { text-align: left; vertical-align: top; padding: 10px 12px; background: var(--panel); }
.page th { color: var(--ink); background: var(--panel-2); }
.page tr + tr td { border-top: 4px solid var(--ground); }
.page + .footer { padding-top: 20svh; }

/* ===== Entrances (only when the script runs) ===== */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .module.reveal .panel { transform: translateY(16px); transition: transform 0.9s var(--ease); }
.js .module.reveal.in .panel { transform: none; }

/* ===== Phone ===== */
@media (max-width: 860px) {
  .nav { gap: 16px; left: var(--margin); justify-content: flex-end; }
  .nav a:not(.button):not([href="#features"]) { display: none; }
  .split { display: block; }
  .stage { position: relative; top: 0; height: 58svh; margin: 12px; }
  .column { padding: 0 20px; }
  .hero { min-height: auto; display: flex; flex-direction: column; }
  .wordmark { order: -1; position: relative; right: auto; bottom: auto; width: 84vw; margin: -9vw 0 0 auto; }
  .lead { position: static; max-width: none; margin-top: 20px; font-size: 19px; }
  .intro { max-width: 78%; padding: 72px 0 96px; }
  .module { grid-template-columns: 1fr; gap: 16px; margin-bottom: 64px; }
  .showcase { grid-template-columns: 1fr; }
  .field { padding: 48px 20px 110px; }
  .field-dark { padding-left: 20px; }
  .field-dark { order: 1; padding-bottom: 24px; }
  .split-title { display: contents; font-size: 11vw; }
  .split-title .a { order: 2; display: block; background: var(--deep); padding: 0 20px 32px; }
  .split-title .b { order: 3; display: block; background: var(--light); padding: 32px 20px 0; }
  .field-light { order: 4; padding-top: 20px; }
  .where, .status, .faq { display: block; padding: 120px 20px 0; }
  .how { display: flex; flex-direction: column; margin: 120px 12px 0; padding: 64px 20px 24px; }
  .how-stage { order: -1; margin-bottom: 40px; }
  .popup { position: static; }
  .step { min-height: 0; margin-bottom: 40px; }
  .step .big { color: var(--ink); }
  .where h2, .faq h2 { margin-bottom: 24px; }
  .names { columns: 2; column-gap: 20px; font-size: 17px; }
  .names .kind { break-before: auto; margin-top: 32px; }
  .status-stage { position: static; margin-bottom: 40px; }
  .install { padding: 120px 20px 0; }
  .answers { columns: 1; }
  .footer { grid-template-columns: 1fr; gap: 8px; padding: 20svh 20px 24px; }
  .footer p:nth-child(3) { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .js .reveal, .js .module.reveal .panel { opacity: 1; transform: none; }
  .stage-pic { transform: none; }
}
