/*
 * Home page layout (src/pages/index.astro).
 *
 * Structure — "bezel and display field":
 *
 *   header (black)
 *   hero (black bezel, compact and content-sized: no viewport minimum)
 *   ╭─ field ───────────────────────────────────────────────╮  lighter
 *   │ What we build · Featured work · How we work ·          │  phosphor
 *   │ Products · Capabilities                                │  gray-green
 *   ╰────────────────────────────────────────────────────────╯
 *   CTA band + footer (black shell again)
 *
 * The hero is deliberately short so the field's top edge and the What we
 * build columns are visible on the first desktop screen; the layout itself
 * says "the page continues", with no scroll prompt. Inside the field,
 * sections share one surface, are separated by thin rules, and most use a
 * "rail": section identity in a narrow left column, content beside it, so
 * there are no empty heading rows.
 *
 * The shared page shell (shell-page base, display field, field sections,
 * rail, work grid, closing band on black, scroll reveal) and all reusable
 * components live in system.css; this file only composes Home's own
 * sections (hero, What we build, method note, product grid, capabilities)
 * and the hero motto motion.
 */

/* ---------------------------------------------------------------------------
 * 1. Hero — the motto is the H1. Height comes from content only.
 * ------------------------------------------------------------------------ */

.hero {
  padding-block: 3.5rem 3rem;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}

.hero__copy {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.hero__motto {
  display: grid;
  gap: 0.06em;
  margin: 0;
  color: var(--text);
  font-size: clamp(2.125rem, 1.2rem + 2.9vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

/* Three verbatim motto lines; the third carries the VFD accent. */
.motto-line {
  display: block;
}

.motto-line--lit {
  color: var(--accent);
  text-shadow: 0 0 28px var(--accent-glow);
}

.hero__lede {
  max-width: 54rem;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 0.25rem;
}

/*
 * Seven-segment mark cropped from the existing logo PNG (with its decimal
 * point). Measured mark bounds in the 1254px source: x 380–945, y 220–878.
 * Kept to ~180px tall so it never sets the hero's height.
 */
.hero__mark {
  display: none;
  position: relative;
  justify-self: end;
  width: 9.5rem;
  aspect-ratio: 565 / 658;
  overflow: hidden;
}

.hero__mark img {
  position: absolute;
  width: 221.9%;
  height: auto;
  max-width: none;
  left: -67.3%;
  top: -33.4%;
}

@media (min-width: 56rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-6);
  }

  .hero__mark {
    display: block;
  }
}

@media (max-width: 30rem) {
  .hero {
    padding-block: 2.5rem 2.5rem;
  }
}

/* ---------------------------------------------------------------------------
 * 2. What we build — three ruled columns answering the motto.
 * ------------------------------------------------------------------------ */

.build__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.build__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-strong);
}

.build__item::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--accent-dim);
}

.build__item--lit::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.build__index {
  margin: 0;
  color: var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.build__word {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.875rem, 1.5rem + 0.8vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* The trailing period echoes the decimal point of the 8. mark. */
.build__word span {
  color: var(--accent);
}

.build__item--lit .build__word {
  color: var(--accent);
  text-shadow: 0 0 22px var(--accent-glow);
}

.build__lead {
  margin: 0;
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.build__list {
  display: grid;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-body);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.build__list li {
  position: relative;
  padding-left: 1.125rem;
}

.build__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 1px;
  background: var(--accent-dim);
}

.build__proof {
  display: grid;
  gap: 0.25rem;
  margin: auto 0 0;
  padding-top: var(--space-1);
}

.build__proof .eyebrow {
  font-size: 0.6875rem;
  color: var(--text-faint);
}

@media (min-width: 48rem) {
  .build__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

/* ---------------------------------------------------------------------------
 * 4. How we work
 * ------------------------------------------------------------------------ */

.method__note {
  max-width: var(--measure);
  margin: var(--space-4) 0 0;
  padding-left: var(--space-3);
  border-left: 2px solid var(--accent-dim);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.method__note .dim8-link {
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * 5. Products
 * ------------------------------------------------------------------------ */

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

@media (min-width: 40rem) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------------------
 * 6. Capabilities — a quiet spec list, not a logo wall.
 * ------------------------------------------------------------------------ */

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

.capabilities__group {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-strong);
}

.capabilities__group dt {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.capabilities__group dd {
  margin: 0;
}

.capabilities__group ul {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

@media (min-width: 64rem) {
  .capabilities__list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------------------
 * Motion — subtle, and only when the visitor hasn't asked for less.
 *
 * Hero lines rise in once; the lit third line gets a brief VFD "strike".
 * While the intro owns the screen the lines wait (opacity 0); the reveal
 * starts as the intro overlay begins fading out, so it reads as one handoff.
 * ------------------------------------------------------------------------ */

@keyframes motto-rise {
  from {
    opacity: 0;
    transform: translateY(0.3em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes vfd-strike {
  0% { opacity: 0; }
  10% { opacity: 0.55; }
  16% { opacity: 0.08; }
  28% { opacity: 0.85; }
  34% { opacity: 0.35; }
  46% { opacity: 1; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .motto-line {
    animation: motto-rise 700ms var(--ease-out) both;
    animation-delay: calc(var(--line, 0) * 140ms);
  }

  .motto-line--lit {
    animation: vfd-strike 900ms linear both;
    animation-delay: calc(var(--line, 0) * 140ms + 120ms);
  }

  html.vfd-intro-pending .motto-line,
  html:has(.vfd-startup.is-active:not(.is-finishing)) .motto-line {
    animation: none;
    opacity: 0;
  }

}
