/*
 * Home — deliverable / sample-estimate section.
 * Paper background, split-screen with detail photo (sticky on desktop)
 * left + estimate-document mock right. Heaviest section by markup.
 */

.home-est {
  background: var(--paper);
  color: var(--ink-0);
  padding: 120px 48px;
}
.home-est-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: start;
}
.home-est-visual { position: sticky; top: 32px; }
.home-est-photo {
  width: 100%;
  height: 520px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: grayscale(0.6) contrast(1.05);
}
.home-est-caption {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  font-size: 12px;
  color: var(--gray-1);
}
.home-est-caption-mono {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--amber-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 48px;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink-0);
  margin-bottom: 24px;
  margin-top: 16px;
  text-wrap: balance;
}
.home-body-light {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
  margin-bottom: 32px;
}

.home-doc-frame {
  background: var(--ink-0);
  color: var(--paper);
  padding: 28px;
  border: 1px solid var(--ink-2);
}
.home-doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink-3);
  margin-bottom: 20px;
}
.home-doc-id {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-2);
  margin-bottom: 6px;
}
.home-doc-meta { font-size: 13px; color: var(--gray-1); }
.home-doc-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: var(--amber);
  color: var(--ink-0);
  font-weight: 600;
}
.home-doc-total {
  border: 1px solid var(--amber-2);
  padding: 20px;
  margin-bottom: 20px;
  background: rgba(190, 120, 40, 0.08);
}
.home-doc-total-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
.home-doc-total-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 38px;
  letter-spacing: -0.03em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.home-doc-total-note { font-size: 12px; color: var(--gray-1); }
.home-doc-table { width: 100%; border-collapse: collapse; }
.home-doc-table td {
  padding: 11px 0;
  border-bottom: 1px solid var(--ink-2);
  font-size: 13px;
  color: var(--gray-3);
}
.home-doc-table td:nth-child(2) { color: var(--gray-2); text-align: center; width: 60px; }
.home-doc-table td:nth-child(3) {
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
}

/* ===== Interactive reveal ===== */
/* The doc starts in `is-pre-animation` (set by JS as soon as the
   script runs); on scroll-into-view JS swaps to `is-animated` and
   the line items stagger-fade-in while the total counts up via JS.
   No-JS fallback: rows stay visible because neither class is set. */
.home-doc-frame.is-pre-animation .home-doc-table tbody tr {
  opacity: 0;
  transform: translateY(8px);
}
.home-doc-frame.is-pre-animation .home-doc-total-num {
  opacity: 0.6;
}
.home-doc-frame.is-animated .home-doc-table tbody tr {
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  opacity: 1;
  transform: translateY(0);
}
.home-doc-frame.is-animated .home-doc-table tbody tr:nth-child(1) { transition-delay: 0.20s; }
.home-doc-frame.is-animated .home-doc-table tbody tr:nth-child(2) { transition-delay: 0.34s; }
.home-doc-frame.is-animated .home-doc-table tbody tr:nth-child(3) { transition-delay: 0.48s; }
.home-doc-frame.is-animated .home-doc-table tbody tr:nth-child(4) { transition-delay: 0.62s; }
.home-doc-frame.is-animated .home-doc-table tbody tr:nth-child(5) { transition-delay: 0.76s; }
.home-doc-frame.is-animated .home-doc-total-num {
  transition: opacity 0.3s ease-out;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .home-doc-frame.is-pre-animation .home-doc-table tbody tr,
  .home-doc-frame.is-pre-animation .home-doc-total-num {
    opacity: 1;
    transform: none;
  }
  .home-doc-frame.is-animated .home-doc-table tbody tr {
    transition: none;
    transition-delay: 0s;
  }
}

@media (max-width: 1024px) {
  .home-est { padding: 96px 32px; }
  .home-h2 { font-size: 38px; }
  .home-est-grid { gap: 48px; }
  .home-est-visual { position: static; }
}
@media (max-width: 768px) {
  .home-est { padding: 72px 20px; }
  .home-h2 { font-size: 28px; }
  .home-est-grid { grid-template-columns: 1fr; gap: 32px; }
  .home-est-photo { height: 320px; }
  .home-doc-total-num { font-size: 30px; }
}
@media (max-width: 480px) {
  .home-doc-frame { padding: 20px; }
  .home-doc-total-num { font-size: 26px; }
  .home-doc-table td { font-size: 12px; padding: 9px 0; }
}
