/* Athena UI product site, built on Athena UI itself (vendor/athena-ui-js, 2.15.0).
   Athena's rules are in the cascade layer "athena"; everything here is unlayered, so it wins.
   The colours are those of "Ocean", a theme of the Athena demo (the screenshots show it): teal,
   so the site is told apart from the blue of Aesir NS and the indigo of Heimdall. An Athena theme
   for data-theme="athena-site". Without JavaScript the page follows the system
   (prefers-color-scheme); with it, theme-boot.js puts data-mode on <html> and the switch in the
   header can choose light or dark. Header: white on #04384a 12.7:1. */

/* ---------------------------------------------------------------- theme */
:root[data-theme="athena-site"] {
    color-scheme: light;
    --athena-bg: #ffffff;               /* cards, tiles */
    --athena-fg: #0e2a35;
    --athena-muted: #3f5c67;
    --athena-border: #bcd4dc;
    --athena-line: #bcd4dc;
    --athena-field-border: #5f8592;
    --athena-surface: #e3f0f4;
    --athena-surface-alt: #eef6f8;      /* the page */
    --athena-hover: #d3ebf2;
    --athena-overlay: rgb(5 25 33 / 45%);
    --athena-accent: #006a8a;
    --athena-accent-fg: #ffffff;
    --athena-focus: #005a76;
    --athena-danger: #b3261e;
    --athena-success: #17673a;
    --athena-warning: #8a5300;
    --athena-info: #006a8a;
    --athena-info-fg: #fff; --athena-success-fg: #fff; --athena-warning-fg: #fff; --athena-danger-fg: #fff;
    --athena-shadow: 0 1px 2px rgb(5 25 33 / 8%), 0 4px 14px rgb(5 25 33 / 10%);
    --athena-radius: 10px;
    --athena-radius-control: 8px;
    --site-header-bg: #04384a;
    --site-header-fg: #ffffff;
    --site-header-accent: #8fdcf5;
    --site-code-bg: #0e2a35;
    --site-code-fg: #dcecf1;
}

:root[data-theme="athena-site"][data-mode="dark"] {
    color-scheme: dark;
    --athena-bg: #102731;
    --athena-fg: #dcecf1;
    --athena-muted: #94b0ba;
    --athena-border: #244250;
    --athena-line: #244250;
    --athena-field-border: #4f7482;
    --athena-surface: #17394a;
    --athena-surface-alt: #08181e;
    --athena-hover: #17394a;
    --athena-overlay: rgb(0 0 0 / 65%);
    --athena-accent: #4fc3e8;
    --athena-accent-fg: #04202b;
    --athena-focus: #8fdcf5;
    --athena-danger: #ff8a80;
    --athena-success: #5fd39a;
    --athena-warning: #f0c060;
    --athena-info: #4fc3e8;
    --athena-info-fg: #04202b; --athena-success-fg: #04202b; --athena-warning-fg: #04202b; --athena-danger-fg: #04202b;
    --athena-shadow: none;
    --site-header-bg: #04202b;
    --site-code-bg: #04141a;
}

