/*
 * Page Archetypes — structural layout CSS for AI-generated pages.
 * Three archetypes produce structurally distinct page layouts.
 * Each archetype uses CSS custom properties from the per-page design system.
 *
 * Archetypes:
 *   .arch-split-screen  — text left, hero image area right
 *   .arch-centered      — centered bold layout with full-width sections
 *   .arch-alternating   — dark/light block alternation with depth
 */

/* ===================================================================
   BASE — shared reset and design token wiring (all archetypes)
   =================================================================== */

.arch-page {
  background: var(--p-bg-primary);
  color: var(--p-text-primary);
  font-family: var(--p-font-body);
  line-height: 1.65;
  overflow-x: hidden;
}

.arch-page *, .arch-page *::before, .arch-page *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.arch-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Headings — all archetypes share font/weight from tokens */
.arch-page h1, .arch-page h2, .arch-page h3, .arch-page h4 {
  font-family: var(--p-font-heading);
  font-weight: var(--p-heading-weight);
  letter-spacing: var(--p-letter-spacing);
  line-height: 1.12;
  color: var(--p-text-primary);
}

.arch-page p {
  color: var(--p-text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.arch-page ul, .arch-page ol {
  padding-left: 20px;
  color: var(--p-text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.arch-page li { margin-bottom: 6px; }

.arch-page strong {
  color: var(--p-text-primary);
  font-weight: 600;
}

/* Shared CTA button style — uses per-page tokens */
.arch-btn {
  display: inline-block;
  background: var(--p-primary);
  color: var(--p-primary-text);
  font-family: var(--p-font-heading);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 36px;
  border-radius: var(--p-radius-btn);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  letter-spacing: 0.02em;
}
.arch-btn:hover { opacity: 0.88; transform: translateY(-2px); }

/* Shared card style */
.arch-card {
  background: var(--p-bg-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-card);
  padding: 28px 32px;
}

/* ===================================================================
   ARCHETYPE 1 — SPLIT SCREEN
   Hero: text on left, image placeholder on right.
   Content: side-by-side two-column sections.
   =================================================================== */

.arch-split-screen .arch-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--p-border);
}

.arch-split-screen .arch-nav-logo {
  font-family: var(--p-font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--p-accent);
  text-decoration: none;
}

.arch-split-screen .arch-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: 480px;
  padding: 80px 0 70px;
}

.arch-split-screen .arch-hero-text {}

.arch-split-screen .arch-hero-eyebrow {
  font-family: var(--p-font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--p-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 18px;
  display: block;
}

.arch-split-screen .arch-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  margin-bottom: 20px;
  color: var(--p-text-primary);
}

.arch-split-screen .arch-hero-sub {
  font-size: 1.15rem;
  color: var(--p-text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 440px;
}

.arch-split-screen .arch-hero-image {
  background: var(--p-bg-secondary);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-card);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p-text-secondary);
  font-size: 0.85rem;
  font-family: var(--p-font-body);
  position: relative;
  overflow: hidden;
}

.arch-split-screen .arch-hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    var(--p-bg-secondary) 0%,
    color-mix(in srgb, var(--p-primary) 15%, var(--p-bg-secondary)) 100%);
}

.arch-split-screen .arch-hero-image-label {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
}

/* Split-screen content sections */
.arch-split-screen .arch-section {
  padding: 72px 0;
  border-top: 1px solid var(--p-border);
}

.arch-split-screen .arch-section-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.arch-split-screen .arch-section-split.reverse {
  direction: rtl;
}
.arch-split-screen .arch-section-split.reverse > * {
  direction: ltr;
}

.arch-split-screen .arch-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 20px;
  color: var(--p-text-primary);
}

.arch-split-screen .arch-section h3 {
  font-size: 1.1rem;
  font-family: var(--p-font-heading);
  font-weight: 600;
  color: var(--p-accent);
  margin: 24px 0 10px;
}

.arch-split-screen .arch-section-card-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.arch-split-screen .arch-section-card-stack .arch-card {
  border-left: 3px solid var(--p-primary);
}

.arch-split-screen .arch-cta-section {
  padding: 80px 0;
  border-top: 1px solid var(--p-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.arch-split-screen .arch-cta-text h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 10px;
}

.arch-split-screen .arch-cta-text p {
  font-size: 1.05rem;
}

/* ===================================================================
   ARCHETYPE 2 — CLEAN CENTER
   Centered headline, massive typographic statement, full-width sections.
   Minimalist with generous whitespace.
   =================================================================== */

.arch-centered .arch-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--p-border);
  position: relative;
}

.arch-centered .arch-nav-logo {
  font-family: var(--p-font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--p-accent);
  text-decoration: none;
}

.arch-centered .arch-nav-cta {
  position: absolute;
  right: 24px;
}

.arch-centered .arch-hero {
  text-align: center;
  padding: 100px 0 90px;
  max-width: 780px;
  margin: 0 auto;
}

.arch-centered .arch-hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--p-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--p-accent) 12%, transparent);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
}

.arch-centered .arch-hero h1 {
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  line-height: 1.06;
  margin-bottom: 28px;
}

.arch-centered .arch-hero h1 .arch-highlight {
  color: var(--p-accent);
}

.arch-centered .arch-hero-sub {
  font-size: 1.2rem;
  color: var(--p-text-secondary);
  line-height: 1.75;
  margin: 0 auto 44px;
  max-width: 560px;
}

/* Full-width image band */
.arch-centered .arch-image-band {
  width: 100%;
  background: var(--p-bg-secondary);
  border-top: 1px solid var(--p-border);
  border-bottom: 1px solid var(--p-border);
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.arch-centered .arch-image-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%,
    color-mix(in srgb, var(--p-primary) 20%, transparent) 0%,
    transparent 70%);
}

