/*
  Carmeci Academy — house style
  Copyright © 2024-2025 Carmeci Academy. All Rights Reserved.

  A quiet, editorial dark theme: warm charcoal canvas, Garamond display
  type, small tracked capitals for labels and navigation, off-white
  buttons with a soft gold glow, hairline borders and a faint film grain.

  Linked at the END of every page's <head>, after the page's own <style>.
  The Tailwind Play CDN injects its utilities at runtime (after this file),
  so every rule that has to beat a utility class is written as `html .x`
  (one extra element in the selector) or uses !important where Tailwind
  sets the same property on the element itself.

  Colours for utility classes come from carmeci_theme.js.
  Opt out per element with class="ca-plain" (no restyling of buttons).
*/

:root {
    --ca-bg: #141414;
    --ca-bg-deep: #0f0f0f;
    --ca-surface: #1b1b1b;
    --ca-surface-2: #222221;
    --ca-line: rgba(255, 255, 255, 0.08);
    --ca-line-strong: rgba(255, 255, 255, 0.16);

    --ca-ink: #efefed;
    --ca-ink-soft: #d6d6d3;
    --ca-muted: #a6a6a6;
    --ca-faint: #737373;

    --ca-parchment: #d1c2ae;
    --ca-gold: #c8b384;
    --ca-gold-bright: #d8c69c;
    --ca-slate: #738795;
    --ca-slate-light: #a3b4c0;

    --ca-action: #f2f2ef;
    --ca-action-hover: #ffffff;
    --ca-action-ink: #141414;
    --ca-gold-glow: 0 0 28px rgba(199, 164, 92, 0.45), 0 0 76px rgba(217, 189, 127, 0.28), 0 8px 24px rgba(0, 0, 0, 0.08);

    --ca-serif: 'EB Garamond', Garamond, 'Times New Roman', serif;
    --ca-label: 'Jost', Futura, 'Century Gothic', 'Avenir Next', sans-serif;
    --ca-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --ca-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ca-radius: 7px;

    color-scheme: dark;
    accent-color: var(--ca-gold);
    scrollbar-color: #3a3a3a var(--ca-bg);
}

