/* ATK public shell: one header, one footer, one language switch for every public
   ATK page (order 0048, 2026-11-20). Load after css/atk.css.
   Pieces: the division accent override, the header with four doors, the language
   switch, the phone menu (a native <dialog>), the phone dock, the footer.
   Two looks share one markup: html[data-shell="a"] (the bar and a menu sheet on
   phones) and html[data-shell="b"] (the floating capsule and a bottom dock on
   phones). js/atk-shell.js sets data-shell, the language and the dialog. */

/* ---------- accent: one per division, inside the same frame ---------- */
:root { --atk-accent: var(--atk-blue); --atk-accent-g: var(--atk-blue-g); --atk-accent-ink: #FFFFFF; --atk-accent-fill: var(--atk-prominent); --atk-div-ground: var(--atk-sky-page); }
/* Studio (Duck Studios) keeps its own amber from the game's poster kit */
[data-division="studio"] { --atk-accent: #FFC45C; --atk-accent-g: #FFC45C; --atk-accent-ink: #1A1206; --atk-accent-fill: #FFC45C; --atk-div-ground: radial-gradient(1200px 800px at 60% 200px, #11363F 0%, #0A1B2B 50%, #04070D 100%); }
/* a new division adds one line here, e.g. [data-division="apps"] { --atk-accent: var(--atk-teal); ... } */

.atk-sky--division { background: var(--atk-div-ground); background-color: var(--atk-ground); }
.atk .atk-btn.atk-btn--accent { background: var(--atk-accent-fill); color: var(--atk-accent-ink); font-weight: 600; }
.atk .atk-btn.atk-btn--accent:hover { background: var(--atk-accent-fill); filter: brightness(1.08); text-decoration: none; }
.atk :focus-visible { outline-color: var(--atk-accent); }

/* ---------- skip link ---------- */
.atk .atk-skip { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 50; padding: 10px 16px; border-radius: var(--atk-r-pill); background: var(--atk-ctl-solid); color: var(--atk-label); font-size: 15px; }
.atk-skip:focus-visible { top: calc(12px + env(safe-area-inset-top)); text-decoration: none; }

/* ---------- header ---------- */
.atk-head { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
.atk-head-in { display: flex; align-items: center; gap: 16px; height: 60px; padding-inline: 20px; }
.atk .atk-home { display: inline-flex; flex: none; align-items: center; gap: 12px; min-height: 44px; color: var(--atk-label); }
.atk-home:hover { text-decoration: none; }
.atk-home img { height: 26px; width: auto; display: block; }
/* the division name sits after the mark, never inside it; it is the only header piece that
   gives way on a narrow phone (an ellipsis), so the switch and the menu button stay whole */
.atk-division { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding-inline-start: 12px; box-shadow: inset 0.5px 0 0 var(--atk-fill-3); font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--atk-label); white-space: nowrap; }
[dir="rtl"] .atk-division { box-shadow: inset -0.5px 0 0 var(--atk-fill-3); }
.atk-division::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 8px; vertical-align: 0.1em; border-radius: 50%; background: var(--atk-accent); }

.atk-head-in > nav { margin-inline-start: auto; }
.atk-doors { display: flex; align-items: center; gap: 4px; list-style: none; padding: 0; margin-block: 0; }
.atk .atk-doors a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--atk-r-pill); font-size: 15px; font-weight: 500; color: var(--atk-label-2); }
.atk .atk-doors a:hover { color: var(--atk-label); background: var(--atk-fill); text-decoration: none; }
.atk .atk-doors a[aria-current="page"] { color: var(--atk-label); background: var(--atk-fill-2); }
.atk-doors a[aria-current="page"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--atk-accent); }
.atk-doors svg { width: 20px; height: 20px; flex: none; display: none; }

/* the language switch: a link to the same page in the other language */
.atk .atk-lang { display: inline-flex; flex: none; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: var(--atk-r-pill); font-size: 15px; font-weight: 500; color: var(--atk-label); background: var(--atk-fill-2); }
.atk-lang:hover { background: var(--atk-fill-3); text-decoration: none; }
.atk-lang:lang(ar) { font-family: var(--atk-font-ar); }
.atk-lang:lang(en) { font-family: var(--atk-font); }

