/* Beyond The Title® — Apple design system
   Paste the unscoped Apple :root tokens verbatim, then add
   component and layout utilities used by every page. */

/* ─────────────────────────────────────────────────────────────────────────
   APPLE TOKENS
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-warm: #fbfbfd;

  --fg: #1d1d1f;
  --fg-2: #424245;
  --muted: #6e6e73;
  --meta: #86868b;

  --border: #d2d2d7;
  --border-soft: #e8e8ed;

  --accent: #0071e3;
  --accent-on: #ffffff;
  --accent-hover: #0077ed;
  --accent-active: #0066cc;

  --success: #16a34a;
  --warn:    #eab308;
  --danger:  #dc2626;

  --font-display:
    "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body:
    "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono:
    "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 17px;
  --text-lg:   21px;
  --text-xl:   28px;
  --text-2xl:  40px;
  --text-3xl:  56px;
  --text-4xl:  80px;

  --leading-body:  1.47;
  --leading-tight: 1.05;
  --tracking-display: -0.015em;

  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;

  --section-y-desktop: 100px;
  --section-y-tablet:  64px;
  --section-y-phone:   40px;

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-pill: 980px;

  --elev-flat:   none;
  --elev-ring:   0 0 0 1px var(--border);
  --elev-raised: 0 12px 32px rgba(0, 0, 0, 0.08);

  --focus-ring: 0 0 0 4px color-mix(in oklab, var(--accent), transparent 65%);

  --motion-fast:   150ms;
  --motion-base:   220ms;
  --ease-standard: cubic-bezier(0.28, 0, 0.22, 1);

  --container-max:            1024px;
  --container-gutter-desktop: 22px;
  --container-gutter-tablet:  18px;
  --container-gutter-phone:   16px;
}

/* ─── Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--fg);
  background: var(--bg);
}

img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color var(--motion-fast) var(--ease-standard); }
a:hover { color: var(--accent-active); }

/* ─── Layout primitives ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter-desktop);
}
@media (max-width: 833px) {
  .container { padding-inline: var(--container-gutter-tablet); }
}
@media (max-width: 640px) {
  .container { padding-inline: var(--container-gutter-phone); }
}

.row {
  display: flex;
  gap: var(--space-4);
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ─── Typography ──────────────────────────────────────────────────────── */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

h1, h2, h3, h4, .display, .section-title {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
  color: var(--fg);
}

h1, .display-xl {
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: var(--leading-tight);
}
h2, .display-lg {
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1.07;
}
h3, .display-md {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.10;
}
h4, .display-sm {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.14;
}

.body-lg {
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.38;
  color: var(--fg-2);
}
.body-muted {
  color: var(--muted);
}
.body-sm {
  font-size: var(--text-sm);
  line-height: 1.47;
}

/* ─── Navigation ──────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 52px;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: #fff;
  letter-spacing: var(--tracking-display);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
}
.nav-links a {
  color: rgba(255,255,255,0.92);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.nav-links a:hover { color: #fff; }
.nav-links .current { color: #fff; }

.nav-menu-btn {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: var(--space-2);
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    inset: 52px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(0,0,0,0.96);
    padding: var(--space-4) var(--container-gutter-phone);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--motion-base) var(--ease-standard), opacity var(--motion-base);
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-links a { display: block; padding: var(--space-3) 0; font-size: var(--text-base); }
  .nav-menu-btn { display: grid; place-items: center; }
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.29;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast), transform var(--motion-fast);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:active { background: var(--accent-active); transform: scale(0.98); }

.btn-dark {
  background: var(--fg);
  color: #fff;
}
.btn-dark:hover { background: #000; color: #fff; }
.btn-dark:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(0,113,227,0.06); color: var(--accent-hover); }

.btn-white {
  background: rgba(255,255,255,0.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
}
.btn-white:hover { background: rgba(255,255,255,0.24); color: #fff; }

.btn-group {
  display: inline-flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ─── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--motion-base) var(--ease-standard), box-shadow var(--motion-base);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--elev-raised);
}
.card-feature {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.card-media-portrait {
  aspect-ratio: 3 / 4;
}
.card-body {
  padding: var(--space-5);
}
.card-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: var(--tracking-display);
  margin-bottom: var(--space-2);
}
.card-meta {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ─── Forms ───────────────────────────────────────────────────────────── */
.field { margin-bottom: var(--space-4); }
.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--fg);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--meta); }
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }
.field-help { font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-2); }

