/* =============================================================================
   ORVOMA · LAYOUT.CSS
   Layout primitives, grid systems, section shells, hero composition, footer,
   responsive breakpoints, AND per-section component styles.

   Assumes tokens.css has loaded and exposes all CSS custom properties from
   §3 (color) and §4 (typography) of DESIGN_BRIEF v1. Do not redefine
   variables here — reference only.

   Author: Agent 09 · Frontend Developer
   Synthesis reconciliation: Orchestrator (class hook alignment to partials)
   ============================================================================= */


/* ============================================================
   1 · CONTAINER + SECTION SHELL
   ============================================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.sec {
  position: relative;
  padding-block: clamp(64px, 10vw, 128px);
}

.sec + .sec {
  border-top: 1px solid var(--hairline);
}

.sec-head {
  max-width: 760px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.sec-head .chip {
  display: inline-flex;
  margin-bottom: 16px;
}

.sec-head .sec-title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.sec-head .sec-lead {
  margin-top: 16px;
  font-size: var(--fs-body-lg);
  line-height: var(--lh-base);
  color: var(--text-2);
  max-width: 60ch;
}


/* ============================================================
   2 · HERO COMPOSITION
   Selectors aligned to Agent 01's .hero-chips-{tl,tr,bl,br} classes.
   ============================================================ */
.sec-hero {
  position: relative;
  display: grid;
  width: 100%;
  height: 100vh;
  min-height: 720px;
  max-height: 1080px;
  padding: clamp(24px, 4vw, 56px);
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 80px 1fr auto;
  grid-template-areas:
    "tl  .       tr"
    ".   center  . "
    "bl  .       br";
  overflow: hidden;
  background-color: var(--bg);
  border-top: 0 !important;
}

.sec-hero > * { position: relative; z-index: 1; }

.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-bg-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-frame {
  display: contents; /* let .bk-frame children flow into the hero grid areas directly */
}

.hero-chips-tl { grid-area: tl; align-self: start; justify-self: start; }
.hero-chips-tr {
  grid-area: tr; align-self: start; justify-self: end;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.hero-chips-bl { grid-area: bl; align-self: end; justify-self: start; }
.hero-chips-br { grid-area: br; align-self: end; justify-self: end; }

.hero-center {
  grid-area: center;
  align-self: center;
  justify-self: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

.hero-wordmark {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.hero-subtitle {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-base);
  color: var(--text-2);
  max-width: 56ch;
  margin: clamp(24px, 3vw, 40px) auto;
}

/* hero corner brackets — frame the viewport */
.sec-hero > .hero-frame > .bk-tl { position: absolute; top: clamp(24px, 4vw, 56px); left: clamp(24px, 4vw, 56px); }
.sec-hero > .hero-frame > .bk-tr { position: absolute; top: clamp(24px, 4vw, 56px); right: clamp(24px, 4vw, 56px); }
.sec-hero > .hero-frame > .bk-bl { position: absolute; bottom: clamp(24px, 4vw, 56px); left: clamp(24px, 4vw, 56px); }
.sec-hero > .hero-frame > .bk-br { position: absolute; bottom: clamp(24px, 4vw, 56px); right: clamp(24px, 4vw, 56px); }


/* ============================================================
   3 · GRID UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 40px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); }


/* ============================================================
   4 · BRACKET FRAME WRAPPER (when .bk-frame wraps a content block)
   ============================================================ */
.bk-frame {
  position: relative;
  padding: clamp(20px, 3vw, 32px);
}


/* ============================================================
   5 · WHAT-WE-DO · three planks
   ============================================================ */
.sec-what-we-do .plank-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  list-style: none;
  padding: 0;
  margin: 0;
}

.plank { padding-top: 4px; }

.plank-rule {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 20px;
}

.plank-label {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.plank-num { color: var(--accent); margin-right: 8px; }
.plank-sep { margin: 0 8px; color: var(--text-muted); }
.plank-kicker { color: var(--text-muted); }

.plank-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 14px;
}

.plank-body {
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--text-2);
  margin: 0;
}


/* ============================================================
   6 · WEDGE · methodology + sample findings
   ============================================================ */
.sec-wedge .wedge-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 24px);
  list-style: none;
  padding: 0;
  margin: 0 0 clamp(40px, 6vw, 72px);
}