/* ── Canvas ─────────────────────────────────────────────────────────── */
html body {
    background-color: var(--ca-bg);
    color: var(--ca-ink);
    font-family: var(--ca-sans);
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html ::selection { background: rgba(209, 194, 174, 0.3); color: #fff; }

/* Film grain — the single detail that most separates "dark website" from
   "dark cinema". Fixed, non-interactive, and very faint. */
html body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}
html body.ca-no-grain::after { content: none; }
@media print { html body::after { content: none; } }

/* ── Type ───────────────────────────────────────────────────────────── */
html h1, html h2, html h3,
html .ca-serif {
    font-family: var(--ca-serif);
    font-weight: 500 !important;
    letter-spacing: -0.005em;
    font-feature-settings: "kern", "liga", "onum";
    color: var(--ca-ink);
}
html h1 { line-height: 1.06; letter-spacing: -0.012em; }
html h2 { line-height: 1.12; }
html h3 { line-height: 1.2; }

/* Garamond sits smaller on the line than Inter; nudge the big sizes up so
   headings keep their presence. */
html h1.text-5xl, html h1.text-4xl, html h2.text-4xl { letter-spacing: -0.018em; }
@media (min-width: 768px) {
    html h1.md\:text-6xl { font-size: 4.25rem; }
    html h1.md\:text-5xl, html h2.md\:text-5xl { font-size: 3.4rem; }
}

/* Highlighted words inside headings ("Scientific Concepts", "Tristan"):
   italic parchment, the way an editorial serif emphasises. */
html :is(h1, h2, h3) :is(.text-accent-purple, .text-secondary-blue, .text-premium-gold, .text-personal-teal) {
    font-style: italic;
    color: var(--ca-parchment);
}

/* Small tracked capitals for every eyebrow / label / badge. */
html .uppercase {
    font-family: var(--ca-label);
    font-weight: 500;
}
html .uppercase:is(.tracking-wide, .tracking-wider, .tracking-widest) { letter-spacing: 0.17em; }
html .uppercase.font-bold, html .uppercase.font-semibold, html .uppercase.font-extrabold { font-weight: 500; }

html p { text-wrap: pretty; }
html blockquote, html .italic { font-family: var(--ca-serif); }
html blockquote { font-size: 1.15em; line-height: 1.55; }

/* ── Header / navigation ───────────────────────────────────────────── */
html body > header,
html body > div > header.sticky {
    background-color: rgba(20, 20, 20, 0.8) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
    border-bottom: 1px solid var(--ca-line) !important;
    box-shadow: none !important;
}

/* Wordmark */
html body > header nav > a:first-child {
    font-family: var(--ca-serif) !important;
    font-weight: 500 !important;
    font-size: 1.2rem !important;
    letter-spacing: 0.2em !important;
    text-transform: uppercase;
    color: var(--ca-ink) !important;
    gap: 0.75rem !important;
}
html body > header nav > a:first-child span { color: inherit !important; font-style: normal; }

/* Logo mark: gold orbit, parchment moon, serif initials */
html .ca-orbit ellipse { stroke: var(--ca-gold); stroke-width: 1.6px; }
html .ca-orbit circle { fill: #efe6d6; }
html .ca-c, html .ca-a {
    font-family: var(--ca-serif) !important;
    font-weight: 500 !important;
    font-size: 54px !important;
    fill: #f1efe9 !important;
}

/* Links */
html body > header nav :is(.md\:flex, .lg\:flex) > a,
html body > header nav :is(.md\:flex, .lg\:flex) > div > a:not([class*="bg-"]) {
    font-family: var(--ca-label);
    font-size: 0.78rem;
    font-weight: 500 !important;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #c9c9c6;
    transition: color 0.22s var(--ca-ease);
}
html body > header nav :is(.md\:flex, .lg\:flex) > a:hover { color: #fff !important; }
/* Current page: white with a hairline gold underline */
html body > header nav :is(.md\:flex, .lg\:flex) > a:is(.text-secondary-blue, .text-white.font-bold, .font-bold) {
    color: #fff !important;
    text-decoration: underline;
    text-decoration-color: var(--ca-gold);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.6em;
}
html body > header nav :is(.md\:flex, .lg\:flex) > a.text-personal-teal { color: #a9bfb2 !important; }

/* Mobile menu */
html #mobile-menu { background: rgba(20, 20, 20, 0.97) !important; border-top: 1px solid var(--ca-line); }
html #mobile-menu > a, html #mobile-menu > div > a:not([class*="bg-"]) {
    font-family: var(--ca-label);
    font-size: 0.82rem;
    font-weight: 500 !important;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-top: 0.7rem; padding-bottom: 0.7rem;
}
html #mobile-menu > a.text-secondary-blue { color: #fff !important; box-shadow: inset 2px 0 0 var(--ca-gold); }
html #mobile-menu a:hover { background-color: rgba(255, 255, 255, 0.04) !important; }

/* ── Buttons ───────────────────────────────────────────────────────── */
/* Primary action: off-white, dark ink, tracked capitals, gold glow. */
html :is(a, button, label, input[type="submit"]).bg-secondary-blue:not(.ca-plain),
html :is(a, button).bg-accent-blue:not(.ca-plain),
html .ca-btn {
    background-color: var(--ca-action) !important;
    color: var(--ca-action-ink) !important;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--ca-radius) !important;
    font-family: var(--ca-label);
    font-weight: 500 !important;
    font-size: 0.8125rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    box-shadow: none !important;
    transition: background-color 0.22s var(--ca-ease), box-shadow 0.22s var(--ca-ease), color 0.22s var(--ca-ease) !important;
}
html :is(a, button, label, input[type="submit"]).bg-secondary-blue:not(.ca-plain):is(:hover, :focus-visible),
html :is(a, button).bg-accent-blue:not(.ca-plain):is(:hover, :focus-visible),
html .ca-btn:is(:hover, :focus-visible) {
    background-color: var(--ca-action-hover) !important;
    color: var(--ca-action-ink) !important;
    box-shadow: var(--ca-gold-glow) !important;
    transform: none !important;
}
html :is(a, button).bg-secondary-blue:not(.ca-plain):active { background-color: #dededb !important; box-shadow: none !important; }
html :is(a, button).bg-secondary-blue:not(.ca-plain) :is(svg, span:not([class*="bg-"])) { color: inherit; }
html :is(a, button).bg-secondary-blue:disabled { opacity: 0.45; box-shadow: none !important; }

/* Premium action: muted gold */
html :is(a, button).bg-premium-gold:not(.ca-plain),
html :is(a, button).bg-accent-gold:not(.ca-plain) {
    background-color: var(--ca-gold) !important;
    color: #16130d !important;
    border: 1px solid rgba(255, 240, 210, 0.35);
    border-radius: var(--ca-radius) !important;
    font-family: var(--ca-label);
    font-weight: 500 !important;
    font-size: 0.8125rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    box-shadow: none !important;
    transition: background-color 0.22s var(--ca-ease), box-shadow 0.22s var(--ca-ease) !important;
}
html :is(a, button).bg-premium-gold:not(.ca-plain):is(:hover, :focus-visible) {
    background-color: var(--ca-gold-bright) !important;
    box-shadow: var(--ca-gold-glow) !important;
    transform: none !important;
}

/* Premium pills / badges */
html :is(span, div, p).bg-premium-gold {
    font-family: var(--ca-label);
    font-weight: 500 !important;
    letter-spacing: 0.12em;
    color: #16130d !important;
}

/* Every other button keeps its shape but loses the bouncy scale-up. */
html :is(a, button).hover\:scale-105:hover { transform: none !important; }

/* ── Surfaces ──────────────────────────────────────────────────────── */
html .bg-card-dark, html .bg-primary-dark, html .bg-secondary-dark { border-color: var(--ca-line); }
html :is(.border-gray-800, .border-gray-700, .border-border-dark) { border-color: var(--ca-line-strong); }
html .shadow-2xl, html .shadow-xl { --tw-shadow-color: rgba(0, 0, 0, 0.55); }

/* ── Forms ─────────────────────────────────────────────────────────── */
html :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), textarea, select) {
    caret-color: var(--ca-gold);
}
html :is(input, textarea, select):focus-visible {
    outline: none;
    border-color: var(--ca-parchment) !important;
    box-shadow: 0 0 0 3px rgba(209, 194, 174, 0.14) !important;
}
html ::placeholder { color: #7a7a78; }

/* ── Focus ─────────────────────────────────────────────────────────── */
html :is(a, button, [tabindex]):focus-visible {
    outline: 2px solid var(--ca-parchment);
    outline-offset: 3px;
}

/* ── Footer ────────────────────────────────────────────────────────── */
html body > footer {
    background-color: var(--ca-bg-deep) !important;
    border-top: 1px solid var(--ca-line);
}
html body > footer p.font-semibold:first-child,
html body > footer .container > p:first-child {
    font-family: var(--ca-serif);
    font-weight: 500 !important;
    font-size: 1.2rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ca-ink);
}
html body > footer a:not(:has(svg)) {
    font-family: var(--ca-label);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
html body > footer a:hover { color: #fff !important; }

/* ── Modals ────────────────────────────────────────────────────────── */
html :is(.video-modal-content, .modal-content) {
    background-color: #181818;
    border-color: var(--ca-line-strong);
}

/* ── Scrollbars (WebKit) ───────────────────────────────────────────── */
html ::-webkit-scrollbar { width: 10px; height: 10px; }
html ::-webkit-scrollbar-track { background: var(--ca-bg); }
html ::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; border: 2px solid var(--ca-bg); }
html ::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }

@media (prefers-reduced-motion: reduce) {
    html :is(a, button) { transition: none !important; }
}

/* Larger sub-headings rendered as h4 ("Subjects in this Category",
   "Sections", lecture titles) read as display type too. */
html :is(h4, h5):is(.text-xl, .text-2xl, .text-3xl, .sm\:text-2xl) {
    font-family: var(--ca-serif);
    font-weight: 500 !important;
    letter-spacing: -0.005em;
}

/* Curator-tier actions are inline-styled sage buttons (pricing,
   curator-portal, curator-success); give them dark ink and the house
   button typography. */
html :is(a, button)[style*="background:#8ea597"],
html :is(a, button)[style*="background: #8ea597"],
html :is(a, button)[style*="background: rgb(142, 165, 151)"],
html :is(a, button)[style*="background: rgb(111, 135, 122)"] {
    color: #10140f !important;
    border-radius: var(--ca-radius) !important;
    font-family: var(--ca-label);
    font-weight: 500 !important;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-size: 0.85rem;
    box-shadow: none !important;
}
html :is(a, button)[style*="background: rgb(111, 135, 122)"] { box-shadow: 0 0 28px rgba(142, 165, 151, 0.35) !important; }
html :is(h1, h2, h3) span[style*="#8ea597"] { font-style: italic; }

/* Display figures (prices, big stats) set in the serif with lining numerals. */
html :is(span, p, div):is(.text-4xl, .text-5xl, .text-6xl, .text-7xl) {
    font-family: var(--ca-serif);
    font-weight: 500 !important;
    font-variant-numeric: lining-nums;
    letter-spacing: -0.01em;
}

@media (max-width: 400px) {
    html body > header nav > a:first-child { font-size: 1rem !important; letter-spacing: 0.15em !important; gap: 0.5rem !important; }
}

/* Secondary action (sign-up, apply): parchment fill, dark ink. Covers the
   old violet / teal button fills, which the palette turns pale. */
html :is(a, button):is(.bg-accent-purple, .bg-purple-500, .bg-violet-500, .bg-violet-600, .bg-teal-500, .bg-teal-600, .bg-personal-teal):not(.ca-plain) {
    background-color: var(--ca-parchment) !important;
    color: #16130d !important;
    border-radius: var(--ca-radius) !important;
    font-family: var(--ca-label);
    font-weight: 500 !important;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-size: 0.8125rem;
    box-shadow: none !important;
}
html :is(a, button):is(.bg-accent-purple, .bg-purple-500, .bg-violet-500, .bg-violet-600, .bg-teal-500, .bg-teal-600, .bg-personal-teal):not(.ca-plain):is(:hover, :focus-visible) {
    background-color: #e3d8c6 !important;
    box-shadow: var(--ca-gold-glow) !important;
}
html :is(a, button):is(.bg-teal-500, .bg-teal-600, .bg-personal-teal):not(.ca-plain) { background-color: #a9bfb2 !important; color: #10140f !important; }
