/* Homepage sections. Shared tokens, bar, buttons and footer live in styles.css. */

/* Hero: text card beside the product, both full height */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px;
  padding: 0 var(--m);
}
.hero-card {
  container-type: inline-size;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 32px;
  padding: clamp(28px, 4.4vw, 72px); min-height: min(64svh, 560px);
  background: var(--surface);
}
.hero h1 { font-size: min(var(--step-display), 11cqi); }
.hero h1 span { display: block; }
.hero-lead { font-size: var(--step-lead); line-height: 1.4; max-width: 30ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.hero-stage {
  margin: 0; display: flex; flex-direction: column;
  background: #fff; overflow: hidden;
}
.hero-stage img {
  flex: 1 1 0; min-height: 0; width: 100%; object-fit: cover; object-position: 0 0;
  animation: settle 1.8s var(--ease) both;
}
.hero-stage figcaption {
  padding: 12px 16px; background: var(--stage); color: var(--muted); font-size: var(--step-small);
}
@keyframes settle { from { transform: scale(1.06); opacity: 0; } to { transform: none; opacity: 1; } }

/* Outputs: index of names beside a stage holding the real output */
.outputs {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(24px, 4vw, 72px);
  padding: var(--gap) var(--m) 0;
}
.outputs > h2 { font-size: var(--step-head); grid-column: 1; margin-bottom: 40px; }
.output-list { display: none; }
.output {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: subgrid; align-items: start;
  margin-bottom: 64px;
}
.output-note { grid-column: 1; display: grid; gap: 16px; max-width: 46ch; }
.output-note h3 { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.01em; }
.sheet-stage {
  grid-column: 2;
  display: grid; align-content: start;
  min-height: min(72svh, 620px); padding: clamp(16px, 4vw, 64px);
  background: var(--stage);
}
.sheet { min-width: 0; }
.sheet-shot { width: 100%; }
.phones { display: flex; gap: 24px; align-items: flex-start; justify-content: center; left: 6%; right: 6%; }
.phones img { flex: 1 1 0; min-width: 0; max-width: 220px; border-radius: 22px; }
.phones img:nth-child(2) { margin-top: 56px; }
.phones img:nth-child(3) { margin-top: 112px; }

.js .outputs > h2 { grid-row: 1; }
.js .output-list {
  grid-column: 1; grid-row: 2;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  position: relative; z-index: 1;
}
.output-list button {
  appearance: none; border: 0; background: none; padding: 2px 0; cursor: pointer;
  font: 400 var(--step-head)/1.1 var(--sans); letter-spacing: -0.02em; text-align: left;
  color: var(--muted); transition: color .2s var(--ease), transform .2s var(--ease);
}
.output-list button:hover { color: var(--ink); transform: translateX(6px); }
.output-list button[aria-selected="true"] { color: var(--ink); }
.js .outputs { grid-template-rows: auto auto 1fr; }
.js .output {
  grid-row: 1 / 4; grid-template-rows: subgrid;
  margin-bottom: 0; pointer-events: none;
  animation: fade .25s var(--ease) both;
}
.js .output > * { pointer-events: auto; }
.js .output-note { grid-row: 3; align-self: end; margin-top: 48px; }
.js .sheet-stage { grid-row: 1 / 4; }
.output[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Ledger */
.ledger { padding: var(--gap) var(--m) 0; }
.ledger > h2 { font-size: var(--step-head); margin-bottom: 40px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows a {
  display: grid; grid-template-columns: minmax(12rem, 3fr) minmax(0, 7fr) minmax(8rem, 2fr); gap: 24px; align-items: baseline;
  padding: 14px 0; text-decoration: none;
  transition: color .2s var(--ease);
}
.rows .name { font-weight: 600; }
.rows .kind { color: var(--muted); }
.rows .state { text-align: right; font-variant-numeric: tabular-nums; }
.rows:hover a, .rows:focus-within a { color: var(--muted); }
.rows a:hover, .rows a:focus-visible { color: var(--ink); }
.rows a:hover .kind, .rows a:focus-visible .kind { color: var(--ink); }
.ledger-more { margin-top: 32px; color: var(--muted); }
.ledger-more a { color: var(--ink); }

/* Sites: the one section that breaks the split and runs full width */
.sites {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 12px;
  padding: var(--gap) var(--m) 0;
}
.sites > h2 { grid-column: 1 / -1; font-size: var(--step-head); }
.sites figure { margin: 0; display: grid; gap: 14px; }
.sites figcaption { font-size: var(--step-small); color: var(--muted); }
.sites figcaption a { color: var(--ink); font-weight: 600; }

/* Letter */
.letter {
  padding: var(--gap) var(--m);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 6vw, 112px); align-items: start;
}
.portrait { grid-row: 1 / 3; width: 100%; max-width: 520px; justify-self: end; aspect-ratio: 3 / 4; object-fit: cover; }
.letter > h2, .letter-body { max-width: 36rem; }
.letter > h2 { font-size: var(--step-head); margin-bottom: 40px; }
.letter-body { display: grid; gap: 1.2em; }
.sign { font-size: var(--step-lead); margin-top: 0.6em; }
.sign span { display: block; font-size: var(--step-small); color: var(--muted); }

/* Tablet and phone */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-stage { order: -1; height: auto; }
  .hero-stage img { flex: none; }
  .hero-stage figcaption { order: -1; }
  .hero-card { padding: 28px 24px 32px; min-height: 0; }
  .outputs { grid-template-columns: 1fr; }
  .js .outputs { grid-template-rows: none; }
  .output, .js .output { grid-template-columns: 1fr; grid-template-rows: none; grid-row: auto; }
  .output-note, .sheet-stage, .js .output-note, .js .sheet-stage { grid-column: 1; grid-row: auto; }
  .js .output-note { margin-top: 28px; }
  .sheet-stage { order: -1; min-height: 0; margin-top: 24px; }
  .js .output-list {
    grid-row: auto; flex-direction: row; gap: 24px;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px;
  }
  .output-list button { font-size: var(--step-lead); white-space: nowrap; scroll-snap-align: start; }
  .output-list button:hover { transform: none; }
  .stage-phones { height: auto; padding: 20px 16px 24px; }
  .stage-phones .phones { position: static; }
  .phones { gap: 14px; }
  .phones img { border-radius: 16px; }
  .phones img:nth-child(2) { margin-top: 32px; }
  .phones img:nth-child(3) { margin-top: 64px; }
  .sites { grid-template-columns: 1fr; }
  .letter { grid-template-columns: 1fr; }
  .portrait { grid-row: auto; justify-self: start; max-width: 320px; margin-bottom: 40px; }
  .rows a { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 0; }
  .rows .kind { grid-column: 1 / -1; grid-row: 2; font-size: var(--step-small); }
  .rows .state { grid-row: 1; grid-column: 2; }
}