.arch-centered .arch-image-band-label {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--p-text-secondary);
  font-size: 0.85rem;
}

/* Centered content sections */
.arch-centered .arch-section {
  padding: 96px 0;
  border-top: 1px solid var(--p-border);
  text-align: center;
}

.arch-centered .arch-section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 16px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.arch-centered .arch-section > .arch-container > p,
.arch-centered .arch-section-intro {
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 60px;
  text-align: center;
}

.arch-centered .arch-section h3 {
  font-size: 1.15rem;
  font-family: var(--p-font-heading);
  color: var(--p-accent);
  margin-bottom: 10px;
}

.arch-centered .arch-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: left;
  margin-top: 48px;
}

.arch-centered .arch-cards-row .arch-card {
  position: relative;
  overflow: hidden;
}

.arch-centered .arch-cards-row .arch-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--p-accent), transparent);
}

/* ===================================================================
   ARCHETYPE 3 — ALTERNATING STACK
   Dark hero → light features → dark testimonials → light CTA
   Creates page depth through alternating backgrounds.
   =================================================================== */

.arch-alternating .arch-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--p-border);
  background: var(--p-bg-primary);
}

.arch-alternating .arch-nav-logo {
  font-family: var(--p-font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--p-accent);
  text-decoration: none;
}

/* BLOCK 1: DARK hero */
.arch-alternating .arch-block-dark {
  background: var(--p-bg-primary);
  padding: 96px 0 80px;
  position: relative;
  overflow: hidden;
}

.arch-alternating .arch-block-dark::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -120px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--p-accent) 20%, transparent) 0%,
    transparent 65%);
  pointer-events: none;
}

.arch-alternating .arch-block-dark h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  margin-bottom: 24px;
  max-width: 760px;
}

.arch-alternating .arch-block-dark h1 .arch-highlight {
  color: var(--p-accent);
}

.arch-alternating .arch-block-dark .arch-hero-eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--p-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.arch-alternating .arch-block-dark .arch-hero-sub {
  font-size: 1.15rem;
  color: var(--p-text-secondary);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 40px;
}

/* BLOCK 2: LIGHT features */
.arch-alternating .arch-block-light {
  background: var(--p-bg-secondary);
  padding: 80px 0;
  border-top: 1px solid var(--p-border);
  border-bottom: 1px solid var(--p-border);
}

.arch-alternating .arch-block-light h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 48px;
  max-width: 600px;
}

.arch-alternating .arch-block-light h3 {
  font-size: 1.1rem;
  font-family: var(--p-font-heading);
  color: var(--p-accent);
  margin-bottom: 10px;
}

.arch-alternating .arch-block-light .arch-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.arch-alternating .arch-block-light .arch-feature-item {
  padding: 28px 0;
  border-top: 2px solid var(--p-primary);
}

/* BLOCK 3: DARK testimonials / social proof */
.arch-alternating .arch-block-dark2 {
  background: var(--p-bg-primary);
  padding: 80px 0;
}

.arch-alternating .arch-block-dark2 h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: 48px;
  max-width: 560px;
}

.arch-alternating .arch-block-dark2 .arch-testimonials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.arch-alternating .arch-block-dark2 .arch-card {
  border-left: 3px solid var(--p-accent);
}

/* BLOCK 4: LIGHT CTA */
.arch-alternating .arch-block-cta {
  background: var(--p-bg-secondary);
  padding: 96px 0;
  border-top: 1px solid var(--p-border);
  text-align: center;
}

.arch-alternating .arch-block-cta h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 16px;
}

.arch-alternating .arch-block-cta p {
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto 36px;
}

/* ===================================================================
   FOOTER — shared across all archetypes
   =================================================================== */

.arch-footer {
  padding: 40px 0;
  border-top: 1px solid var(--p-border);
  background: var(--p-bg-primary);
}

.arch-footer .arch-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.arch-footer-logo {
  font-family: var(--p-font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--p-accent);
}

.arch-footer-note {
  font-size: 0.8rem;
  color: var(--p-text-secondary);
}

.arch-footer-links {
  display: flex;
  gap: 16px;
}

.arch-footer-links a {
  font-size: 0.8rem;
  color: var(--p-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.arch-footer-links a:hover { color: var(--p-accent); }

/* ===================================================================
   RESPONSIVE — mobile-first breakpoints
   =================================================================== */

@media (max-width: 768px) {
  /* Split screen collapses to single column */
  .arch-split-screen .arch-hero {
    grid-template-columns: 1fr;
    padding: 60px 0 48px;
  }
  .arch-split-screen .arch-hero-image { display: none; }
  .arch-split-screen .arch-section-split { grid-template-columns: 1fr; gap: 32px; }
  .arch-split-screen .arch-section-split.reverse { direction: ltr; }
  .arch-split-screen .arch-cta-section { flex-direction: column; text-align: center; }

  /* Centered collapses */
  .arch-centered .arch-hero { padding: 64px 0 56px; }
  .arch-centered .arch-image-band { height: 220px; }
  .arch-centered .arch-cards-row { grid-template-columns: 1fr; }
  .arch-centered .arch-nav-cta { display: none; }

  /* Alternating collapses */
  .arch-alternating .arch-block-dark { padding: 64px 0 52px; }
  .arch-alternating .arch-block-light .arch-features-grid { grid-template-columns: 1fr; }
  .arch-alternating .arch-block-dark2 .arch-testimonials-grid { grid-template-columns: 1fr; }
  .arch-alternating .arch-block-cta { padding: 64px 0; }

  /* Footer */
  .arch-footer .arch-container { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .arch-container { padding: 0 16px; }
  .arch-btn { padding: 14px 28px; font-size: 0.95rem; }
}
