/* ---------- chrome + shared components (both themes, semantic tokens only) ---------- */

/* quiet page backdrop for light pages */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg); }
.backdrop::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 44rem; background: radial-gradient(55% 60% at 88% 0%, rgba(255, 154, 53, 0.10), transparent 70%), radial-gradient(45% 55% at 0% 8%, rgba(135, 87, 250, 0.12), transparent 70%), radial-gradient(40% 40% at 60% 30%, rgba(51, 210, 195, 0.05), transparent 70%); }
[data-theme="light"] .backdrop::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 38rem;
  background: radial-gradient(60% 70% at 85% 0%, color-mix(in srgb, var(--orange) 10%, transparent), transparent 70%),
              radial-gradient(50% 60% at 0% 10%, color-mix(in srgb, var(--violet) 7%, transparent), transparent 70%); }

/* header */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); border-bottom: 1px solid transparent; transition: background var(--t-med), border-color var(--t-med); }
.site-header.is-solid, [data-theme="light"] .site-header { background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); border-bottom-color: var(--line); }
.page-home .site-header:not(.is-solid) { background: transparent; border-color: transparent; }
.site-header__in { display: flex; align-items: center; gap: var(--s-5); width: min(100% - var(--gutter) * 2, var(--w-wide)); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; margin-right: auto; padding: 0.3rem 0; }
.brand svg { width: 2.15rem; height: 2.15rem; flex: none; border-radius: 23%; }
.brand__name { font-family: var(--font-head); font-size: 1.36rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.nav { display: flex; align-items: center; gap: clamp(0.1rem, 0.9vw, 0.9rem); }
.nav a { position: relative; display: block; padding: 0.55rem 0.65rem; color: var(--text-2); text-decoration: none; font-size: 0.95rem; font-weight: 500; letter-spacing: 0.02em; border-radius: var(--r-1); }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0.65rem; right: 0.65rem; bottom: 0.18rem; height: 2px; border-radius: 2px; background: var(--orange); }
.header-cta { margin-left: 0.4rem; }
.site-header .language-picker select { min-height: 44px; }
.menu-btn { display: none; align-items: center; gap: 0.55rem; min-height: 2.75rem; padding: 0 0.3rem 0 0.95rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 0.92rem; font-weight: 500; }
.menu-btn i { position: relative; display: block; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--surface-2); }
.menu-btn i::before, .menu-btn i::after { content: ""; position: absolute; left: 0.62rem; right: 0.62rem; height: 1.5px; background: currentColor; top: 0.85rem; }
.menu-btn i::after { top: 1.2rem; }
@media (max-width: 900px), (orientation: portrait) and (pointer: coarse) { .site-header .nav, .site-header .header-cta { display: none; } .menu-btn { display: inline-flex; } }

