/* PuTTY for iOS. Neutral surfaces, one accent (the Windows blue behind PuTTY), the product up front.
   Contrast: ink #1d1d1f on #fff 16.8:1 · ink-2 #636366 on #f5f5f7 5.4:1 · white on accent #0063b1 6.3:1
   Dark: ink #f5f5f7 on #000 19.3:1 · ink-2 #a1a1a6 on #1c1c1e 6.6:1 · link #6cb4ff on #000 9.1:1 */
:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #e8e8ed;
  --ink: #1d1d1f;
  --ink-2: #636366;
  --separator: rgba(0, 0, 0, 0.12);
  --accent: #0063b1;
  --accent-hover: #00528f;
  --on-accent: #ffffff;
  --link: #0063b1;
  --cursor: #00c400;
  --bezel: #1d1d1f;
  --bezel-ring: rgba(0, 0, 0, 0.08);
  --band: #000000;
  --segment: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --page: min(1080px, 100% - 48px);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #1c1c1e;
    --bg-3: #2c2c2e;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --separator: rgba(255, 255, 255, 0.16);
    --link: #6cb4ff;
    --cursor: #00ff00;
    --bezel: #121214;
    --bezel-ring: rgba(255, 255, 255, 0.16);
    --band: #1c1c1e;
    --segment: #636366;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, figure { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 16px; top: -48px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 980px;
  background: var(--accent); color: var(--on-accent);
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  transition: background-color 0.2s ease, transform 0.12s ease;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-small { min-height: 32px; padding: 0 14px; font-size: 14px; }
.link-more { font-size: 17px; font-weight: 500; }
.link-more::after { content: " ›"; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}
@media (prefers-reduced-transparency: reduce) { .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.nav-inner { width: var(--page); margin: 0 auto; height: 52px; display: flex; align-items: center; gap: 28px; }
.nav-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 15px; }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { border-radius: 6px; }
.nav nav { display: flex; gap: 24px; margin-left: auto; }
.nav-inner > .btn-small { margin-left: auto; }
.nav nav + .btn-small { margin-left: 0; }
.nav nav a { color: var(--ink); font-size: 14px; opacity: 0.85; }
.nav nav a:hover { opacity: 1; text-decoration: none; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 72px 24px 0; overflow: hidden; }
.hero-icon { margin: 0 auto 28px; border-radius: 28px; }
.hero h1 {
  font-size: clamp(44px, 7.4vw, 88px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em;
  display: inline-flex; align-items: baseline;
}
.cursor {
  display: inline-block; width: 0.42em; height: 0.78em; margin-left: 0.08em;
  background: var(--cursor); transform: translateY(0.08em);
}
@media (prefers-reduced-motion: no-preference) { .cursor { animation: blink 1.1s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { margin: 20px auto 0; max-width: 30em; font-size: clamp(19px, 2.2vw, 24px); line-height: 1.38; color: var(--ink-2); font-weight: 400; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: center; align-items: center; margin-top: 32px; }
.hero-meta { margin-top: 16px; font-size: 14px; color: var(--ink-2); }

/* ---------- iPhones ---------- */
.phone {
  position: relative; background: var(--bezel); padding: 1.6%;
  border-radius: 14.8% / 6.8%;
  box-shadow: 0 0 0 1px var(--bezel-ring), 0 30px 60px -24px rgba(0, 0, 0, 0.4);
}
.phone img, .phone video { width: 100%; aspect-ratio: 598 / 1300; object-fit: cover; border-radius: 13.6% / 6.3%; background: #000; }
.phones {
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(16px, 3vw, 40px);
  margin: 64px auto 0; width: var(--page); padding-bottom: 0;
  height: clamp(420px, 52vw, 640px); overflow: hidden;
}
.phone-main { width: clamp(240px, 26vw, 320px); flex: none; align-self: flex-start; }
.phone-side { width: clamp(200px, 21vw, 260px); flex: none; align-self: flex-start; margin-top: 12%; opacity: 0.92; }

/* ---------- stories ---------- */
.story {
  width: var(--page); margin: 0 auto; padding: 140px 0;
  display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: clamp(40px, 8vw, 120px); align-items: center;
}
.story-flip { grid-template-columns: minmax(240px, 320px) 1fr; }
.story-flip .story-text { order: 2; }
.story h2, .section-title {
  font-size: clamp(32px, 4.6vw, 56px); line-height: 1.07; font-weight: 700; letter-spacing: -0.03em;
  max-width: 14em;
}
.story p { margin-top: 20px; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; color: var(--ink-2); max-width: 32em; }
.story + .story { border-top: 1px solid var(--separator); }
.terminal-band { background: var(--band); color: #f5f5f7; }
.story-dark { --ink-2: #a1a1a6; --bezel: #121214; --bezel-ring: rgba(255, 255, 255, 0.16); }
.story-dark p { color: #a1a1a6; }

/* ---------- tiles ---------- */
.grid-section { width: var(--page); margin: 0 auto; padding: 140px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.tile { background: var(--bg-2); border-radius: var(--radius); padding: 36px 32px; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; }
.tile-wide { grid-column: span 2; }
.tile h3 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; }
.tile p { margin-top: 12px; color: var(--ink-2); max-width: 34em; }
.tile-accent { background: var(--accent); color: var(--on-accent); }
.tile-accent p { color: rgba(255, 255, 255, 0.88); }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92em; color: var(--ink); }

/* ---------- install ---------- */
.install { width: var(--page); margin: 0 auto; padding: 140px 0 0; text-align: center; }
.section-sub { margin: 16px auto 0; font-size: 21px; color: var(--ink-2); }
.install .section-title { margin: 0 auto; }
.segmented {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  margin-top: 36px; padding: 3px; border-radius: 11px; background: var(--bg-3);
}
.segmented button {
  min-width: 128px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font: 500 15px var(--font); cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.segmented button[aria-selected="true"] { background: var(--segment); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.install-card {
  margin-top: 28px; background: var(--bg-2); border-radius: var(--radius); padding: 44px;
  display: grid; grid-template-columns: 1fr 260px; gap: 48px; text-align: left; align-items: center;
}
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 22px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; }
.steps li::before {
  content: counter(s); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 15px;
}
.steps strong { font-weight: 600; }
.steps span { color: var(--ink-2); }
.install-side { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.install-side img { border-radius: 16px; }
.checksum { font-size: 13px; color: var(--ink-2); }
.checksum span { font-family: ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; }

/* ---------- faq ---------- */
.faq { width: min(780px, 100% - 48px); margin: 0 auto; padding: 140px 0 0; }
.faq-list { margin-top: 36px; border-top: 1px solid var(--separator); }
.faq details { border-bottom: 1px solid var(--separator); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-size: 19px; font-weight: 600; letter-spacing: -0.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 40px 24px 0; color: var(--ink-2); max-width: 40em; }

/* ---------- closer & footer ---------- */
.closer { text-align: center; padding: 160px 24px 140px; }
.closer img { margin: 0 auto 24px; border-radius: 22px; }
.closer h2 { font-size: clamp(36px, 5.4vw, 64px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.footer { background: var(--bg-2); color: var(--ink-2); font-size: 13px; }
.footer-inner { width: var(--page); margin: 0 auto; padding: 24px 0 32px; display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { color: var(--ink); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .phones .reveal:nth-child(1) { transition-delay: 0.12s; }
  .js .phones .reveal:nth-child(2) { transition-delay: 0s; }
  .js .phones .reveal:nth-child(3) { transition-delay: 0.2s; }
  .js .tiles .reveal:nth-child(2), .js .tiles .reveal:nth-child(4) { transition-delay: 0.08s; }
  .js .tiles .reveal:nth-child(3) { transition-delay: 0.16s; }
}

/* ---------- compact widths ---------- */
@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile-wide { grid-column: span 2; }
  .install-card { grid-template-columns: 1fr; padding: 32px 24px; }
  .install-side { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 734px) {
  .nav nav { display: none; }
  .nav .btn-small, .nav nav + .btn-small { margin-left: auto; }
  .hero { padding-top: 48px; }
  .phones { width: 100%; }
  .hero-icon { width: 96px; height: 96px; border-radius: 22px; }
  .hero-sub br { display: none; }
  .phones { height: auto; overflow: visible; }
  .phone-side { display: none; }
  .phone-main { width: min(72vw, 300px); }
  .story, .story-flip { grid-template-columns: 1fr; padding: 96px 0; gap: 40px; text-align: center; }
  .story-flip .story-text { order: 0; }
  .story h2, .section-title { margin-left: auto; margin-right: auto; }
  .story p { margin-left: auto; margin-right: auto; }
  .phone-story { width: min(66vw, 280px); margin: 0 auto; }
  .grid-section, .install, .faq { padding-top: 96px; }
  .tiles { grid-template-columns: 1fr; }
  .tile-wide { grid-column: auto; }
  .tile { min-height: 0; padding: 28px 24px; }
  .segmented { display: grid; width: 100%; }
  .segmented button { min-width: 0; padding: 0 8px; }
  .closer { padding: 112px 24px 96px; }
}
