/**
 * Landing page styling (Phase 10.2 prep — B2B positioning page).
 *
 * Colors/font/radius/button classes come from ./design/tokens.css (Phase
 * 8.1's real gridhearth.com extraction) — this file only adds layout, and a
 * small set of *new* tokens (spacing scale, shadow, a dark "code card"
 * surface) that tokens.css doesn't define, because tokens.css was scoped to
 * the playable board, not a marketing/docs-style page. New tokens are
 * additive and derived from the existing palette (e.g. --gh-shadow uses
 * --gh-ink-primary at low alpha) rather than introducing off-brand colors.
 *
 * Brief from the user (2026-09-28): doesn't need to visually match
 * create.gridhearth.com or gridhearth.com's own layout — same color theme is
 * enough — but the UX/UI should read as a well-designed, high-end SaaS page.
 * gridhearth.com's own aesthetic (see BRAND.md) is deliberately "editorial,
 * not flat-SaaS" (rotating tinted section backgrounds, no shadows on
 * buttons). This page keeps the palette but leans into a cleaner, more
 * structured SaaS composition instead (sticky nav, two-column hero with a
 * code sample, elevated cards, a numbered process strip) — the audience
 * here (integrating engineers, publishers evaluating a vendor) reads that
 * kind of layout as credibility, the way GridHearth's own consumer pages
 * read editorial warmth as credibility for a different audience.
 */

* {
  box-sizing: border-box;
}

:root {
  --gh-space-1: 4px;
  --gh-space-2: 8px;
  --gh-space-3: 16px;
  --gh-space-4: 24px;
  --gh-space-5: 32px;
  --gh-space-6: 48px;
  --gh-space-7: 64px;
  --gh-space-8: 96px;

  --gh-max-width: 1180px;
  --gh-max-width-narrow: 760px;

  --gh-radius-card: 16px;
  --gh-radius-pill: 999px;

  --gh-shadow-sm: 0 1px 2px rgba(23, 59, 58, 0.06), 0 1px 1px rgba(23, 59, 58, 0.04);
  --gh-shadow-md: 0 8px 24px rgba(23, 59, 58, 0.08), 0 2px 6px rgba(23, 59, 58, 0.05);
  --gh-shadow-lg: 0 24px 48px rgba(23, 59, 58, 0.14), 0 8px 16px rgba(23, 59, 58, 0.08);

  /* Dark "code card" surface — a near-black tint of the brand ink rather
     than a generic editor-theme black/grey, so the one dark element on an
     otherwise warm/light page still feels like it belongs to this brand. */
  --gh-code-bg: #0e2423;
  --gh-code-line: #1f4241;
  --gh-code-ink: #d9ece9;
  --gh-code-muted: #7fa39f;
  --gh-code-key: #9fd6c9;
  --gh-code-string: #f1c98a;
  --gh-code-number: #e7b0a0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--gh-bg-cream);
  color: var(--gh-ink-primary);
  font-family: var(--gh-font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: var(--gh-max-width);
  margin: 0 auto;
  padding: 0 var(--gh-space-4);
}

.wrap--narrow {
  max-width: var(--gh-max-width-narrow);
}

section {
  padding: var(--gh-space-8) 0;
}

/* ---------- Nav ---------- */

.gh-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 250, 240, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--gh-border-tan-beige);
}

.gh-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.gh-nav-brand {
  display: flex;
  align-items: center;
  gap: var(--gh-space-2);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--gh-ink-primary);
  letter-spacing: -0.01em;
}

.gh-nav-brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gh-ink-primary);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 4px;
  flex: none;
}

.gh-nav-brand .mark span {
  background: var(--gh-bg-off-white);
  border-radius: 1px;
}

.gh-nav-brand .mark span:nth-child(2),
.gh-nav-brand .mark span:nth-child(4),
.gh-nav-brand .mark span:nth-child(6),
.gh-nav-brand .mark span:nth-child(8) {
  background: var(--gh-accent-amber);
}

.gh-nav-links {
  display: flex;
  align-items: center;
  gap: var(--gh-space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.gh-nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--gh-ink-primary);
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.gh-nav-links a:hover {
  opacity: 1;
}

/* Specificity note: plain `.gh-nav-cta { display: none }` ties with the
   later `.gh-btn { display: inline-flex }` rule (both are single-class
   selectors) — at equal specificity the later rule in the file wins, which
   silently re-shows this button below 720px. The `.gh-nav` prefix (a
   descendant selector) gives this rule strictly higher specificity so it
   wins regardless of source order. */
.gh-nav .gh-nav-cta {
  display: none;
}

@media (min-width: 720px) {
  .gh-nav .gh-nav-cta {
    display: inline-flex;
  }
}

.gh-nav-toggle {
  display: none;
}

/* ---------- Buttons ---------- */

.gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gh-space-2);
  padding: 13px 22px;
  border-radius: var(--gh-radius-button);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease;
  white-space: nowrap;
}

