/* ─────────────────────────────────────────────────────────
   ATOMIC  ·  Landing
   The public home page (layout/home.atom.php): stores view (scrolling)
   and framework view (one screen). Loaded after tokens.css and base.css
   only. Tokens only; light mode comes from the tokens as well.
   ───────────────────────────────────────────────────────── */

/* The landing keeps its original typeface; the rest of the theme uses --ff/--mono from tokens.css. */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400..600&display=swap');

/* ── Page ── */
.land {
  /* The landing keeps its own palette (tokens.css --land-*) on the shared role names. */
  --t1: var(--land-t1); --t2: var(--land-t2); --t3: var(--land-t3);
  --line: var(--land-line); --line-2: var(--land-line-2);
  --card: var(--land-card); --ac-softer: var(--land-soft);
  --ac-hi: var(--land-ac-hi); --ac-ink: var(--land-ac-ink);
  --shadow-md: var(--land-shadow);
  --ff: 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh;
  background: var(--land-bg); color: var(--t1);
  font-family: var(--ff);
  -webkit-font-smoothing: antialiased;
}
/* The framework view is one screen; below the stacked breakpoint it scrolls like the stores view. */
.land[data-view="framework"] { height: 100vh; height: 100svh; overflow: hidden; }

.land a { text-decoration: none; }

/* The two views (stores, framework) fill the page between header and footer. */
.land > main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Shared container: header, sections and footers share the same edges. */
.land-row {
  width: 100%; max-width: var(--land-max);
  margin-inline: auto; padding-inline: var(--land-gutter);
}

/* Mono caps label: meta lines, eyebrows, tabs, tags, table heads. */
.land-mono {
  font-family: var(--mono); font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--t3);
}

.land-text { font-size: var(--fs-base); line-height: 1.65; color: var(--t2); }
.land-lead { max-width: 60ch; font-size: var(--fs-xl); line-height: 1.6; color: var(--land-lead); }

/* ── Entrance and scroll reveal ──
   [data-rise] enters on load; --step (inline) sets its place in the sequence.
   landing.js turns [data-reveal-item] into [data-reveal] only when it can animate it,
   so nothing stays hidden without the script. */
@keyframes land-rise {
  from { opacity: 0; transform: translateY(var(--space-4)); }
  to   { opacity: 1; transform: none; }
}
.land [data-rise] { --step: 0; animation: land-rise var(--dur-rise) var(--ease-out) calc(var(--step) * var(--dur-step)) both; }
.land [data-reveal] {
  opacity: 0; transform: translateY(var(--space-3-5));
  transition: opacity var(--dur-rise) var(--ease-out), transform var(--dur-rise) var(--ease-out);
}
.land [data-reveal].is-revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .land { --dur-rise: 0s; --dur-step: 0s; --dur-fast: 0s; --dur-med: 0s; --dur-slow: 0s; }
}

/* ── Backdrop: two soft light pools and film grain ── */
/* z-index makes the backdrop its own blend group, so it carries the page colour for the grain to overlay. */
.land-backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--land-bg); }
.land-glow-a, .land-glow-b, .land-grain { position: absolute; }
.land-glow-a {
  top: -38vw; left: -6vw; width: 88vw; height: 88vw;
  border-radius: var(--r-pill);
  background: var(--land-glow-a); opacity: var(--land-glow-a-opacity);
  transform: translate3d(2vw, 1.5vh, 0) scale(1.04);
}
.land-glow-b {
  bottom: -52vw; right: -22vw; width: 96vw; height: 96vw;
  border-radius: var(--r-pill);
  background: var(--land-glow-b);
  transform: translate3d(-2.5vw, -1.5vh, 0);
}
.land-grain {
  inset: -6%; opacity: 0.6; mix-blend-mode: overlay;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/></filter><rect width="160" height="160" filter="url(%23n)" opacity="0.5"/></svg>');
}

/* ── Header ── */
.land-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  padding-block: var(--space-5);
}
.land-header-start { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3) var(--space-10); }
.land-header-end { display: flex; align-items: center; gap: var(--space-6); font-size: var(--fs-base); }

