/* AppleFileViewer landing page — self-contained, system fonts, no external resources. */
:root {
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #dbe2ea;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --accent-text: #ffffff;
  --accent-soft: #dbeafe;
  --code-bg: #e8edf4;
  --shadow: 0 10px 30px -12px rgb(15 23 42 / 0.25);
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --surface: #131c2e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #243044;
  --accent: #3b82f6;
  --accent-2: #38bdf8;
  --accent-soft: #172554;
  --code-bg: #1c2638;
  --shadow: 0 10px 30px -12px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --bg: #0b1220;
    --bg-alt: #0f172a;
    --surface: #131c2e;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #243044;
    --accent: #3b82f6;
    --accent-2: #38bdf8;
    --accent-soft: #172554;
    --code-bg: #1c2638;
    --shadow: 0 10px 30px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    Ubuntu,
    Cantarell,
    'Noto Sans',
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus {
  top: 12px;
}
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }
}
.narrow {
  max-width: 820px;
}
.muted {
  color: var(--text-muted);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}
.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main-nav {
  display: none;
  gap: 22px;
}
.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.main-nav a:hover {
  color: var(--text);
}
@media (min-width: 900px) {
  .main-nav {
    display: flex;
  }
  .brand {
    margin-right: 12px;
  }
  .header-tools {
    margin-left: auto;
  }
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.lang-select {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  min-height: 38px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn svg,
.feature svg,
.btn svg,
.dl svg,
.card-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.fill {
  fill: currentColor;
  stroke: none;
}
.i-moon {
  display: none;
}
:root[data-theme='dark'] .i-sun {
  display: none;
}
:root[data-theme='dark'] .i-moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .i-sun {
    display: none;
  }
  :root[data-theme='auto'] .i-moon {
    display: block;
  }
}

/* Theme-aware screenshots */
.shot-dark {
  display: none;
}
:root[data-theme='dark'] .shot-dark {
  display: block;
}
:root[data-theme='dark'] .shot-light {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .shot-dark {
    display: block;
  }
  :root[data-theme='auto'] .shot-light {
    display: none;
  }
}

/* Hero */
.hero {
  padding: 48px 0 40px;
  background:
    radial-gradient(
      60% 50% at 85% 0%,
      color-mix(in srgb, var(--accent-2) 18%, transparent),
      transparent
    ),
    radial-gradient(
      50% 40% at 0% 20%,
      color-mix(in srgb, var(--accent) 14%, transparent),
      transparent
    );
}
.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 980px) {
  .hero {
    padding: 88px 0 72px;
  }
  .hero-grid {
    grid-template-columns: 5fr 7fr;
  }
}
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin: 0 0 16px;
}
:root[data-theme='dark'] .eyebrow {
  color: var(--accent-2);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .eyebrow {
    color: var(--accent-2);
  }
}
h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem);
}
.lead {
  font-size: 1.12rem;
  color: var(--text-muted);
  margin: 0 0 28px;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: var(--accent-text);
  box-shadow: var(--shadow);
}
.btn-primary:hover {
  transform: translateY(-1px);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}
.meta {
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meta a {
  font-weight: 500;
}
.hero-shot {
  margin: 0;
}
.hero-shot img,
.shot-grid img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Sections */
.section {
  padding: 64px 0;
}
.section.alt {
  background: var(--bg-alt);
}
.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 32px;
  max-width: 60ch;
}
.feature-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.feature svg {
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 12px;
}
.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.shot-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
.shot-grid figure {
  margin: 0;
}
.shot-grid figcaption {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.two-col {
  display: grid;
  gap: 32px;
  align-items: start;
}
@media (min-width: 900px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.checklist li {
  position: relative;
  padding-left: 32px;
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.4rem;
}
.card-icon {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 14px;
}
.steps {
  margin: 0 0 16px;
  padding-left: 1.3em;
  display: grid;
  gap: 10px;
}

/* Downloads */
.dl-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.dl {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  min-height: 64px;
}
.dl:hover {
  border-color: var(--accent);
}
.dl.recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dl svg {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--accent);
}
.dl span {
  display: flex;
  flex-direction: column;
}
.dl small {
  color: var(--text-muted);
}
.note {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

/* Tabs */
.tabs [role='tablist'] {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tabs [role='tab'] {
  font: inherit;
  font-weight: 600;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  min-height: 44px;
}
.tabs [role='tab'][aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tabs [role='tabpanel'] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

/* FAQ */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 20px;
  margin-bottom: 10px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  min-height: 44px;
}
details p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  font-size: 0.92rem;
}
.footer-inner p {
  margin: 0 0 6px;
}

@media (max-width: 420px) {
  #gh-link {
    display: none; /* also linked in the footer — keeps the brand readable on small phones */
  }
}

/* ---- Screenshot lightbox ---- */
.hero-shot,
.shot-grid figure {
  cursor: zoom-in;
}
.hero-shot:focus-visible,
.shot-grid figure:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 4px;
  border-radius: var(--radius);
}
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgb(2 6 23 / 0.88);
  backdrop-filter: blur(4px);
}
.lb-figure {
  box-sizing: border-box;
  height: 100%;
  margin: 0;
  padding: 56px 72px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.lb-figure img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px -20px rgb(0 0 0 / 0.8);
  background: #0b1220;
}
.lb-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  align-items: baseline;
  font-size: 0.95rem;
  text-align: center;
}
.lb-counter {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgb(148 163 184 / 0.35);
  background: rgb(15 23 42 / 0.7);
  color: #e2e8f0;
  cursor: pointer;
}
.lb-btn:hover {
  background: rgb(30 41 59 / 0.95);
}
.lb-btn:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}
.lb-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lb-close {
  top: 12px;
  right: 12px;
}
.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
}
.lb-prev {
  left: 14px;
}
.lb-next {
  right: 14px;
}
.lightbox[data-single] .lb-prev,
.lightbox[data-single] .lb-next {
  display: none;
}
@media (max-width: 640px) {
  .lb-figure {
    padding: 56px 8px 72px;
  }
  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 14px;
    transform: none;
  }
  .lb-prev {
    left: calc(50% - 56px);
  }
  .lb-next {
    right: calc(50% - 56px);
  }
  .lb-figure img {
    max-height: calc(100vh - 170px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] .lb-figure img {
    animation: lb-in 160ms ease-out;
  }
  @keyframes lb-in {
    from {
      opacity: 0;
      transform: scale(0.98);
    }
  }
}