.wedge-step {
  padding: clamp(20px, 2vw, 28px);
  background: var(--bg-elev);
  border: 1px solid var(--hairline-2);
  display: flex;
  flex-direction: column;
}

.wedge-step-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}

.wedge-step-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.wedge-step-days {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.wedge-step-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 8px;
}

.wedge-step-body {
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-2);
  margin: 0;
}

.wedge-sample {
  background: var(--bg-elev);
  padding: clamp(28px, 4vw, 48px);
}

.wedge-sample-head { margin-bottom: 24px; }
.wedge-sample-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin: 10px 0 0;
  letter-spacing: 0.04em;
}

.wedge-findings {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.wedge-findings th {
  text-align: left;
  padding: 12px 12px 12px 0;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--hairline-2);
}

.wedge-findings td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-2);
  vertical-align: top;
}

.wedge-findings .wedge-col-rank {
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 40px;
}

.wedge-findings .wedge-col-finding { color: var(--text); }
.wedge-findings .wedge-col-cause { font-size: var(--fs-small); color: var(--text-2); }

.wedge-findings .wedge-col-impact,
.wedge-findings .wedge-foot-total {
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
  color: var(--red);
  white-space: nowrap;
}

.wedge-findings tfoot td {
  padding-top: 18px;
  border-top: 1px solid var(--hairline-2);
  border-bottom: none;
}

.wedge-foot-label {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.wedge-foot-total { color: var(--accent); font-size: var(--fs-body); }

.wedge-sample-foot {
  margin: 20px 0 0;
  font-size: var(--fs-meta);
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.02em;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* ============================================================
   7 · PRICING · three tiers
   ============================================================ */
.sec-pricing .pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 32px);
  margin-bottom: clamp(48px, 6vw, 72px);
}

.tier-card { position: relative; }

.tier-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--hairline-2);
  padding: clamp(28px, 3vw, 40px);
}

.tier-card-featured .tier-card-inner {
  border-color: var(--accent);
  background: var(--bg-elev-2);
}

.tier-flag {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg) !important;
  border-color: var(--accent);
  z-index: 2;
}

.tier-head { margin-bottom: 24px; }

.tier-name {
  display: inline-flex;
  margin-bottom: 18px;
}

.tier-price {
  margin: 0;
  line-height: 1;
}

.tier-price-amount {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text);
}

.tier-positioning {
  margin: 14px 0 0;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-2);
}

.tier-scope {
  list-style: none;
  padding: 22px 0 0;
  margin: 0 0 24px;
  border-top: 1px solid var(--hairline);
  flex-grow: 1;
}

.tier-scope li {
  padding: 10px 0 10px 22px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-2);
  position: relative;
}

.tier-scope li::before {
  content: "→";
  position: absolute;
  left: 0; top: 10px;
  color: var(--accent);
  font-weight: 600;
}

.tier-meta { margin-bottom: 22px; }

.tier-cta { margin-top: auto; }
.tier-cta .cta-chip { width: 100%; justify-content: center; }

.pricing-rationale {
  margin: 0 auto;
}

.pricing-rationale-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(28px, 4vw, 40px);
}

.pricing-rationale-inner .chip {
  margin-bottom: 18px;
}

.pricing-rationale-body {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text-2);
}


/* ============================================================
   8 · ICP · "who we work with"
   ============================================================ */
.sec-icp .icp-lead {
  margin-bottom: clamp(40px, 5vw, 64px);
  max-width: 760px;
}

.icp-statement {
  font-size: var(--fs-body-lg);
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

.icp-cohort {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--accent);
  letter-spacing: 0.03em;
}

.icp-cohort em { font-style: normal; }

.icp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 32px);
}

.icp-col {
  padding: clamp(24px, 3vw, 32px);
  background: var(--bg-elev);
  border: 1px solid var(--hairline-2);
}

.icp-col-head {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline-2);
}

.icp-col-fit .icp-col-head { color: var(--accent); }
.icp-col-nofit .icp-col-head { color: var(--text-muted); }

.icp-list { list-style: none; padding: 0; margin: 0; }

.icp-list li {
  padding: 12px 0;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-2);
  border-bottom: 1px solid var(--hairline);
}

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


/* ============================================================
   9 · SECOND CTA BAND
   ============================================================ */
.sec-cta-band { padding-block: clamp(80px, 12vw, 160px); }