.land-brand { display: flex; align-items: center; gap: var(--space-3); }
.land-brand-name { font-size: var(--fs-lg); font-weight: var(--fw-medium); }
.land-brand-suffix { color: var(--t3); }

/* Atom mark: ring, core and two electrons. */
.land-mark { position: relative; flex: none; width: var(--icon-md); height: var(--icon-md); }
.land-mark > span { position: absolute; border-radius: var(--r-pill); }
.land-mark-ring { inset: 0; border: var(--bw) solid var(--t3); }
.land-mark-core { inset: 36%; background: var(--t1); }
.land-mark-dot-a, .land-mark-dot-b { width: 20%; height: 20%; }
.land-mark-dot-a { top: 5%; right: 5%; background: var(--t2); }
.land-mark-dot-b { bottom: 10%; left: 0; background: var(--t3); }

.land-seg { display: flex; gap: var(--space-1); padding: var(--space-1); border-radius: var(--r-pill); background: var(--ac-softer); }
.land-seg-btn {
  padding: var(--space-1-5) var(--space-3-5);
  border: 0; border-radius: var(--r-pill); background: transparent;
  transition: background var(--dur-med), color var(--dur-med);
}
.land-seg-btn:hover { color: var(--t1); }
.land-seg-btn[aria-selected="true"] { background: var(--ac-hi); color: var(--ac-ink); }

.land-link { color: var(--t2); transition: color var(--dur-med); }
.land-link:hover { color: var(--t1); }

/* ── Buttons ── */
.land-btn {
  display: inline-flex; align-items: center; gap: var(--space-2-5);
  padding: var(--space-3) var(--space-7);
  border: var(--bw) solid transparent; border-radius: var(--r-pill);
  font: inherit; font-size: var(--fs-md); font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background var(--dur-slow), border-color var(--dur-slow), color var(--dur-med), box-shadow var(--dur-slow), transform var(--dur-slow) var(--ease-out);
}
.land-btn:hover { transform: translateY(calc(var(--bw) * -2)); }
.land-btn .ic { width: var(--icon-sm); height: var(--icon-sm); color: var(--t3); transition: transform var(--dur-slow) var(--ease-out); }
.land-btn:hover .ic { transform: translateX(var(--space-1)); }
.land-btn-primary { background: var(--ac-hi); color: var(--ac-ink); }
.land-btn-primary:hover { box-shadow: var(--shadow-md); }
.land-btn-ghost { border-color: var(--line-2); background: transparent; color: var(--t1); }
.land-btn-ghost:hover { background: var(--ac-softer); }
.land-btn-sm { padding: var(--space-2-5) var(--space-5); font-size: var(--fs-base); }

/* ── Hero (stores) and framework main ── */
.land-hero {
  display: grid; grid-template-columns: 1fr 1.05fr; align-items: center;
  gap: var(--space-16);
  padding-block: var(--space-16) var(--space-20);
}
.land-hero-copy, .land-fw-copy { display: flex; flex-direction: column; gap: var(--space-7); min-width: 0; }

.land-fw {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1fr 1.05fr; align-content: center;
  gap: var(--space-16);
  padding-block: var(--space-6);
}
.land-fw-copy { justify-content: center; }
.land-fw-actions { display: flex; flex-direction: column; gap: var(--space-4); max-width: 35rem; }

.land-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--t2); }
.land-meta > span { white-space: nowrap; }
/* Middle-dot separator before every item but the first. */
.land-meta-sep::before { content: "\00B7"; margin-right: var(--space-2); color: var(--t3); }

.land-title {
  max-width: 15ch;
  font-size: var(--fs-land-hero); font-weight: var(--fw-medium);
  line-height: 1; letter-spacing: var(--ls-title);
  text-wrap: balance;
}
.land-title span, .land-h2 span { font-weight: var(--fw-light); color: var(--t3); }

.land-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }

.land-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-base); color: var(--t3); }

