/* Pinch Remote — a plain, README-style project page. Light by default, dark when the system is. */
:root {
  --bg: #fbfaf7;
  --surface: #f2f0ea;
  --text: #17181b;
  --muted: #5d5f66;
  --line: #e3e0d8;
  --accent: #e2552d;
  --code: #efece5;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #1a1b1e;
    --text: #ecebe7;
    --muted: #a3a29d;
    --line: #2a2b2f;
    --accent: #ff7a4f;
    --code: #1f2023;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.col { width: min(720px, 100% - 40px); margin-inline: auto; }
.col-wide { width: min(1080px, 100% - 40px); margin-inline: auto; }

/* ---- top bar ---------------------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-inner { height: 54px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand img { border-radius: 6px; }
.top nav { display: flex; gap: 22px; font-size: 14px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }

/* ---- intro ---------------------------------------------------------------------------------- */
.intro { padding: 72px 0 40px; }
.intro-mark { border-radius: 16px; margin-bottom: 26px; }
h1 { font-size: clamp(40px, 6vw, 56px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; }
.tagline { margin-top: 10px; font-size: 20px; color: var(--muted); }
.lead { margin-top: 22px; font-size: 19px; max-width: 620px; }
.badges { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badges li { font: 13px/1 var(--mono); padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); }
.badges li:first-child { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.actions { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
/* Placeholder until it's live; swap in Apple's official App Store badge then. */
.button { display: inline-block; padding: 11px 18px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px; }
.text-link { font-size: 15px; }

/* ---- screenshots ---------------------------------------------------------------------------- */
.shot { margin: 0; }
.shot img { border-radius: 14px; border: 1px solid var(--line); }
.shot.wide { width: min(1080px, 100% - 40px); margin: 8px auto 0; }
.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; padding-top: 64px; }

/* Screenshots open full size (see the viewer script in index.html). */
.zoom { display: block; cursor: zoom-in; border-radius: 14px; }
.zoom img { transition: transform 0.2s ease, box-shadow 0.2s ease; }
@media (hover: hover) { .zoom:hover img { transform: translateY(-2px); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.35); } }
.zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Grid thumbnails share one shape (the channel shot is 16:9, the rest 16:10). */
.gallery .shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* ---- the tour: the visionOS room stays put while screens slide into a floating window ---------- */
.tour { position: relative; margin-top: 40px; }
.tour-stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.tour-room { position: absolute; inset: -24px; background: #d9d4cc url("assets/room.jpg") center / cover no-repeat; filter: blur(3px) saturate(0.9) brightness(0.94); }
/* Soften the room into the page above and below. */
.tour-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(var(--bg), transparent 9%, transparent 91%, var(--bg)); }
.tour-window {
  --w: min(66vw, 124vh);
  position: absolute; left: 28vw; top: 50%; width: var(--w); aspect-ratio: 16 / 10; padding: 0; margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 22px; overflow: hidden; background: #0d0e10; cursor: zoom-in;
  transform: translateY(-50%) perspective(2000px) rotateY(-4deg);
  box-shadow: 0 50px 120px -30px rgba(20, 16, 10, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.tour-shot {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: translateY(7%) scale(0.98);
  transition: opacity 0.55s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tour-shot.is-before { transform: translateY(-7%) scale(0.98); }
.tour-shot.is-active { opacity: 1; transform: none; }
.tour-grabber { position: absolute; left: calc(28vw + var(--w, 66vw) / 2 - 46px); top: calc(50% + min(66vw, 124vh) * 0.3125 + 18px); width: 92px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.8); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); --w: min(66vw, 124vh); }

.tour-steps { position: relative; margin-top: -100vh; margin-top: -100dvh; }
.step { min-height: 100vh; display: flex; align-items: center; padding-left: 4vw; pointer-events: none; }
.step-card {
  pointer-events: auto; width: min(22vw, 340px); min-width: 260px; padding: 26px 28px; border-radius: 22px;
  background: rgba(252, 251, 248, 0.8); color: #17181b; border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 30px 70px -24px rgba(20, 16, 10, 0.45);
  opacity: 0; transform: translateY(18px); transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.step.is-active .step-card { opacity: 1; transform: none; }
.step-label { font: 12px/1 var(--mono); color: #5d5f66; text-transform: uppercase; letter-spacing: 0.06em; }
.step-label span { color: #d14a22; margin-right: 6px; }
.step-card h3 { margin-top: 12px; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.step-card p:last-child { margin-top: 10px; font-size: 15.5px; color: #44464c; }
.step-shot { display: none; }
.tour-intro { padding-top: 72px; }
.tour-intro p { color: var(--muted); }

/* Narrow screens: no stage; each step is a card and its screenshot. */
@media (max-width: 1000px) {
  .tour-stage { display: none; }
  .tour-steps { margin-top: 0; }
  .step { min-height: 0; display: block; padding: 0; width: min(720px, 100% - 40px); margin: 40px auto 0; pointer-events: auto; }
  .step-card { width: auto; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; opacity: 1; transform: none; color: var(--text); }
  .step-label { color: var(--muted); }
  .step-card p:last-child { color: var(--muted); }
  .step-shot { display: block; margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-shot, .step-card { transition: none; }
}

/* ---- the viewer --------------------------------------------------------------------------- */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; color: #f3f1ec; }
.viewer::backdrop { background: rgba(10, 10, 12, 0.72); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); }
.viewer[open] { display: grid; place-items: center; padding: 56px 0 96px; box-sizing: border-box; animation: viewer-in 0.22s ease-out; }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
.viewer-img {
  max-width: min(92vw, 2400px); max-height: calc(100dvh - 152px); width: auto; height: auto;
  border-radius: 14px; box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0; transform: scale(0.985); transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.viewer-img.in { opacity: 1; transform: none; }
.viewer-close, .viewer-bar {
  position: fixed; background: rgba(40, 40, 46, 0.55); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 30px rgba(0, 0, 0, 0.3);
}
.viewer-close { top: 22px; right: 22px; width: 40px; height: 40px; border-radius: 50%; color: inherit; display: grid; place-items: center; cursor: pointer; padding: 0; }
.viewer-bar { bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; }
.viewer-nav { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; padding: 0; }
.viewer-nav:hover, .viewer-close:hover { background: rgba(255, 255, 255, 0.12); }
.viewer-nav:focus-visible, .viewer-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.viewer-caption { padding: 0 6px 0 10px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.viewer-count { padding-right: 8px; white-space: nowrap; font: 12px/1 var(--mono); color: rgba(243, 241, 236, 0.6); }

/* ---- sections --------------------------------------------------------------------------------- */
main > section.col { padding-top: 72px; }
h2 { font-size: 26px; letter-spacing: -0.02em; font-weight: 650; margin-bottom: 16px; }
h3 { font-size: 17px; font-weight: 600; }
section p + p { margin-top: 12px; }
.features { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 22px; }
.features li { padding-left: 22px; position: relative; }
.features li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.features p { margin-top: 4px; color: var(--muted); }

.reqs { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.reqs div { padding: 12px 14px; background: var(--surface); }
.reqs div + div { border-left: 1px solid var(--line); }
.reqs dt { font: 12px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.reqs dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.steps { margin: 22px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.steps li::marker { color: var(--accent); font-weight: 600; }
.steps b, .faq b { font-weight: 600; }

.faq { margin-top: 20px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 12px; font: 20px/1 var(--mono); color: var(--muted); }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding-bottom: 16px; color: var(--muted); }

#privacy h3 { margin-top: 22px; font-size: 16px; }
#privacy h3 + p { margin-top: 4px; color: var(--muted); }
.meta { font: 13px/1.4 var(--mono); color: var(--muted); margin: -6px 0 14px; }

/* ---- footer ---------------------------------------------------------------------------------- */
.foot { margin-top: 88px; padding: 28px 0 56px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.legal { margin-top: 10px; font-size: 12.5px; line-height: 1.6; }

@media (max-width: 680px) {
  body { font-size: 16px; }
  .top nav a:nth-child(-n+2) { display: none; }
  .intro { padding-top: 48px; }
  .gallery { grid-template-columns: 1fr; }
  .reqs { grid-template-columns: 1fr 1fr; }
  .reqs div:nth-child(3) { border-left: 0; }
  .reqs div:nth-child(n+3) { border-top: 1px solid var(--line); }
  main > section.col { padding-top: 56px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
