/* InflightPlay — single site stylesheet. No external resources. */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #0B1F3A;          /* brand navy */
  --text-muted: #4a5668;
  --line: #d8dee7;
  --accent: #B4530A;        /* brand orange #D9650A, darkened for text: 5.0:1 on white */
  --accent-strong: #8F4208;
  --accent-soft: #FDF0E6;
  --brand-orange: #D9650A;  /* decorative use only (lines, icons), not text */
  --focus: #1d4ed8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 28, 46, .06), 0 4px 16px rgba(15, 28, 46, .06);
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1420;
    --surface: #121d2c;
    --surface-2: #182536;
    --text: #e8edf4;
    --text-muted: #a9b4c3;
    --line: #26354a;
    --accent: #FF9A2E;      /* brand orange (dark logo) */
    --accent-strong: #FFB566;
    --accent-soft: #3a2410;
    --brand-orange: #FF9A2E;
    --focus: #93c5fd;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); }
h3 { font-size: 1.1875rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: .35em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: 12px; top: -100px;
  background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm); z-index: 100;
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 24px; flex-wrap: wrap; min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.125rem;
  letter-spacing: -.01em; padding: 8px 0;
}
.brand:hover { color: var(--text); }
.brand img { height: 40px; width: auto; margin-left: -6px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; font-size: .9688rem; font-weight: 500;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

@media (max-width: 720px) {
  .site-header { position: static; }
  .site-header .wrap { padding-top: 4px; padding-bottom: 4px; }
  .site-nav { width: 100%; margin: 0 -8px; }
  .site-nav ul { gap: 0; }
  .site-nav a { padding: 10px 8px; min-height: 44px; display: flex; align-items: center; font-size: .9375rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: var(--radius-sm);
  font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent-strong); color: var(--bg); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-alt { background: var(--surface); }
.eyebrow {
  font-size: .8125rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75em;
}
.lead { font-size: clamp(1.125rem, 1rem + .4vw, 1.3125rem); color: var(--text-muted); max-width: 62ch; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head h2 { margin: 0; }
.prose { max-width: 70ch; }
.wrap.prose { max-width: var(--wrap); }
.wrap.prose > * { max-width: 70ch; }
.wrap.prose > .tech-block > * { max-width: 70ch; }
.wrap.prose .lang-groups, .wrap.prose .table-scroll { max-width: none; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.muted { color: var(--text-muted); }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 96px); position: relative; overflow: hidden; }
.hero::before {
  /* faint flight-grid, no imagery */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 0%, transparent 70%);
  opacity: .7;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 18ch; }
.hero .lead { margin-bottom: 1.75em; }
.hero-meta { margin-top: 28px; font-size: .9375rem; color: var(--text-muted); }

.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 3vw, 40px); }
.page-head h1 { margin-bottom: .35em; }

/* ---------- Feature list ---------- */
.features { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { background: var(--surface); padding: 28px 24px; }
.feature svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 16px; }
.feature h3 { margin-bottom: .4em; }
.feature p { margin: 0; color: var(--text-muted); font-size: .9688rem; }

/* ---------- Game cards ---------- */
.game-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); list-style: none; padding: 0; margin: 0; }
.game-grid li + li { margin-top: 0; }
.game-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; height: 100%;
  transition: box-shadow .15s, border-color .15s;
}
.game-card:hover { box-shadow: var(--shadow); border-color: var(--text-muted); }
.game-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.game-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game-card h3 { margin: 0; }
.game-card .desc { color: var(--text-muted); font-size: .9375rem; margin: 0; flex: 1; }
.game-card .btn { align-self: flex-start; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags li + li { margin-top: 0; }
.tag { font-size: .8125rem; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.tag-accent { background: var(--accent-soft); color: var(--accent-strong); }

.status { padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text-muted); }

/* ---------- CTA band ---------- */
.cta {
  background: var(--text); color: var(--bg);
  border-radius: var(--radius); padding: clamp(32px, 5vw, 56px);
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.cta h2 { margin: 0 0 .3em; }
.cta p { margin: 0; opacity: .85; max-width: 52ch; }
.cta .btn-primary { background: var(--bg); color: var(--text); }
.cta .btn-primary:hover { background: var(--accent-soft); color: var(--text); }
.cta a:not(.btn) { color: inherit; }
.cta :focus-visible { outline-color: var(--accent); }

/* ---------- Play page ---------- */
.play-layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .play-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.player { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; }
.player iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.player.portrait { max-width: 480px; margin: 0 auto; }
.player.portrait iframe { aspect-ratio: 9 / 16; max-height: 78vh; }
.player:fullscreen, .player:-webkit-full-screen { border-radius: 0; max-width: none; display: flex; align-items: center; justify-content: center; }
.player:fullscreen iframe, .player:-webkit-full-screen iframe { width: 100%; height: 100%; aspect-ratio: auto; max-height: none; }
.player-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 16px; }
.player-bar h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin: 0; }

.spec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.spec h2 { font-size: 1.125rem; margin-bottom: 16px; }
.spec dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 12px 16px; font-size: .9375rem; }
.spec dt { color: var(--text-muted); }
.spec dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.spec .note { margin: 20px 0 0; font-size: .875rem; color: var(--text-muted); }
@media (max-width: 400px) { .spec dl { grid-template-columns: 1fr; gap: 2px; } .spec dd { margin-bottom: 10px; } }

