/* =========================
   generator.ink marketing-page styles
   - Layers on top of theme.css + layout.css + site.css (301-ui).
   - Only defines classes used by landing/src/pages.tsx; the design
     system primitives (.btn, .card, .badge, ...) come from site.css.
   - Spacing tokens from theme.css (--space-1..--space-6).
   ========================= */

/* Heading face — Bricolage Grotesque, the same family slotsreach.com
   uses for its h1..h3. Better visual rhyme with the Generator
   wordmark than the prior Montserrat-only setup. Body keeps
   Montserrat (set on :root in theme.css). Loaded via Google Fonts
   variable in landing/src/layout.tsx. */
:root {
  --font-heading: "Bricolage Grotesque", Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Cyrillic + Greek + other scripts Bricolage Grotesque doesn't
   ship glyphs for. Per-glyph browser fallback would mix two
   families inside a single heading and look broken; override
   --font-heading wholesale on those locales so the heading
   renders in a single Cyrillic-capable face (Montserrat — same
   body family, so headings just bold up instead of looking
   foreign). Add new langs here when we localize. Verify a new
   subset via fonts.google.com/specimen/Bricolage+Grotesque
   "Languages" tab before extending. */
:lang(ru), :lang(uk), :lang(be), :lang(bg), :lang(mk), :lang(sr),
:lang(el),
:lang(zh), :lang(ja), :lang(ko),
:lang(ar), :lang(he),
:lang(hi), :lang(th) {
  --font-heading: Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* All page-level headings inherit the heading family — Bricolage's
   slightly squarer shapes + tighter spacing give h1/h2/h3 the
   marketing weight they lacked at Montserrat 400. Body text and UI
   chrome stay on Montserrat for tonal continuity. */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* Brand text wordmark — currentColor SVG ships with its own viewBox;
   restrict to display:block so flexbox aligns it baseline-flush with
   the icon mark. */
.brand {
  align-items: center;
  gap: var(--space-2);
}
.brand__logo {
  display: block;
  flex-shrink: 0;
}
.brand__text {
  display: block;
  height: auto;
  color: var(--text-main);
}

/* Footer brand-mark row — the Generator icon sits next to companion
   project marks (301.st today; more can follow). Plain flex row with
   the same gap as the .brand element. */
.footer-brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.footer-brand-link {
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}
.footer-brand-link:hover { opacity: 1; }
.footer-brand-link img { display: block; }

/* ── Feature-card icon-rings: palette harmonize ──────────── */

/* 301-ui's .icon-ring--brand hardcodes a non-brand blue (rgba 52 117
   192). Re-tint to our teal so the brand ring uses --primary tones.
   Same for --cf (their CF orange → our gold). The semantic variants
   (success / info / warning / danger) keep their canonical hues —
   they read as status colours, not brand colours. */
.icon-ring--brand {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
}
.icon-ring--cf {
  background: color-mix(in srgb, var(--accent-cf) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent-cf) 25%, transparent);
  color: var(--accent-cf);
}

/* ── Primary CTA contrast fix ─────────────────────────────── */

/* site.css ships `.btn--primary { background: var(--primary); color:
   var(--btn-text-on-dark); }` where --btn-text-on-dark is hardcoded
   #FFFFFF. In dark theme the primary teal #4db7bf reads at ~2.6:1
   against white — fails WCAG AA (PageSpeed flagged this 2026-05-25).
   Light theme is fine (white on #2e7a80 ≈ 5.3:1).

   Fix: pick the button text colour per theme so the dark-theme
   bright teal gets near-black text (≈ 7.5:1) and the light-theme
   deeper teal keeps the white-text reading we already had. */
:root[data-theme="dark"] {
  --btn-primary-text: #0c1320;
}
:root[data-theme="light"] {
  --btn-primary-text: #FFFFFF;
}
.btn--primary {
  color: var(--btn-primary-text);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  color: var(--btn-primary-text);
}

/* Page shell — layout.css's .page-shell already gives padding-block:
   var(--space-6) on desktop / var(--space-4) on mobile, so <main.page>
   itself stays paddingless. Each top-level section either renders a
   .page-shell directly (which handles the gutter) or sets its own
   padding (.hero, .section--alt). Without this reset we'd stack
   main + section + page-shell padding and end up with ~5.5rem of
   dead space above the first heading on guide / about / pricing
   pages — the issue called out in screenshot review on 2026-05-25. */
main.page {
  padding-block: 0;
}

/* 301-ui's site.css ships a `.site-header + * { margin-top: 60px }`
   rule that compensates for an absolutely positioned utility-bar
   above the main header. We don't ship that bar in the marketing
   site, so the 60px is dead weight — null it out. */
.site-header + * {
  margin-top: 0;
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  padding-block: var(--space-5) var(--space-4);
}

.hero__inner {
  max-width: 760px;
}

.hero__title {
  font-size: clamp(2rem, 3.5vw + 1rem, 3.25rem);
  line-height: 1.1;
  margin: 0 0 var(--space-4);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

.hero__title-accent {
  color: var(--primary);
}

.hero__subtitle {
  font-size: clamp(1.05rem, 0.5vw + 1rem, 1.2rem);
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 var(--space-5);
  max-width: 60ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.hero__hint {
  font-size: var(--fs-sm);
  margin: 0;
}

.hero__cta-band {
  text-align: center;
  padding-block: var(--space-5);
}

.hero__cta-band .hero__cta {
  justify-content: center;
}

/* Lead paragraph inside a centered CTA band needs explicit
   horizontal auto margins — .section__lead ships with
   `margin: 0 0 var(--space-5)` (3-value shorthand → left/right
   = 0), so even with text-align:center on the parent the block
   stays left-aligned, looking like the prose "slid" out from
   under the centered buttons. Same fix applies to any muted
   paragraph used as the band body. */
.hero__cta-band .section__lead,
.hero__cta-band > p {
  margin-inline: auto;
  max-width: 56ch;
}

/* Section title inside a CTA band also wants a max-width so
   the H2 doesn't stretch full 1200px on wide viewports —
   reads as a tighter banner heading instead of a page title. */
.hero__cta-band .section__title {
  max-width: 36ch;
  margin-inline: auto;
}

/* ── Section ─────────────────────────────────────────────── */

/* .section is a semantic wrapper around .page-shell; the page-shell
   already supplies vertical breathing room (var(--space-6) on desktop)
   so .section itself stays paddingless. .section--alt re-introduces
   padding because it paints a different background that needs to
   visually extend past the .page-shell content edges. */
.section {
  padding-block: 0;
}

.section + .section {
  border-top: 1px solid var(--border-subtle);
}

.section--alt {
  background: var(--bg-soft);
  padding-block: var(--space-4);
}

.section--center {
  text-align: center;
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 1.5vw + 1rem, 2rem);
  line-height: 1.2;
  margin: 0 0 var(--space-3);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section__lead {
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 65ch;
  margin: 0 0 var(--space-5);
}

.section__heading {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: var(--space-5) 0 var(--space-3);
  font-weight: var(--fw-semibold);
}

/* ── Page title (for /features, /pricing, /about, etc.) ──── */

.page-title {
  font-size: clamp(2rem, 2.5vw + 1rem, 2.75rem);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

/* ── Card grid (homepage features + pricing) ─────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin: 0;
}

.card-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .card-grid--2,
  .card-grid--3 {
    grid-template-columns: 1fr;
  }
}

/* Sprite-icon badge above the card title. The icon itself paints
   in --primary (logo teal); the soft pill bg pulls from
   --primary-soft so the badge tints harmoniously in both themes. */
.card__icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
  margin: var(--space-4) var(--space-4) 0;
}

/* Card-internal title / body when the card is built as flat
   children (no .card__header wrapper). Pads title same as body. */
.card .card__title {
  padding: var(--space-3) var(--space-4) 0;
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
}

.card > .card__body {
  /* site.css already covers padding for direct .card__body children;
     this rule just kills the top padding so it sits flush against
     the title when both are present. */
  padding-top: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.card code {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.05em 0.4em;
  border-radius: var(--radius-xs);
  font-size: 0.95em;
}

/* ── Feature list (bullets with breathing room) ──────────── */

.feature-list {
  padding-left: var(--space-4);
  margin: 0 0 var(--space-4);
  line-height: 1.6;
}

.feature-list li {
  margin-bottom: var(--space-3);
}

.feature-list li:last-child {
  margin-bottom: 0;
}

.feature-list strong {
  color: var(--text-main);
}

.feature-list code {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.05em 0.4em;
  border-radius: var(--radius-xs);
  font-size: 0.95em;
}

/* ── Link grid (homepage showcase) ───────────────────────── */

.link-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
}

.link-grid li {
  padding: var(--space-2) 0;
  font-size: 1.05rem;
}

.link-grid a {
  color: var(--primary);
  text-decoration: none;
  font-weight: var(--fw-medium);
}

.link-grid a:hover {
  text-decoration: underline;
}

/* ── Preview card grid (See it live) ─────────────────────── */

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.preview-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  background: var(--bg-elevated, var(--bg));
  color: var(--text);
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;
}

.preview-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.preview-card__type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-xs, .75rem);
  font-weight: var(--fw-medium, 500);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}