.gh-btn--primary {
  background: var(--gh-ink-primary);
  color: var(--gh-bg-off-white);
  box-shadow: var(--gh-shadow-sm);
}

.gh-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--gh-shadow-md);
}

.gh-btn--secondary {
  background: var(--gh-bg-off-white);
  color: var(--gh-ink-primary);
  border-color: var(--gh-border-tan-beige);
}

.gh-btn--secondary:hover {
  border-color: var(--gh-ink-primary);
  transform: translateY(-1px);
}

.gh-btn--sm {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.gh-btn--ghost-light {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gh-code-ink);
  border-color: var(--gh-code-line);
}

.gh-btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- Eyebrow / section heads ---------- */

.gh-eyebrow {
  color: var(--gh-accent-rust);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 var(--gh-space-3);
}

.gh-section-head {
  max-width: 620px;
  margin: 0 0 var(--gh-space-6);
}

.gh-section-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.gh-section-head h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  margin: 0 0 var(--gh-space-2);
  letter-spacing: -0.01em;
}

.gh-section-head p {
  color: var(--gh-border-teal-grey);
  font-size: 1.02rem;
  margin: 0;
}

/* ---------- Hero ---------- */

.gh-hero {
  padding-top: var(--gh-space-8);
  padding-bottom: var(--gh-space-7);
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(220, 231, 216, 0.55), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(237, 187, 88, 0.16), transparent 55%);
}

.gh-hero .wrap {
  display: grid;
  gap: var(--gh-space-7);
  align-items: center;
}

@media (min-width: 960px) {
  .gh-hero .wrap {
    grid-template-columns: 1.05fr 1fr;
  }
}

.gh-hero h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 var(--gh-space-4);
}

.gh-hero .lede {
  font-size: 1.12rem;
  color: var(--gh-border-teal-grey);
  max-width: 52ch;
  margin: 0 0 var(--gh-space-5);
}

.gh-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gh-space-3);
  margin-bottom: var(--gh-space-5);
}

.gh-hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gh-space-2) var(--gh-space-5);
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.86rem;
  color: var(--gh-border-teal-grey);
}

.gh-hero-trust li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gh-hero-trust svg {
  flex: none;
  color: var(--gh-accent-rust);
}

/* ---------- Code card ---------- */

.gh-code-card {
  background: var(--gh-code-bg);
  color: var(--gh-code-ink);
  border-radius: var(--gh-radius-card);
  box-shadow: var(--gh-shadow-lg);
  overflow: hidden;
  transform: rotate(0.4deg);
}

.gh-code-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gh-space-3);
  padding: var(--gh-space-3) var(--gh-space-4);
  border-bottom: 1px solid var(--gh-code-line);
}

.gh-code-dots {
  display: flex;
  gap: 6px;
}

.gh-code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gh-code-line);
}

.gh-code-card-head .path {
  font-size: 0.78rem;
  color: var(--gh-code-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-code-card pre {
  margin: 0;
  padding: var(--gh-space-4);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-x: auto;
}

.gh-code-card .req {
  color: var(--gh-code-muted);
}
.gh-code-card .k {
  color: var(--gh-code-key);
}
.gh-code-card .s {
  color: var(--gh-code-string);
}
.gh-code-card .n {
  color: var(--gh-code-number);
}
.gh-code-card .p {
  color: var(--gh-code-muted);
}

.gh-code-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gh-space-3);
  padding: var(--gh-space-3) var(--gh-space-4);
  border-top: 1px solid var(--gh-code-line);
}

.gh-code-card-foot .note {
  font-size: 0.78rem;
  color: var(--gh-code-muted);
}

/* ---------- Logo / stat strip ---------- */

.gh-strip {
  padding: var(--gh-space-6) 0;
  border-top: 1px solid var(--gh-border-tan-beige);
  border-bottom: 1px solid var(--gh-border-tan-beige);
}

.gh-strip .wrap {
  display: grid;
  gap: var(--gh-space-5);
  grid-template-columns: repeat(2, 1fr);
  text-align: center;
}

@media (min-width: 720px) {
  .gh-strip .wrap {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gh-stat b {
  display: block;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.01em;
}

.gh-stat span {
  font-size: 0.82rem;
  color: var(--gh-border-teal-grey);
}

/* ---------- Feature cards ---------- */

.gh-cards {
  display: grid;
  gap: var(--gh-space-4);
}

@media (min-width: 720px) {
  .gh-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gh-card {
  background: var(--gh-bg-off-white);
  border: 1px solid var(--gh-border-tan-beige);
  border-radius: var(--gh-radius-card);
  padding: var(--gh-space-5);
  box-shadow: var(--gh-shadow-sm);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.gh-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--gh-shadow-md);
}

.gh-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gh-surface-mint);
  color: var(--gh-ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gh-space-4);
}

