/* ===========================================
   findusdoc.ch · shared tokens and chrome
   Same language as the app (css/variables.css in FINDUS):
   high contrast, square, dense type. No radii, no gradients, no shadows.
   Mono for everything technical: numbers, addresses, times, file names.
   =========================================== */

@import url('../fonts/fonts.css');

/* ---------- LIGHT (default) ---------- */
:root {
    --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

    --bg:          #ffffff;
    --bg-2:        #f4f4f4;
    --bg-3:        #ececec;
    --bg-4:        #e0e0e0;
    --ink:         #000000;
    --ink-2:       #2b2b2b;
    --muted:       #6b6b6b;
    --rule:        #c0c0c0;
    --rule-strong: #9a9a9a;

    /* One hue, used sparingly. --accent-text is the shade that still reads as
       small text on the background (the light orange only passes when large). */
    --accent:      #ea580c;
    --accent-hover:#c2410c;
    --accent-text: #c2410c;
    --accent-soft: rgba(234, 88, 12, 0.08);
    --on-accent:   #000000;

    --warn:        #b07a00;
    --warn-soft:   rgba(176, 122, 0, 0.08);
    --ok:          #008f00;

    /* OSC syntax, as in the app's log */
    --osc-kw:     #7b2fbe;
    --osc-target: #0b6fbf;
    --osc-level:  #1a7f37;
    --osc-time:   #0f7a75;
    --osc-cue:    #9a6700;
    --osc-op:     #c33f2e;

    --text-2xs: 10px; --text-xs: 11px; --text-sm: 12px;
    --text-base: 13px; --text-md: 14px; --text-lg: 15px;

    --nav-h: 56px;
    --gutter: 32px;
    --col-max: 1240px;

    color-scheme: light;
}

/* ---------- DARK ---------- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #1a1a1a; --bg-2: #222222; --bg-3: #2a2a2a; --bg-4: #333333;
        --ink: #f5f5f5; --ink-2: #cfcfcf; --muted: #8a8a8a;
        --rule: #3a3a3a; --rule-strong: #555555;
        --accent: #fb923c; --accent-hover: #fdba74; --accent-text: #fb923c;
        --accent-soft: rgba(251, 146, 60, 0.10); --on-accent: #000000;
        --warn: #f0b400; --warn-soft: rgba(240, 180, 0, 0.08); --ok: #3fcf3f;
        --osc-kw: #c586c0; --osc-target: #9cdcfe; --osc-level: #b5cea8;
        --osc-time: #4ec9b0; --osc-cue: #dcdcaa; --osc-op: #ff9d68;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #1a1a1a; --bg-2: #222222; --bg-3: #2a2a2a; --bg-4: #333333;
    --ink: #f5f5f5; --ink-2: #cfcfcf; --muted: #8a8a8a;
    --rule: #3a3a3a; --rule-strong: #555555;
    --accent: #fb923c; --accent-hover: #fdba74; --accent-text: #fb923c;
    --accent-soft: rgba(251, 146, 60, 0.10); --on-accent: #000000;
    --warn: #f0b400; --warn-soft: rgba(240, 180, 0, 0.08); --ok: #3fcf3f;
    --osc-kw: #c586c0; --osc-target: #9cdcfe; --osc-level: #b5cea8;
    --osc-time: #4ec9b0; --osc-cue: #dcdcaa; --osc-op: #ff9d68;
    color-scheme: dark;
}

/* ---------- BLACK · for the house ---------- */
:root[data-theme="black"] {
    --bg: #000000; --bg-2: #0a0a0a; --bg-3: #121212; --bg-4: #1a1a1a;
    --ink: #ffffff; --ink-2: #d0d0d0; --muted: #808080;
    --rule: #2a2a2a; --rule-strong: #3d3d3d;
    --accent: #fb923c; --accent-hover: #fdba74; --accent-text: #fb923c;
    --accent-soft: rgba(251, 146, 60, 0.12); --on-accent: #000000;
    --warn: #f0b400; --warn-soft: rgba(240, 180, 0, 0.10); --ok: #3fcf3f;
    --osc-kw: #d7a3d2; --osc-target: #a8e0ff; --osc-level: #c3dcb6;
    --osc-time: #5fdcc3; --osc-cue: #e6e6b4; --osc-op: #ffab7d;
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; border-radius: 0; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--text-lg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: inherit; }
img, svg { display: block; max-width: 100%; }
code, kbd, .mono { font-family: var(--font-mono); }
code { font-size: 0.86em; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
    position: absolute; left: 8px; top: -48px; z-index: 300;
    background: var(--ink); color: var(--bg);
    font-family: var(--font-mono); font-size: var(--text-xs);
    text-transform: uppercase; letter-spacing: 0.14em;
    padding: 10px 14px; text-decoration: none;
}
.skip-link:focus { top: 8px; }