.atk-menu-btn { display: none; flex: none; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; border-radius: var(--atk-r-pill); background: var(--atk-fill-2); color: var(--atk-label); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
.atk-menu-btn svg { flex: none; width: 18px; height: 18px; }

/* ---------- the dialog: a native <dialog> opened with showModal() ---------- */
.atk-dialog { margin: 0; border: 0; padding: 0; color: var(--atk-label); background: var(--atk-pane-solid); max-width: none; max-height: none; }
.atk-dialog::backdrop { background: rgba(4, 5, 10, 0.6); }
.atk-dialog[open] { animation: atk-sheet-in var(--atk-dur) var(--atk-ease); }
@keyframes atk-sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.atk-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding-inline: 20px; }
.atk-dialog-title { margin: 0; font-size: 17px; font-weight: 600; }
.atk-close { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; border-radius: var(--atk-r-pill); background: var(--atk-fill-2); color: var(--atk-label); font: inherit; font-size: 15px; cursor: pointer; }
.atk-menu-list { list-style: none; margin: 8px 0 0; padding: 0 12px; }
.atk .atk-menu-list a { display: block; padding: 14px 12px; border-radius: var(--atk-r-card); color: var(--atk-label); }
.atk-menu-list a:hover { background: var(--atk-fill); text-decoration: none; }
.atk-menu-list b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.atk-menu-list span { display: block; margin-top: 2px; font-size: 15px; color: var(--atk-label-2); }
.atk-menu-list a[aria-current="page"] b::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-start: 10px; vertical-align: middle; border-radius: 50%; background: var(--atk-accent); }
.atk-menu-foot { padding: 20px 24px calc(24px + env(safe-area-inset-bottom)); }

/* ---------- footer: legal line, privacy, terms ---------- */
.atk-foot { position: relative; z-index: 1; padding: 56px 0 40px; font-size: 13px; line-height: 1.7; color: var(--atk-label-3); }
.atk-foot-in { width: min(var(--atk-content-w), 100% - 40px); margin-inline: auto; padding-top: 20px; box-shadow: inset 0 0.5px 0 var(--atk-sep); }
.atk-foot nav { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 8px; }
.atk .atk-foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--atk-label-2); }
.atk-foot nav a:first-child { padding-inline-start: 0; }
.atk-foot p { margin: 0; }
.atk-endorse { color: var(--atk-label-2); }

/* ---------- look A: the bar ---------- */
[data-shell="a"] .atk-head { background: rgba(7, 8, 15, 0.82); -webkit-backdrop-filter: var(--atk-ctl-blur); backdrop-filter: var(--atk-ctl-blur); box-shadow: inset 0 -0.5px 0 var(--atk-sep); }
[data-shell="a"] .atk-head-in { width: min(1200px, 100%); margin-inline: auto; }
[data-shell="a"] .atk-dock { display: none; }
/* keyboard focus going back up (Shift+Tab) scrolls a control clear of the sticky bar (60 px + 16 px room);
   going down it stops 16 px above the bottom edge, so the ring is never cut there */
html[data-shell="a"] { scroll-padding-top: calc(76px + env(safe-area-inset-top)); scroll-padding-bottom: 16px; }
@media (max-width: 860px) {
  [data-shell="a"] .atk-head-in > nav { display: none; }
  [data-shell="a"] .atk-menu-btn { display: inline-flex; }
  [data-shell="a"] .atk-lang { margin-inline-start: auto; }
  [data-shell="a"] .atk-head-in { padding-inline: 16px; gap: 8px; }
  .atk-dialog { width: 100vw; height: 100dvh; box-sizing: border-box; padding-top: env(safe-area-inset-top); }
}
/* a cut brand name reads as a defect, so the division name gives way where it cannot fit whole:
   at 400 px and below in A the name (123 px) has 16 to 30 px of room, so only its accent mark stays
   beside the ATK mark; the name is set at size 0, so it is still read out and nothing overflows.
   Below 380 px in B it drops, and the footer line still names the division there (order 0050 step 5) */