/* ── Panel with tabs (payment panel, code panel) ── */
.land-panel {
  display: flex; flex-direction: column; gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5) var(--space-7) var(--space-6);
  border: var(--bw) solid var(--line-2); border-radius: var(--r-xs);
  background: var(--card); box-shadow: var(--shadow-md);
}
.land-tabs { display: flex; align-items: center; gap: var(--space-5); min-width: 0; overflow: hidden; border-bottom: var(--bw) solid var(--line); }
.land-tab {
  padding: 0 0 var(--space-2);
  border: 0; border-bottom: var(--bw) solid transparent; background: transparent;
  transition: color var(--dur-med);
}
.land-tab:hover { color: var(--t1); }
.land-tab[aria-selected="true"] { border-bottom-color: var(--t1); color: var(--t1); }
.land-tab-file { margin-left: auto; min-width: 0; padding-bottom: var(--space-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.land-paypane { display: flex; flex-direction: column; gap: var(--space-4); min-height: 18.75rem; }
.land-paypane-head { display: flex; flex-direction: column; gap: var(--space-3-5); }
.land-paypane-title { font-size: var(--fs-lg); font-weight: var(--fw-medium); }
.land-payrows { display: flex; flex-direction: column; gap: var(--space-2-5); }
.land-payrow {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: var(--bw) solid var(--line); border-radius: var(--r-xs);
  background: var(--card);
  font-size: var(--fs-base);
}
/* Footnote or command line closing a pane. */
.land-cmd {
  display: flex; align-items: center; gap: var(--space-2-5);
  margin-top: auto; padding-top: var(--space-3-5);
  border-top: var(--bw) solid var(--line);
  font-family: var(--mono); font-size: var(--fs-xs); color: var(--t2);
  overflow-wrap: anywhere;
}
.land-prompt { flex: none; color: var(--t3); }

/* Code panel: every pane sits in the same grid cell, so switching tabs never resizes it. */
.land-code { display: grid; grid-template-rows: auto 1fr; }
.land-code-pane {
  grid-row: 2; grid-column: 1;
  display: flex; flex-direction: column; gap: var(--space-4); min-height: 0;
  visibility: hidden;
}
.land-code-pane.is-active { visibility: visible; }
.land-code-pane pre {
  flex: 1; min-height: 0; margin: 0; overflow: auto;
  font-family: var(--mono); font-size: var(--fs-land-code); line-height: 1.85;
  color: var(--t2);
}
.land-code-comment { color: var(--t3); }
.land-code-fn { color: var(--t1); }
.land-code-str { color: var(--ac); }

.land-install {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-1-5) var(--space-2) var(--space-1-5) var(--space-4);
  border-radius: var(--r-pill); background: var(--ac-softer);
}
.land-install code {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: var(--space-2);
  font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.5;
  overflow-wrap: anywhere;
}
.land-copy-btn {
  flex: none; padding: var(--space-2) var(--space-4);
  border: 0; border-radius: var(--r-pill); background: transparent;
  transition: background var(--dur-med), color var(--dur-med);
}
.land-copy-btn:is(:hover, [data-copied]) { background: var(--ac-hi); color: var(--ac-ink); }

/* ── Sections ── */
.land-section { padding-block: var(--land-section-y); border-top: var(--bw) solid var(--line); }
.land-head { display: flex; flex-direction: column; gap: var(--space-4); max-width: 60ch; margin-bottom: var(--space-11); }
.land-split .land-head { margin-bottom: 0; }
.land-h2 { font-size: var(--fs-land-h2); font-weight: var(--fw-medium); line-height: 1.08; letter-spacing: var(--ls-tight); }
.land-h2-lg { max-width: 20ch; font-size: var(--fs-land-h2-lg); line-height: 1.05; text-wrap: balance; }

.land-grid-3, .land-grid-2 { display: grid; gap: var(--space-5); }
.land-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.land-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.land-card {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-6);
  border: var(--bw) solid var(--line-2); border-radius: var(--r-xs);
  background: var(--card);
  transition: border-color var(--dur-slow);
}
.land-card:hover { border-color: var(--t3); }
.land-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.land-card-title { font-size: var(--fs-lg); font-weight: var(--fw-medium); }
.land-tag { flex: none; padding: var(--space-1) var(--space-2); border: var(--bw) solid var(--line-2); border-radius: var(--r-pill); }

