/* Xoonex — dark-first editorial studio site. Hand-written, no build step. */

:root {
  --paper: #08090b;
  --surface: #0f1115;
  --surface-2: #14171c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #f4f2ee;
  --ink-2: rgba(244, 242, 238, 0.66);
  --ink-3: rgba(244, 242, 238, 0.42);
  --accent: #e9b872;
  --accent-ink: #1a1509;
  --live: #4ec98a;
  --beta: #7cc2f5;
  --dev: #e0a03c;
  --shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.9);
  --serif: "Instrument Serif", Iowan Old Style, Charter, Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --page: 1120px;
  --gut: clamp(20px, 5vw, 56px);
}

[data-theme="light"] {
  --paper: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f2ed;
  --line: rgba(20, 18, 14, 0.12);
  --line-strong: rgba(20, 18, 14, 0.24);
  --ink: #16150f;
  --ink-2: rgba(22, 21, 15, 0.7);
  --ink-3: rgba(22, 21, 15, 0.5);
  --accent: #9a6b17;
  --accent-ink: #fffaf0;
  --live: #1f7a4d;
  --beta: #1b5f96;
  --dev: #8a5a12;
  --shadow: 0 20px 44px -30px rgba(20, 18, 14, 0.45);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
}
.skip:focus { left: 12px; }

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px var(--gut);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.top[data-stuck="1"] { border-bottom-color: var(--line); }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark { width: 22px; height: 22px; overflow: visible; }
.brand__mark path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: square;
}
.brand__mark-accent { stroke: var(--accent); }
.brand__word {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.top__nav {
  margin-left: auto;
  display: flex;
  gap: 26px;
  font-size: 14px;
  color: var(--ink-2);
}
.top__nav a { position: relative; padding: 4px 0; }
.top__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}
.top__nav a:hover { color: var(--ink); }
.top__nav a:hover::after { right: 0; }

.top__tools { display: flex; gap: 8px; }
.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.tool:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
[data-theme="dark"] .ico-sun { display: block; }
[data-theme="dark"] .ico-moon { display: none; }
[data-theme="light"] .ico-sun { display: none; }
[data-theme="light"] .ico-moon { display: block; }

/* ---------- hero ---------- */

main { display: block; }

.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(64px, 12vh, 132px) var(--gut) clamp(48px, 8vh, 88px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent);
}

