/* Semantic colours from MASTER's frontend/src/hooks/useTheme.tsx. */
:root {
  color-scheme: light;
  --bg: #E8EEF6;
  --surface: #E8EEF6;
  --field: #E8EEF6;
  --raised-surface: #E8EEF6;
  --text: #303947;
  --muted: #526071;
  --line: #C5CEDB;
  --accent: #C33838;
  --accent-secondary: #A62B2B;
  --accent-hover: #A62B2B;
  --on-accent: #FFFFFF;
  --grid-ink: color-mix(in srgb, var(--text) 5.6%, transparent);
}

:root[data-axelus-theme="tokyo-night"] {
  color-scheme: dark;
  --bg: #1A1B27;
  --surface: #24283B;
  --field: #1F2335;
  --raised-surface: #24283B;
  --text: #C0CAF5;
  --muted: #A9B1D6;
  --line: #3B4261;
  --accent: #70A5FD;
  --accent-secondary: #BF91F3;
  --accent-hover: #70A5FD;
  --on-accent: #1A1B27;
  --grid-ink: color-mix(in srgb, var(--text) 3.2%, transparent);
}

:root[data-axelus-theme="radical-nord"] {
  color-scheme: dark;
  --bg: #2E3440;
  --surface: #3B4252;
  --field: #2E3440;
  --raised-surface: #3B4252;
  --text: #ECEFF4;
  --muted: #D8DEE9;
  --line: #4C566A;
  --accent: #F78DA7;
  --accent-secondary: #88C0D0;
  --accent-hover: #F78DA7;
  --on-accent: #2E3440;
  --grid-ink: color-mix(in srgb, var(--text) 3.2%, transparent);
}

:root[data-axelus-theme] {
  --accent-dark: var(--accent-hover);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --raised: none;
  --raised-soft: none;
  --pressed: none;
}

body {
  background:
    linear-gradient(to right, var(--grid-ink) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-ink) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
}

[hidden] { display: none !important; }

.ax-header {
  position: relative;
  z-index: 40;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.ax-brand {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
}
.ax-brand img,
footer .footer-logo {
  display: block;
  width: clamp(72px, 10vw, 104px);
  height: auto;
}

.preferences { display: flex; align-items: center; gap: 12px; }
.preference { position: relative; }

.preference-trigger {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.preference-trigger:is(:hover, [aria-expanded="true"]) {
  color: var(--accent);
  border-color: var(--accent);
}

.preference-trigger svg { width: 18px; height: 18px; }
.preference-trigger [data-theme-icon] { display: none; }
[data-axelus-theme="axelus"] [data-theme-icon="axelus"],
[data-axelus-theme="tokyo-night"] [data-theme-icon="tokyo-night"],
[data-axelus-theme="radical-nord"] [data-theme-icon="radical-nord"] { display: block; }

.preference-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  min-width: 154px;
  width: max-content;
  max-width: calc(100vw - 80px);
  max-height: min(70vh, 490px);
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--raised-surface);
  box-shadow: 0 6px 18px rgb(0 0 0 / .18);
}

.preference-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: start;
  cursor: pointer;
}

.preference-item:is(:hover, :focus-visible) { background-color: color-mix(in srgb, var(--text) 10%, var(--surface)); }
.preference-item[aria-checked="true"] {
  background-color: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-weight: 600;
}
.preference-item:focus-visible { outline-offset: -2px; }

.hero, .service-card, .principles, .access-option, footer {
  border: 1px solid var(--line);
  background: var(--surface);
}

.hero { min-height: 460px; }
.hero::before { border-color: color-mix(in srgb, var(--accent) 7%, transparent); }
.hero-copy { min-width: 0; overflow-wrap: anywhere; }
.eyebrow, .service-icon, .principle, .payment-method, .back-to-top { border: 1px solid var(--line); }
.section-kicker, .eyebrow { color: var(--accent-secondary); }
.fabric, .fabric::before, .fabric::after { border: 1px solid var(--line); }
.fabric { background: var(--field); }
.fabric::after { inset: 21%; }
.fabric-core { width: 53%; aspect-ratio: 313 / 110; }
.service-card { min-width: 0; min-height: 0; }
.service-heading { margin-bottom: 2px; }
.service-icon { flex: 0 0 58px; }
.status-live { color: var(--accent-secondary); border-color: color-mix(in srgb, var(--accent-secondary) 32%, var(--line)); }
.service-card .card-note { margin-top: 0 !important; padding-top: 0; }
.account-button { align-self: stretch; max-width: 100%; }
.actions, .access-buttons { flex-wrap: wrap; }
.access-option, .principles { min-width: 0; }
.access-option ol { padding-inline-start: 23px; padding-inline-end: 0; }
.access-option li { padding-inline-start: 5px; padding-inline-end: 0; }
.payment-method { background: var(--field); }
.button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  box-shadow: none;
  text-align: center;
}
.button svg { flex: none; }
.button-primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-hover); filter: none; }
.button-secondary { color: var(--text); background: var(--surface); }
.button-secondary:not(:disabled):hover { color: var(--accent); border-color: var(--accent); }
.button:disabled {
  color: var(--muted);
  background: var(--field);
  cursor: not-allowed;
  transform: none;
}
[dir="rtl"] :is(.button, .back-to-top) > svg:not(:only-child) { transform: scaleX(-1); }
[dir="rtl"] .hero::before { right: auto; left: -190px; }
footer .copyright { margin: 0; text-align: end; white-space: normal; }

@media (max-width: 900px) {
  .hero { min-height: 0; }
}
@media (max-width: 480px) {
  .ax-header { padding: 8px 12px; }
  .preferences { gap: 8px; }
  .preference-trigger { width: 42px; height: 42px; }
  .hero .actions > .button { width: 100%; }
  .section-kicker, .eyebrow { white-space: normal; }
}
