/* ═══════════════════════════════════════════════════════════════
   MARMO — the public pages' base (owner's choice of 2026-11-28: proposal «B · Marmo»).
   Tokens, reset, type, buttons, nav, footers, forms and the few shared behaviours. Each page adds its own css/marmo-*.css.
   Pompeian red on marble (light) and warm black (dark, the default without data-theme="light").
   Newsreader for titles, Instrument Sans for text; both self-hosted (css/fonts.css).
   The console and the demos do not load this file.
   Phone layout from 760px down; the nav folds into the burger from 1040px down.
   ═══════════════════════════════════════════════════════════════ */

:root {
    color-scheme: dark;
    --bg: #12100e; --surface: #1b1816; --surface2: #24201c; --paper: #211d1a; --ink: #f1ebe0; --text: #d3cabd; --muted: #ab9f92;
    --line: rgba(241,235,224,.13); --line2: rgba(241,235,224,.38); --rule: rgba(241,235,224,.55);
    --red: #b01e26; --on-red: #fffaf4; --red-text: #f07a7f; --red-deep: #f07a7f;
    --bronze: #d0a768; --ok: #8fcf9b; --warn: #e9a862; --warn-bg: #2f2312; --inv-bg: #f1ebe0; --inv-fg: #171311;
    --tint-red: #2d1719; --mark: #431c20; --skel: #3b342e; --track: #342e29; --grid: #2c2723; --nav: #171412;
    --shadow: 0 34px 80px rgba(0,0,0,.6); --shadow-s: 0 24px 60px rgba(0,0,0,.5);
    --c-auto: #9bb6ee; --c-data: #e4b660; --c-know: #d7c7a8; --c-models: #93c197;
    --t-auto: #1b2340; --t-data: #30250f; --t-know: #2b261c; --t-models: #192b1e;
    --serif: 'Newsreader', 'Newsreader Stand-in', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    --sans: 'Instrument Sans', 'Instrument Stand-in', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pad: 72px;
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f2efe8; --surface: #fbf9f5; --surface2: #ebe4d8; --paper: #fffdf8; --ink: #1c1715; --text: #453e39; --muted: #5e5650;
    --line: rgba(28,23,21,.14); --line2: rgba(28,23,21,.38); --rule: #1c1715;
    --red-text: #b01e26; --red-deep: #8f1920;
    --bronze: #8a6329; --ok: #2f6b3f; --warn: #8a4b0a; --warn-bg: #fbf1dc; --inv-bg: #1c1715; --inv-fg: #f2efe8;
    --tint-red: #f4e4de; --mark: #f7dcd6; --skel: #ddd5c8; --track: #e8e1d6; --grid: #e4ddd2; --nav: #fbf9f5;
    --shadow: 0 34px 80px rgba(74,13,18,.28); --shadow-s: 0 24px 60px rgba(74,13,18,.14);
    --c-auto: #2f56a3; --c-data: #8a5a07; --c-know: #6f5f3f; --c-models: #2f6b3f;
    --t-auto: #e6ebf5; --t-data: #f6ecd8; --t-know: #ebe4d6; --t-models: #e3eee4;
}

