:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-raised: #2c2c2e;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --cedar: #d8e8c9;
  --cedar-bright: #eff9e8;
  --warm: #c8925a;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 84% 8%, rgba(84, 112, 77, 0.18), transparent 30rem),
    radial-gradient(circle at 18% 54%, rgba(146, 92, 45, 0.08), transparent 30rem),
    var(--bg);
  color: var(--text);
}

a { color: inherit; }

a:focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--cedar-bright);
  outline-offset: 4px;
}

.site-frame {
  width: min(1240px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px;
}

.policy-header,
.policy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.policy-header { border-bottom: 1px solid var(--line); }

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 1.1rem;
  font-weight: 780;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.site-brand img {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.policy-header nav,
.policy-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(16px, 2.5vw, 32px);
}

.policy-header nav a,
.policy-footer nav a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 680;
  text-decoration: none;
}

.policy-header nav a[aria-current="page"] { color: var(--text); }

.document-page { padding: clamp(48px, 7vw, 80px) 0 96px; }

.document-header {
  max-width: 820px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  max-width: 900px;
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.document-header > p:last-child,
.apple-lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  line-height: 1.55;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.document-grid section {
  padding: clamp(22px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.document-grid h2 {
  margin-bottom: 10px;
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.document-grid p,
.document-grid li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.document-grid ul,
.document-grid ol {
  margin: 0;
  padding-inline-start: 22px;
}

.document-grid li + li { margin-top: 10px; }

.inline-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 8px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.inline-action { background: var(--text); color: var(--bg); }
.secondary-action { border: 1px solid var(--line); background: var(--surface-raised); }
.inline-document-link { color: var(--cedar); font-weight: 600; text-decoration: none; }
.inline-document-link::after { content: " ›"; }

.tmdb-attribution-link { display: inline-block; margin: 2px 0 18px; }
.tmdb-attribution-logo { display: block; width: min(220px, 78vw); height: auto; }

.apple-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.55fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
  min-height: 520px;
  padding: clamp(48px, 7vw, 96px) 0;
}

.apple-hero h1 { max-width: 880px; }
.apple-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.apple-actions .inline-action,
.apple-actions .secondary-action { margin-top: 0; }

.brand-stage { display: grid; justify-items: center; gap: 18px; }
.brand-stage img {
  display: block;
  width: min(31vw, 340px);
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22.5%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.brand-stage p { color: var(--muted); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; }

/* Apple apps: real captures, one row per pair. Each figure grows by its aspect ratio, so a row
   shares one height. */
.apple-screens { margin: 0 0 56px; }
.apple-screens h2 { margin-bottom: 12px; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.apple-screens > p:not(.eyebrow) { max-width: 720px; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.screens { display: grid; gap: 16px; margin-top: 28px; }
.screens-row { display: flex; gap: 16px; }
.screens figure { flex: var(--ratio) 1 0; min-width: 0; margin: 0; }
.screen-tv { --ratio: 1.778; }
.screen-mac { --ratio: 1.561; }
.screen-ipad { --ratio: 0.75; }
.screen-iphone { --ratio: 0.46; }
.screens img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.screens .screen-iphone img { border-radius: 22px; }
.screens figcaption { margin-top: 10px; color: var(--muted); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; }

.policy-callout {
  margin: 56px 0 96px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.policy-callout h2 {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.policy-callout p { max-width: 720px; color: var(--muted); font-size: 1rem; line-height: 1.6; }

.release-page { max-width: 1200px; margin: 0 auto; }
.release-header { margin-bottom: clamp(32px, 5vw, 48px); }
.release-header h1 { max-width: 1040px; }

.release-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.release-card,
.release-entry {
  border: 1px solid var(--line);
  background: var(--surface);
}

.release-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 16px;
}

.release-card h2,
.release-entry h2 {
  margin-bottom: 10px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.release-card > p:not(.eyebrow),
.release-summary,
.release-notes-body p,
.release-notes-body li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.release-card .inline-document-link { margin-top: auto; padding-top: 24px; }
.release-card .inline-document-link + .inline-document-link { margin-top: 0; padding-top: 10px; }
.release-card-aside { margin: 12px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.release-card-links { margin: auto 0 0; padding-top: 24px; color: var(--muted); font-size: 0.95rem; font-weight: 600; }
.release-card-links a { color: var(--cedar); text-decoration: none; }
.release-card-links + .inline-document-link { margin-top: 0; padding-top: 10px; }

.release-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.release-status {
  color: var(--cedar);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.release-status-released { color: var(--cedar-bright); }
.release-status-testflight { color: #c9d8ff; }
.release-status-preview { color: #ffd39b; }
.beta-callout { margin: 16px 0 20px; padding: 20px 24px; border-color: rgba(220, 160, 80, 0.45); }
.beta-callout h2 { margin-bottom: 6px; font-size: 1.15rem; }
.beta-callout p { margin: 0; }
.compact-callout { margin-bottom: 0; }

/* Shared by the visual release notes cover and the release hub spotlight. */
.note-icon { flex: none; width: 15px; height: 15px; }
.note-wall {
  position: absolute;
  inset: -60px -80px auto;
  display: grid;
  gap: 14px;
  transform: rotate(-7deg);
  opacity: 0.62;
}
.note-wall-row { display: flex; gap: 14px; }
.note-wall-row:nth-child(2) { transform: translateX(-70px); }
.note-wall-row:nth-child(3) { transform: translateX(-20px); }
.note-wall img { flex: none; width: 128px; height: 192px; border-radius: 8px; object-fit: cover; }
.note-audience { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 6px; background: rgba(233, 178, 118, 0.16); color: #f1c48f; font-size: 0.7rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.note-audience-public { background: rgba(185, 221, 152, 0.16); color: #cbe8b0; }
.note-audience-internal { background: rgba(255, 255, 255, 0.1); color: #e3e3e8; }
.note-audience-beta { background: rgba(150, 200, 240, 0.16); color: #bcdcf4; }

/* Release hub "What's new": posters on the right fade into the text; dark in both themes like the notes cover. */
.release-spotlight {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(242, 239, 232, 0.1);
  border-radius: 16px;
  background: #0c100b;
  color: #f2efe8;
}
.release-spotlight .note-wall { inset-block-start: -50px; inset-block-end: auto; inset-inline: 42% -60px; }
.release-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, #0c100b 0, #0c100b 40%, rgba(12, 16, 11, 0.72) 62%, rgba(12, 16, 11, 0.2) 100%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(126, 168, 105, 0.16), transparent 70%);
}
.release-spotlight-content { position: relative; z-index: 2; max-width: 640px; padding: clamp(24px, 4vw, 40px); }
.release-spotlight-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; color: rgba(242, 239, 232, 0.72); font-size: 0.85rem; font-weight: 600; }
.release-spotlight h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.release-spotlight-intro { margin: 0; color: rgba(242, 239, 232, 0.72); font-size: 0.95rem; line-height: 1.6; }
.release-spotlight-glance { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; padding: 0; list-style: none; color: rgba(242, 239, 232, 0.72); font-size: 0.9rem; font-weight: 600; }
.release-spotlight-glance strong { margin-inline-end: 2px; font-size: 1.25rem; font-weight: 760; letter-spacing: -0.02em; }
.release-spotlight-glance .note-glance-new strong { color: #b9dd98; }
.release-spotlight-glance .note-glance-improved strong { color: #e9b276; }
.release-spotlight-glance .note-glance-fixed strong { color: #8fc7ff; }
.release-spotlight-devices { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 22px; padding: 0; list-style: none; color: rgba(242, 239, 232, 0.6); font-size: 0.82rem; font-weight: 600; }
.release-spotlight-devices .note-device { display: inline-flex; align-items: center; gap: 6px; }
.release-spotlight .inline-action { margin-top: 0; background: #f2efe8; color: #0c100b; }

.release-back {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
  text-decoration: none;
}

.release-back::before { content: "←"; margin-inline-end: 9px; }
.release-stack { display: grid; gap: 24px; }

.release-entry {
  overflow: hidden;
  border-radius: 16px;
}

.release-entry > header,
.release-notes-body { padding: clamp(22px, 4vw, 40px); }
.release-entry > header { border-bottom: 1px solid var(--line); }
.release-entry > header .release-metadata { margin-bottom: 0; }
.release-summary { max-width: 780px; margin-bottom: 0; }
.release-notes-body { max-width: 860px; }

.release-notes-body h3 {
  margin: 28px 0 10px;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.release-notes-body h3:first-child { margin-top: 0; }
.release-notes-body ul { margin: 0; padding-inline-start: 22px; }
.release-notes-body li + li { margin-top: 10px; }

.policy-footer {
  align-items: flex-start;
  border-top: 1px solid var(--line);
}

.policy-footer p {
  max-width: 560px;
  margin: 0;
  color: #777b82;
  font-size: 0.78rem;
  line-height: 1.6;
}

@media (hover: hover) and (pointer: fine) {
  .policy-header nav a:hover,
  .policy-footer nav a:hover { color: var(--text); }
  .inline-action:hover { background: var(--cedar-bright); }
  .secondary-action:hover { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.07); }
}

@media (max-width: 820px) {
  .apple-hero,
  .document-grid,
  .release-grid { grid-template-columns: 1fr; }
  .brand-stage { justify-self: center; }
  .brand-stage img { width: min(70vw, 330px); }
  .document-grid section { padding: 22px; }
  .policy-footer { flex-direction: column; }
}

@media (max-width: 620px) {
  /* Phones: TV and Mac full width, then iPad and iPhone side by side at one height. */
  .screens { grid-template-columns: 0.75fr 0.46fr; gap: 14px 12px; }
  .screens-row { display: contents; }
  .screens .screen-tv, .screens .screen-mac { grid-column: 1 / -1; }
  .screens .screen-tv { order: 1; }
  .screens .screen-mac { order: 2; }
  .screens .screen-ipad { order: 3; }
  .screens .screen-iphone { order: 4; }
  .policy-header { align-items: flex-start; flex-direction: column; }
  .policy-header nav { width: 100%; gap: 14px 20px; }
  .apple-actions .inline-action,
  .apple-actions .secondary-action { width: 100%; }
  .policy-callout { border-radius: 14px; }
  .release-spotlight { border-radius: 14px; }
  .release-spotlight .note-wall { inset: -60px -80px auto; }
  .release-spotlight .note-wall img { width: 96px; height: 144px; }
  .release-spotlight::before { background: linear-gradient(180deg, rgba(12, 16, 11, 0.15) 0, rgba(12, 16, 11, 0.7) 130px, #0c100b 210px); }
  .release-spotlight-content { padding-top: 160px; }
  .release-spotlight .inline-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* Collapsed release history: the newest build stays open, earlier builds expand on demand. */
.release-history-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 36px 0 4px; }
.release-history-heading h2 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -0.03em; }
.release-history-controls { display: flex; gap: 8px; }
.release-history-controls[hidden] { display: none; }
.release-history-controls button { min-height: 40px; padding: 0 14px; border: 1px solid var(--control-border, var(--line)); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 650; cursor: pointer; }
.release-entry-collapsed { border-radius: 12px; }
.release-entry-collapsed summary { position: relative; display: block; padding: clamp(22px, 3vw, 32px) clamp(64px, 7vw, 84px) clamp(22px, 3vw, 32px) clamp(22px, 4vw, 40px); list-style: none; cursor: pointer; }
.release-entry-collapsed summary::-webkit-details-marker { display: none; }
.release-entry-collapsed summary::after { content: ""; position: absolute; top: clamp(28px, 3.4vw, 38px); inset-inline-end: clamp(24px, 3vw, 34px); width: 10px; height: 10px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 160ms ease; }
.release-entry-collapsed details[open] > summary::after { transform: translateY(4px) rotate(-135deg); }
.release-entry-collapsed details[open] > summary { border-bottom: 1px solid var(--line); }
.release-entry-collapsed summary .eyebrow { margin-bottom: 8px; }
.release-entry-collapsed h2 { margin: 0 0 8px; font-size: clamp(1.3rem, 2.2vw, 1.75rem); letter-spacing: -0.03em; line-height: 1.15; }
.release-entry-collapsed .release-summary { margin: 0; font-size: 0.95rem; }
.release-entry-collapsed .release-metadata { margin-top: 12px; }
.release-entry-collapsed summary:focus-visible { outline: 3px solid var(--cedar); outline-offset: -3px; border-radius: 12px; }
.release-entry-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 22px clamp(22px, 4vw, 40px) 0; }
.release-entry-collapsed .release-notes-body { padding: clamp(22px, 4vw, 40px); }
.release-notes-body a { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  .release-entry-collapsed summary:hover h2 { text-decoration: underline; text-underline-offset: 5px; }
  .release-history-controls button:hover { border-color: var(--cedar); }
}


/* Right-to-left: mirror directional glyphs, the poster wall and the spotlight fade. */
:root[dir="rtl"] .inline-document-link::after { content: " ‹"; }
:root[dir="rtl"] .release-back::before { content: "→"; }
:root[dir="rtl"] .note-wall { transform: rotate(7deg); }
:root[dir="rtl"] .note-wall-row:nth-child(2) { transform: translateX(70px); }
:root[dir="rtl"] .note-wall-row:nth-child(3) { transform: translateX(20px); }
:root[dir="rtl"] .release-spotlight::before {
  background:
    linear-gradient(270deg, #0c100b 0, #0c100b 40%, rgba(12, 16, 11, 0.72) 62%, rgba(12, 16, 11, 0.2) 100%),
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(126, 168, 105, 0.16), transparent 70%);
}