.land-split { display: grid; grid-template-columns: 1fr 1.15fr; align-items: start; gap: var(--space-16); }
.land-sources { display: flex; flex-direction: column; gap: var(--space-2-5); margin-top: var(--space-2-5); }
.land-source {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3-5) var(--space-4);
  border: var(--bw) solid var(--line); border-radius: var(--r-xs);
  font-size: var(--fs-base);
}
.land-source.is-lead { border-color: var(--line-2); background: var(--card); }
.land-source-dim { color: var(--t2); }
.land-source-meta { margin-left: auto; font-size: var(--fs-sm); color: var(--t3); }
.land-source .land-tag { margin-left: auto; }

.land-strip {
  display: flex; align-items: center; gap: var(--space-8);
  margin-top: var(--space-11); padding-top: var(--space-6);
  border-top: var(--bw) solid var(--line);
}
.land-strip-list, .land-core-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); font-size: var(--fs-base); color: var(--t2); }

.land-banner {
  display: flex; align-items: center; gap: var(--space-10);
  padding: var(--space-8);
  border: var(--bw) solid var(--line-2); border-radius: var(--r-xs);
  background: var(--card);
}
.land-banner-copy { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; max-width: 68ch; }
.land-banner .land-btn { flex: none; margin-left: auto; }

.land-closing {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-6);
  padding-block: var(--land-section-y) var(--space-20);
  border-top: var(--bw) solid var(--line);
  text-align: center;
}
.land-closing .land-cta { justify-content: center; }

/* ── Analytics sample ── */
.land-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-5); margin-bottom: var(--space-5); }
.land-stat {
  display: flex; flex-direction: column; gap: var(--space-1-5);
  padding: var(--space-5);
  border: var(--bw) solid var(--line-2); border-radius: var(--r-xs);
  background: var(--card);
}
.land-stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.land-stat-value { font-size: var(--fs-3xl); font-weight: var(--fw-semibold); line-height: 1.1; letter-spacing: var(--ls-tight); font-variant-numeric: tabular-nums; }
.land-stat-icon {
  display: grid; place-items: center; flex: none;
  width: var(--box-md); height: var(--box-md);
  border-radius: var(--r-sm); background: var(--ac-softer); color: var(--t1);
}
.land-stat-label { font-size: var(--fs-sm); color: var(--t2); }
.land-stat-change { font-size: var(--fs-sm); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.land-stat-change[data-tone="danger"] { color: var(--danger); }

.land-charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-5); }
.land-chart {
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-6);
  border: var(--bw) solid var(--line-2); border-radius: var(--r-xs);
  background: var(--card);
}
.land-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.land-chart-title { font-size: var(--fs-lg); font-weight: var(--fw-medium); }
.land-chart-axis { display: flex; justify-content: space-between; }

/* Revenue trend: an area and a 2-point line cut from the same polygon, over three gridlines. */
.land-spark {
  --spark-top: 0% 85%, 9% 79%, 18% 83%, 27% 75%, 36% 73%, 45% 72%, 54% 61%, 63% 65%, 72% 52%, 82% 41%, 91% 39%, 100% 20%;
  position: relative; height: 10rem;
  background: linear-gradient(var(--line) 0 0) 0 33% / 100% var(--bw) no-repeat,
              linear-gradient(var(--line) 0 0) 0 66% / 100% var(--bw) no-repeat,
              linear-gradient(var(--line-2) 0 0) 0 100% / 100% var(--bw) no-repeat;
}
.land-spark > span { position: absolute; inset: 0; }
.land-spark-area { clip-path: polygon(var(--spark-top), 100% 100%, 0% 100%); background: linear-gradient(var(--ac-soft), transparent); }
.land-spark-line {
  background: var(--t1);
  clip-path: polygon(var(--spark-top), 100% calc(20% + 0.125rem), 91% calc(39% + 0.125rem), 82% calc(41% + 0.125rem), 72% calc(52% + 0.125rem), 63% calc(65% + 0.125rem), 54% calc(61% + 0.125rem), 45% calc(72% + 0.125rem), 36% calc(73% + 0.125rem), 27% calc(75% + 0.125rem), 18% calc(83% + 0.125rem), 9% calc(79% + 0.125rem), 0% calc(85% + 0.125rem));
}
.land-spark > .land-spark-dot {
  inset: auto; top: 20%; right: 0;
  width: var(--space-2-5); height: var(--space-2-5);
  translate: 50% -50%;
  border: var(--bw) solid var(--bg); border-radius: var(--r-pill);
  background: var(--t1);
}

