/* Xunami shared stylesheet.
   Loaded by every studio page BEFORE its own <style>, so page rules win on ties.
   Theme: "paper and ink" light theme by default. A page (or a player region) can opt into the
   dark studio look with data-theme="dark" on any ancestor. */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300..900&family=DM+Mono:wght@400;500&display=swap');

/* ---------- Tokens: light "paper and ink" (default) ---------- */
:root {
    color-scheme: light;

    /* surfaces */
    --bg-deep: #F7F8FA;              /* page canvas: cool paper, never beige */
    --paper-2: #EDF0F3;              /* recessed panels, table headers */
    --surface: #FFFFFF;              /* cards */
    --frame: #05070C;                /* letterboxed video frames, the one dark surface */
    --frame-text: #F5F6F8;

    /* ink */
    --text-main: #0B0F19;
    --text-2: #3F4756;
    --text-muted: #6B7280;

    /* lines and fields */
    --line: #E1E5EA;
    --line-strong: #C9D0D8;
    --field-bg: #FFFFFF;
    --field-border: #CDD4DC;

    /* kept for existing references (glass panels become paper cards) */
    --glass-bg: #FFFFFF;
    --glass-border: #E1E5EA;
    --accent-glow: rgba(40, 40, 40, 0.12);
    --accent-glow-2: rgba(40, 40, 40, 0.05);

    /* accent: one hue, used like a highlighter */
    --accent: #282828;               /* brand charcoal (2026-10-02, no blue): interactive text and primary buttons */
    --accent-hover: #111111;
    --accent-soft: #C4C4C4;          /* light gray: highlights, focus rings, marks on dark surfaces */
    --accent-tint: #EFEFEF;
    --accent-gradient: var(--accent); /* name kept for existing references; single tone */
    --on-accent: #FFFFFF;

    /* pop: the tertiary color, tech sky blue (2026-10-07; was electric lime). Used SPARINGLY and only as a fill
       (switches that are on, the current step, the "next step" bar, a dot on a dark band, the camera rig's beam);
       text on it is --on-pop. Never sky text on paper: it doesn't read. Same blue as the video graphics' accent. */
    --pop: #38BDF8;
    --pop-hover: #0EA5E9;
    --pop-tint: rgba(56, 189, 248, 0.22);
    --on-pop: #1C1C1C;

    --success: #15803d;
    --success-tint: #E7F4EC;
    --warning: #b45309;
    --warning-tint: #FFF6D9;
    --error: #b91c1c;
    --error-tint: #FBE9E9;
    --gold: #B8962E;                 /* Luxury upgrade only */
    --gold-tint: #FFFFFF;             /* Luxury boxes stay white with a gold rule; no cream fills */

    --font: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-frame: 4px;

    --shadow-sm: 0 1px 2px rgba(11, 15, 25, 0.05);
    --shadow-md: 0 1px 2px rgba(11, 15, 25, 0.05), 0 10px 28px rgba(11, 15, 25, 0.07);
    --shadow-lg: 0 2px 4px rgba(11, 15, 25, 0.06), 0 24px 60px rgba(11, 15, 25, 0.12);
    --scrim: rgba(11, 15, 25, 0.55);   /* behind modals */
}

/* ---------- Tokens: the dark room (Studio default; a page opts in with data-theme-default="dark") ----------
   Black, like an actual darkroom, lit by one red safelight (see the body wash below). Monochrome: white is the accent. */
[data-theme="dark"] {
    color-scheme: dark;
    --bg-deep: #050505;              /* the room */
    --paper-2: #111112;              /* recessed panels, empty slots */
    --surface: #0C0C0D;              /* cards */
    --frame: #000000;
    --frame-text: #F5F6F8;

    --text-main: #EEF0F2;            /* soft paper, not pure white */
    --text-2: #B4B9C0;
    --text-muted: #7D838B;

    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --field-bg: #0A0A0B;
    --field-border: rgba(255, 255, 255, 0.14);

    --glass-bg: #0C0C0D;
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-glow: transparent;      /* no glows in the dark room */
    --accent-glow-2: transparent;

    --accent: #F2F3F5;               /* monochrome in the dark room: white is the accent (blue returns with the lights on) */
    --accent-hover: #FFFFFF;
    --accent-soft: rgba(255, 255, 255, 0.55);
    --accent-tint: rgba(255, 255, 255, 0.08);
    --accent-gradient: var(--accent);
    --on-accent: #050505;
    --safelight: rgba(229, 72, 77, 0.28); /* the one red lamp in the room */

    --success: #4ADE80;  --success-tint: rgba(74, 222, 128, 0.12);
    --warning: #FBBF24;  --warning-tint: rgba(251, 191, 36, 0.12);
    --error: #f87171;    --error-tint: rgba(248, 113, 113, 0.12);
    --gold: #D4AF37;     --gold-tint: rgba(212, 175, 55, 0.12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.6), 0 12px 32px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.6), 0 30px 70px rgba(0, 0, 0, 0.7);
    --scrim: rgba(0, 0, 0, 0.86);
}

