/* Samverk product site, built on Athena UI (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 "Ember", a theme of the Samverk UI (samverk-ui/public/css/samverk.css),
   and the screenshots show it: warm, so the site is told apart from the blue of Aesir NS, the teal
   of Athena UI and the indigo of Heimdall. The accent is a little darker than Ember's (#a63e0c, not
   #b4440f) for more contrast on the cream page. An Athena theme for data-theme="samverk-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. */

/* ---------------------------------------------------------------- theme */
:root[data-theme="samverk-site"] {
    color-scheme: light;
    --athena-bg: #ffffff;               /* cards, tiles */
    --athena-fg: #1f1712;
    --athena-muted: #5f4f42;
    --athena-border: #eadccd;
    --athena-line: #eadccd;
    --athena-field-border: #8f7a68;
    --athena-surface: #f5ebe0;
    --athena-surface-alt: #fbf5ef;      /* the page */
    --athena-hover: #fbe6d3;
    --athena-overlay: rgb(40 20 8 / 50%);
    --athena-accent: #a63e0c;
    --athena-accent-fg: #ffffff;
    --athena-focus: #8a3208;
    --athena-danger: #b3261e;
    --athena-success: #17673a;
    --athena-warning: #8a5300;
    --athena-info: #a63e0c;
    --athena-info-fg: #fff; --athena-success-fg: #fff; --athena-warning-fg: #fff; --athena-danger-fg: #fff;
    --athena-shadow: 0 1px 2px rgb(60 30 10 / 6%), 0 6px 18px rgb(60 30 10 / 8%);
    --athena-radius: 10px;
    --athena-radius-control: 8px;
    --site-header-bg: #3a1f12;
    --site-header-fg: #fdf1e6;
    --site-header-accent: #f0925a;
    --site-code-bg: #2a1a11;
    --site-code-fg: #fbeee2;
}

:root[data-theme="samverk-site"][data-mode="dark"] {
    color-scheme: dark;
    --athena-bg: #251c17;
    --athena-fg: #f1e6dc;
    --athena-muted: #c4b3a4;
    --athena-border: #43332a;
    --athena-line: #43332a;
    --athena-field-border: #8a7262;
    --athena-surface: #2e231d;
    --athena-surface-alt: #1a1411;
    --athena-hover: #3b2a20;
    --athena-overlay: rgb(0 0 0 / 65%);
    --athena-accent: #f0925a;
    --athena-accent-fg: #261107;
    --athena-focus: #ffb88c;
    --athena-danger: #ff8a80;
    --athena-success: #5fd39a;
    --athena-warning: #f0c060;
    --athena-info: #f0925a;
    --athena-info-fg: #261107; --athena-success-fg: #261107; --athena-warning-fg: #261107; --athena-danger-fg: #261107;
    --athena-shadow: none;
    --site-header-bg: #120d0a;
    --site-code-bg: #110c09;
}

/* The same dark colours without JavaScript (no data-mode on <html>) on a dark system */
@media (prefers-color-scheme: dark) {
    :root[data-theme="samverk-site"]:not([data-mode]) {
        color-scheme: dark;
        --athena-bg: #251c17;
        --athena-fg: #f1e6dc;
        --athena-muted: #c4b3a4;
        --athena-border: #43332a;
        --athena-line: #43332a;
        --athena-field-border: #8a7262;
        --athena-surface: #2e231d;
        --athena-surface-alt: #1a1411;
        --athena-hover: #3b2a20;
        --athena-overlay: rgb(0 0 0 / 65%);
        --athena-accent: #f0925a;
        --athena-accent-fg: #261107;
        --athena-focus: #ffb88c;
        --athena-danger: #ff8a80;
        --athena-success: #5fd39a;
        --athena-warning: #f0c060;
        --athena-info: #f0925a;
        --athena-info-fg: #261107; --athena-success-fg: #261107; --athena-warning-fg: #261107; --athena-danger-fg: #261107;
        --athena-shadow: none;
        --site-header-bg: #120d0a;
        --site-code-bg: #110c09;
    }
}

/* ---------------------------------------------------------------- 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);
    border-bottom: 3px solid var(--site-header-accent);    /* the ember line under the header */
}

.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; }
}

.clients-table { margin-top: 1.5rem; }
.clients-table .athena-table th[scope="row"] { white-space: nowrap; }

/* How an agent works with the board: numbered steps next to what the agent reads */
.agent-flow {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
    align-items: start;
}
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 0.75rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3rem; }
.steps li::before {
    content: counter(step);
    position: absolute; left: 0; top: 0.1rem;
    width: 2rem; height: 2rem; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--athena-accent); color: var(--athena-accent-fg); font-weight: 700;
}
.steps h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--athena-muted); }
.agent-output pre { margin-top: 0.5rem; white-space: pre; overflow-x: auto; overflow-wrap: normal; font-size: 0.85rem; }
.agent-output pre:focus-visible { outline: var(--athena-focus-width, 2px) solid var(--athena-focus); outline-offset: 2px; }
.agent-output p { margin: 0.5rem 0 0; color: var(--athena-muted); font-size: 0.95rem; }

/* 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;
}

.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; }
}

/* Coming soon: the mark in the hero and the note under the lead */
.soon-badge {
    display: inline-block;
    margin-right: 0.5rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--athena-accent);
    color: var(--athena-accent-fg);
    letter-spacing: 0.04em;
}
.soon-note {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--athena-accent);
    background: var(--athena-surface);
    border-radius: 0 8px 8px 0;
    font-weight: 600;
}
