/* The home page: one pinned stage — the hero, the Mac's window growing to fill the screen, the
   walkthrough inside it, the download — and the tour's words as text after it. home.js places
   everything on the stage from the scroll. */

.home { color-scheme: dark; }
.home body { background: #000; color: #f5f5f7; }

/* The site's bar: the same island throughout — at the top of the page, and while the window fills
   the page, in the window's title bar between the sidebar and its toolbar, among the app's own
   capsules. home.js sets where (--nav-x, --nav-y, --nav-w); only where changes. */
.home .nav {
  left: var(--nav-x, 12px); top: var(--nav-y, 12px); right: auto; margin: 0; width: var(--nav-w, calc(100% - 24px));
  background: rgba(39, 40, 43, 0.5);
  box-shadow: inset 0 0 0 0.5px rgba(236, 236, 238, 0.12), 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: left 0.45s var(--ease), top 0.45s var(--ease), width 0.45s var(--ease);
}
.home .nav.narrow .nav-links { display: none; }
.home.resizing .nav { transition: none; }

/* The page's key points: a dot for each, on the right; the one the page is at drawn long. */
.dots {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 9px;
  padding: 11px 7px; border-radius: 980px; background: rgba(39, 40, 43, 0.5);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 0 0 0.5px rgba(236, 236, 238, 0.14), 0 8px 24px rgba(0, 0, 0, 0.3);
}
.dots a { position: relative; display: block; width: 7px; height: 7px; border-radius: 4px; background: #f5f5f7; opacity: 0.4; transition: height 0.4s var(--ease), opacity 0.3s; }
.dots a.on { height: 22px; opacity: 1; }
.dots a:hover { opacity: 0.8; }
.dots a.on:hover { opacity: 1; }
.dots a span {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%); padding: 4px 9px; border-radius: 8px; white-space: nowrap;
  font-size: 12px; font-weight: 500; color: #f5f5f7; background: rgba(39, 40, 43, 0.85); opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.dots a:hover span, .dots a:focus-visible span { opacity: 1; }
@media (max-width: 680px) { .dots { display: none; } }

/* The stage: home.js sets its height from the tour's length. */
.tour { position: relative; height: 2400vh; }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* The hero: the words on the left, the Mac on the right (home.js reads where from .hero-slot);
   stacked on narrow screens. */
.hero-glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 48% at 74% 52%, rgba(106, 16, 40, 0.42), transparent 70%),
    radial-gradient(30% 40% at 18% 30%, rgba(60, 100, 190, 0.16), transparent 70%),
    radial-gradient(60% 40% at 60% 100%, rgba(62, 5, 24, 0.5), transparent 70%);
}
.hero {
  position: absolute; inset: 0; z-index: 3; display: grid; align-items: center; pointer-events: none;
  grid-template-columns: minmax(300px, 0.6fr) 1.4fr; gap: clamp(16px, 2vw, 40px);
  padding: 60px clamp(24px, 4vw, 72px) 52px; max-width: 1800px; margin: 0 auto;
}
.hero-copy { pointer-events: auto; will-change: transform, opacity; }
.hero-slot { align-self: center; aspect-ratio: 2400 / 1466; width: 100%; }
.hero-icon { width: clamp(96px, 9vw, 150px); height: auto; margin: 0 0 24px -4px; filter: drop-shadow(0 18px 40px rgba(140, 26, 58, 0.45)); }
.hero h1 {
  margin: 0; font-size: clamp(40px, 3.9vw, 76px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; color: #f5f5f7;
}
.hero h1 span { background: linear-gradient(100deg, #f4e8ec 0%, #e7b3c2 45%, #c46a86 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-scroll {
  position: absolute; left: 0; right: 0; bottom: 22px; width: max-content; margin: 0 auto; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: #86868b; text-decoration: none; white-space: nowrap;
}
.hero-scroll:hover { color: #f5f5f7; }
.hero-scroll .wheel { position: relative; width: 16px; height: 24px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px currentColor; }
.hero-scroll .wheel::after { content: ""; position: absolute; left: 6.5px; top: 5px; width: 3px; height: 6px; border-radius: 2px; background: currentColor; animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(7px); opacity: 0; } 100% { opacity: 0; } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-content: start; padding-top: 84px; gap: 36px; }
  .hero-icon { margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .hero-scroll .wheel::after { animation: none; } }

/* The MacBook Pro (Apple's bezel, flattened with its desktop) and the window on its screen. */
.mac { position: absolute; left: 0; top: 0; z-index: 1; transform-origin: 0 0; will-change: transform; }
.mac img { width: 100%; height: auto; }
.window-host { position: absolute; left: 0; top: 0; z-index: 2; transform-origin: 0 0; will-change: transform; }
.window-host .tw { box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5); }
.pin.full .window-host .tw { box-shadow: none; }

/* A caption: a small popout beside the row it is about, pointing at it. */
.caption {
  position: absolute; z-index: 6; left: 0; top: 0; width: max-content; max-width: 300px; margin: 0; padding: 12px 15px 13px; border-radius: 14px;
  color: #f5f5f7; background: rgba(36, 37, 41, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 28px rgba(0, 0, 0, 0.38);
  opacity: 0; transform: translateX(-6px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, top 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.caption::before {
  content: ""; position: absolute; left: -6px; top: calc(50% - 6px + var(--arrow, 0px)); width: 12px; height: 12px; border-radius: 2px;
  background: inherit; transform: rotate(45deg); box-shadow: inset 0.5px -0.5px 0 rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: none; backdrop-filter: none; clip-path: polygon(0 0, 0 100%, 100% 100%);
}
.caption.on { opacity: 1; transform: none; }
.caption .eyebrow { margin: 0 0 2px; font-size: 11px; font-weight: 600; color: #7fb6ff; letter-spacing: 0.01em; text-transform: uppercase; }
.caption h2 { margin: 0; font-size: 16px; line-height: 1.2; font-weight: 600; letter-spacing: -0.005em; }
.caption .text { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: rgba(245, 245, 247, 0.72); }

/* The fractal's depth, while the view dives. */
.readout {
  position: absolute; z-index: 6; top: 72px; right: 24px; padding: 10px 16px 11px; border-radius: 16px; text-align: right;
  color: #f5f5f7; background: rgba(24, 25, 28, 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16), 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.readout.on { opacity: 1; }
.readout b { display: block; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.readout span { display: block; margin-top: 2px; font-size: 13px; color: rgba(245, 245, 247, 0.7); max-width: 260px; }

/* "Your turn": a nudge in the popout to take over. */
.caption .try { display: none; margin: 9px 0 0; padding: 5px 10px; width: max-content; border-radius: 980px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(0, 136, 255, 0.9); }
.caption.trying .try { display: block; animation: try-pulse 1.8s ease-in-out infinite; }
@keyframes try-pulse { 50% { box-shadow: 0 0 0 5px rgba(0, 136, 255, 0.18); } }

/* The download, after the tour. */
/* A screen of its own, so nothing of the tour shows with it. */
.closing { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 72px 24px; background: radial-gradient(50% 60% at 50% 40%, rgba(106, 16, 40, 0.3), transparent 70%), #000; }
.closing-icon { width: 128px; height: auto; margin: 0 auto 26px; filter: drop-shadow(0 14px 32px rgba(140, 26, 58, 0.45)); }
.closing h2 { margin: 0; font-size: clamp(40px, 5.4vw, 64px); line-height: 1.0625; letter-spacing: -0.009em; font-weight: 600; }
.closing p { margin: 14px 0 0; color: #a1a1a6; font-size: 21px; }
.closing .store { display: inline-block; margin-top: 30px; }
.closing .store img { transition: transform 0.25s var(--ease); }
.closing .store:hover img { transform: translateY(-1px); }
.closing small { display: block; margin-top: 40px; font-size: 14px; color: #86868b; }

/* Watch: the tour plays itself. */
.watch {
  position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(12px);
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px 9px 14px; border: 0; border-radius: 980px;
  font: 600 14px/1 var(--font); color: #f5f5f7; cursor: pointer;
  background: rgba(30, 31, 34, 0.62); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.18), 0 10px 26px rgba(0, 0, 0, 0.3);
  opacity: 0; pointer-events: none; transition: opacity 0.4s, transform 0.4s;
}
.watch.on { opacity: 1; pointer-events: auto; transform: translateX(-50%); }
.watch-icon { width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; }
.watch[aria-pressed="true"] .watch-icon { width: 10px; height: 12px; border: 0; border-left: 3.5px solid; border-right: 3.5px solid; }

/* The tour as text: read out, not shown (the stage shows it). */
.tour-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* What was typed, to copy, beside a result. */
.tw-tip {
  position: fixed; z-index: 70; display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 8px 8px 8px 12px; border-radius: 12px;
  color: #f5f5f7; background: rgba(36, 37, 40, 0.88); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16), 0 10px 26px rgba(0, 0, 0, 0.35); font-size: 12px;
}
.tw-tip code { font: 12px/1.35 ui-monospace, "SF Mono", Menlo, monospace; color: rgba(245, 245, 247, 0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-tip button { flex: none; border: 0; border-radius: 8px; padding: 6px 10px; font: 600 12px var(--font); color: #fff; background: #0088ff; cursor: pointer; }

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav .pill { margin-left: auto; }
  .caption { left: 12px !important; right: 12px; top: 64px !important; width: auto; max-width: none; }
  .caption::before { display: none; }
  .readout { top: auto; bottom: calc(46% + 60px); right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .caption, .readout { transition: none; }
  .caption.trying .try { animation: none; }
}