.hero__title {
  margin: 26px 0 0;
  max-width: 20ch;
  font-family: var(--serif);
  font-size: clamp(44px, 8.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero__title em { font-style: italic; color: var(--accent); }

.hero__lead {
  margin-top: 26px;
  max-width: 60ch;
  font-size: clamp(16px, 1.4vw, 18.5px);
  color: var(--ink-2);
}

.hero__cta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn:hover { background: var(--surface); transform: translateY(-1px); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, #ffffff);
  border-color: color-mix(in srgb, var(--accent) 85%, #ffffff);
}
.btn span { font-size: 12px; opacity: 0.7; }

.stats {
  margin: clamp(52px, 9vh, 92px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.stat { padding: 20px 22px; background: var(--paper); }
.stat dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stat dd {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ---------- sections ---------- */

.section {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(64px, 11vh, 128px) var(--gut) 0;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.section__title {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.05;
}
.section__note { font-size: 14.5px; color: var(--ink-3); max-width: 46ch; }

/* ---------- products ---------- */

.product {
  --media-col: 0.7fr;
  display: grid;
  grid-template-columns: minmax(0, var(--media-col)) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(46px, 7vh, 82px) 0;
  border-bottom: 1px solid var(--line);
}
.product:nth-of-type(odd) { grid-template-columns: minmax(0, 1fr) minmax(0, var(--media-col)); }
.product:nth-of-type(odd) > .product__media { order: 2; }

/* per-product accent + media share (in CSS, so no inline styles are needed under CSP) */
.product--vesti { --p: #00d9f5; --media-col: 0.6fr; }
.product--finpulse { --p: #2985ff; --media-col: 1.45fr; }
.product--fitly { --p: #0c94e8; --media-col: 0.6fr; }
.product--kaza { --p: #c9503c; --media-col: 0.74fr; }

.product__media { position: relative; }
.product__media img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.product__media::after {
  content: "";
  position: absolute;
  inset: auto 0 -12% 0;
  height: 60%;
  background: radial-gradient(60% 100% at 50% 100%, color-mix(in srgb, var(--p) 22%, transparent), transparent 70%);
  filter: blur(26px);
  z-index: -1;
  pointer-events: none;
}
.product__media--wide img { border-radius: 10px; }
.product__media--phone img {
  width: auto;
  max-height: 600px;
  margin-inline: auto;
}
.product__media--panel::after { display: none; }

.product__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.product__head h3 {
  font-family: var(--serif);
  font-size: clamp(27px, 3.4vw, 38px);
  line-height: 1.1;
}
.product__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  object-fit: cover;
}
.product__icon--glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--p, var(--ink-2));
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status--live { color: var(--live); border-color: color-mix(in srgb, var(--live) 34%, transparent); }
.status--beta { color: var(--beta); border-color: color-mix(in srgb, var(--beta) 34%, transparent); }
.status--dev { color: var(--dev); border-color: color-mix(in srgb, var(--dev) 34%, transparent); }

.product__lead {
  margin-top: 18px;
  max-width: 54ch;
  font-size: 16.5px;
  color: var(--ink-2);
}

.feat { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.feat li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  color: var(--ink-2);
}
.feat li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 9px;
  height: 1px;
  background: var(--p, var(--accent));
}

.disclosure {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 2px solid var(--p, var(--accent));
  background: var(--surface);
  font-size: 14px;
  color: var(--ink-2);
}

.chips, .stack, .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.chips span, .stack span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.links { margin-top: 20px; gap: 18px; font-size: 14.5px; }
.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.links a:hover { color: var(--p, var(--accent)); border-bottom-color: var(--p, var(--accent)); }
.links a span { font-size: 11px; }
.links__muted { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* metrics panel (kaza) */

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}
.panel__rows { margin: 16px 0 0; display: grid; gap: 1px; background: var(--line); }
.panel__rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px;
  background: var(--surface);
}
.panel__rows dt { font-size: 13.5px; color: var(--ink-3); }
.panel__rows dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.panel__foot {
  margin-top: 16px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-3);
}

/* ---------- approach ---------- */

.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.rules li { padding: clamp(26px, 4vw, 40px) clamp(20px, 3vw, 34px); background: var(--paper); }
.rules__num {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.rules h3 {
  margin: 14px 0 10px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 28px);
}
.rules p { font-size: 15px; color: var(--ink-2); max-width: 44ch; }

.stack { margin-top: 30px; }

/* ---------- contact ---------- */

.section--contact {
  padding-bottom: clamp(64px, 11vh, 128px);
  text-align: center;
}
.section--contact .section__title { max-width: none; }
.contact__lead {
  margin: 18px auto 0;
  max-width: 54ch;
  font-size: 16.5px;
  color: var(--ink-2);
}
.contact__links { margin-top: 30px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* ---------- footer ---------- */

.foot {
  max-width: var(--page);
  margin: 0 auto;
  padding: 30px var(--gut) 46px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  font-size: 13.5px;
  color: var(--ink-3);
}
.foot__brand { font-family: var(--mono); letter-spacing: 0.22em; color: var(--ink-2); }
.foot__note { font-family: var(--mono); font-size: 12px; }
.foot__links { margin-left: auto; display: flex; gap: 18px; }
.foot__links a:hover { color: var(--ink); }

/* ---------- reveal ----------
   Scroll-driven, CSS-only, no JS. Deliberately fades from 0.55 rather than 0:
   a renderer that never scrolls (crawlers, print, headless full-page capture)
   evaluates the timeline at 0% for off-screen elements, so the start state must
   still be readable. Browsers without animation-timeline skip it entirely. */

@keyframes reveal-in {
  from { opacity: 0.55; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .stats,
    .section__head,
    .product,
    .rules li,
    .section--contact > * {
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 4% cover 20%;
    }
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product { grid-template-columns: 1fr; gap: 30px; }
  .product:nth-of-type(odd) { grid-template-columns: 1fr; }
  .product:nth-of-type(odd) > .product__media { order: 0; }
  .product__media { max-width: 380px; }
  .product__media--wide { max-width: none; }
  .product__media--panel { max-width: none; }
  .rules { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .top { gap: 12px; padding: 12px var(--gut); }
  .top__nav { display: none; }
  .top__tools { margin-left: auto; }
  .hero__title { font-size: clamp(36px, 11vw, 54px); max-width: none; }
  .stat dd { font-size: 28px; }
  .foot { flex-direction: column; align-items: flex-start; }
  .foot__links { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

@media print {
  .top, .top__tools, .hero__cta { display: none; }
  body { background: #fff; color: #000; }
}