.preview-card__icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.preview-card--brand .preview-card__type { color: var(--accent, #d4a017); }
.preview-card--rating .preview-card__type { color: var(--primary); }

.preview-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--fw-semibold, 600);
  color: var(--text);
  line-height: 1.3;
}

.preview-card__body {
  margin: 0;
  font-size: var(--fs-sm, .92rem);
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.preview-card__url {
  font-size: var(--fs-xs, .75rem);
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--primary);
  margin-top: var(--space-1);
  word-break: break-all;
}

/* ── Pricing cards ───────────────────────────────────────── */

.pricing-card {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pricing-card .card__title {
  padding: 0;
}

.pricing-card .feature-list {
  flex: 1;
  margin-bottom: var(--space-4);
}

.pricing-card .btn {
  margin-top: auto;
}

.pricing-card--featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.pricing-price {
  font-size: 2rem;
  font-weight: var(--fw-bold);
  margin: 0;
  color: var(--text-main);
}

.pricing-price .muted {
  font-size: 1rem;
  font-weight: var(--fw-normal);
}

/* ── Docs / guide pages ──────────────────────────────────── */

.docs-page-header {
  display: grid;
  gap: var(--space-2);
}

.docs-page-header .page-title {
  margin: 0;
}

/* Detail-faq blocks need a small breathing-room between items in
   the guide flow. site.css's .docs-faq__item already has the
   bordered/rounded look. */
.docs-faq__item + .docs-faq__item {
  margin-top: var(--space-2);
}

/* Guide prose readability — wider paragraphs in /docs/<slug>.
   Constrains within page-shell so 1200px viewport doesn't run text
   to the edge. */
.section > .page-shell > p,
.section > .page-shell > ol,
.section > .page-shell > .feature-list {
  max-width: 70ch;
}

/* Guide footer prev/next */
.guide-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.guide-footer__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel);
  text-decoration: none;
  color: var(--text-main);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.guide-footer__link:hover {
  border-color: var(--primary);
}