.gh-card h3 {
  font-size: 1.1rem;
  margin: 0 0 var(--gh-space-2);
  letter-spacing: -0.005em;
}

.gh-card p {
  color: var(--gh-border-teal-grey);
  font-size: 0.94rem;
  margin: 0 0 var(--gh-space-4);
  flex: 1;
}

.gh-card .gh-link {
  margin-top: auto;
}

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--gh-ink-primary);
}

.gh-link svg {
  transition: transform 0.15s ease;
}

.gh-link:hover svg {
  transform: translateX(3px);
}

/* ---------- Process strip ---------- */

.gh-process {
  display: grid;
  gap: var(--gh-space-6);
  counter-reset: step;
  position: relative;
}

@media (min-width: 860px) {
  .gh-process {
    grid-template-columns: repeat(3, 1fr);
  }

  .gh-process::before {
    content: "";
    position: absolute;
    top: 23px;
    left: 12%;
    right: 12%;
    height: 1px;
    background: var(--gh-border-tan-beige);
  }
}

.gh-step {
  position: relative;
}

.gh-step .num {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gh-bg-cream);
  border: 1px solid var(--gh-border-tan-beige);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: var(--gh-space-3);
  position: relative;
  z-index: 1;
}

.gh-step h3 {
  font-size: 1.05rem;
  margin: 0 0 var(--gh-space-2);
}

.gh-step p {
  color: var(--gh-border-teal-grey);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Origin story band ---------- */

.gh-origin {
  background: var(--gh-surface-sage);
  border-top: 1px solid var(--gh-border-tan-beige);
  border-bottom: 1px solid var(--gh-border-tan-beige);
}

.gh-origin blockquote {
  margin: 0 0 var(--gh-space-4);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.gh-origin cite {
  font-style: normal;
  font-size: 0.88rem;
  color: var(--gh-border-teal-grey);
  display: block;
}

/* ---------- Final CTA ---------- */

.gh-final-cta {
  text-align: center;
}

.gh-final-cta h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  margin: 0 0 var(--gh-space-3);
  letter-spacing: -0.01em;
}

.gh-final-cta p {
  color: var(--gh-border-teal-grey);
  max-width: 52ch;
  margin: 0 auto var(--gh-space-5);
  font-size: 1.02rem;
}

.gh-final-cta .gh-hero-ctas {
  justify-content: center;
}

/* ---------- Footer ---------- */

.gh-footer {
  background: var(--gh-ink-primary);
  color: var(--gh-bg-off-white);
  padding: var(--gh-space-7) 0 var(--gh-space-5);
}

.gh-footer .wrap {
  display: grid;
  gap: var(--gh-space-6);
}

@media (min-width: 720px) {
  .gh-footer .wrap {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }
}

.gh-footer-brand .gh-nav-brand {
  color: var(--gh-bg-off-white);
}

.gh-footer-brand .mark {
  background: var(--gh-bg-off-white);
}

.gh-footer-brand .mark span {
  background: var(--gh-ink-primary);
}

.gh-footer-brand .mark span:nth-child(2),
.gh-footer-brand .mark span:nth-child(4),
.gh-footer-brand .mark span:nth-child(6),
.gh-footer-brand .mark span:nth-child(8) {
  background: var(--gh-accent-amber);
}

.gh-footer-brand p {
  color: var(--gh-code-muted);
  font-size: 0.88rem;
  max-width: 34ch;
  margin-top: var(--gh-space-3);
}

.gh-footer h4 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gh-code-muted);
  margin: 0 0 var(--gh-space-3);
}

.gh-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gh-space-2);
}

.gh-footer a {
  text-decoration: none;
  color: var(--gh-bg-off-white);
  opacity: 0.85;
  font-size: 0.92rem;
}

.gh-footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

.gh-footer-bottom {
  margin-top: var(--gh-space-7);
  padding-top: var(--gh-space-4);
  border-top: 1px solid var(--gh-border-teal-grey);
  font-size: 0.8rem;
  color: var(--gh-code-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--gh-space-3);
  justify-content: space-between;
}

/* ---------- Reveal-on-scroll ---------- */

.gh-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.gh-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .gh-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 719px) {
  .gh-nav-links {
    display: none;
  }

  .gh-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--gh-border-tan-beige);
    background: var(--gh-bg-off-white);
  }

  .gh-nav.is-open .gh-nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gh-space-4);
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--gh-bg-off-white);
    border-bottom: 1px solid var(--gh-border-tan-beige);
    padding: var(--gh-space-4);
  }

  .gh-code-card {
    transform: none;
  }
}

@media print {
  .gh-nav,
  .gh-footer {
    display: none;
  }
}
