/* ============================================================
   NATIVED SPACES home page (index.html only)
   Loaded after index.css, which updates.html and upgrade.html
   also share. White surface down through Canvas; the dot grid
   returns from the semester timeline onward.
   ============================================================ */

body.home {
  background: var(--card);
}

.dotted {
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 26px 26px;
}

.home .nav-link:hover { background: #F4F2EC; }

/* ---- Hero --------------------------------------------------------- */
.home .hero { padding: 112px 0 40px; text-align: center; }

.home .hero-eyebrow {
  display: block;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.home .hero h1 {
  max-width: none;
  margin: 22px 0 26px;
}

.home .hero h1 em { display: block; }

.home .hero-sub {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--muted);
  max-width: none;
  margin: 0 auto 34px;
}

.home .hero-btns {
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.home .btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(26, 24, 20, 0.12), 0 6px 16px rgba(26, 24, 20, 0.1);
}

.home .btn-download span { transition: transform 0.15s; }
.home .btn-download:hover span { transform: translateX(3px); }

/* ---- Device toggle ------------------------------------------------ */
.showcase { padding: 16px 0 96px; }

.showcase-wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 24px;
}

.device-tabs {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-bottom: 44px;
}

.device-tab {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 1.45rem;
  color: var(--faint);
  padding: 4px 6px 10px;
  position: relative;
  transition: color 0.15s;
}

.device-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.device-tab:hover { color: var(--ink); }
.device-tab[aria-selected="true"] { color: var(--ink); }
.device-tab[aria-selected="true"]::after { transform: scaleX(1); }

/* ---- Feature cards ------------------------------------------------- */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.feature-cards[hidden] { display: none; }

.js .feature-cards.is-entering .fcard {
  animation: fadeUp 0.45s ease both;
}
.js .feature-cards.is-entering .fcard:nth-child(2) { animation-delay: 0.05s; }
.js .feature-cards.is-entering .fcard:nth-child(3) { animation-delay: 0.1s; }
.js .feature-cards.is-entering .fcard:nth-child(4) { animation-delay: 0.15s; }