.cta-band-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(40px, 6vw, 72px);
}

.cta-band-title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: var(--lh-snug);
  color: var(--text);
  margin: 0;
}

.cta-band-lead {
  margin: 22px auto 36px;
  font-size: var(--fs-body-lg);
  line-height: var(--lh-base);
  color: var(--text-2);
  max-width: 56ch;
}

.cta-band-action {
  display: flex;
  justify-content: center;
}


/* ============================================================
   10 · FOOTER
   Aligned to Agent 07's .footer-row / .footer-brand / .footer-nav structure.
   ============================================================ */
.site-footer {
  padding: 48px 0 56px;
  border-top: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.site-footer .footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.site-footer .footer-brand,
.site-footer .footer-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer .footer-wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-2);
  font-size: var(--fs-body);
  letter-spacing: -0.01em;
}

.site-footer .footer-copy {
  color: var(--text-muted);
}

.site-footer .footer-nav {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-footer .footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.site-footer .footer-link:hover { color: var(--accent); }

.site-footer .footer-sep {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.site-footer .footer-microcopy {
  margin: 24px 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}


/* ============================================================
   11 · SKIP LINK (a11y)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  z-index: 1000;
  transition: top 120ms ease;
}

.skip-link:focus {
  top: 8px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ============================================================
   12 · RESPONSIVE: LARGE DESKTOP (≥1440px)
   ============================================================ */
@media (min-width: 1440px) {
  .container { padding-inline: clamp(48px, 5vw, 64px); }
  .sec-hero { padding: clamp(40px, 4vw, 64px); }
}


/* ============================================================
   13 · RESPONSIVE: TABLET (≤1023px)
   ============================================================ */
@media (max-width: 1023px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sec-what-we-do .plank-grid { grid-template-columns: 1fr; gap: 32px; max-width: 720px; }
  .sec-wedge .wedge-steps { grid-template-columns: repeat(2, 1fr); }
  .sec-pricing .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin-left: auto; margin-right: auto; }
  .icp-grid { grid-template-columns: 1fr; }
  .sec-hero { padding: clamp(20px, 3vw, 40px); min-height: 640px; }
  .hero-center { padding-inline: clamp(16px, 3vw, 32px); }
  .hero-subtitle { max-width: 48ch; }
  .wedge-findings .wedge-col-cause { display: none; }
}


/* ============================================================
   14 · RESPONSIVE: MOBILE (≤767px)
   Selectors aligned: .chip-menu (Agent 01) for mobile-visible menu chip.
   ============================================================ */
@media (max-width: 767px) {
  .container { padding-inline: 20px; }
  .sec { padding-block: clamp(48px, 12vw, 80px); }
  .sec-head { margin-bottom: clamp(28px, 7vw, 48px); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 20px; }

  /* hero collapse per §6 */
  .sec-hero {
    height: auto;
    min-height: 100vh;
    max-height: none;
    grid-template-rows: auto 1fr auto;
    padding: 20px;
  }
  .hero-chips-tr { gap: 0; }
  .hero-chips-tr > :not(.chip-menu) { display: none; }
  .hero-chips-bl, .hero-chips-br { display: none; }
  .hero-subtitle { max-width: 38ch; margin: 20px auto 28px; }

  .sec-what-we-do .plank-grid { grid-template-columns: 1fr; }
  .sec-wedge .wedge-steps { grid-template-columns: 1fr; }
  .sec-pricing .pricing-grid { grid-template-columns: 1fr; max-width: 100%; }
  .icp-grid { grid-template-columns: 1fr; }

  .wedge-findings { font-size: var(--fs-meta); }
  .wedge-findings th, .wedge-findings td { padding: 10px 6px 10px 0; }

  .site-footer .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .site-footer .footer-brand,
  .site-footer .footer-nav { gap: 12px; }
}


/* ============================================================
   15 · RESPONSIVE: SMALL MOBILE (≤419px)
   ============================================================ */
@media (max-width: 419px) {
  .container { padding-inline: 16px; }
  .sec { padding-block: 48px; }
  .sec-hero { padding: 16px; }
  .hero-subtitle { font-size: var(--fs-body); max-width: 32ch; }
  .bk-frame { padding: 16px; }
  body, html { overflow-x: hidden; }
}


/* ============================================================
   16 · REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .site-footer a,
  .skip-link { transition: none; }
}