/* mobile menu: native <dialog> = focus trap, inert page, Esc */
.menu { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: color-mix(in srgb, var(--bg) 96%, transparent); color: var(--text); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.menu::backdrop { background: transparent; }
.menu[open] { display: flex; flex-direction: column; animation: menu-in 340ms var(--ease-out); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
.menu__top { display: flex; align-items: center; justify-content: space-between; height: calc(var(--header-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--gutter) 0; flex: none; }
.menu__close { min-height: 2.75rem; padding: 0 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 0.92rem; }
.menu__list { flex: 1; overflow-y: auto; padding: var(--s-4) var(--gutter) calc(var(--s-7) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.menu__list a { display: flex; align-items: center; gap: 0.9rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; }
.menu__list a svg { width: 1.6rem; height: 1.6rem; }
.menu__list a span { margin-left: auto; font-family: var(--font-sans); font-size: 0.8rem; font-weight: 400; color: var(--text-3); }
.menu__list a[aria-current="page"] { color: var(--accent); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 3rem; padding: 0.65rem 1.45rem; border-radius: var(--r-pill); border: 1px solid transparent; font-size: 1rem; font-weight: 600; letter-spacing: 0.02em; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-med), opacity var(--t-fast); }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--orange); color: #1b1306; }
.btn--primary:hover { background: #ffab55; box-shadow: 0 10px 34px -12px color-mix(in srgb, var(--orange) 70%, transparent); }
[data-theme="light"] .btn--primary { background: var(--navy-800); color: #fff; }
[data-theme="light"] .btn--primary:hover { background: var(--navy-700); box-shadow: 0 10px 30px -14px rgba(15, 23, 51, 0.55); }
.btn--ghost { color: var(--text); border-color: var(--line-strong); background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.btn--ghost:hover { border-color: var(--text-2); background: var(--surface-2); }
.btn--small { min-height: 2.5rem; padding: 0.35rem 1rem; font-size: 0.9rem; }
.btn--block { width: 100%; }
.link-arrow { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text); font-weight: 600; text-decoration: none; padding: 0.4rem 0; border-bottom: 1.5px solid var(--line-strong); transition: border-color var(--t-fast), gap var(--t-fast) var(--ease-out); }
.link-arrow:hover { border-color: var(--accent); gap: 0.7rem; }
.link-arrow::after { content: "→"; color: var(--accent); }

/* status pill: colour + dot shape + words, never colour alone */
.status { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.65rem; border-radius: var(--r-pill); border: 1px solid currentColor; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.04em; line-height: 1.7; white-space: nowrap; }
.status::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.status--available { color: var(--ok); }
.status--testing, .status--preparing { color: var(--warn); }
.status--offline { color: var(--err); }
.status--planned { color: var(--muted); }
.status--planned::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

/* forms */
.field { display: grid; gap: 0.4rem; }
.field > label, .field__label { font-weight: 600; font-size: 0.95rem; }
.field__hint { font-size: var(--fs-0); color: var(--text-3); line-height: 1.6; }
.field__error { font-size: var(--fs-0); color: var(--err); font-weight: 500; }
.input, .select { width: 100%; min-height: 3rem; padding: 0.65rem 0.95rem; border-radius: var(--r-2); border: 1.5px solid var(--field-line); background: var(--field); color: var(--text); font-size: 1rem; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input::placeholder { color: var(--text-3); }
.input:focus-visible, .select:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input[aria-invalid="true"] { border-color: var(--err); }
.select { appearance: none; padding-right: 2.6rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 1.25rem) 52%, calc(100% - 0.9rem) 52%; background-size: 0.36rem 0.36rem; background-repeat: no-repeat; }
.choice { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; min-height: 2.6rem; padding: 0 1rem; border-radius: var(--r-pill); border: 1.5px solid var(--field-line); background: var(--field); font-weight: 500; font-size: 0.95rem; transition: border-color var(--t-fast), background var(--t-fast); }
.choice input:checked + span { border-color: var(--text); background: var(--text); color: var(--bg); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input:disabled + span { opacity: 0.4; }

/* cards + panels */
.card { position: relative; display: grid; gap: var(--s-3); align-content: start; padding: clamp(1.25rem, 2.6vw, 1.9rem); border-radius: var(--r-3); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.panel { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow-1); }

/* service card (manifest-driven); tint per service id */
.t-downloader { --tint: var(--svc-downloader); } .t-converter { --tint: var(--svc-converter); }
.svc { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 1.1rem; align-items: start; padding: clamp(1.25rem, 2.6vw, 1.8rem); border-radius: var(--r-3); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--text); text-decoration: none; transition: transform var(--t-med) var(--ease-out), border-color var(--t-fast), box-shadow var(--t-med); }
a.svc:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.svc__icon { grid-row: 1 / 4; width: 3.6rem; height: 3.6rem; border-radius: 23%; }
.svc__icon svg { width: 100%; height: 100%; }
.svc__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.svc__name { font-family: var(--font-head); font-size: var(--fs-3); font-weight: 700; }
.svc__sum { color: var(--text-2); }
.svc__go { margin-top: 0.4rem; color: var(--text); font-weight: 600; font-size: 0.95rem; }
.svc__go::after { content: " →"; color: var(--accent); }

/* states */
.state { display: grid; justify-items: start; gap: var(--s-3); padding: clamp(1.4rem, 3.6vw, 2.4rem); border: 1px dashed var(--line-strong); border-radius: var(--r-3); background: var(--surface-2); }
.state__title { font-family: var(--font-head); font-size: var(--fs-3); font-weight: 700; }
.state p { color: var(--text-2); max-width: 38rem; }
.state--error { border-style: solid; border-color: color-mix(in srgb, var(--err) 50%, transparent); }
.state--offline { border-style: solid; border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.notice { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.9rem 1.1rem; border-radius: var(--r-2); border: 1px solid; font-size: 0.95rem; line-height: 1.65; }
.notice b { font-weight: 700; }
.notice--warn { color: var(--text); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.notice--info { color: var(--text); border-color: color-mix(in srgb, var(--info) 45%, transparent); background: color-mix(in srgb, var(--info) 8%, transparent); }
.notice__dot { flex: none; width: 0.6rem; height: 0.6rem; margin-top: 0.5rem; border-radius: 50%; background: var(--warn); }
.notice--info .notice__dot { background: var(--info); }
.spinner { width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 800ms linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(1turn); } }
.progress { position: relative; height: 0.5rem; border-radius: var(--r-pill); background: var(--bg-2); overflow: hidden; }
.progress > i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--accent); transition: width 300ms var(--ease-out); }
.progress[data-indeterminate] > i { width: 35%; animation: indet 1.2s var(--ease-in-out) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* toast */
.toasts { position: fixed; z-index: 80; right: max(1rem, env(safe-area-inset-right)); bottom: calc(1rem + env(safe-area-inset-bottom)); display: grid; gap: 0.5rem; width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.85rem 1rem; border-radius: var(--r-2); background: var(--navy-800); color: #eef0f8; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6); font-size: 0.94rem; line-height: 1.55; pointer-events: auto; animation: toast-in 320ms var(--ease-out); }
.toast::before { content: ""; flex: none; width: 0.55rem; height: 0.55rem; margin-top: 0.45rem; border-radius: 50%; background: var(--orange); }
.toast--ok::before { background: #5fd6a0; } .toast--err::before { background: #ff8794; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* dialog */
.dialog { width: min(32rem, calc(100vw - 2rem)); padding: 0; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-2); }
.dialog::backdrop { background: rgba(7, 11, 26, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog__body { display: grid; gap: var(--s-4); padding: clamp(1.4rem, 4vw, 2rem); }
.dialog__title { font-size: var(--fs-3); }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; }

/* sections */
.section { position: relative; padding-block: clamp(4rem, 10vw, 8rem); }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section__head { display: grid; gap: var(--s-3); margin-bottom: clamp(1.8rem, 4.4vw, 3.4rem); max-width: 44rem; }
.section__title { font-size: var(--fs-5); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; }
.section__lede { font-size: var(--fs-2); color: var(--text-2); max-width: 38rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.eyebrow::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--orange); }
.note { font-size: var(--fs-0); color: var(--text-3); line-height: 1.7; }
.page-hero { padding-top: calc(var(--header-h) + clamp(2.5rem, 7vw, 5.5rem)); padding-bottom: clamp(1.6rem, 4vw, 3rem); }
.page-hero__title { font-size: var(--fs-5); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; max-width: 18em; }
.page-hero__lede { margin-top: var(--s-4); font-size: var(--fs-2); color: var(--text-2); max-width: 40rem; }
.page-hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; margin-bottom: var(--s-4); }
.page-hero__icon { width: 3.4rem; height: 3.4rem; border-radius: 23%; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--s-4); font-size: var(--fs-0); color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--text-3); }
.offline-bar { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; padding: 0.55rem 1.1rem; border-radius: var(--r-pill); background: var(--navy-700); color: #eef0f8; font-size: var(--fs-0); box-shadow: var(--shadow-2); }

/* footer: always navy - the one surface every page shares */
.site-footer { position: relative; color: #eef0f8; background: var(--navy-950); border-top: 1px solid rgba(220, 226, 255, 0.08); padding-block: clamp(3rem, 7vw, 5rem) calc(2rem + env(safe-area-inset-bottom)); margin-top: clamp(3rem, 8vw, 6rem);
  --text: #eef0f8; --text-2: #b9bfd6; --text-3: #8c93b0; --line: rgba(220, 226, 255, 0.13); --link: #ffb46b; }
.page-home .site-footer, .page-gallery .site-footer { margin-top: 0; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: var(--s-7) var(--s-6); }
.site-footer__claim { font-family: var(--font-head); font-size: var(--fs-3); font-weight: 700; line-height: 1.4; margin-top: var(--s-4); max-width: 14em; }
.site-footer h2 { font-family: var(--font-sans); font-size: var(--fs-00); font-weight: 600; letter-spacing: 0.16em; color: var(--text-3); margin-bottom: var(--s-4); }
.site-footer ul { display: grid; gap: 0.5rem; }
.site-footer li a { color: var(--text-2); text-decoration: none; }
.site-footer li a:hover { color: var(--text); }
.site-footer li.pending { color: var(--text-3); }
.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3) var(--s-6); margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--fs-00); color: var(--text-3); }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__grid > :first-child { grid-column: 1 / -1; } }