.fcard {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fcard-head {
  padding: 26px 28px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  text-align: center;
}

.fcard-head h3 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

.fcard-head p {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* the device rises from the card's bottom edge; the screenshot is
   pre-cropped, so the stage sizes to it and the device sits flush */
.fcard-stage {
  flex: 1;
  padding-top: 36px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.device {
  flex-shrink: 0;
  background: #1A1814;
  box-shadow: 0 30px 60px -30px rgba(26, 24, 20, 0.5);
}

.device img {
  display: block;
  width: 100%;
  height: auto;
  background: #F4F3EF;
}

.device--phone {
  width: 256px;
  padding: 9px;
  border-radius: 44px;
}

.device--phone img { border-radius: 35px; }

.device--tablet {
  width: min(84%, 470px);
  padding: 14px;
  border-radius: 32px;
}

.device--tablet img { border-radius: 18px; }

/* landscape iPad: shows the whole screen, so it runs wider */
.device--landscape { width: min(92%, 540px); }

.fcard-stage .device {
  align-self: flex-end;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: 0;
}

.fcard-stage .device img {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* ---- Canvas -------------------------------------------------------- */
.canvas-section { padding: 40px 0 120px; }

.canvas-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 40px;
}

.canvas-copy { text-align: center; }

.canvas-copy .sec-title {
  max-width: none;
  margin-bottom: 12px;
}

.canvas-copy .sec-sub { margin-inline: auto; max-width: 32ch; }

.canvas-grid .device--phone { width: min(100%, 260px); justify-self: center; }
.canvas-grid .device--tablet { width: min(100%, 420px); justify-self: center; }

/* ---- Rhythm band: left / center / right steps ------------------------ */
/* The line runs from the first dot's center to the last dot's center. */
@media (min-width: 901px) {
  .home .wf-line { left: 8px; right: 8px; }

  .home .wf-step:nth-of-type(2) { text-align: center; }
  .home .wf-step:nth-of-type(2)::before { left: 50%; transform: translateX(-50%); }
  .home .wf-step:nth-of-type(2) p { margin-inline: auto; }

  .home .wf-step:nth-of-type(3) { text-align: right; }
  .home .wf-step:nth-of-type(3)::before { left: auto; right: 0; }
  .home .wf-step:nth-of-type(3) p { margin-left: auto; }
}

/* ---- Snowball (two-column timeline) -------------------------------- */
.snowball { padding: 104px 0; }

.snowball .sec-head { margin-bottom: 56px; text-align: center; }
.snowball .sec-title { max-width: none; margin-bottom: 0; }
.snowball .sec-title span { display: block; }

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 64px;
}

.timeline-grid .timeline { max-width: none; }

/* Right column mirrors the left: line and dots on the outer edge,
   so both columns of text meet in the middle. Every item fills the full
   column width; right-column paragraphs are justified (last line pushed
   right) so the block keeps straight edges while reading right-aligned. */
.timeline-grid .tl-item p { max-width: none; }

@media (min-width: 821px) {
  .snowball .sec-title { white-space: nowrap; }
  .timeline-grid .timeline:last-child { padding-left: 0; padding-right: 38px; text-align: right; }
  .timeline-grid .timeline:last-child .tl-item p { text-align: justify; text-align-last: right; }
  .timeline-grid .timeline:last-child .tl-line { left: auto; right: 8px; }
  .timeline-grid .timeline:last-child .tl-item::before { left: auto; right: -36px; }
}

.tl-item--next::before {
  background: var(--card);
  border-color: #9DB8A4;
}

/* ---- CTA ---------------------------------------------------------- */
.cta { padding: 120px 0 110px; text-align: center; }

.cta h2 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 24ch;
  margin: 0 auto 40px;
}

.cta h2 em { font-style: italic; color: var(--accent); }

.cta-card {
  max-width: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding: 34px 44px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 54px -36px rgba(26, 24, 20, 0.45);
  text-align: left;
}

.cta-devices {
  width: 210px;
  color: var(--ink);
}

.cta-devices svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.cta-os {
  font-size: 1.12rem;
  font-weight: 750;
  line-height: 1.2;
}

.cta-os span { font-weight: 400; color: var(--muted); }

.cta-card .dl-btn { margin-top: 14px; }

.cta .closer-note { margin-top: 26px; }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 960px) {
  .canvas-grid {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
    gap: 28px 24px;
    align-items: end;
  }
  .canvas-copy { grid-column: 1 / -1; order: -1; margin-bottom: 12px; }
}

@media (max-width: 820px) {
  .feature-cards { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .timeline-grid { grid-template-columns: 1fr; }
  .timeline-grid .timeline:first-child .tl-item:last-child { padding-bottom: 38px; }
}

@media (max-width: 640px) {
  .home .hero { padding: 72px 0 28px; }
  .home .hero-sub { font-size: 1.22rem; }
  .home .hero-eyebrow { letter-spacing: 0.16em; }
  .showcase { padding: 8px 0 64px; }
  .device-tab { font-size: 1.3rem; }
  .showcase-wrap { padding-inline: 16px; }
  .device-tabs { gap: 40px; margin-bottom: 30px; }
  .fcard-head { padding: 22px 20px 18px; }
  .fcard-stage { padding-top: 28px; }
  .device--phone { width: 204px; border-radius: 38px; padding: 8px; }
  .device--phone img { border-radius: 30px; }
  .device--tablet { width: 88%; padding: 10px; border-radius: 24px; }
  .device--tablet img { border-radius: 14px; }
  .canvas-section { padding: 24px 0 80px; }
  .canvas-grid .device--phone { width: 100%; }
  .snowball { padding: 72px 0; }
  .cta { padding: 80px 0 72px; }
  .cta-card {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 22px;
    padding: 28px 22px;
    text-align: center;
  }
  .cta-card .dl-btn { width: 100%; }
  .cta-devices { width: 180px; }
}