/* ---------- Technical page ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 24px 0 0; }
.toc li + li { margin-top: 0; }
.toc a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text-muted); font-size: .9375rem; background: var(--surface); }
.toc a:hover { color: var(--accent); border-color: var(--accent); }
.tech-block { scroll-margin-top: 88px; }
.table-scroll { overflow-x: auto; margin: 0 0 1.25em; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; background: var(--surface); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
pre { font-family: var(--mono); font-size: .875rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
label, legend { font-weight: 600; font-size: .9375rem; }
.hint { font-weight: 400; color: var(--text-muted); font-size: .875rem; }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; min-height: 46px; width: 100%;
}
input:hover, select:hover, textarea:hover { border-color: var(--text-muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
textarea { min-height: 140px; resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px 16px; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; }
.checks label { font-weight: 400; display: inline-flex; gap: 8px; align-items: center; min-height: 32px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-note { font-size: .875rem; color: var(--text-muted); margin-top: 12px; }

.contact-layout { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .contact-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.aside-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; align-self: start; }
.aside-card h2 { font-size: 1.125rem; }
.aside-card p:last-child { margin-bottom: 0; }
.big-link { font-size: 1.125rem; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0; font-size: .9375rem; color: var(--text-muted); margin-top: clamp(48px, 7vw, 96px); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer li + li { margin-top: 0; }
.site-footer a { color: var(--text-muted); display: inline-block; padding: 6px 0; }
.site-footer a:hover { color: var(--text); }

/* ---------- Misc ---------- */
.center { text-align: center; }
.notfound { padding: clamp(64px, 12vw, 140px) 0; }
.notfound .code { font: 700 clamp(4rem, 3rem + 6vw, 8rem)/1 var(--font); color: var(--accent); letter-spacing: -.04em; margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.lead-gap { margin-bottom: 32px; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; }
.steps li { margin: 0; }
[hidden] { display: none !important; }
.section-tight { padding: 0 0 clamp(32px, 5vw, 64px); }
.play-section { padding-top: 24px; }
.back { margin: 0 0 16px; font-size: .9375rem; }
.desc-line { margin-top: 12px; max-width: 70ch; }
.form-actions { margin-top: 24px; }
.lang-groups { display: grid; gap: 8px 32px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 8px; }
.lang-groups h3 { font-size: 1rem; margin: 16px 0 6px; }
.lang-groups ul { margin: 0; padding-left: 1.1em; font-size: .9375rem; }
.lang-groups li + li { margin-top: .15em; }
.spec details summary { cursor: pointer; color: var(--accent); }
.spec details p { margin: 8px 0 0; font-weight: 400; color: var(--text-muted); }

/* ---------- Language picker & translations ---------- */
.lang-picker { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.lang-picker svg { width: 18px; height: 18px; flex: none; }
.lang-picker select {
  font: 500 .9375rem/1.2 var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: 40px; padding: 6px 10px; width: 12rem; max-width: 12rem; cursor: pointer;
}
.lang-picker select:hover { border-color: var(--text-muted); }
.i18n-notice { background: var(--accent-soft); color: var(--text); font-size: .875rem; }
.i18n-notice p { margin: 0; padding: 8px 0; }
.i18n-pending main { visibility: hidden; }
.lang-groups .muted { font-size: .8125rem; }
@media (max-width: 720px) {
  .site-header .wrap { justify-content: space-between; column-gap: 12px; }
  .lang-picker { order: 2; }
  .lang-picker svg { display: none; }
  .site-nav { order: 3; }
  .lang-picker select { width: 8.5rem; max-width: 8.5rem; font-size: .875rem; }
}
.non-latin h1, .non-latin h2, .non-latin h3, .non-latin .eyebrow { letter-spacing: normal; }
.non-latin .eyebrow { text-transform: none; font-size: .875rem; }

/* ---------- Right-to-left ---------- */
[dir="rtl"] ul, [dir="rtl"] ol { padding-left: 0; padding-right: 1.25em; }
[dir="rtl"] .lang-groups ul { padding-right: 1.1em; }
[dir="rtl"] .tags, [dir="rtl"] .toc, [dir="rtl"] .site-nav ul, [dir="rtl"] .site-footer ul, [dir="rtl"] .steps, [dir="rtl"] .game-grid { padding-right: 0; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] .skip-link { left: auto; right: 12px; }
[dir="rtl"] pre, [dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] pre { text-align: left; }

/* ---------- Licensing ---------- */
.lic-grid { margin-top: 8px; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-inline-start: 28px; }
.check-list li + li { margin-top: .75em; }
.check-list li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: .45em;
  width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
[dir="rtl"] .check-list { padding-right: 0; }
.pilot {
  background: var(--accent-soft); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px);
  display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between;
}
.pilot h2 { margin-bottom: .4em; }
.pilot p:last-child { margin: 0; max-width: 60ch; }
#how, #included, #options, #pilot { padding-bottom: clamp(32px, 5vw, 56px); }