/* The same dark colours without JavaScript (no data-mode on <html>) on a dark system */
@media (prefers-color-scheme: dark) {
    :root[data-theme="athena-site"]:not([data-mode]) {
        color-scheme: dark;
        --athena-bg: #102731;
        --athena-fg: #dcecf1;
        --athena-muted: #94b0ba;
        --athena-border: #244250;
        --athena-line: #244250;
        --athena-field-border: #4f7482;
        --athena-surface: #17394a;
        --athena-surface-alt: #08181e;
        --athena-hover: #17394a;
        --athena-overlay: rgb(0 0 0 / 65%);
        --athena-accent: #4fc3e8;
        --athena-accent-fg: #04202b;
        --athena-focus: #8fdcf5;
        --athena-danger: #ff8a80;
        --athena-success: #5fd39a;
        --athena-warning: #f0c060;
        --athena-info: #4fc3e8;
        --athena-info-fg: #04202b; --athena-success-fg: #04202b; --athena-warning-fg: #04202b; --athena-danger-fg: #04202b;
        --athena-shadow: none;
        --site-header-bg: #04202b;
        --site-code-bg: #04141a;
    }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background: var(--athena-surface-alt);
    color: var(--athena-fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

/* not on .athena-button: an unlayered "a" rule would beat Athena's (layered) button colours */
a:where(:not(.athena-button)) { color: var(--athena-accent); text-underline-offset: 0.18em; }
a:where(:not(.athena-button)):hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid var(--athena-focus);
    outline-offset: 3px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }

code, pre {
    font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

:not(pre) > code {
    background: var(--athena-surface);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.wrap {
    width: min(100% - 2rem, 1160px);
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -10rem;
    z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* ---------------------------------------------------------------- header */
.site-header {
    background: var(--site-header-bg);
    color: var(--site-header-fg);
}

.site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.5rem;
    padding-block: 0.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    margin-right: auto;
    color: inherit;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
}
.brand img { width: 36px; height: 36px; }

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.75rem;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}
.site-nav a:hover { background: rgb(255 255 255 / 12%); }

/* The light / dark switch (made by js/site.js; without JavaScript it is not there) */
.site-mode.athena-button {
    min-height: 40px;
    background: transparent;
    color: var(--site-header-fg);
    border-color: rgb(255 255 255 / 60%);
}
.site-mode.athena-button:hover { background: rgb(255 255 255 / 12%); filter: none; }
.site-mode.athena-button[aria-pressed="true"] { background: rgb(255 255 255 / 18%); border-color: var(--site-header-accent); }
.site-mode svg { width: 18px; height: 18px; }

.site-header :focus-visible { outline-color: var(--site-header-accent); }

/* Phones: the switch is an icon on the row of the name (its text stays its accessible name), the menu below */
@media (max-width: 720px) {
    .site-nav { order: 2; flex-basis: 100%; }
    .site-mode.athena-button { padding: 0; width: 44px; height: 44px; justify-content: center; }
    .site-mode-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .site-nav ul { gap: 0; margin-inline: -0.5rem; }
    .site-nav a { padding: 0 0.5rem; }
}

/* ---------------------------------------------------------------- hero */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 3.5rem); }

.hero .wrap {
    display: grid;
    gap: clamp(2rem, 4vw, 3rem);
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
}

