/* Home page: hero (reuses the launch artwork from styles.css), sections and footer */

.hero h1 {
  max-width: none;
  font-size: clamp(3.4rem, 6.4vw, 7rem);
  letter-spacing: -0.055em;
  line-height: 0.9;
}
.hero .lede { max-width: 32rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 3.5vh, 2.25rem);
  opacity: 0;
  animation: arrive 0.8s 0.9s ease-out forwards;
}
.hero-actions .yt-cta { margin: 0; opacity: 1; animation: none; }

/* A real hand calculation from the prestressed girder tool, revealed line by line, on the right of the hero */
.hero-calc {
  position: absolute;
  z-index: 1;
  top: 55%;
  right: clamp(1.5rem, 6vw, 6.5rem);
  width: min(31vw, 30rem);
  margin: 0;
  padding: 1.25rem 1.4rem 1.15rem;
  border: 1px solid rgba(var(--line-rgb), 0.22);
  border-top: 2px solid var(--accent);
  background: rgba(var(--surface-rgb), 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color: var(--text-soft);
  opacity: 0;
  transform: translateY(-50%);
  animation: hcc-in 0.9s 0.7s cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}
:root[data-theme="light"] .hero-calc { box-shadow: 0 20px 50px rgba(10, 40, 90, 0.16); }
.hcc-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--accent-pale);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hcc-head span:last-child { white-space: nowrap; }
.hcc-meta { margin: 0.55rem 0 0.8rem; color: var(--text-dim); font-size: 0.78rem; }
.hcc-lines { margin: 0; padding: 0; list-style: none; }
.hcc-lines li {
  display: grid;
  gap: 0.05rem;
  padding: 0.42rem 0;
  border-top: 1px solid rgba(var(--line-rgb), 0.1);
  opacity: 0;
  transform: translateY(4px);
  animation: hcc-line 0.45s ease-out forwards;
}
.hcc-lines li:nth-child(1) { animation-delay: 1.4s; }
.hcc-lines li:nth-child(2) { animation-delay: 1.85s; }
.hcc-lines li:nth-child(3) { animation-delay: 2.3s; }
.hcc-lines li:nth-child(4) { animation-delay: 2.75s; }
.hcc-lines li:nth-child(5) { animation-delay: 3.2s; }
.hcc-lines li:nth-child(6) { animation-delay: 3.65s; }
.hcc-lines .d { color: var(--text-dim); font-size: 0.72rem; }
.hcc-lines .m { color: var(--text-soft); font-size: 0.86rem; line-height: 1.45; }
.hcc-lines b, .hcc-pass { color: var(--text); font-weight: 650; }
.hero-calc sub { font-size: 70%; line-height: 0; }
.hcc-pass {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.7rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(var(--line-rgb), 0.18);
  font-size: 0.9rem;
  opacity: 0;
  animation: hcc-line 0.5s 4.2s ease-out forwards;
}
.hcc-pass .tag {
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--ok);
  color: var(--ok);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}
.hcc-link {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--link);
  font-size: 0.82rem;
  text-decoration: none;
  opacity: 0;
  animation: hcc-line 0.5s 4.6s ease-out forwards;
}
.hcc-link:hover { text-decoration: underline; }
@keyframes hcc-in {
  from { opacity: 0; transform: translateY(-46%); }
  to { opacity: 1; transform: translateY(-50%); }
}
@keyframes hcc-line { to { opacity: 1; transform: none; } }
/* Below 1280 px there is no room beside the headline: the hero stacks and the card sits under the buttons */
@keyframes hcc-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 1279px) {
  .hero { min-height: auto; padding-bottom: 3.5rem; }
  /* The stacked announcement (z-index 2) reserves room for the masthead with top padding, so that padding
     sits over the nav; lift the masthead above it or its links and theme toggle can't be tapped */
  .hero .masthead { z-index: 3; }
  .hero .announcement {
    position: relative;
    top: auto; left: auto; right: auto;
    width: auto;
    max-width: 46rem;
    padding: clamp(9rem, 20vh, 12rem) clamp(1.5rem, 6vw, 6.5rem) 0;
    transform: none;
  }
  .hero-calc {
    position: relative;
    top: auto; right: auto;
    width: auto;
    max-width: 34rem;
    margin: 2.5rem clamp(1.5rem, 6vw, 6.5rem) 0;
    transform: none;
    animation-name: hcc-up;
  }
}
@media (max-width: 420px) {
  .hero-calc { padding: 1rem 1rem 0.95rem; }
  .hcc-head { flex-wrap: wrap; gap: 0.25rem 1rem; }
  .hcc-lines .m { font-size: 0.82rem; }
}
@media (max-height: 700px) and (min-width: 1280px) { .hcc-meta { display: none; } .hcc-lines li { padding: 0.3rem 0; } }

