/* Design Theory · Apps & Extensions (tokens match /assets/home/home.css) */
:root {
  color-scheme: light;
  --bg: #F5F5F7; --surface: #FFFFFF; --surface-2: #F5F5F7;
  --label: #1D1D1F; --label-2: #6E6E73; --label-3: #86868B;
  --sep: rgba(60, 60, 67, 0.14); --fill: rgba(118, 118, 128, 0.12); --fill-2: rgba(118, 118, 128, 0.2);
  --blue: #007AFF; --blue-press: #0062CC; --orange: #FF9500;
  --tile-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.05);
  --glass: rgba(250, 250, 252, 0.72); --glass-rim: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  --wallpaper: url("/assets/home/img/wallpaper-light.jpg");
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1080px;
  --gutter: 20px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E;
  --label: #F5F5F7; --label-2: #A1A1A6; --label-3: #6E6E73;
  --sep: rgba(84, 84, 88, 0.55); --fill: rgba(118, 118, 128, 0.24); --fill-2: rgba(118, 118, 128, 0.36);
  --blue: #0A84FF; --blue-press: #3D9BFF; --orange: #FF9F0A;
  --tile-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.35);
  --glass: rgba(28, 28, 30, 0.7); --glass-rim: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3);
  --wallpaper: url("/assets/home/img/wallpaper-dark.jpg");
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 140px; }
body { margin: 0; background: var(--bg); color: var(--label); font: 400 17px/1.47 var(--font); letter-spacing: -0.012em; -webkit-font-smoothing: antialiased; transition: background .3s var(--ease), color .3s var(--ease); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.022em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 10px; background: var(--blue); color: #fff; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
[hidden] { display: none !important; }

/* glass nav */
.nav { position: fixed; top: 12px; left: 50%; translate: -50% 0; z-index: 50; width: min(1000px, 100% - 24px); height: 56px; padding: 0 8px 0 18px; border-radius: 28px; display: flex; align-items: center; gap: 16px; background: var(--glass); border: 1px solid var(--glass-rim); box-shadow: var(--glass-shadow); backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%); }
.nav-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; margin: 0 auto; }
.nav-links a { padding: 7px 13px; border-radius: 18px; font-size: 15px; color: var(--label-2); transition: background .2s, color .2s; }
.nav-links a:hover { background: var(--fill); color: var(--label); }
.nav-links a[aria-current] { color: var(--label); background: var(--fill); font-weight: 500; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; margin-left: auto; }
.nav-links + .icon-btn { margin-left: 0; }
.icon-btn:hover { background: var(--fill); }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="light"] .i-sun, [data-theme="dark"] .i-moon { display: none; }

/* hero */
.hero { position: relative; padding: 132px 0 40px; text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--wallpaper) center / cover no-repeat; opacity: .55; -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent); mask-image: linear-gradient(180deg, #000 30%, transparent); }
.hero .wrap { position: relative; }
.eyebrow { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--blue); }
.hero h1 { font-size: clamp(40px, 7vw, 72px); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em; }
.lede { max-width: 560px; margin: 16px auto 0; font-size: clamp(18px, 2.2vw, 21px); color: var(--label-2); }
.stats { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; }
.stats li { padding: 8px 16px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-rim); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 15px; color: var(--label-2); }
.stats strong { color: var(--label); font-weight: 600; }