@media (min-width: 960px) {
    .hero .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

.eyebrow {
    color: var(--athena-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.lead {
    font-size: clamp(1.075rem, 1rem + 0.4vw, 1.25rem);
    color: var(--athena-muted);
    max-width: 68ch;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.actions .athena-button {
    font-weight: 600;
    text-decoration: none;
    border-width: 2px;
}
.actions .athena-button:hover { text-decoration: underline; }
.actions .button-secondary {
    background: transparent;
    color: var(--athena-accent);
    border-color: var(--athena-accent);
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}
.facts .badge { font-size: 0.85rem; font-weight: 600; padding: 0.3rem 0.75rem; }

.shot {
    margin: 0;
    border: 1px solid var(--athena-line);
    border-radius: var(--athena-radius);
    overflow: hidden;
    background: var(--athena-bg);
    box-shadow: var(--athena-shadow);
}

/* At a glance: Athena stats */
.glance {
    --grid-columns: 4;
    --grid-gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.glance .stat { height: 100%; }
.glance .stat-value { line-height: 1.15; color: var(--athena-accent); }
@media (max-width: 480px) {
    .glance .stat-value { font-size: 1.35rem; }
    .glance .stat { padding: 12px; }
}

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section.alt { background: var(--athena-bg); border-block: 1px solid var(--athena-line); }
.section.alt .card, .section.alt .stat { background: var(--athena-surface-alt); }
.section-intro { max-width: 68ch; color: var(--athena-muted); margin-bottom: 2rem; }

.athena-grid.features { --grid-columns: 4; --grid-gap: 1rem; margin: 0; padding: 0; list-style: none; }
.athena-grid.modules { --grid-columns: 4; --grid-gap: 1rem; margin: 0; padding: 0; list-style: none; }
.athena-grid.gallery { --grid-columns: 2; --grid-gap: 1.5rem; }

@media (max-width: 1100px) {
    .athena-grid.features, .athena-grid.modules, .glance { --grid-columns: 2; }
}

.athena-grid.links { --grid-columns: 3; margin-top: 1.5rem; }
@media (max-width: 1100px) { .athena-grid.links { --grid-columns: 3; } }

/* Athena makes every grid one column under 768 px; two tiles still fit on a phone */
@media (max-width: 768px) {
    .athena-grid.glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card { display: flex; flex-direction: column; }
.card .card-body { padding: 1.25rem; flex: 1; }
.card .card-title { font-size: 1.125rem; margin-bottom: 0.35rem; }
.card .card-body p { margin: 0; color: var(--athena-muted); }
.card .card-footer { padding: 0.5rem 1.25rem; }
.card .card-footer a { font-weight: 600; }

/* Screenshots */
.gallery figure { margin: 0; }
.gallery .card-image { border-bottom: 1px solid var(--athena-line); }
.gallery figcaption { color: var(--athena-muted); font-size: 0.95rem; padding: 0.75rem 1rem; }

.phone-row {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    margin-top: 2rem;
}
.phone-row .shot { max-width: 260px; }

@media (min-width: 720px) {
    .phone-row { grid-template-columns: 260px minmax(0, 1fr); }
}

/* Install */
.install {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
}

.code-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.code-head .card-title { margin: 0; }

pre {
    margin: 1rem 0 0;
    padding: 1rem;
    background: var(--site-code-bg);
    color: var(--site-code-fg);
    border-radius: 8px;
    line-height: 1.5;
    white-space: pre-wrap;        /* long commands wrap: nothing scrolls out of sight */
    overflow-wrap: anywhere;
}

/* Code examples: an Athena accordion (native <details>, works without JS); code keeps its
   indentation and scrolls sideways inside its own box (focusable, so the keyboard can scroll it) */
.examples { background: var(--athena-bg); border-radius: var(--athena-radius); overflow: hidden; }
.examples .accordion-item:first-child { border-radius: var(--athena-radius) var(--athena-radius) 0 0; }
.examples .accordion-header { min-height: 48px; gap: 1rem; font-weight: 600; }
.examples .accordion-header > span:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6rem; }
.examples .accordion-header code { font-weight: 400; color: var(--athena-muted); white-space: nowrap; }
.examples .accordion-panel { padding: 1rem; }
.examples .code-head p { margin: 0; color: var(--athena-muted); flex: 1 1 18rem; }
.examples pre { white-space: pre; overflow-x: auto; overflow-wrap: normal; font-size: 0.9rem; }
.examples pre:focus-visible { outline: var(--athena-focus-width, 2px) solid var(--athena-focus); outline-offset: 2px; }

.needs { margin-top: 1.5rem; }
.needs .athena-table-wrapper { overflow-x: auto; }
.needs .athena-table { width: 100%; }
.needs .athena-table th { text-align: left; white-space: nowrap; width: 1%; }
.needs .athena-table th, .needs .athena-table td { padding: 0.6rem 0.9rem; vertical-align: top; }
.needs .athena-table tbody tr:nth-child(even) { background: transparent; }

/* ---------------------------------------------------------------- footer */
.site-footer {
    padding-block: 2rem;
    color: var(--athena-muted);
    font-size: 0.95rem;
    border-top: 1px solid var(--athena-line);
}
.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
}
.site-footer p { margin: 0; }

/* Touch screens: 44 x 44 px for everything a finger presses (Athena 2.15.0 does not do it yet) */
@media (pointer: coarse) {
    .athena-button, .site-mode.athena-button { min-height: 44px; min-width: 44px; }
    .card-footer a, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media print {
    .site-header, .skip-link, .actions, .copy-button { display: none; }
    body { background: #fff; color: #000; }
    .section.alt { background: none; }
}
