/* xoinx.io — homepage
   System: serif headlines (Source Serif 4), Plex Sans text, Plex Mono only for
   literal data (indexes, table names). 12-column grid; section labels live in
   the left margin (cols 1–3), content in cols 4–12. Hairline rules instead of
   boxes; one accent (amber) reserved for live data. */
:root {
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #0d0d0c;
  --band: #151513;
  --text: #edebe6;
  --text-2: #c9c6be;
  --muted: #8f8c84;
  --rule: #2a2926;
  --rule-strong: #403e3a;
  --live: #e3a440;

  --gutter: clamp(16px, 2.2vw, 32px);
  --edge: clamp(20px, 4vw, 56px);
  --section: clamp(80px, 10vw, 144px);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 17px; line-height: 1.55; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

.container { max-width: 1360px; margin: 0 auto; padding-inline: var(--edge); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }

/* Type */
h1, h2, h3 { font-weight: 400; }
h2 { font-family: var(--serif); font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.08; letter-spacing: -0.015em; max-width: 20ch; }
.label { font-size: 13px; font-weight: 500; letter-spacing: 0.01em; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.label::before { content: ''; width: 24px; height: 1px; background: var(--rule-strong); }
.intro { color: var(--muted); max-width: 58ch; margin-top: 22px; }

/* Controls */
.btn { display: inline-block; background: var(--text); color: var(--bg); padding: 14px 22px; border-radius: 2px; font-size: 15px; font-weight: 500; text-decoration: none; transition: background-color .2s; }
.btn:hover { background: #fff; }
.text-link { font-size: 15px; font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: var(--rule-strong); transition: text-decoration-color .2s; }
.text-link:hover { text-decoration-color: var(--text); }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.wordmark { font-weight: 600; font-size: 22px; letter-spacing: -0.03em; text-decoration: none; }
.masthead-nav { display: flex; gap: 32px; font-size: 14px; color: var(--muted); }
.masthead-nav a { text-decoration: none; transition: color .2s; }
.masthead-nav a:hover { color: var(--text); }

/* Hero: headline across 11 columns, body offset right, stack anchored left */
.hero { padding-block: clamp(72px, 11vw, 152px) clamp(72px, 9vw, 128px); row-gap: 0; }
.hero-label { grid-column: 1 / -1; margin-bottom: 32px; }
.hero-title { grid-column: 1 / span 11; font-family: var(--serif); font-size: clamp(3.1rem, 7.2vw, 5.75rem); line-height: 1.02; letter-spacing: -0.022em; max-width: 15ch; }
.hero-body { grid-column: 6 / span 6; grid-row: 3; margin-top: clamp(40px, 5vw, 64px); }
.lead { font-size: 19px; line-height: 1.55; color: var(--text-2); max-width: 46ch; }
.actions { display: flex; align-items: center; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.stack { grid-column: 1 / span 4; grid-row: 3; align-self: end; font-size: 13px; color: var(--muted); max-width: 30ch; }

/* Sections */
/* Dividers are drawn at content width, matching every other rule on the page */
.section, .footer { background: linear-gradient(var(--rule), var(--rule)) no-repeat center top / calc(100% - 2 * var(--edge)) 1px; }
.section { padding-block: var(--section); }
.band + .section { background: none; }
.section-label { grid-column: 1 / span 3; align-self: start; padding-top: 14px; }
.section-head { grid-column: 4 / span 8; }

/* How it works: ruled rows, not cards */
.steps { grid-column: 1 / -1; margin-top: clamp(56px, 7vw, 96px); }
.step { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); padding: 36px 0 44px; border-top: 1px solid var(--rule); }
.step:last-child { border-bottom: 1px solid var(--rule); }
.step-num { grid-column: 1 / span 3; font-family: var(--serif); font-size: clamp(2.5rem, 4vw, 3.5rem); line-height: 1; color: var(--muted); font-variant-numeric: lining-nums; }
.step h3 { grid-column: 4 / span 4; font-family: var(--serif); font-size: clamp(1.5rem, 2.2vw, 1.875rem); line-height: 1.2; padding-right: var(--gutter); }
.step-body { grid-column: 8 / span 5; color: var(--text-2); font-size: 16.5px; }
.step-body ul { margin-top: 20px; font-size: 15px; color: var(--muted); }
.step-body li { padding: 7px 0; border-top: 1px solid var(--rule); }

/* Data flow band */
.band { background: var(--band); padding-block: var(--section); }
.flow { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: clamp(56px, 7vw, 88px); border-top: 1px solid var(--rule-strong); }
.stage { position: relative; padding-top: 20px; }
.stage-sources { grid-column: 1 / span 3; }
.stage-lake { grid-column: 4 / span 4; }
.stage-live { grid-column: 8 / span 5; }
.stage-lake, .stage-live { border-left: 1px solid var(--rule); padding-left: var(--gutter); }
.stage-lake::before, .stage-live::before { content: '→'; position: absolute; left: -9px; top: 16px; width: 17px; text-align: center; background: var(--band); color: var(--muted); font-size: 14px; line-height: 20px; }
.stage-label { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.ledger li { padding: 13px 0; border-bottom: 1px solid var(--rule); font-size: 16px; }
.layers li { display: grid; grid-template-columns: 28px 1fr; padding: 15px 0 17px; border-bottom: 1px solid var(--rule); }
.layers .idx { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 3px; }
.layers b { font-weight: 600; font-size: 16px; }
.layers p { font-size: 14.5px; color: var(--muted); margin-top: 3px; }
.layers .tables { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: live 2.4s ease-in-out infinite; }
@keyframes live { 50% { opacity: .35; } }

.report { display: block; text-decoration: none; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
#pv-title { font-weight: 600; font-size: 16px; }
#pv-asof { font-size: 13px; color: var(--muted); }
.figures { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; border-top: 1px solid var(--rule); }
.figures > div { padding: 14px 0 16px; border-bottom: 1px solid var(--rule); }
.figures > div:nth-child(odd) { border-right: 1px solid var(--rule); padding-right: 16px; }
.figures > div:nth-child(even) { padding-left: 20px; }
.figures dt { font-size: 13px; color: var(--muted); }
.figures dd { font-family: var(--serif); font-size: clamp(1.9rem, 2.6vw, 2.4rem); line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums lining-nums; }
.spark { margin-top: 22px; }
.spark-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.spark svg { display: block; width: 100%; height: 96px; border-bottom: 1px solid var(--rule); }
.spark-line { fill: none; stroke: var(--live); stroke-width: 1.75; }
.spark-area { fill: color-mix(in srgb, var(--live) 9%, transparent); }
.report:hover #pv-title { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.views { margin-top: 28px; border-top: 1px solid var(--rule); }
.views a { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 15px; text-decoration: none; color: var(--text-2); transition: color .2s; }
.views a::after { content: '→'; color: var(--muted); transition: transform .2s; }
.views a:hover { color: var(--text); }
.views a:hover::after { transform: translateX(3px); }
.stage-live .btn { margin-top: 32px; }

/* Contact: a statement, not a centered card */
.contact-body { grid-column: 4 / span 8; }
.contact-body h2 { font-size: clamp(2.6rem, 5.4vw, 4.5rem); max-width: 16ch; }
.contact-email { display: inline-block; margin-top: 40px; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.4rem); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px; text-decoration-color: var(--rule-strong); transition: text-decoration-color .2s; }
.contact-email:hover { text-decoration-color: var(--text); }

.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 28px; font-size: 13px; color: var(--muted); }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

@media (max-width: 1080px) {
  .hero-body { grid-column: 4 / -1; }
  .stack { grid-column: 1 / span 3; }
  .step-num { grid-column: 1 / span 2; }
  .step h3 { grid-column: 3 / span 4; }
  .step-body { grid-column: 7 / -1; }
  .stage-sources, .stage-lake, .stage-live { grid-column: 1 / -1; }
  .stage-lake, .stage-live { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-strong); margin-top: 40px; padding-top: 28px; }
  .stage-lake::before, .stage-live::before { content: '↓'; left: 0; top: -11px; width: auto; padding-right: 8px; }
  .ledger { display: flex; flex-wrap: wrap; column-gap: 28px; }
  .ledger li { border-bottom: 0; padding: 4px 0; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .masthead-nav { gap: 20px; }
  .hero-title, .hero-body, .stack, .section-label, .section-head, .contact-body { grid-column: 1 / -1; }
  .hero-body { grid-row: auto; }
  .stack { grid-row: auto; margin-top: 48px; }
  .section-label { padding-top: 0; margin-bottom: 24px; }
  .step { display: block; padding: 28px 0 32px; }
  .step-num { display: block; font-size: 2.25rem; margin-bottom: 14px; }
  .step h3 { padding-right: 0; margin-bottom: 14px; }
  .lead { font-size: 17px; }
}
@media (max-width: 420px) {
  .masthead-nav a:not([href="#demo"]) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-dot { animation: none; }
}