/* ─── Footer ───────────────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
  padding: var(--section-y-desktop) 0 var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: var(--space-8);
}
.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--space-2); }
.footer-col a {
  font-size: var(--text-sm);
  color: var(--fg-2);
}
.footer-col a:hover { color: var(--accent); }
.footer-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.footer-legal {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-soft);
  font-size: var(--text-sm);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
}
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}
.footer-legal-links a { color: var(--muted); }
.footer-legal-links a:hover { color: var(--fg); }

@media (max-width: 833px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; }
}

/* ─── Utility helpers ──────────────────────────────────────────────────── */
.bg-black { background: #000; color: #fff; }
.bg-black h1, .bg-black h2, .bg-black h3, .bg-black .display, .bg-black .section-title { color: #fff; }
.bg-black .body-muted, .bg-black .card-meta { color: rgba(255,255,255,0.72); }

.bg-surface { background: var(--surface); }
.bg-warm { background: var(--surface-warm); }

.text-center { text-align: center; }
.full-bleed { width: 100vw; margin-left: calc(50% - 50vw); }

.section {
  padding: var(--section-y-desktop) 0;
}
@media (max-width: 833px) { .section { padding: var(--section-y-tablet) 0; } }
@media (max-width: 640px) { .section { padding: var(--section-y-phone) 0; } }

.section-head {
  max-width: 680px;
  margin-bottom: var(--space-8);
}
.section-head h2 { margin-bottom: var(--space-3); }
.section-head.center { margin-inline: auto; text-align: center; }

/* ─── Cover card (Apple editorial) ─────────────────────────────────────── */
.cover-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  color: #fff;
}
.cover-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0.88;
  transition: transform var(--motion-base) var(--ease-standard), opacity var(--motion-base);
}
.cover-card:hover img {
  transform: scale(1.03);
  opacity: 0.92;
}
.cover-card .overlay {
  position: relative;
  z-index: 2;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 420px;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.18) 55%, transparent 100%);
}
.cover-card .eyebrow { color: var(--accent); }
.cover-card .card-title { color: #fff; margin-bottom: var(--space-2); }
.cover-card .card-meta { color: rgba(255,255,255,0.8); }

.cover-large .overlay { min-height: 640px; }

@media (max-width: 640px) {
  .cover-card .overlay { min-height: 360px; padding: var(--space-4); }
  .cover-large .overlay { min-height: 480px; }
}

/* ─── Filter chips ────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  cursor: pointer;
  transition: all var(--motion-fast) var(--ease-standard);
}
.chip:hover { border-color: var(--meta); }
.chip.active {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
}

/* ─── Article body (Apple long-form) ──────────────────────────────────── */
.article-body {
  max-width: 680px;
  margin-inline: auto;
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--fg);
}
.article-body p { margin-bottom: 1.2em; }
.article-body h2 {
  font-size: var(--text-2xl);
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-5);
  margin: 1.6em 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.25;
  color: var(--fg);
}
.article-body cite {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--muted);
}

/* ─── Reading progress ────────────────────────────────────────────────── */
.read-progress {
  position: fixed;
  top: 52px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  z-index: 101;
  transition: width 0.1s linear;
}

/* ─── Rights gate banner ─────────────────────────────────────────────── */
.rights-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
}
.rights-banner.status-held {
  background: #fff;
  border-color: var(--border-soft);
}
.rights-banner .status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

/* ─── Fill-in placeholders ───────────────────────────────────────────────
   Marks details that must be replaced with real business information before
   this site goes live. Deliberately loud so none of them ship by accident.
   Search the project for "fill-in" to find every one. */
.fill-in {
  background: #fff3cd;
  border-bottom: 2px solid #eab308;
  color: #713f12;
  padding: 0 4px;
  font-weight: 600;
  border-radius: 2px;
}

/* ─── Legal pages ────────────────────────────────────────────────────── */
.legal-wrap { max-width: 720px; margin-inline: auto; }
.legal-updated {
  font-size: var(--text-sm);
  color: var(--muted);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}
.legal-wrap h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}
.legal-wrap h2:first-of-type { margin-top: 0; }
.legal-wrap h3 {
  font-size: var(--text-lg);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}
.legal-wrap p { margin-bottom: var(--space-4); color: var(--fg-2); }
.legal-wrap ul, .legal-wrap ol {
  margin: 0 0 var(--space-4) var(--space-5);
  color: var(--fg-2);
}
.legal-wrap li { margin-bottom: var(--space-2); }
.legal-wrap a { border-bottom: 1px solid var(--border); }
.legal-callout {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}
.legal-callout p:last-child { margin-bottom: 0; }

/* ─── Focus states ───────────────────────────────────────────────────── */
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
button:focus-visible, a:focus-visible { border-radius: inherit; }

/* ─── Selection ──────────────────────────────────────────────────────── */
::selection { background: var(--accent); color: #fff; }

/* ─── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
