/* =====================================================================
   APOWENS shared theme
   Colors are RGB channel triplets so Tailwind opacity modifiers
   (e.g. bg-obsidian/95) keep working. theme.js maps them to Tailwind.

   Token names are historical: "obsidian" is the page background and
   "phosphor" is the accent, whatever color they are in a theme.
   ===================================================================== */

/* Day (default): warm paper terminal */
:root,
:root[data-theme="light"] {
    --c-obsidian:   236 232 219;  /* page background   #ECE8DB */
    --c-surface:    227 222 205;  /* panels            #E3DECD */
    --c-raised:     242 239 230;  /* card hover        #F2EFE6 */
    --c-borderline: 207 199 173;  /* rules & borders   #CFC7AD */
    --c-primary:     30  27  22;  /* ink               #1E1B16 */
    --c-secondary:  107  97  82;  /* muted ink         #6B6152 */
    --c-phosphor:   180  82  14;  /* accent: orange    #B4520E */
    --c-amber:      143 106  12;  /* caution: ochre    #8F6A0C */
    --c-ok:          47 125  62;  /* live / active     #2F7D3E */
    --c-danger:     192  57  43;  /* alert             #C0392B */
    --grid-alpha: 0.3;
    --net-link-boost: 2.2;        /* hero network lines need more ink on paper */
    color-scheme: light;
}

/* Night: the original obsidian + phosphor look */
:root[data-theme="dark"] {
    --c-obsidian:    10  10  12;
    --c-surface:     17  18  21;
    --c-raised:      19  21  25;
    --c-borderline:  34  36  40;
    --c-primary:    228 230 235;
    --c-secondary:  139 144 154;
    --c-phosphor:     0 255 102;
    --c-amber:      255 153   0;
    --c-ok:           0 255 102;
    --c-danger:     255  59  59;
    --grid-alpha: 0.25;
    --net-link-boost: 1;
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    background-color: rgb(var(--c-obsidian));
    color: rgb(var(--c-primary));
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Subtle background grid */
.bg-grid-pattern {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgb(var(--c-borderline) / var(--grid-alpha)) 1px, transparent 1px),
        linear-gradient(to bottom, rgb(var(--c-borderline) / var(--grid-alpha)) 1px, transparent 1px);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track {
    background: rgb(var(--c-obsidian));
    border-left: 1px solid rgb(var(--c-borderline));
}
::-webkit-scrollbar-thumb { background: rgb(var(--c-borderline)); }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--c-phosphor)); }

/* Theme toggle: show the moon in day mode, the sun at night */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Long-form document pages (privacy, terms, Zeo) */
.doc h2 { font-size: 1.25rem; font-weight: 700; color: rgb(var(--c-primary)); margin-top: 2.5rem; margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.doc h3 { font-size: 1rem; font-weight: 600; color: rgb(var(--c-primary)); margin-top: 1.5rem; margin-bottom: 0.5rem; }
.doc p, .doc li { color: rgb(var(--c-secondary)); line-height: 1.7; font-size: 0.95rem; }
.doc p + p { margin-top: 1rem; }
.doc ul { list-style: square; padding-left: 1.25rem; margin: 0.75rem 0 1rem; }
.doc li + li { margin-top: 0.4rem; }
.doc li::marker { color: rgb(var(--c-phosphor)); }
.doc a { color: rgb(var(--c-phosphor)); text-decoration: underline; text-underline-offset: 3px; }
.doc a:hover { color: rgb(var(--c-primary)); }
.doc strong { color: rgb(var(--c-primary)); font-weight: 600; }
.doc .callout { border: 1px solid rgb(var(--c-borderline)); border-left: 2px solid rgb(var(--c-phosphor)); background: rgb(var(--c-surface)); padding: 1rem 1.25rem; margin: 1rem 0; }
.doc .callout p { color: rgb(var(--c-primary)); }