.wrap { max-width: var(--col-max); margin: 0 auto; padding: 0 var(--gutter); }

/* Small uppercase mono label: section numbers, meta lines, table heads */
.label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

/* ---------- Brand mark (the cat, square) ---------- */
.mark { width: 22px; height: 22px; flex: none; color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-h);
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
}
.nav-inner {
    max-width: var(--col-max); height: 100%;
    margin: 0 auto; padding: 0 var(--gutter);
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--ink);
    font-weight: 800; font-size: var(--text-lg); letter-spacing: 0.02em;
    white-space: nowrap;
}
.nav-brand .sep { color: var(--rule-strong); font-weight: 400; }
.nav-brand .sub {
    font-family: var(--font-mono); font-weight: 400;
    font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--muted);
}
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
    display: block;
    font-family: var(--font-mono); font-size: var(--text-xs);
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--ink-2); text-decoration: none;
    padding: 8px 10px;
    border: 1px solid transparent;
}
.nav-links a:hover { color: var(--ink); border-color: var(--rule); }
.nav-links a.nav-cta { color: var(--bg); background: var(--ink); border-color: var(--ink); margin-left: 8px; }
.nav-links a.nav-cta:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 14px;
    height: 44px; padding: 0 20px;
    font-family: var(--font-mono); font-size: var(--text-sm);
    text-transform: uppercase; letter-spacing: 0.14em;
    text-decoration: none; cursor: pointer;
    border: 1px solid var(--ink);
    background: var(--ink); color: var(--bg);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { background: var(--bg-2); color: var(--ink); border-color: var(--ink); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--rule); padding: 56px 0 32px; background: var(--bg); }
.footer-grid {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
    padding-bottom: 40px; border-bottom: 1px solid var(--rule);
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--text-lg); }
.footer-tag { margin-top: 12px; color: var(--ink-2); font-size: var(--text-md); max-width: 34ch; }
.footer h4 { margin-bottom: 12px; }
.footer ul { list-style: none; display: grid; gap: 6px; }
.footer ul a { font-size: var(--text-md); color: var(--ink-2); text-decoration: none; }
.footer ul a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    padding-top: 20px;
}

/* Theme switch: Auto · Light · Dark · Black, like the app's Appearance */
.theme-switch { display: inline-flex; border: 1px solid var(--rule-strong); }
.theme-switch button {
    font-family: var(--font-mono); font-size: var(--text-2xs);
    text-transform: uppercase; letter-spacing: 0.12em;
    background: transparent; color: var(--ink-2);
    border: 0; border-left: 1px solid var(--rule-strong);
    padding: 7px 10px; cursor: pointer;
}
.theme-switch button:first-child { border-left: 0; }
.theme-switch button:hover { background: var(--bg-2); color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    :root { --gutter: 16px; }
    .nav-links li:not(.keep) { display: none; }
    .nav-brand .sub, .nav-brand .sep { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > :first-child { grid-column: 1 / -1; }
}
