/**
 * TWA Solution — landing page layout
 * Layout only. All color, type, spacing, radius, shadow, and motion values
 * come from brand.css / colors_and_type.css tokens. No hardcoded hex.
 */

/* ============ base ============ */

/* The reference pages relied on Tailwind's preflight for this. Without it,
   width:100% inputs overflow their grid cells by their padding + border. */
*, *::before, *::after { box-sizing: border-box; }

/* ============ header ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: var(--bg1);
  background: color-mix(in srgb, var(--bg1) 92%, transparent);
}

.site-header .header-logo { height: 1.75rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.site-nav a.nav-link {
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--fg2);
  transition: color var(--dur) var(--ease);
}

.site-nav a.nav-link:hover { color: var(--fg1); }

/* ============ sections ============ */

section { scroll-margin-top: 5rem; }

.section {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

.section-dark {
  background: var(--bg-inverse);
  color: var(--fg-inverse);
}

.section-dark h2, .section-dark h3 { color: var(--fg-inverse); }

.section-band {
  background: var(--bg3);
}

.section-intro {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ============ hero ============ */

.hero {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  text-align: center;
}

.hero h1 {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-lg);
}

.hero .lead {
  max-width: 42rem;
  margin: 0 auto var(--space-xl);
}

.cta-row {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ capability band ============ */

.cap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  text-align: center;
}

.cap-n {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-xs);
}

.cap-label {
  color: var(--gray-400);
  font-size: var(--text-sm);
}

/* ============ grids ============ */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* ============ problem list ============ */

.trigger-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 36rem;
}

.trigger-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.trigger-list li:last-child { border-bottom: none; }

/* ============ process ============ */

.step {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-n {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
  color: var(--fg3);
  min-width: 3rem;
}

/* ============ placeholder marking ============ */

.placeholder {
  border: 1px dashed var(--gray-400);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  color: var(--fg3);
  background: var(--bg2);
}

.placeholder .eyebrow { color: var(--fg3); }

/* ============ FAQ ============ */

.faq details {
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.faq details:last-child { border-bottom: none; }

.faq summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-weight: 400;
  color: var(--fg3);
  transition: transform var(--dur) var(--ease);
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p {
  margin-top: var(--space-sm);
  color: var(--fg2);
  max-width: 44rem;
}

/* ============ form ============ */

/* Paired fields: when one label wraps to two lines, keep the inputs on a
   shared baseline by bottom-aligning each cell. */
#assessment-form .grid-2 { align-items: end; }

/* Form pairs are short fields: keep them side by side at all but truly
   narrow viewports, overriding the generic 640px grid collapse (which
   otherwise stacks them under window zoom or split-screen widths). */
@media (min-width: 480px) {
  #assessment-form .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ============ footer ============ */

.site-footer {
  background: var(--bg-inverse);
  color: var(--fg-inverse);
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.site-footer .footer-logo { height: 2rem; margin-bottom: var(--space-md); }

.site-footer h4 {
  color: var(--fg-inverse);
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  color: var(--gray-400);
  font-size: var(--text-sm);
  padding: var(--space-2xs) 0;
}

.site-footer a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.site-footer a:hover { color: var(--fg-inverse); }

.footer-legal {
  border-top: 1px solid var(--gray-800);
  padding-top: var(--space-lg);
  color: var(--gray-400); /* gray-500 on black fails AA (4.34:1) */
  font-size: var(--text-xs);
}

/* ============ responsive ============ */

@media (max-width: 960px) {
  .cap-grid, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cap-grid, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .step { flex-direction: column; gap: var(--space-xs); }
  .site-nav { flex-wrap: wrap; gap: var(--space-md); width: 100%; }
}

/* Sample work section */
.sample-frame {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: var(--space-lg) var(--space-lg) 0;
}
.sample-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  box-shadow: var(--shadow-sm);
}
.sample-card { overflow: hidden; padding: 0; }
.sample-card .card-body { padding: var(--space-lg); }

/* ============ legibility and focus ============ */

/* Meta copy carries pricing and legal notes: 14px, AA on white and lavender. */
.meta { font-size: var(--text-sm); color: var(--fg2); }

.section-band .trigger-list li { border-color: var(--gray-400); }

:focus-visible,
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--fg1);
  outline-offset: 2px;
}

.section-dark :focus-visible,
.site-footer :focus-visible { outline-color: var(--fg-inverse); }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--fg3); }

/* ============ compact mobile header ============ */

@media (max-width: 640px) {
  section { scroll-margin-top: 7rem; }
  .site-header {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xs);
  }
  .site-header > :first-child { grid-column: 1 / 3; }
  .site-nav { display: contents; }
  .site-nav .btn { grid-column: 3 / 5; grid-row: 1; justify-self: end; }
  .site-nav a.nav-link { grid-row: 2; }
}
