/* Home page: "House lights down". Always dark, like the stage it's used on, with carousels for the
   screenshots and a quiet reveal as sections scroll into view. Loaded after site.css on index.html only. */

html.theme-stage {
  color-scheme: dark;
  --accent-text: #f19737;
  --bg: #0e1012;
  --card: #191c20;
  --card-shade: #16181c;
  --text: #f2f3f5;
  --text-2: rgba(201, 204, 209, 0.86);
  --text-3: rgba(201, 204, 209, 0.62);
  --hairline: rgba(201, 204, 209, 0.12);
  --panel: rgba(201, 204, 209, 0.04);
  --raised: #121417;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.5);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --page: 1200px;
}

.theme-stage ::selection {
  background: var(--accent);
  color: #000;
}

.theme-stage .wrap {
  padding: 0 40px;
}

.home h1,
.home h2 {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.home h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.04;
  margin: 0 0 20px;
}

.home section {
  padding: 112px 0;
  border-top: 1px solid var(--hairline);
}

.home section.raised {
  background: var(--raised);
}

/* ---------- Hero ---------- */

.home .hero {
  text-align: left;
  padding: 88px 0 104px;
  border-top: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.6fr);
  gap: 56px;
  align-items: center;
}

.home .hero h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.98;
  margin: 0;
}

.home .hero .lead {
  margin: 28px 0 0;
  font-size: 1.25rem;
  max-width: 30em;
}

.home .hero-actions {
  justify-content: flex-start;
  margin-top: 36px;
}

.home .key {
  min-height: 56px;
  padding: 0 26px;
  border-radius: 12px;
  box-shadow: none;
  background: transparent;
  border-color: rgba(201, 204, 209, 0.28);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.2s,
    border-color 0.2s;
}

.home .key.prominent {
  background: var(--accent);
  color: #000;
  border-color: transparent;
}

.home .key.prominent:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  background: #f5a650;
}

.home .key:not(.prominent):hover {
  border-color: rgba(201, 204, 209, 0.6);
}

.home .availability {
  margin-top: 28px;
}

.hero-device {
  display: flex;
  justify-content: center;
}

.hero-device .device.phone {
  width: min(310px, 100%);
}

.home .device {
  border: 7px solid #1d2024;
  background: #000;
  box-shadow: var(--shadow);
}

/* ---------- Showcase sections ---------- */

.home .showcase {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px;
}

.home .showcase > * {
  min-width: 0;
}

.home .showcase ul {
  margin: 24px 0;
}

.home .showcase p.muted {
  font-size: 1.1rem;
  max-width: 32em;
}

.home .section-head {
  margin-bottom: 48px;
}

.home .section-head .lead {
  margin-top: 0;
}

.mac-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}

.mac-list li {
  padding: 18px 0;
  border-top: 1px solid var(--hairline);
  color: var(--text-2);
}

.mac-list strong {
  color: var(--text);
}

.home .lrc {
  font-size: 0.75rem;
}

.home .cta-band {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-end;
  justify-content: space-between;
}

.home .cta-band h2 {
  font-size: clamp(2.2rem, 4.6vw, 3.5rem);
  max-width: 12em;
  margin: 0;
}

.home .cta-band p {
  margin: 16px 0 0;
  max-width: 34em;
}

/* ---------- Carousel ---------- */

.carousel {
  position: relative;
  min-width: 0;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-radius: 20px;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 0;
}

.slide figcaption {
  font-size: 0.95rem;
  color: var(--text-3);
  text-align: center;
  max-width: 28em;
  min-height: 2.9em;
}

.gallery .slide .device.phone {
  width: min(280px, 70vw);
}

.gallery .slide .device.watch {
  width: min(200px, 52vw);
}

.gallery .slide .device.mac {
  width: 100%;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s, transform 0.25s var(--ease-out);
}

.carousel-btn:hover:not(:disabled) {
  border-color: rgba(201, 204, 209, 0.5);
  transform: scale(1.06);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.carousel-btn svg {
  width: 18px;
  height: 18px;
}

.carousel-dots {
  display: flex;
  gap: 2px;
}

.carousel-dot {
  width: 24px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(201, 204, 209, 0.3);
  transition: width 0.35s var(--ease-out), background 0.2s;
}

.carousel-dot[aria-current="true"]::before {
  width: 22px;
  background: var(--accent);
}

.carousel-count {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  color: var(--text-3);
  min-width: 4.5em;
  text-align: center;
}

/* The feature carousel: text beside its screenshot, one feature at a time. */
.features .slide {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
  padding: 8px 4px;
}

.feature-text h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
  margin: 0 0 16px;
}

.feature-text p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 28em;
}

.feature-text a {
  display: inline-block;
  margin-top: 20px;
}

.feature-text .icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 20px;
}

.feature-media {
  height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--raised);
  border: 1px solid var(--hairline);
  padding: 28px;
}

.feature-media .device {
  max-height: 100%;
}

.feature-media .device img {
  max-height: 470px;
  width: auto;
}

.feature-media .device.tablet img,
.feature-media .device.phone-land img,
.feature-media .device.mac img {
  width: 100%;
  height: auto;
  max-height: none;
}

.feature-media .device.phone {
  width: auto;
}

.feature-media .device.phone-land {
  border-radius: 28px;
}

.carousel [hidden] {
  display: none;
}

.features .carousel-controls {
  justify-content: flex-start;
}

/* ---------- Motion: reveal on scroll, images that develop as they load ---------- */

.motion-ready .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.motion-ready .reveal.is-in {
  opacity: 1;
  transform: none;
}

.motion-ready .home img.develop {
  opacity: 0;
  filter: blur(12px);
  transform: scale(1.02);
  transition: opacity 0.8s var(--ease-out), filter 0.9s var(--ease-out), transform 1.1s var(--ease-out);
}

.motion-ready .home img.develop.loaded {
  opacity: 1;
  filter: none;
  transform: none;
}

.site-header.scrolled {
  border-bottom-color: rgba(201, 204, 209, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  .motion-ready .reveal,
  .motion-ready .home img.develop {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .carousel-track {
    scroll-behavior: auto;
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .home .showcase {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .features .slide {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .features .feature-media {
    order: -1;
    height: 440px;
  }

  .feature-media .device img {
    max-height: 380px;
  }
}

@media (max-width: 720px) {
  .theme-stage .wrap {
    padding: 0 16px;
  }

  .home section {
    padding: 80px 0;
  }

  .home .hero {
    padding: 48px 0 72px;
  }

  .home .hero-actions .key {
    flex: 1 1 100%;
  }

  .mac-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .features .feature-media {
    height: 380px;
    padding: 18px;
  }

  .feature-media .device img {
    max-height: 330px;
  }

  .features .carousel-controls {
    justify-content: center;
  }
}