@media (max-width: 400px) { [data-shell="a"] .atk-division { flex: none; padding: 0; box-shadow: none; font-size: 0; line-height: 0; } [data-shell="a"] .atk-division::before { margin: 0; } }
/* at 320 px in Arabic ("English" is the wider switch label) the mark needs 8 px more: a tighter row */
@media (max-width: 340px) { [data-shell="a"] .atk-head-in { padding-inline: 12px; gap: 6px; } }
@media (max-width: 380px) { [data-shell="b"] .atk-division { display: none; } }

/* ---------- look B: the capsule and the dock ---------- */
/* the 12 px above the capsule is part of the header and fades from the ground, so the page never shows
   through the gap; the capsule matches the dock (0.86), as at the 0.09 glass a white headline under it
   dropped the labels to 1.13:1 (order 0050) */
[data-shell="b"] .atk-head { top: 0; padding: calc(12px + env(safe-area-inset-top)) 12px 0; background: linear-gradient(var(--atk-ground) calc(12px + env(safe-area-inset-top)), rgba(7, 8, 15, 0)); }
/* focus going back up scrolls clear of the capsule (12 px gap + 60 px + 16 px room), and down 16 px clear of the edge */
html[data-shell="b"] { scroll-padding-top: calc(88px + env(safe-area-inset-top)); scroll-padding-bottom: 16px; }
[data-shell="b"] .atk-head-in { width: min(1120px, 100%); margin-inline: auto; height: 60px; padding-inline: 18px 8px; background: rgba(28, 31, 43, 0.86); -webkit-backdrop-filter: var(--atk-ctl-blur); backdrop-filter: var(--atk-ctl-blur); box-shadow: var(--atk-ctl-shadow); border-radius: var(--atk-r-pill); }
[data-shell="b"] .atk-menu-btn { display: none; }
[data-shell="b"] .atk-dock { display: none; }
@media (max-width: 860px) {
  [data-shell="b"] .atk-head-in > nav { display: none; }
  [data-shell="b"] .atk-lang { margin-inline-start: auto; }
  [data-shell="b"] .atk-head-in { height: 56px; padding-inline: 16px 6px; }
  /* the dock: the four doors in thumb reach, as the iPhone tab bar */
  [data-shell="b"] .atk-dock { display: block; position: fixed; z-index: 20; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 26px; background: rgba(28, 31, 43, 0.86); -webkit-backdrop-filter: var(--atk-ctl-blur); backdrop-filter: var(--atk-ctl-blur); box-shadow: var(--atk-ctl-shadow); }
  [data-shell="b"] .atk-dock .atk-doors { margin: 0; padding: 6px; gap: 0; justify-content: space-between; }
  [data-shell="b"] .atk-dock .atk-doors li { flex: 1; }
  [data-shell="b"] .atk-dock .atk-doors a { flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-height: 54px; padding: 4px 2px; border-radius: 20px; font-size: 12px; font-weight: 600; }
  [data-shell="b"] .atk-dock .atk-doors svg { display: block; width: 22px; height: 22px; }
  [data-shell="b"] .atk-dock .atk-doors a[aria-current="page"] { color: var(--atk-accent-g); }
  [data-shell="b"] .atk-dock .atk-doors a[aria-current="page"]::after { display: none; }
  [data-shell="b"] .atk-foot { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  /* keyboard focus scrolls a field clear of the dock (dock 66 px + 10 px gap + 20 px room) */
  html[data-shell="b"] { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
/* on a short phone (320 x 568) the dock takes 76 px of the screen, so the hero gives that room back:
   a tighter top and a smaller headline keep both hero buttons clear of the dock at rest (order 0050) */
@media (max-width: 860px) and (max-height: 640px) {
  [data-shell="b"] .atk-hero { padding-top: 32px; }
  [data-shell="b"] .atk-hero h1 { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .atk-dialog[open] { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  [data-shell="a"] .atk-head, [data-shell="b"] .atk-head-in, [data-shell="b"] .atk-dock { background: var(--atk-ctl-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