.cta {
  display: inline-flex;
  align-items: center;
  padding: 0.72rem 1.1rem;
  border: 1px solid rgba(var(--line-rgb), 0.35);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  background: rgba(var(--bg-rgb), 0.45);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.cta:hover { border-color: var(--accent); background: rgba(var(--tint-rgb), 0.22); }
.cta-primary { border-color: var(--btn-bg); background: var(--btn-bg); color: var(--btn-text); }
.cta-primary:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.cta:focus-visible, .home-card:focus-visible, .more:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

/* ---------- Sections ---------- */
.home {
  padding: clamp(3.5rem, 9vh, 6rem) clamp(1.5rem, 6vw, 6.5rem) clamp(3rem, 8vh, 5rem);
  color: var(--text-soft);
}
.home-block { max-width: 76rem; margin: 0 auto; }
.home-block + .home-block { margin-top: clamp(4rem, 10vh, 6.5rem); }
.block-head { max-width: 46rem; margin-bottom: 1.75rem; }
.kicker {
  margin: 0 0 0.7rem;
  color: var(--accent-pale);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.home h2 {
  margin: 0 0 0.8rem;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.home p { line-height: 1.65; }
.block-head p:not(.kicker), .split-card p:not(.kicker), .founder-note p:not(.kicker) { margin: 0; color: var(--text-muted); font-size: 1.02rem; }

.tool-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 1000px) { .tool-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tool-row { grid-template-columns: 1fr; } }
.home-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem 1.3rem 1.2rem;
  border: 1px solid rgba(var(--line-rgb), 0.18);
  background: rgba(var(--surface-rgb), 0.55);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.home-card:hover { border-color: rgba(var(--accent-rgb), 0.65); transform: translateY(-2px); }
.home-card .tag { color: var(--accent-pale); font-size: 0.68rem; font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; }
.home-card h3 { margin: 0; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 400; }
.home-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; }
.home-card .code { margin-top: auto; padding-top: 0.5rem; color: var(--text-dim); font-size: 0.75rem; letter-spacing: 0.04em; }
.more { display: inline-block; margin-top: 1.25rem; color: var(--link); font-size: 0.95rem; text-decoration: none; }
.more:hover { text-decoration: underline; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.steps li {
  padding: 1.3rem 1.3rem 1.2rem;
  border-top: 2px solid var(--accent);
  background: rgba(var(--surface-rgb), 0.4);
}
.step-no { color: var(--link); font-family: Georgia, "Times New Roman", serif; font-size: 2.2rem; line-height: 1; }
.steps h3 { margin: 0.6rem 0 0.35rem; color: var(--text); font-size: 1.08rem; }
.steps p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1rem;
}
.split-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid rgba(var(--line-rgb), 0.18);
  background: rgba(var(--surface-rgb), 0.55);
}
.split-card .cta, .split-card .yt-cta { margin-top: auto; padding-top: 0.72rem; }
.split-card p:not(.kicker) { margin-bottom: 1.4rem; }
.split .yt-cta { opacity: 1; animation: none; }

.founder-note {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}
.founder-note img { width: 100%; height: auto; border: 1px solid rgba(var(--line-rgb), 0.18); }
.founder-note p:not(.kicker) { max-width: 44rem; }
.founder-note .founder-role { margin: -0.3rem 0 0.8rem; color: var(--accent-pale); font-size: 0.9rem; letter-spacing: 0.02em; }

/* ---------- Phones: the hero stacks instead of overlaying ---------- */
@media (max-width: 760px) {
  .hero { min-height: auto; padding-bottom: 3.5rem; }
  .hero .announcement {
    position: relative;
    top: auto; left: auto; right: auto;
    width: auto;
    padding: 11.5rem 1.5rem 0;
    transform: none;
  }
  .hero h1 { font-size: clamp(3rem, 14vw, 4.6rem); line-height: 0.92; }
  .founder-note { grid-template-columns: 1fr; }
  .founder-note img { max-width: 10rem; }
  .split { grid-template-columns: 1fr; }
}

@media (max-height: 650px) and (min-width: 761px) {
  .hero h1 { font-size: clamp(3rem, 5.5vw, 5.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-actions { opacity: 1; animation: none; }
  .hero-calc, .hcc-lines li, .hcc-pass, .hcc-link { opacity: 1; animation: none; }
  .hcc-lines li, .hcc-pass, .hcc-link { transform: none; }
  .home-card { transition: none; }
}
