/* Product-page styles for the hand-written landing page. Base tokens and
   element styles come from style.css; the documentation pages keep their own
   shell in guides.css and never load this file. */
.product-landing {
  --landing-wide: 74rem;
  --landing-content: 64rem;
  --navy: #1f3a5f;
  --accent-hover: #7f3b17;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .product-landing { --accent-hover: #eaa06f; }
}

/* Blocks painted navy carry their own text tokens, so every rule that reads
   --text, --muted, or --accent stays readable on them in both themes. */
.on-navy {
  --text: #fff;
  --muted: #dce5ee;
  --accent: #efaa77;
  background: var(--navy);
  color: var(--text);
}

.product-main h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  text-transform: none;
  font-weight: 660;
}

.product-nav {
  width: min(var(--landing-wide), calc(100% - 2.5rem));
  min-height: 4.5rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
}
.product-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 680;
  text-decoration: none;
}
.product-brand img { width: 2rem; height: 2rem; }
.product-nav nav { display: flex; align-items: center; gap: 1.4rem; }
.product-nav nav a { color: var(--muted); font-size: .9rem; text-decoration: none; }
.product-nav nav a:hover { color: var(--accent); }
.product-nav nav .nav-cta {
  padding: .45rem .8rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.product-hero {
  width: min(var(--landing-content), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 7rem 0 5.5rem;
}
.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: .8rem;
  line-height: 1.4;
  font-weight: 720;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.product-hero h1 {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.4rem);
  line-height: 1.01;
  letter-spacing: -.05em;
  font-weight: 680;
}
.hero-lead {
  max-width: 42rem;
  margin: 1.8rem 0 0;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: .65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .94rem;
  font-weight: 650;
  text-decoration: none;
}
/* Text on the accent takes the page background colour: near-white on the
   light rust, near-black on the dark orange, so both themes clear 4.5:1. */
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { background: var(--panel); color: var(--text); }
.button.secondary:hover { border-color: var(--accent); color: var(--accent); }

.product-pillars {
  width: min(var(--landing-wide), calc(100% - 2.5rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  overflow: hidden;
}
.product-pillars article {
  padding: 1.8rem;
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 1.2rem;
}
.product-pillars article + article { border-left: 1px solid var(--border); }
.pillar-index {
  color: var(--accent);
  font: .75rem/1.5 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.product-pillars strong { display: block; margin-bottom: .45rem; font-size: 1.05rem; }
.product-pillars p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.65; }

.product-section {
  width: min(var(--landing-content), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 8rem 0;
}
.section-heading { max-width: 42rem; }
.example-grid {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  overflow: hidden;
}
.example-card {
  padding: 1.65rem;
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
}
.example-card + .example-card { border-left: 1px solid var(--border); }
.example-card:hover { background: var(--accent-soft); }
.example-kicker {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.mini-flow {
  margin: 2.5rem 0 2.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
}
.mini-flow i {
  padding: .4rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--muted);
  font: normal .7rem/1.3 ui-monospace, SFMono-Regular, monospace;
}
.mini-flow b { color: var(--accent); font-size: .75rem; }
.example-card > strong { font-size: 1.08rem; }
.example-card p { margin: .6rem 0 1.5rem; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.card-link { margin-top: auto; color: var(--accent); font-size: .85rem; font-weight: 650; }

.adaptive-walkthrough {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  overflow: hidden;
}
.adaptive-walkthrough > header {
  padding: 1.8rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, .85fr);
  gap: 3rem;
  align-items: end;
  border-bottom: 1px solid var(--border);
}
.adaptive-walkthrough h3 {
  max-width: 26ch;
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}
.adaptive-walkthrough header > p {
  margin: 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.65;
}
.adaptive-run { padding: 1.6rem 1.8rem 1.8rem; }
.run-label {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font: .74rem/1.4 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.run-label span,
.reuse-note span {
  margin-right: .65rem;
  color: var(--accent);
  font-weight: 720;
}
.adaptive-steps {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  list-style: none;
}
.adaptive-steps li {
  min-width: 0;
  padding: 0 1rem 0 1.25rem;
  position: relative;
  border-left: 1px solid var(--border);
}
.adaptive-steps li > i {
  position: absolute;
  top: -.05rem;
  left: -.72rem;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font: normal 700 .66rem/1 ui-monospace, SFMono-Regular, monospace;
}
.adaptive-steps li > span {
  display: block;
  min-height: 2.2em;
  color: var(--accent);
  font-size: .67rem;
  line-height: 1.15;
  font-weight: 710;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.adaptive-steps strong {
  display: block;
  margin: .55rem 0 .4rem;
  font-size: .88rem;
  line-height: 1.35;
}
.adaptive-steps small {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.5;
}
.adaptive-steps code,
.reuse-note code { font-size: .82em; }
.adaptive-foot {
  padding: 1.35rem 1.8rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, .65fr);
  gap: 2rem;
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--code-bg);
}
.adaptive-foot p {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
}
.adaptive-foot p > strong { color: var(--text); }
.reuse-note {
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.reuse-note strong { display: block; margin-top: .35rem; }
.adaptive-next .card-link {
  display: inline-block;
  margin: .7rem 0 0 1.25rem;
  text-decoration: none;
}
.adaptive-next .card-link:hover { text-decoration: underline; }

.why-section {
  width: min(var(--landing-wide), calc(100% - 2.5rem));
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(3rem, 8vw, 8rem);
  border-top: 1px solid var(--border);
}
.why-copy { padding-top: .15rem; }
.why-copy p {
  margin: 0 0 1.3rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}
.why-copy p:last-child { margin-bottom: 0; color: var(--text); }

.loop-section,
.evidence-section { width: min(var(--landing-wide), calc(100% - 2.5rem)); }
.section-intro { margin-top: 2rem; }
.two-column-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 6vw, 6rem);
}
.two-column-copy p,
.single-column-copy {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}
.single-column-copy { max-width: 48rem; margin-top: 2rem; }
.two-column-copy a,
.single-column-copy a { color: var(--text); }
.product-diagram { margin: 3.5rem 0 0; }
.product-diagram img {
  border-radius: 10px;
  box-shadow: 0 16px 50px rgba(28, 26, 23, .08);
}
.product-diagram figcaption { max-width: 48rem; margin: 1rem auto 0; text-align: center; }

.runtime-section { width: min(var(--landing-wide), calc(100% - 2.5rem)); }
.feature-grid {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  overflow: hidden;
}
.feature-grid article { padding: 1.8rem; }
.feature-grid article + article { border-left: 1px solid var(--border); }
.feature-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  margin-bottom: 2.5rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-bg);
}
/* The three marks are s-expressions drawn with the brand mark's parentheses
   and stroke weights: the parentheses take the text colour, the symbol inside
   takes the accent, so they follow the theme without a second image file. */
.feature-mark svg {
  width: 1.85rem;
  height: 1.85rem;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-mark .paren { stroke: var(--text); stroke-width: 10; }
.feature-mark .ink { stroke: var(--accent); stroke-width: 9; }
.feature-mark .ring { stroke: var(--accent); stroke-width: 7; }
.feature-mark .dot { fill: var(--accent); }
.feature-grid h3 { margin: 0 0 .65rem; font-size: 1.08rem; }
.feature-grid p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.feature-note { max-width: 48rem; margin: 1.5rem 0 0; color: var(--muted); font-size: .9rem; }

.language-section { width: min(var(--landing-wide), calc(100% - 2.5rem)); padding-top: 2rem; }
.language-card {
  padding: clamp(2rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  gap: clamp(3rem, 7vw, 7rem);
  border-radius: 12px;
}
.language-copy p { margin: 0 0 1.2rem; color: var(--muted); line-height: 1.7; }
.text-link { display: inline-block; color: var(--accent); font-weight: 650; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.closing-line {
  max-width: 48rem;
  margin: 2rem auto 0;
  color: var(--muted);
  text-align: center;
  font-size: .95rem;
}

.viewer-section {
  width: min(var(--landing-wide), calc(100% - 2.5rem));
  margin: 1rem auto 8rem;
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.viewer-copy { max-width: 42rem; }
.viewer-copy h2 { margin-bottom: 1rem; }
.viewer-copy p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.viewer-shot { margin: 2.5rem 0 0; }
.viewer-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #3b3b3b;
  border-radius: 8px;
  background: #181818;
  box-shadow: 0 18px 45px rgba(28, 26, 23, .18);
}
.viewer-shot figcaption { margin-top: .7rem; color: var(--muted); font-size: .85rem; }

.beam-section { padding: 7rem 1.25rem; }
.beam-inner {
  width: min(var(--landing-wide), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: start;
}
.beam-copy { padding-top: .2rem; }
.beam-copy p { margin: 0 0 1.3rem; color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.beam-copy p:last-child { margin-bottom: 0; color: var(--text); }

.install-section {
  width: min(var(--landing-wide), calc(100% - 2.5rem));
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
}
.install-copy h2 { margin-bottom: 1rem; }
.install-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.install-terminal {
  overflow: hidden;
  border: 1px solid #33302a;
  border-radius: 10px;
  background: #1c1b18;
  box-shadow: 0 18px 50px rgba(28, 26, 23, .15);
}
.terminal-bar {
  padding: .7rem .85rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  border-bottom: 1px solid #33302a;
  color: #8f897f;
  font: .7rem/1 ui-monospace, SFMono-Regular, monospace;
}
.terminal-bar i { width: .55rem; height: .55rem; border-radius: 50%; background: #4c4942; }
.terminal-bar span { margin-left: .35rem; }
.install-terminal pre {
  margin: 0;
  padding: 1.5rem;
  border: 0;
  background: transparent;
  color: #e9e4da;
}
/* The prompt is drawn, not typed, so selecting the block copies runnable
   commands without a leading `$`. */
.install-terminal .cmd::before { content: "$ "; color: #e08a55; }
.install-terminal samp { font-family: inherit; color: #7bc5a7; }
.install-terminal p { margin: 0; padding: 0 1.5rem 1.35rem; color: #8f897f; font-size: .78rem; }

.resources-section { padding: 7rem 1.25rem; background: var(--accent-soft); }
.resources-inner { width: min(var(--landing-wide), 100%); margin: 0 auto; }
.resource-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  overflow: hidden;
}
.resource-grid a { padding: 1.5rem; color: var(--text); text-decoration: none; }
.resource-grid a:nth-child(even) { border-left: 1px solid var(--border); }
.resource-grid a:nth-child(n+3) { border-top: 1px solid var(--border); }
.resource-grid a:hover { background: var(--bg); }
.resource-grid strong { display: block; margin-bottom: .35rem; color: var(--accent); }
.resource-grid span { color: var(--muted); font-size: .9rem; line-height: 1.55; }

.product-footer {
  width: min(var(--landing-wide), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 3rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  border: 0;
}
.product-footer p { margin: .8rem 0 0; color: var(--muted); font-size: .82rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1.2rem; }
.footer-links a { color: var(--muted); font-size: .82rem; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.product-footer .build-stamp { grid-column: 1 / -1; margin-top: 0; }

@media (max-width: 58rem) {
  .product-nav nav a[href="#examples"],
  .product-nav nav a[href="#why"] { display: none; }
  .example-grid { grid-template-columns: 1fr; }
  .example-card + .example-card { border-left: 0; border-top: 1px solid var(--border); }
  .mini-flow { justify-content: flex-start; gap: .6rem; }
  .adaptive-walkthrough > header,
  .adaptive-foot { grid-template-columns: 1fr; gap: 1.25rem; }
  .adaptive-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 0; }
  .reuse-note { padding: 1rem 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .adaptive-next .card-link { margin-left: 0; }
  .why-section,
  .language-card,
  .beam-inner,
  .install-section { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article + article { border-left: 0; border-top: 1px solid var(--border); }
  .feature-mark { margin-bottom: 2rem; }
}

@media (max-width: 40rem) {
  .product-nav { min-height: 4rem; }
  .product-nav nav { gap: 1rem; }
  /* The hero repeats the call to action a few lines down, so the phone nav
     keeps the two links it would otherwise lose. */
  .product-nav nav .nav-cta { display: none; }
  .product-hero { padding: 5rem 0 4rem; }
  .product-hero h1 { font-size: clamp(2.75rem, 13vw, 4.2rem); }
  .product-pillars { grid-template-columns: 1fr; }
  .product-pillars article + article { border-left: 0; border-top: 1px solid var(--border); }
  .product-section { padding: 6rem 0; }
  .adaptive-steps { grid-template-columns: 1fr; gap: 1.3rem; }
  .adaptive-steps li { padding-left: 1.4rem; }
  .two-column-copy { grid-template-columns: 1fr; gap: 1rem; }
  .viewer-section { margin-bottom: 6rem; padding: 1.25rem; }
  .beam-section { padding-top: 5rem; padding-bottom: 5rem; }
  .install-terminal pre { padding: 1.1rem; font-size: .8rem; }
  .install-terminal p { padding: 0 1.1rem 1.1rem; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-grid a:nth-child(even) { border-left: 0; }
  .resource-grid a + a { border-top: 1px solid var(--border); }
  .product-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .product-footer .build-stamp { grid-column: auto; }
}