.land-bars { display: flex; flex-direction: column; gap: var(--space-3-5); }
.land-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); font-size: var(--fs-base); }
.land-track { display: block; height: var(--space-2); border-radius: var(--r-xs); background: var(--ac-softer); overflow: hidden; }
.land-track-thin { height: var(--space-0-5); }
/* --bar-w and --bar-o are set inline per bar. */
.land-fill { --bar-w: 0%; --bar-o: 1; display: block; height: 100%; width: var(--bar-w); opacity: var(--bar-o); background: var(--t1); }

.land-table-panel { margin-top: var(--space-5); }
.land-tr {
  display: grid; grid-template-columns: 2.4fr 1.1fr 0.6fr 1fr; align-items: center;
  gap: var(--space-6);
  padding-block: var(--space-4);
  border-bottom: var(--bw) solid var(--line);
}
.land-tr:last-child { border-bottom: 0; }
.land-th { align-items: baseline; padding-top: 0; border-bottom-color: var(--line-2); }
.land-num { text-align: right; font-variant-numeric: tabular-nums; }
.land-td-product { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.land-td-title { font-size: var(--fs-md); }
.land-td-cat { font-size: var(--fs-base); color: var(--t2); }
.land-td-sales { font-family: var(--mono); font-size: var(--fs-sm); color: var(--t2); }
.land-td-revenue { display: flex; flex-direction: column; gap: var(--space-2); }
.land-td-revenue .land-num { font-size: var(--fs-md); font-weight: var(--fw-medium); }

/* ── Footers ── */
.land-core {
  position: relative;
  display: flex; align-items: center; gap: var(--space-8);
  padding-block: var(--space-4) var(--space-6);
}
/* The rule spans the content edges, not the row padding. */
.land-core::before {
  content: ""; position: absolute; top: 0; left: var(--land-gutter); right: var(--land-gutter);
  border-top: var(--bw) solid var(--line);
}
.land-core > .land-mono { flex: none; }
/* One line that fades out at the end instead of wrapping (masks read alpha only). */
.land-core-list {
  flex: 1; min-width: 0; flex-wrap: nowrap; white-space: nowrap; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, var(--t1) 82%, transparent);
  mask-image: linear-gradient(90deg, var(--t1) 82%, transparent);
}

.land-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  padding-block: var(--space-6) var(--space-10);
  border-top: var(--bw) solid var(--line);
  font-size: var(--fs-sm); color: var(--t3);
}
.land-footer-links { display: flex; flex-wrap: wrap; gap: var(--space-6); }

/* ── Narrow screens ── */
@media (max-width: 68.75rem) {
  .land-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .land-charts { grid-template-columns: 1fr; }
}

@media (max-width: 56.25rem) {
  .land[data-view="framework"] { height: auto; min-height: 100svh; overflow: visible; }
  .land-hero, .land-fw, .land-split { grid-template-columns: 1fr; gap: var(--space-10); }
  .land-grid-3, .land-grid-2 { grid-template-columns: 1fr; }
  .land-strip, .land-banner, .land-core { flex-wrap: wrap; gap: var(--space-5); }
  .land-banner .land-btn { margin-left: 0; }
  /* U-01: the header must fit 360px. */
  .land-header-end { gap: var(--space-4); }
  .land-link-docs { display: none; }
}

@media (max-width: 43.75rem) {
  .land-stats { grid-template-columns: 1fr; }
  .land-tr { grid-template-columns: 1.6fr 0.9fr; row-gap: var(--space-2-5); }
  .land-th, .land-td-cat { display: none; }
}