/* segmented control (sticks under the nav) */
.seg-wrap { position: sticky; top: 80px; z-index: 40; display: flex; justify-content: center; padding: 8px var(--gutter) 12px; }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-rim); box-shadow: var(--glass-shadow); backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%); }
.seg button { position: relative; z-index: 1; min-width: 84px; height: 34px; padding: 0 16px; border-radius: 9px; font-size: 15px; font-weight: 500; color: var(--label-2); transition: color .25s; }
.seg button[aria-selected="true"] { color: var(--label); }
.seg-pill { position: absolute; left: 0; top: 3px; height: 34px; border-radius: 9px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 3px 8px rgba(0,0,0,.06); transition: transform .35s var(--ease), width .35s var(--ease); }
[data-theme="dark"] .seg-pill { background: #636366; }

/* groups */
.group { padding-top: 36px; }
.group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.group-head h2 { display: flex; align-items: center; gap: 10px; font-size: clamp(26px, 3.4vw, 32px); font-weight: 700; }
.group-head p { margin: 6px 0 0; color: var(--label-2); font-size: 16px; }
.plat { width: 28px; height: 28px; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.see-all { flex: 0 0 auto; font-size: 15px; color: var(--blue); white-space: nowrap; }
.see-all::after { content: " ›"; }
.see-all:hover { text-decoration: underline; }

/* app cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 22px; background: var(--surface); box-shadow: var(--tile-shadow); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.app:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 18px 40px rgba(0,0,0,.09); }
.app-icon { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 0 0 1px var(--sep), 0 4px 12px rgba(0,0,0,.12); background: #fff; object-fit: cover; }
.app-body { flex: 1; }
.app h3 { font-size: 21px; font-weight: 600; }
.app-desc { margin: 6px 0 0; color: var(--label-2); font-size: 15px; line-height: 1.45; }
.app-meta { margin: 12px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--label-3); }
.app-meta a { color: var(--blue); }
.stars { --pct: calc(var(--r) / 5 * 100%); display: inline-block; width: 64px; height: 12px; background: linear-gradient(90deg, var(--orange) var(--pct), var(--fill-2) var(--pct)); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 12'%3E%3Cg%3E%3Cpath id='s' d='M6 .6l1.6 3.5 3.8.4-2.9 2.6.8 3.8L6 9 2.7 10.9l.8-3.8L.6 4.5l3.8-.4z'/%3E%3Cuse href='%23s' x='13'/%3E%3Cuse href='%23s' x='26'/%3E%3Cuse href='%23s' x='39'/%3E%3Cuse href='%23s' x='52'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 12'%3E%3Cg%3E%3Cpath id='s' d='M6 .6l1.6 3.5 3.8.4-2.9 2.6.8 3.8L6 9 2.7 10.9l.8-3.8L.6 4.5l3.8-.4z'/%3E%3Cuse href='%23s' x='13'/%3E%3Cuse href='%23s' x='26'/%3E%3Cuse href='%23s' x='39'/%3E%3Cuse href='%23s' x='52'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.get { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 18px; border-radius: 18px; background: var(--fill); color: var(--blue); font-size: 15px; font-weight: 600; white-space: nowrap; transition: background .2s; }
.get:hover { background: var(--fill-2); }

/* roku cards */
.tv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tv { overflow: hidden; border-radius: 22px; background: var(--surface); box-shadow: var(--tile-shadow); display: flex; flex-direction: column; transition: transform .35s var(--ease); }
.tv:hover { transform: translateY(-3px); }
.tv-shot { display: block; aspect-ratio: 16 / 9; background: #0a0f1e; overflow: hidden; }
.tv-shot img { width: 100%; height: 100%; object-fit: cover; }
.tv-body { flex: 1; display: grid; grid-template-columns: 96px 1fr; grid-template-rows: 1fr auto; gap: 14px 16px; padding: 20px 22px 22px; }
.tv-poster { width: 96px; aspect-ratio: 290 / 218; height: auto; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1px var(--sep); }
.tv h3 { font-size: 21px; font-weight: 600; }
.tv .get { grid-column: 2; justify-self: start; }

/* cta + footer */
.cta { padding-top: 56px; padding-bottom: 64px; }
.cta-card { text-align: center; padding: clamp(32px, 6vw, 56px) 24px; border-radius: 28px; background: var(--surface); box-shadow: var(--tile-shadow); }
.cta h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 700; }
.cta p { max-width: 520px; margin: 12px auto 24px; color: var(--label-2); }
.cta-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 24px; font-size: 17px; font-weight: 500; transition: background .2s; }
.btn-filled { background: var(--blue); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--blue) 30%, transparent); }
.btn-filled:hover { background: var(--blue-press); }
.btn-plain { color: var(--blue); }
.btn-plain:hover { background: var(--fill); }
.foot { border-top: 1px solid var(--sep); }
.foot-in { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 22px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--label-3); }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a:hover { color: var(--label); }

/* tablet */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links a { padding: 7px 9px; font-size: 14px; }
}

/* phone: App Store–style list */
@media (max-width: 720px) {
  body { font-size: 16px; }
  html { scroll-padding-top: 128px; }
  .nav { height: 52px; padding-left: 14px; }
  .nav-links { display: none; }
  .nav .icon-btn { margin-left: auto; }
  .hero { padding: 104px 0 24px; text-align: left; }
  .hero h1 { font-size: 40px; }
  .lede { margin-left: 0; font-size: 17px; }
  .stats { justify-content: flex-start; gap: 8px; margin-top: 20px; }
  .stats li { padding: 6px 12px; font-size: 13px; }
  .seg-wrap { top: 70px; padding-top: 6px; }
  .seg { width: 100%; }
  .seg button { flex: 1; min-width: 0; padding: 0 6px; font-size: 14px; }
  .group { padding-top: 26px; }
  .group-head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
  .group-head h2 { font-size: 24px; }
  .group-head p { font-size: 14px; }
  .see-all { order: 2; font-size: 14px; }
  .grid, .grid-2 { grid-template-columns: 1fr; gap: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--tile-shadow); overflow: hidden; }
  .app { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-radius: 0; box-shadow: none; background: none; position: relative; }
  .app:hover { transform: none; box-shadow: none; }
  .app + .app::before { content: ""; position: absolute; top: 0; left: 90px; right: 0; height: 1px; background: var(--sep); }
  .app-icon { width: 62px; height: 62px; border-radius: 14px; }
  .app h3 { font-size: 16px; line-height: 1.25; }
  .app-desc { margin-top: 2px; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .app-meta { margin-top: 4px; font-size: 12px; }
  .stars { width: 52px; height: 10px; }
  .get { align-self: center; min-height: 30px; padding: 0 14px; border-radius: 15px; font-size: 0; }
  .get::after { content: "Get"; font-size: 14px; }
  .tv-grid { grid-template-columns: 1fr; gap: 14px; }
  .tv-body { grid-template-columns: 62px 1fr auto; grid-template-rows: auto; align-items: center; gap: 12px; padding: 14px 14px 16px 16px; }
  .tv-poster { width: 62px; height: 62px; aspect-ratio: 1; border-radius: 14px; }
  .tv h3 { font-size: 16px; }
  .tv .app-desc { -webkit-line-clamp: 3; }
  .tv .get { grid-column: auto; }
  .cta { padding-top: 36px; padding-bottom: 40px; }
  .cta-actions .btn { width: 100%; }
  .foot-in { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
html { overflow-x: clip; }