.guide-footer__link--next {
  text-align: right;
}

.guide-footer__link strong {
  font-size: 1rem;
  font-weight: var(--fw-semibold);
}

@media (max-width: 700px) {
  .guide-footer {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile burger button ────────────────────────────────── */

.burger-button {
  /* site.css sets display:none desktop / flex mobile. Style the
     visible state — bordered icon button matching theme tokens. */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}
.burger-button:hover {
  background: var(--bg-soft);
}

/* On mobile (≤1023 — same breakpoint as site.css's .primary-nav
   hide) shrink the header CTAs to icon-only so brand + burger +
   nav fit in the bar. Theme toggle stays visible; Sign in /
   Get started fold inside the nav panel when the burger opens. */
@media (max-width: 1023px) {
  .header-actions .btn:not(.theme) {
    /* Keep links accessible via primary-nav; hide the duplicate
       header-CTA pair on mobile to make room. */
    display: none;
  }
}

/* The primary-nav mobile panel uses --bg as background per site.css;
   our 4-card palette means the panel reads fine with default tokens.
   This rule just makes the nav links larger + spaced so taps don't
   miss. */
@media (max-width: 1023px) {
  body.mobile-menu-open .primary-nav {
    background: var(--bg);
  }
  body.mobile-menu-open .primary-nav a {
    font-size: 1.15rem;
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
  }
}

/* ── Mobile sweep ─────────────────────────────────────────── */

/* Diagnosed 2026-05-25: footer-brand was `flex: 0 0 auto` with a long
   .muted paragraph and no max-width — that combination forced the
   container to expand past the viewport on sub-650px screens, giving
   the whole page a horizontal scrollbar. The rules below let the
   footer-brand shrink, cap its paragraph, and clean up the legal
   row separators that wrap awkwardly when squeezed. */
@media (max-width: 768px) {
  .footer-brand { flex: 1 1 auto; min-width: 0; }
  .footer-brand .muted { max-width: 100%; word-wrap: break-word; }

  /* Generic safety net for any flex/grid child that contains long
     unbroken content (URLs, code spans, the brand SVG). Lets shells
     shrink below their intrinsic content width when needed. */
  .page-shell { min-width: 0; }

  /* footer-legal: the bullet separator pattern looks broken once the
     row wraps. Hide the • dots, let the items wrap with a gap. */
  .footer-legal { flex-wrap: wrap; gap: 0.25rem 0.5rem; }
  .footer-legal .separator { display: none; }
}

/* ── Inline alert banner (contact form success / error) ──── */

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-soft);
  line-height: 1.5;
}
.alert--success {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}
.alert--danger {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

/* ── Theme toggle icon (sun/moon) ────────────────────────── */

.btn-icon.theme {
  width: var(--control-min-height);
  height: var(--control-min-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.btn-icon.theme:hover {
  background: var(--bg-soft);
}