/* Service families (services, service pages, home): text colour, tint, deep plate */
.fam-auto   { --fc: var(--c-auto);   --ft: var(--t-auto);   --fd: #223f78; }
.fam-data   { --fc: var(--c-data);   --ft: var(--t-data);   --fd: #6d4705; }
.fam-know   { --fc: var(--c-know);   --ft: var(--t-know);   --fd: #56492f; }
.fam-models { --fc: var(--c-models); --ft: var(--t-models); --fd: #24532f; }

/* ── Reset (low specificity on purpose: page rules win without !important) ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: calc(100vh / var(--mv-zoom, 1)); display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; overflow-x: hidden; overflow-x: clip; }
:where(h1, h2, h3, h4, p, ol, ul, figure, address, blockquote) { margin: 0; padding: 0; }
:where(ul, ol) { list-style: none; }
:where(h1, h2, h3, h4) { font-family: var(--serif); font-weight: 400; }
:where(a) { color: var(--ink); text-decoration: none; }
:where(a:hover) { color: var(--red-text); }
:where(img, svg, video, canvas) { max-width: 100%; }
:where(button, input, textarea, select) { font-family: inherit; font-size: inherit; color: inherit; }
:where(address) { font-style: normal; }
::selection { background: var(--red); color: var(--on-red); }
:focus-visible { outline: 2px solid var(--red-text); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 2000; background: var(--red); color: var(--on-red); padding: 12px 18px; font-weight: 600; }
.skip-link:focus { left: 0; color: var(--on-red); }
#content { scroll-margin-top: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Type ── */
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
em.r, .display em { color: var(--red-text); }
.display { font-family: var(--serif); font-weight: 300; font-size: clamp(42px, 4.2vw, 60px); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }
.h2 { font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1.06; letter-spacing: -.012em; text-wrap: balance; }
.lead { font-size: 19px; line-height: 1.6; color: var(--text); text-wrap: pretty; }
.kick { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--bronze); }
.wrap { padding-left: var(--pad); padding-right: var(--pad); }

/* ── Buttons (.btn-primary / .btn-secondary are the older names, same look) ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 28px; border-radius: 3px; border: 1px solid transparent; font-family: var(--sans); font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; background: transparent; color: var(--ink); text-align: center; }
.btn-red, .btn-primary { background: var(--red); color: var(--on-red); }
a.btn-red:hover, a.btn-primary:hover, .btn-red:hover, .btn-primary:hover { color: var(--on-red); filter: brightness(1.12); }
.btn-ink { background: var(--inv-bg); color: var(--inv-fg); }
a.btn-ink:hover, .btn-ink:hover { color: var(--inv-fg); filter: brightness(1.12); }
.btn-line, .btn-secondary, .btn-ghost { border-color: var(--line2); color: var(--ink); }
.btn-sm { min-height: 44px; padding: 0 20px; }
.btn-lg { min-height: 54px; padding: 0 32px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: default; }

/* ── Nav ── */
.nav { height: 72px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 var(--pad); position: sticky; top: 0; z-index: 40; background: var(--bg); }
/* always at hand (owner, 2026-11-29); its hairline shows once the page has moved (js/nav.js) */
.nav.is-scrolled { box-shadow: 0 1px 0 var(--line); }
/* what a link or the keyboard jumps to stops below the bar */
html { scroll-padding-top: 80px; }
@media (max-width: 760px) { html { scroll-padding-top: 72px; } }
.nav-start { display: flex; align-items: center; gap: 14px; justify-self: start; min-width: 0; }
.logo { font-family: var(--serif); font-weight: 400; font-size: 29px; line-height: 1.1; color: var(--ink); white-space: nowrap; padding: 6px 0; }
.logo span { font-style: italic; color: var(--red-text); }
a.logo:hover { color: var(--ink); }
.mv-back { position: relative; width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.mv-back::after { content: ''; position: absolute; inset: -7px; }
/* One line for everything in the bar (owner, 2026-11-28): the letters of the wordmark, the arrow, the switches and the menu share
   the same middle. The wordmark is moved down because its line box keeps room for descenders that «ModelVault» does not have
   (measured on the rendered pixels at each size of the bar). */
.nav .logo { position: relative; top: 3.7px; }
@media (min-width: 1041px) { .nav-links { position: relative; top: 1.5px; } }
.mv-back:hover { border-color: var(--line2); color: var(--red-text); }
.mv-back--ghost { display: none; }
.nav-links { display: flex; gap: 40px; font-size: 15px; font-weight: 500; }
.nav-links > a { padding: 12px 0; border-bottom: 1px solid transparent; }
.nav-links > a.active { border-bottom-color: var(--red-text); color: var(--red-text); }
.nav-acct { display: none; }
.nav-right { display: flex; gap: 12px; align-items: center; justify-self: end; font-size: 15px; font-weight: 600; }
.nav-right > .nav-cta { display: inline-flex; align-items: center; gap: 18px; margin-left: 6px; }
.nav-login { padding: 12px 4px; }
/* signed in: one button, as wide as the two it replaces */
.nav-right > .nav-cta .nav-dash { min-width: 190px; justify-content: center; text-align: center; }
.nav-burger { display: none; width: 44px; height: 44px; border: 0; background: transparent; padding: 0; cursor: pointer; position: relative; color: var(--ink); }
.nav-burger span { position: absolute; left: 12px; width: 20px; height: 1.7px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.nav-burger span:nth-child(1) { top: 15px; }
.nav-burger span:nth-child(2) { top: 21px; }
.nav-burger span:nth-child(3) { top: 27px; }
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Language and theme switches ── */
.theme-tgl, .nav-lang-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; padding: 0; }
.theme-tgl:hover, .nav-lang-btn:hover, .nav-lang-btn[aria-expanded="true"] { border-color: var(--line2); }
.theme-tgl svg, .nav-lang-btn svg { width: 18px; height: 18px; }
.theme-tgl .i-sun { display: block; }
.theme-tgl .i-moon { display: none; }
:root[data-theme="light"] .theme-tgl .i-sun { display: none; }
:root[data-theme="light"] .theme-tgl .i-moon { display: block; }
.nav-lang-dd { position: relative; flex: none; }
.nav-lang-panel { position: absolute; right: 0; top: 52px; width: 232px; z-index: 80; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-s); padding: 6px; display: flex; flex-direction: column; text-align: left; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .14s ease, transform .14s ease, visibility 0s .14s; }
.nav-lang-panel.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .14s ease, transform .14s ease, visibility 0s; }
.nav-lang-head { font-size: 12px; font-weight: 400; color: var(--muted); padding: 8px 10px 6px; }
.nav-lang-item { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 5px; font-size: 14px; font-weight: 500; }
.nav-lang-item:hover { background: var(--surface2); color: var(--ink); }
.nav-lang-item.is-active { font-weight: 700; background: var(--tint-red); }
.nav-lang-check { order: -1; width: 14px; height: 14px; color: var(--red-text); visibility: hidden; }
.nav-lang-item.is-active .nav-lang-check { visibility: visible; }
.nav-lang-code { font-size: 12px; font-weight: 400; color: var(--muted); }

/* ── Footer ── */
/* Sections told apart (owner, 2026-11-28): the page alternates its beige with warm white, hairlines between them; the closing
   invitation warms towards the red of the footer. The colour reaches the window's edges also when the section is a centred
   column (border-image: no extra markup, no sideways scroll). */
.sec-alt { border-image: linear-gradient(180deg, var(--line) 0 1px, var(--surface) 1px calc(100% - 1px), var(--line) calc(100% - 1px)) fill 0 // 0 100vw; }
.sec-tint { border-image: linear-gradient(180deg, transparent 0, var(--tint-red) 100%) fill 0 // 0 100vw; }
.footer { --sky: #370a0f; --hi: #ebc88f; flex: none; margin-top: auto; padding: 32px var(--pad) 22px; background: var(--sky); color: #f6ead9; }
:root[data-theme="light"] .footer { --sky: #8f181f; }
.footer a { color: #f6ead9; }
.footer a:hover { color: var(--hi); }
.footer .logo, .footer .logo:hover { color: #f6ead9; font-size: 22px; }
.footer .logo span { color: var(--hi); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; font-size: 13px; }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.foot-col > a { padding: 4px 0; }
.foot-brand { gap: 8px; }
.foot-brand .logo { padding: 0; }
@media (max-width: 760px) { .foot-brand .logo { padding: 4px 0; margin: -4px 0; } }   /* a taller touch area, the same footer */
.foot-brand p { color: rgba(246,234,217,.82); line-height: 1.6; max-width: 360px; }
.foot-note { margin-top: 20px; padding-top: 12px; border-top: 1px solid rgba(246,234,217,.2); font-size: 12px; color: rgba(246,234,217,.82); line-height: 1.6; }
.foot-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 8px 0; }

.foot-mini { display: none; }

/* ── Forms and messages ── */
.field { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; height: 50px; border: 1px solid var(--line2); border-radius: 3px; background: var(--paper); padding: 0 14px; font-size: 16px; font-weight: 400; color: var(--ink); }
.field textarea { height: 150px; resize: vertical; padding: 12px 14px; }
.field ::placeholder { color: var(--muted); }
.alert { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 3px; padding: 14px 16px; font-size: 15px; background: var(--surface); transition: opacity .4s ease, transform .4s ease; }
.alert svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.alert-error { border-color: var(--red-text); background: var(--tint-red); }
.alert-success { border-color: var(--ok); }
.alert-hide { opacity: 0; transform: translateY(-6px); }

/* ── Shared behaviours: scroll reveal ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
#scroll-progress { display: none; }

@keyframes mvup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mvflow { to { stroke-dashoffset: -24; } }
@keyframes mvgrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.up { animation: mvup .5s ease both; }
.d1 { animation-delay: .1s; } .d2 { animation-delay: .3s; } .d3 { animation-delay: .5s; } .d4 { animation-delay: .7s; }
.flow { stroke-dasharray: 6 6; animation: mvflow 1.2s linear infinite; }
.grow { transform-origin: left center; animation: mvgrow .9s ease both; }

/* Pages cross-fade into each other where the browser supports it (phones and tablets); the bar stays put */
@media (prefers-reduced-motion: no-preference) and (not ((hover: hover) and (pointer: fine))) {
    @view-transition { navigation: auto; }
    #main-nav { view-transition-name: mv-bar; }
    ::view-transition-group(mv-bar) { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .up, .flow, .grow { animation: none !important; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .nav-lang-panel { transition: none; }
}

/* Paintings come in pairs: .day for the light theme, .night for the dark one */
:root[data-theme="light"] .night, :root:not([data-theme="light"]) .day { display: none !important; }

/* Visible only on one side of the phone breakpoint */
.m-only { display: none !important; }

/* ── Between desktop and phone ── */
@media (max-width: 1280px) {
    :root { --pad: 48px; }
}
@media (max-width: 1040px) {
    :root { --pad: 32px; }
    .nav { display: flex; gap: 8px; height: 72px; }
    .nav-start { margin-right: auto; }
    .nav-right > .nav-cta { display: none; }
    .nav-burger { display: inline-block; }
    .nav-links { display: none; }
    .nav-links.open { display: flex; flex-direction: column; gap: 0; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-s); padding: 6px var(--pad) 22px; z-index: 60; max-height: calc(100vh / var(--mv-zoom, 1) - 72px); overflow-y: auto; }
    .nav-links.open > a { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 23px; font-weight: 400; }
    .nav-links.open > a::after { content: '\2192'; font-family: var(--sans); font-size: 18px; }
    .nav-links.open .nav-acct { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
    .nav-links.open .nav-acct:has(> :only-child) { grid-template-columns: 1fr; }
}
/* ── Phone ── */
@media (max-width: 760px) {
    :root { --pad: 20px; }
    .d-only { display: none !important; }
    .m-only { display: revert !important; }
    .m-only.flex { display: flex !important; }
    .m-only.grid { display: grid !important; }
    .m-only.block { display: block !important; }
    .display { font-size: 42px; line-height: 1.1; }
    .h2 { font-size: 36px; line-height: 1.1; }
    .lead { font-size: 17px; }
    .nav { height: 64px; padding: 0 12px 0 var(--pad); }
    .nav .logo { font-size: 25px; top: 3.5px; }
    .nav-right { gap: 4px; }
    .nav .nav-lang-btn { border-color: transparent; }
    /* language, theme (moon or sun) and menu stay in the bar, without borders */
    .nav .theme-tgl { border-color: transparent; }
    .nav-links.open { max-height: calc(100vh / var(--mv-zoom, 1) - 64px); }
    /* no link lists on a phone: wordmark, one row with the legal pages, the provider's details */
    .footer { padding: 24px var(--pad) 18px; }
    .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 0; font-size: 13px; }
    .foot-grid > .foot-col:not(.foot-brand) { display: none; }
    .foot-mini { display: flex; flex-wrap: wrap; column-gap: 20px; margin-top: 8px; font-size: 13px; }
    .foot-mini > a { min-width: 32px; padding: 11px 0; text-decoration: underline; text-underline-offset: 3px; }
    .foot-note { margin-top: 8px; }
}

/* Narrow phones: wordmark, arrow and the three buttons still fit one line */
@media (max-width: 380px) {
    .nav { padding: 0 6px 0 16px; gap: 4px; }
    .nav-right { gap: 0; }
    .nav .logo { font-size: 22px; }
    .nav-start { gap: 8px; }
    .nav .logo { top: 2.5px; }
    .nav .theme-tgl, .nav .nav-lang-btn, .nav-burger { width: 40px; }
    .nav-burger span { left: 10px; }
}

@media print {
    .nav, .footer, .skip-link { display: none !important; }
    :root, :root[data-theme="light"] { --bg: #fff; --ink: #000; --text: #111; --muted: #333; --line: #ccc; }
}