/* The safelight: a single red lamp above the room. The only wash the Studio has, and only with the lights off. */
[data-theme="dark"] body {
    background-image: radial-gradient(1200px 680px at 50% -160px, var(--safelight), rgba(229, 72, 77, 0.07) 48%, transparent 72%);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Ink-on-paper buttons invert in the dark room: paper pill, ink text. */
[data-theme="dark"] .btn-submit { background: var(--text-main); color: var(--bg-deep); }
[data-theme="dark"] .btn-submit:hover { background: #fff; }

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Hanken Grotesk', sans-serif; }
body { background-color: var(--bg-deep); color: var(--text-main); -webkit-font-smoothing: antialiased; }
html.theme-transition, html.theme-transition * { transition: background-color 420ms ease, border-color 420ms ease, color 420ms ease !important; }
a { color: var(--accent); }
::selection { background: var(--accent-tint); color: var(--text-main); }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* Studio Minimal type: Hanken Grotesk headlines with tight tracking; DM Mono for small technical labels */
h1, h2, h3 { letter-spacing: -0.025em; }
.mono-label { font-family: 'DM Mono', ui-monospace, monospace; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- Shared components ---------- */

/* "← Back" link pinned to the top-left of app pages */
.top-back-btn { position: absolute; top: 30px; left: 40px; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 1.1rem; transition: color 0.2s; z-index: 1000; }
.top-back-btn:hover { color: var(--text-main); }

/* Passcode gate used by the internal tools and the portal fallback */
#login-screen { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 60px 40px; text-align: center; max-width: 450px; width: 100%; box-shadow: var(--shadow-lg); transition: opacity 0.6s ease, transform 0.6s ease; }
#login-screen h2 { font-size: 2rem; font-weight: 700; letter-spacing: -1px; margin-bottom: 10px; }
#login-screen p { color: var(--text-muted); margin-bottom: 30px; font-weight: 300; }
.passcode-input { width: 100%; background: var(--field-bg); border: 1px solid var(--field-border); padding: 18px; border-radius: var(--radius-md); color: var(--text-main); font-size: 1.2rem; text-align: center; letter-spacing: 4px; outline: none; margin-bottom: 20px; text-transform: uppercase; transition: border-color 0.3s; }
.passcode-input::placeholder { color: var(--text-muted); font-weight: 300; }
.passcode-input:focus { border-color: var(--accent); }
.btn-submit { width: 100%; background: var(--text-main); color: var(--bg-deep); border: none; padding: 18px; font-size: 1.1rem; font-weight: 700; border-radius: var(--radius-md); cursor: pointer; transition: transform 0.2s, background 0.2s; }
.btn-submit:hover { transform: scale(1.02); background: var(--text-2); }
#error-msg { color: var(--error); font-size: 0.9rem; margin-top: 15px; opacity: 0; transition: opacity 0.3s; }
.dropzone h4 { font-size: 1.5rem; margin-bottom: 10px; font-weight: 600; }

/* Letterboxed frame: the one dark surface on a light page. Wrap any video/still in it. */
.frame { background: var(--frame); color: var(--frame-text); border-radius: var(--radius-frame); overflow: hidden; }
.slate { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- The Xunami mark (assets/brand) ----------
   .brand: the mark beside the letter-spaced wordmark. Each spot carries two images, the accent mark
   (ink with the green bar) for paper and the inverse mark for dark rooms; the theme shows one. */
.brand { display: inline-flex; align-items: center; gap: 0.62em; color: var(--text-main); text-decoration: none; font: 800 1.15rem var(--font); letter-spacing: 0.32em; line-height: 1; }
.brand img, .brand-mark { display: block; height: 1.5em; width: auto; flex: none; }
.brand .wordmark { margin-right: -0.32em; }   /* the tracking after the last letter */
.on-dark { display: none !important; }
[data-theme="dark"] .on-light { display: none !important; }
[data-theme="dark"] .on-dark { display: block !important; }
