/* =============================================================================
   tokens.css  —  Single source of truth for the dark-luxury design system.
   Loaded on every public (pre-login) page. Defines:
     1. Design tokens (colors, type, shadows, motion)
     2. Reset & body defaults
     3. Atmospheric background (the navy-gold canvas)
     4. Layout containers (.wrap, .container)
     5. Reveal helper (scroll-in animations)
   ========================================================================== */

/* =============================================================================
   Pinar — display/headline font for public pre-login pages
   Files are served from: staticfiles/fonts/Pinar-V4/ttf/
   ========================================================================== */
@font-face {
    font-family: 'Pinar';
    src: url('../fonts/Pinar-V4/ttf/Pinar-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Pinar';
    src: url('../fonts/Pinar-V4/ttf/Pinar-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Pinar';
    src: url('../fonts/Pinar-V4/ttf/Pinar-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Pinar';
    src: url('../fonts/Pinar-V4/ttf/Pinar-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Pinar';
    src: url('../fonts/Pinar-V4/ttf/Pinar-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Pinar';
    src: url('../fonts/Pinar-V4/ttf/Pinar-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Pinar';
    src: url('../fonts/Pinar-V4/ttf/Pinar-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* =============================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
    /* — gold accent (primary brand) — */
    --gold-300:    #fcd34d;
    --gold-400:    #ffd34a;
    --gold-500:    #ffc218;
    --gold-600:    #f0b400;
    --gold-700:    #c89500;

    /* — navy palette (surface) — */
    --navy-100:    #e0e4f5;
    --navy-200:    #c1c9ea;
    --navy-300:    #8a96d1;
    --navy-400:    #5b67a6;
    --navy-500:    #4154ad;
    --navy-600:    #364782;
    --navy-700:    #2f3968;
    --navy-800:    #26315c;
    --navy-900:    #1c2447;
    --navy-950:    #131932;
    --navy-deep:   #0c1124;

    /* — text on dark — */
    --ink-white:   #f7f9ff;
    --ink-soft:    rgba(247, 249, 255, .82);
    --ink-muted:   rgba(202, 212, 247, .68);
    --ink-faint:   rgba(202, 212, 247, .42);

    /* — lines & borders — */
    --line:         rgba(255, 255, 255, .08);
    --line-strong:  rgba(255, 255, 255, .14);
    --gold-line:    rgba(255, 194, 24, .32);

    /* — surfaces (translucent fills) — */
    --surface-1:    rgba(255, 255, 255, .03);
    --surface-2:    rgba(255, 255, 255, .05);
    --surface-3:    rgba(255, 255, 255, .08);
    --surface-gold: rgba(255, 194, 24, .06);

    /* — shadows — */
    --shadow-sm:   0 4px 14px rgba(0, 0, 0, .25), 0 1px 3px rgba(0, 0, 0, .15);
    --shadow:      0 14px 36px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .18);
    --shadow-lg:   0 30px 70px rgba(0, 0, 0, .45), 0 10px 26px rgba(0, 0, 0, .22);
    --shadow-gold: 0 14px 32px rgba(255, 194, 24, 0), 0 3px 10px rgba(255, 194, 24, .50);

    /* — motion — */
    --t-fast: 200ms cubic-bezier(.4, 0, .2, 1);
    --t:      320ms cubic-bezier(.4, 0, .2, 1);
    --t-slow: 600ms cubic-bezier(.22, .61, .36, 1);

    /* — radii — */
    --r-sm:   8px;
    --r:      12px;
    --r-md:   16px;
    --r-lg:   20px;
    --r-xl:   24px;
    --r-pill: 999px;

    /* — typography — */
    --ff:         'Estedad', system-ui, -apple-system, sans-serif;
    --ff-display: 'Estedad', system-ui, -apple-system, sans-serif;
    --ff-pinar:   'Pinar', 'Estedad', system-ui, -apple-system, sans-serif;

    /* — layout — */
    --wrap-max: 1280px;
    --wrap-pad: 28px;
}

/* =============================================================================
   1.b LIGHT THEME OVERRIDES
   ----
   Triggered by  <html data-theme="light">. Only semantic tokens flip; the
   gold/navy primitives stay constant — gold is gold, navy stays navy where
   it's used as a contrast color (button text, drawer, etc.).
   ========================================================================== */
[data-theme="light"] {
    /* — text on light — */
    --ink-white:  #1c2447;
    --ink-soft:   rgba(28, 36, 71, .82);
    --ink-muted:  rgba(28, 36, 71, .60);
    --ink-faint:  rgba(28, 36, 71, .42);

    /* — lines & borders (dark on light) — */
    --line:         rgba(28, 36, 71, .10);
    --line-strong:  rgba(28, 36, 71, .16);
    --gold-line:    rgba(255, 194, 24, .42);

    /* — surfaces (light fills) — */
    --surface-1:    rgba(28, 36, 71, .035);
    --surface-2:    #ffffff;
    --surface-3:    rgba(28, 36, 71, .07);
    --surface-gold: rgba(255, 194, 24, .10);

    /* — shadows (lighter, more subtle on light) — */
    --shadow-sm:   0 4px 14px rgba(28, 36, 71, .07), 0 1px 3px rgba(28, 36, 71, .04);
    --shadow:      0 14px 36px rgba(28, 36, 71, .10), 0 4px 12px rgba(28, 36, 71, .05);
    --shadow-lg:   0 30px 70px rgba(28, 36, 71, .15), 0 10px 26px rgba(28, 36, 71, .07);
    /* gold shadow stays similar for buttons */

    /* — page background (re-purposes existing --navy-* names so we don't
       have to touch every file) — */
    --navy-deep:   #f7f9fc;
    --navy-950:    #eef0fa;
}

/* Smooth transitions when switching theme */
html { transition: background-color var(--t) ease; }
body,
.site-header,
.site-footer,
.atmosphere,
.page-card,
.aside-card {
    transition: background var(--t) ease,
                color var(--t) ease,
                border-color var(--t) ease;
}

/* =============================================================================
   2. RESET & BODY
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--ff);
    color: var(--ink-soft);
    background: var(--navy-deep);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

::selection {
    background: rgba(255, 194, 24, .32);
    color: var(--ink-white);
}

/* Headings on dark — gentle defaults; pages override sizes */
h1, h2, h3, h4, h5, h6 {
    color: var(--ink-white);
    font-family: var(--ff-display);
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 .6em;
    letter-spacing: -.01em;
}

p { margin: 0 0 1em; }

/* =============================================================================
   PUBLIC PRE-LOGIN DISPLAY TYPOGRAPHY
   ----
   Pinar is applied only when templates add .tk-public on <body>.
   Body text remains Estedad; titles, headings and short slogans use Pinar.
   ========================================================================== */
body.tk-public {
    --ff-display: var(--ff-pinar);
}

body.tk-public h1,
body.tk-public h2,
body.tk-public h3,
body.tk-public .page-title,
body.tk-public .section-title,
body.tk-public .section__title,
body.tk-public .sec-title,
body.tk-public .hero__title,
body.tk-public .slide-title,
body.tk-public .tk-title,
body.tk-public .tkx-sec-title,
body.tk-public .tkx-domain-title,
body.tk-public .xr-page-title,
body.tk-public .ft-runner__title,
body.tk-public .ft-result-hero__title,
body.tk-public .auth-heading {
    font-family: var(--ff-display);
}

body.tk-public .page-subtitle,
body.tk-public .hero__subtitle,
body.tk-public .section__subtitle,
body.tk-public .slide-lead,
body.tk-public .xr-page-subtitle,
body.tk-public .ft-runner__subtitle,
body.tk-public .auth-subtitle,
body.tk-public .lead,
body.tk-public .slogan {
    font-family: var(--ff-display);
    font-weight: 500;
}

.font-pinar,
.tk-display-font {
    font-family: var(--ff-pinar) !important;
}


/* =============================================================================
   3. ATMOSPHERIC BACKGROUND
   ----
   A fixed canvas that gives the entire site its navy-gold feel.
   Place <div class="atmosphere" aria-hidden="true"></div> right after <body>.
   ========================================================================== */
.atmosphere {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(900px 600px at 88% 12%, rgba(255, 194, 24, .14), transparent 65%),
        radial-gradient(700px 500px at  8% 88%, rgba(65, 84, 173, .26), transparent 60%),
        radial-gradient(500px 400px at 50% 50%, rgba(255, 211, 74, .04), transparent 70%),
        linear-gradient(180deg, var(--navy-deep) 0%, var(--navy-950) 50%, var(--navy-deep) 100%);
}
.atmosphere::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .015) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 1200px 800px at 50% 30%, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 1200px 800px at 50% 30%, black 30%, transparent 70%);
    opacity: .55;
}

/* Light-mode atmosphere — softer pastels, dark grid lines */
[data-theme="light"] .atmosphere {
    background:
        radial-gradient(900px 600px at 88% 12%, rgba(255, 194, 24, .10), transparent 65%),
        radial-gradient(700px 500px at  8% 88%, rgba(65, 84, 173, .10), transparent 60%),
        linear-gradient(180deg, #f7f9fc 0%, #eef0fa 50%, #f7f9fc 100%);
}
[data-theme="light"] .atmosphere::before {
    background-image:
        linear-gradient(rgba(28, 36, 71, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 36, 71, .025) 1px, transparent 1px);
    opacity: .8;
}

/* =============================================================================
   4. LAYOUT CONTAINERS
   ----
   Use .wrap for fluid max-width sections. .container is a bootstrap-compatible
   alias kept so existing markup keeps working — both behave identically.
   ========================================================================== */
.wrap,
.container {
    max-width: var(--wrap-max);
    margin: 0 auto;
    padding: 0 var(--wrap-pad);
    position: relative;
    width: 100%;
}

@media (max-width: 640px) {
    .wrap,
    .container { padding: 0 18px; }
}

/* =============================================================================
   5. DECORATIVE ARCS  (flowing gold curves used by hero sections)
   Gradients are defined as inline <svg><defs/></svg> in the template.
   ========================================================================== */
.arc { position: absolute; pointer-events: none; z-index: 0; overflow: visible; }
.arc path {
    fill: none; stroke: url(#arcGold); stroke-width: 1.4;
    stroke-linecap: round; opacity: .8;
}
.arc--mirror path { stroke: url(#arcGoldMirror); }

/* =============================================================================
   6. UTILITY: SCROLL REVEAL
   Add data-reveal="" or class="reveal" to elements; toggle .is-in to play.
   ========================================================================== */
.reveal,
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s var(--t-slow), transform .8s var(--t-slow);
}
.reveal.is-in,
[data-reveal].is-in {
    opacity: 1;
    transform: translateY(0);
}

/* No-JS fallback */
.no-js .reveal,
.no-js [data-reveal] {
    opacity: 1;
    transform: none;
}

/* =============================================================================
   7. UTILITY: MUTED TEXT & DIVIDER
   ========================================================================== */
.muted {
    color: var(--ink-muted);
    font-size: .92rem;
}

.divider {
    height: 1px;
    /* background: linear-gradient(90deg, transparent, var(--line-strong), transparent); */
    margin: 28px 0;
    border: none;
}

/* =============================================================================
   8. PRINT
   ========================================================================== */
@media print {
    .atmosphere { display: none; }
    body { background: #fff; color: #000; }
}
