/* goatcms.com homepage. Loaded after the module's landing.css, which owns the
   topbar, hero, feature grid, steps and download cards; this file adds only the
   homepage sections and the adjustments they need. */

/* landing.css makes <main> a grid; an auto column would grow to fit the
   unbreakable init command and scroll the page sideways on phones. */
.home main { grid-template-columns: minmax(0, 1fr); }
.home .brand { display: inline-flex; }
.home .brand:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 3px; }

/* Keep the introduction in proportion with the rest of the homepage. */
.home .hero-copy { min-width: 0; }
.home .hero-copy h1 {
  max-width: 22ch;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
}
.home .hero-copy .lede {
  max-width: 56ch;
  margin-top: var(--space-4);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.65;
}

/* Hero side: release card under the sign-in badge. */
.home-release {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease;
}
.home-release:hover { border-color: var(--primary); }
.home-release__label,
.home-kicker { color: var(--primary); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.home-release__version { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.home-release__platforms { color: var(--text-muted); font-size: 0.875rem; }

/* Shared section header: title on the left, short lede on the right. */
.home-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: var(--space-5);
}
.home-kicker { margin: 0 0 var(--space-3); }
.home-section-lede { max-width: 48ch; margin: 0; color: var(--text-muted); line-height: 1.6; }
.home-subtitle { margin: var(--space-7) 0 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.home-more {
  display: inline-flex;
  gap: var(--space-2);
  margin-top: var(--space-5);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.home-more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Get started: downloads, steps and the init command. */
.home-downloads { margin-top: var(--space-6); }
.home-downloads .download-card { min-height: 12rem; }
.home-downloads .download-card.is-detected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.home-detected { align-self: start; justify-self: start; margin-top: var(--space-3); padding: 2px var(--space-2); border-radius: 999px; background: var(--surface-subtle); color: var(--primary); font-size: 0.75rem; font-weight: 700; }
.home-detected[hidden] { display: none; }
.home-all-dists { margin: var(--space-4) 0 0; color: var(--text-muted); font-size: 0.9375rem; }
.home-all-dists a { margin-left: var(--space-2); color: var(--primary); font-weight: 700; text-decoration: none; }
.home-all-dists a:hover { text-decoration: underline; text-underline-offset: 4px; }
.home .steps code,
.home .feature code { padding: 1px 4px; border-radius: var(--radius-sm); background: var(--surface-subtle); color: var(--text); font-size: 0.85em; overflow-wrap: anywhere; }

.home-command {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: #18231c;
  color: #edf4ef;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9375rem;
}
.home-command__prompt { color: #65d69c; user-select: none; }
.home-command code { flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; }
.home-copy {
  flex: 0 0 auto;
  min-height: 2.25rem;
  padding: 0 var(--space-3);
  border: 1px solid rgba(237, 244, 239, 0.25);
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  font: 600 0.8125rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.home-copy:hover { border-color: rgba(237, 244, 239, 0.6); }
.home-copy:focus-visible { outline: 3px solid #65d69c; outline-offset: 2px; }

/* Documentation: numbered "start here" cards. */
.home-doc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: home-doc;
}
.home-doc-grid li { display: grid; counter-increment: home-doc; }
.home-doc {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}
.home-doc::before { content: "0" counter(home-doc); color: var(--primary); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; }
.home-doc:hover { border-color: var(--primary); transform: translateY(-2px); }
.home-doc:focus-visible,
.home-article__title a:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 3px; }
.home-doc__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.home-doc__body { color: var(--text-muted); font-size: 0.9375rem; line-height: 1.55; }
.home-doc__arrow { margin-top: var(--space-3); color: var(--primary); font-weight: 700; }

/* Blog: latest articles. */
.home-article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);
}
.home-article { position: relative; display: grid; align-content: start; gap: var(--space-2); padding-top: var(--space-4); border-top: 2px solid var(--primary); }
.home-article__image { width: 100%; aspect-ratio: 16 / 9; margin-bottom: var(--space-2); border-radius: var(--radius-md); object-fit: cover; background: var(--surface-subtle); }
.home-article__date { color: var(--text-subtle); font-size: 0.8125rem; font-weight: 600; }
.home-article__title { margin: 0; font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.01em; }
.home-article__title a { color: var(--text); text-decoration: none; }
/* The whole card is clickable through the title link. */
.home-article__title a::after { content: ""; position: absolute; inset: 0; }
.home-article:hover .home-article__title a { color: var(--primary); }
.home-article__body { margin: 0; color: var(--text-muted); line-height: 1.6; }

/* Final call to action. */
.home-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin: var(--layout-section-space) 0 0;
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: var(--surface);
}
.home-cta h2 { max-width: 20ch; margin: 0; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: -0.03em; }
.home-cta p { max-width: 52ch; margin: var(--space-3) 0 0; color: color-mix(in srgb, var(--surface) 82%, transparent); line-height: 1.6; }
.home-cta .actions { flex: 0 0 auto; margin-top: 0; }
.home-cta .cta-primary { background: var(--surface); color: var(--primary); }
.home-cta .cta-primary:hover { background: var(--surface-subtle); }
.home-cta .cta-secondary { border-color: color-mix(in srgb, var(--surface) 40%, transparent); color: var(--surface); }
.home-cta .cta-secondary:hover { border-color: var(--surface); background: transparent; color: var(--surface); }
.home-cta .cta-primary:focus-visible,
.home-cta .cta-secondary:focus-visible { outline-color: var(--surface); }

/* Footer. */
.home-footer {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-strong);
}
.home-footer__brand img { width: 40px; height: auto; }
.home-footer__brand p { max-width: 36ch; margin: var(--space-3) 0 0; color: var(--text-muted); font-size: 0.9375rem; line-height: 1.6; }
.home-footer__col { display: grid; align-content: start; gap: var(--space-2); }
.home-footer__col h2 { margin: 0 0 var(--space-1); color: var(--text); font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.home-footer__col a { color: var(--text-muted); font-size: 0.9375rem; text-decoration: none; }
.home-footer__col a:hover,
.home-footer__col a[aria-current="page"] { color: var(--primary); }
.home-footer__col a:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 2px; }
.home-footer__legal { grid-column: 1 / -1; margin: 0; padding-top: var(--space-4); border-top: 1px solid var(--border); color: var(--text-subtle); font-size: 0.8125rem; }

@media (max-width: 1000px) {
  .home-doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .home-section-head { grid-template-columns: 1fr; gap: var(--space-3); }
  .home-article-grid { grid-template-columns: 1fr; }
  .home-article { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); column-gap: var(--space-4); }
  .home-article__image { grid-row: span 3; margin-bottom: 0; }
  .home-cta { align-items: stretch; flex-direction: column; }
  .home-footer { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .home-doc-grid { grid-template-columns: 1fr; }
  .home-article { grid-template-columns: 1fr; }
  .home-article__image { grid-row: auto; }
  .home-command { flex-wrap: wrap; }
  .home-command code { flex-basis: calc(100% - 2rem); white-space: normal; overflow-wrap: anywhere; }
  .home-copy { width: 100%; }
  .home-subtitle { margin-top: var(--space-6); }
  .home-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  .home-doc,
  .home-release { transition: none; }
  .home-doc:hover { transform: none; }
}
