/* ─── DESIGN TOKENS ─── */
:root {
    /* Colour palette */
    --primary: #ff245b;                    /* Rose accent */
    --primary-bright: #ff6b8a;             /* Rose bright */
    --primary-glow: rgba(255, 36, 91, 0.25);  /* Rose glow bg */
    --primary-glow-shadow: 0 0 40px rgba(255, 36, 91, 0.25);
    
    --canvas: #09090f;                     /* Main background */
    --surface: #0d0d18;                    /* Surface level 1 */
    --surface-2: #111120;                  /* Surface level 2 */
    
    --ink: #f0f0f8;                        /* Text primary */
    --ink-muted: rgba(240, 240, 248, 0.48);     /* Text secondary */
    --ink-faint: rgba(240, 240, 248, 0.2);      /* Text tertiary */
    
    --border-light: rgba(255, 255, 255, 0.07);  /* Default border */
    --border-strong: rgba(255, 255, 255, 0.14); /* Hover/strong border */
    --border-accent: rgba(255, 36, 91, 0.35); /* Rose accent border */
    
    /* Semantic colours */
    --success: #1D9E75;
    --warning: #EF9F27;
    --danger: #E24B4A;
    --info: #378ADD;
}

[data-theme="light"] {
    --canvas: #f7f7fb;
    --surface: #ffffff;
    --surface-2: #eef0f6;
    --ink: #0f1220;
    --ink-muted: rgba(15, 18, 32, 0.6);
    --ink-faint: rgba(15, 18, 32, 0.38);
    --border-light: rgba(15, 18, 32, 0.12);
    --border-strong: rgba(15, 18, 32, 0.22);
    --border-accent: rgba(255, 36, 91, 0.25);
}

/* ─── GLOBAL STYLES ─── */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--canvas);
    color: var(--ink);
    overflow-x: hidden;
    position: relative;
    z-index: 0;
}

/* Sticky footer layout - single source of truth */
html, body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    flex: 1 0 auto;
    position: relative;
    z-index: 5;
}
footer {
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 10;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.35;
}

[data-theme="light"] body::before {
    opacity: 0.2;
}

.page-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 55% at 70% 50%, rgba(255, 36, 91, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 45% 40% at 20% 80%, rgba(255, 36, 91, 0.06) 0%, transparent 60%),
        var(--canvas);
    animation: auroraDrift 14s ease-in-out infinite alternate;
}

[data-theme="light"] .page-gradient {
    background:
        radial-gradient(ellipse 60% 55% at 70% 50%, rgba(255, 36, 91, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 45% 40% at 20% 80%, rgba(0, 102, 255, 0.06) 0%, transparent 60%),
        var(--canvas);
}

.theme-toggle {
    color: rgba(240, 240, 248, 0.7);
    position: relative;
}

.theme-toggle:hover {
    color: var(--ink);
    border-color: var(--border-strong);
}

[data-theme="light"] .theme-toggle {
    color: rgba(15, 18, 32, 0.7);
    background: rgba(15, 18, 32, 0.03);
}

[data-theme="light"] .theme-toggle:hover {
    color: var(--ink);
    background: rgba(15, 18, 32, 0.06);
}

[data-theme="light"] .text-white {
    color: #0f1220 !important;
}

[data-theme="light"] .text-white\/80 {
    color: rgba(15, 18, 32, 0.8) !important;
}

[data-theme="light"] .text-white\/70 {
    color: rgba(15, 18, 32, 0.7) !important;
}

[data-theme="light"] .text-white\/60 {
    color: rgba(15, 18, 32, 0.6) !important;
}

[data-theme="light"] .text-white\/55 {
    color: rgba(15, 18, 32, 0.55) !important;
}

[data-theme="light"] .text-white\/50 {
    color: rgba(15, 18, 32, 0.5) !important;
}

[data-theme="light"] .text-white\/40 {
    color: rgba(15, 18, 32, 0.4) !important;
}

[data-theme="light"] .text-white\/30 {
    color: rgba(15, 18, 32, 0.32) !important;
}

[data-theme="light"] .text-gray-300 {
    color: rgba(15, 18, 32, 0.72) !important;
}

[data-theme="light"] .text-appleInk {
    color: #0f1220 !important;
}

[data-theme="light"] .text-appleMuted {
    color: rgba(15, 18, 32, 0.6) !important;
}

[data-theme="light"] .border-white\/10 {
    border-color: rgba(15, 18, 32, 0.12) !important;
}

[data-theme="light"] .border-white\/5 {
    border-color: rgba(15, 18, 32, 0.06) !important;
}

[data-theme="light"] .border-white\/15 {
    border-color: rgba(15, 18, 32, 0.15) !important;
}

[data-theme="light"] .border-white\/20 {
    border-color: rgba(15, 18, 32, 0.2) !important;
}

[data-theme="light"] .border-white\/8 {
    border-color: rgba(15, 18, 32, 0.08) !important;
}

[data-theme="light"] .border-white\/\[0\.04\] {
    border-color: rgba(15, 18, 32, 0.04) !important;
}

[data-theme="light"] .border-white\/\[0\.07\] {
    border-color: rgba(15, 18, 32, 0.07) !important;
}

[data-theme="light"] .bg-black\/40 {
    background-color: rgba(255, 255, 255, 0.75) !important;
}

[data-theme="light"] .bg-black\/50 {
    background-color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme="light"] .bg-black\/60 {
    background-color: rgba(255, 255, 255, 0.92) !important;
}

[data-theme="light"] .bg-black\/70 {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="light"] .bg-appleBg {
    background-color: var(--canvas) !important;
}

[data-theme="light"] .text-slate-100 {
    color: rgba(15, 18, 32, 0.92) !important;
}

[data-theme="light"] .text-slate-200 {
    color: rgba(15, 18, 32, 0.85) !important;
}

[data-theme="light"] .text-slate-300 {
    color: rgba(15, 18, 32, 0.72) !important;
}

[data-theme="light"] .text-slate-200\/90 {
    color: rgba(15, 18, 32, 0.82) !important;
}

[data-theme="light"] .text-slate-500 {
    color: rgba(15, 18, 32, 0.48) !important;
}

[data-theme="light"] .text-slate-400 {
    color: rgba(15, 18, 32, 0.6) !important;
}

[data-theme="light"] .text-\[\#f0f0f8\] {
    color: #0f1220 !important;
}

[data-theme="light"] .text-\[rgba\(240,240,248,0\.48\)\] {
    color: rgba(15, 18, 32, 0.6) !important;
}

[data-theme="light"] .bg-white\/5 {
    background-color: rgba(15, 18, 32, 0.04) !important;
}

[data-theme="light"] .bg-white\/10 {
    background-color: rgba(15, 18, 32, 0.08) !important;
}

[data-theme="light"] .bg-white\/30 {
    background-color: rgba(15, 18, 32, 0.12) !important;
}

[data-theme="light"] .bg-white\/\[0\.02\] {
    background-color: rgba(15, 18, 32, 0.02) !important;
}

[data-theme="light"] .bg-white\/\[0\.03\] {
    background-color: rgba(15, 18, 32, 0.03) !important;
}

[data-theme="light"] .bg-white\/\[0\.035\] {
    background-color: rgba(15, 18, 32, 0.035) !important;
}

[data-theme="light"] .bg-white\/\[0\.04\] {
    background-color: rgba(15, 18, 32, 0.04) !important;
}

[data-theme="light"] .bg-white\/\[0\.06\] {
    background-color: rgba(15, 18, 32, 0.06) !important;
}

[data-theme="light"] .bg-black\/20 {
    background-color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme="light"] .bg-black\/30 {
    background-color: rgba(255, 255, 255, 0.9) !important;
}

[data-theme="light"] .bg-slate-500 {
    background-color: rgba(15, 18, 32, 0.35) !important;
}

[data-theme="light"] .bg-gray-500\/20 {
    background-color: rgba(15, 18, 32, 0.08) !important;
}

[data-theme="light"] .ruled {
    background: rgba(15, 18, 32, 0.08) !important;
}

[data-theme="light"] .ruled > * {
    background: #ffffff !important;
}

[data-theme="light"] .card-h:hover {
    background: #f2f3f8 !important;
}

[data-theme="light"] .bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.06\)\,rgba\(255\,255\,255\,0\.03\)\)\] {
    background: linear-gradient(180deg, rgba(15, 18, 32, 0.04), rgba(15, 18, 32, 0.02)) !important;
}

[data-theme="light"] .bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.08\)\,rgba\(255\,255\,255\,0\.04\)\)\] {
    background: linear-gradient(180deg, rgba(15, 18, 32, 0.06), rgba(15, 18, 32, 0.03)) !important;
}

[data-theme="light"] .bg-\[radial-gradient\(circle_at_top_left\,rgba\(255\,36\,91\,0\.28\)\,transparent_40%\)\,linear-gradient\(135deg\,rgba\(255\,255\,255\,0\.08\)\,rgba\(255\,255\,255\,0\.02\)\)\] {
    background:
        radial-gradient(circle at top left, rgba(255, 36, 91, 0.16), transparent 45%),
        linear-gradient(135deg, rgba(15, 18, 32, 0.06), rgba(15, 18, 32, 0.02)) !important;
}

[data-theme="light"] .bg-\[radial-gradient\(circle_at_top_left\,rgba\(255\,36\,91\,0\.18\)\,transparent_30%\)\,radial-gradient\(circle_at_top_right\,rgba\(255\,255\,255\,0\.08\)\,transparent_24%\)\,linear-gradient\(180deg\,#07111f_0%\,#040814_100%\)\] {
    background:
        radial-gradient(circle at top left, rgba(255, 36, 91, 0.12), transparent 35%),
        radial-gradient(circle at top right, rgba(0, 102, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #f7f7fb 0%, #eef0f6 100%) !important;
}

[data-theme="light"] [class*="bg-[radial-gradient(circle_at_top_left,rgba(255,36,91,0.18),transparent_30%),radial-gradient(circle_at_top_right,rgba(255,255,255,0.08),transparent_24%),linear-gradient(180deg,#07111f_0%,#040814_100%)]"] {
    background:
        radial-gradient(circle at top left, rgba(255, 36, 91, 0.12), transparent 35%),
        radial-gradient(circle at top right, rgba(0, 102, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #f7f7fb 0%, #eef0f6 100%) !important;
}

[data-theme="light"] .bg-\[linear-gradient\(135deg\,rgba\(255\,36\,91\,0\.18\)\,rgba\(8\,12\,24\,0\.9\)\)\] {
    background: linear-gradient(135deg, rgba(255, 36, 91, 0.12), rgba(246, 247, 251, 0.95)) !important;
}

[data-theme="light"] [class*="bg-[linear-gradient(135deg,rgba(255,36,91,0.18),rgba(8,12,24,0.9))]"] {
    background: linear-gradient(135deg, rgba(255, 36, 91, 0.12), rgba(246, 247, 251, 0.95)) !important;
}

[data-theme="light"] .bg-\[linear-gradient\(135deg\,rgba\(255\,36\,91\,0\.16\)\,rgba\(8\,12\,24\,0\.92\)\)\] {
    background: linear-gradient(135deg, rgba(255, 36, 91, 0.1), rgba(246, 247, 251, 0.95)) !important;
}

[data-theme="light"] [class*="bg-[linear-gradient(135deg,rgba(255,36,91,0.16),rgba(8,12,24,0.92))]"] {
    background: linear-gradient(135deg, rgba(255, 36, 91, 0.1), rgba(246, 247, 251, 0.95)) !important;
}

[data-theme="light"] [class*="bg-[linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04))]"] {
    background: linear-gradient(180deg, rgba(15, 18, 32, 0.06), rgba(15, 18, 32, 0.03)) !important;
}

[data-theme="light"] [class*="bg-[linear-gradient(180deg,rgba(255,255,255,0.06),rgba(255,255,255,0.03))]"] {
    background: linear-gradient(180deg, rgba(15, 18, 32, 0.04), rgba(15, 18, 32, 0.02)) !important;
}

[data-theme="light"] [class*="bg-[radial-gradient(circle_at_top_left,rgba(255,36,91,0.28),transparent_40%),linear-gradient(135deg,rgba(255,255,255,0.08),rgba(255,255,255,0.02))]"] {
    background:
        radial-gradient(circle at top left, rgba(255, 36, 91, 0.16), transparent 45%),
        linear-gradient(135deg, rgba(15, 18, 32, 0.06), rgba(15, 18, 32, 0.02)) !important;
}

[data-theme="light"] input.bg-black\/20,
[data-theme="light"] textarea.bg-black\/20,
[data-theme="light"] select.bg-black\/20,
[data-theme="light"] input.text-white,
[data-theme="light"] textarea.text-white,
[data-theme="light"] select.text-white {
    color: #0f1220 !important;
}

[data-theme="light"] input.bg-black\/20::placeholder,
[data-theme="light"] textarea.bg-black\/20::placeholder {
    color: rgba(15, 18, 32, 0.45) !important;
}

/* ─── LIGHT MODE: MISSING text-white OPACITY VARIANTS ─── */
[data-theme="light"] .text-white\/10 {
    color: rgba(15, 18, 32, 0.1) !important;
}

[data-theme="light"] .text-white\/20 {
    color: rgba(15, 18, 32, 0.2) !important;
}

[data-theme="light"] .text-white\/35 {
    color: rgba(15, 18, 32, 0.35) !important;
}

[data-theme="light"] .text-white\/45 {
    color: rgba(15, 18, 32, 0.45) !important;
}

[data-theme="light"] .text-white\/65 {
    color: rgba(15, 18, 32, 0.65) !important;
}

[data-theme="light"] .text-white\/75 {
    color: rgba(15, 18, 32, 0.75) !important;
}

[data-theme="light"] .text-white\/90 {
    color: rgba(15, 18, 32, 0.9) !important;
}

/* ─── LIGHT MODE: HOVER TEXT STATES ─── */
[data-theme="light"] .hover\:text-white:hover {
    color: #0f1220 !important;
}

[data-theme="light"] .group:hover .group-hover\:text-white {
    color: #0f1220 !important;
}

/* ─── LIGHT MODE: HOVER BACKGROUND STATES ─── */
[data-theme="light"] .hover\:bg-white\/5:hover {
    background-color: rgba(15, 18, 32, 0.04) !important;
}

[data-theme="light"] .hover\:bg-white\/10:hover {
    background-color: rgba(15, 18, 32, 0.08) !important;
}

[data-theme="light"] .hover\:bg-white\/15:hover {
    background-color: rgba(15, 18, 32, 0.12) !important;
}

[data-theme="light"] .hover\:bg-white\/\[0\.03\]:hover {
    background-color: rgba(15, 18, 32, 0.03) !important;
}

[data-theme="light"] .hover\:bg-white\/\[0\.035\]:hover {
    background-color: rgba(15, 18, 32, 0.035) !important;
}

[data-theme="light"] .hover\:bg-white\/\[0\.04\]:hover {
    background-color: rgba(15, 18, 32, 0.04) !important;
}

[data-theme="light"] .hover\:bg-white\/\[0\.05\]:hover {
    background-color: rgba(15, 18, 32, 0.05) !important;
}

[data-theme="light"] .hover\:bg-white\/\[0\.08\]:hover {
    background-color: rgba(15, 18, 32, 0.08) !important;
}

/* ─── LIGHT MODE: PROSE CONTENT (blog-single) ─── */
[data-theme="light"] .prose-invert {
    --tw-prose-body: rgba(15, 18, 32, 0.72);
    --tw-prose-headings: #0f1220;
    --tw-prose-lead: rgba(15, 18, 32, 0.72);
    --tw-prose-links: #0f1220;
    --tw-prose-bold: #0f1220;
    --tw-prose-counters: rgba(15, 18, 32, 0.6);
    --tw-prose-bullets: rgba(15, 18, 32, 0.4);
    --tw-prose-hr: rgba(15, 18, 32, 0.15);
    --tw-prose-quotes: rgba(15, 18, 32, 0.72);
    --tw-prose-code: rgba(15, 18, 32, 0.85);
    --tw-prose-pre-code: rgba(15, 18, 32, 0.85);
    --tw-prose-pre-bg: rgba(15, 18, 32, 0.06);
    --tw-prose-th-borders: rgba(15, 18, 32, 0.2);
    --tw-prose-td-borders: rgba(15, 18, 32, 0.12);
}

[data-theme="light"] .prose-headings\:text-white :is(h1, h2, h3, h4, h5, h6) {
    color: #0f1220 !important;
}

[data-theme="light"] .prose-p\:text-slate-300 p {
    color: rgba(15, 18, 32, 0.72) !important;
}

[data-theme="light"] .prose-li\:text-slate-300 li {
    color: rgba(15, 18, 32, 0.72) !important;
}

[data-theme="light"] .prose-strong\:text-white strong {
    color: #0f1220 !important;
}

[data-theme="light"] .prose-blockquote\:text-slate-200 blockquote {
    color: rgba(15, 18, 32, 0.85) !important;
}

.theme-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(15, 18, 32, 0.92);
    color: #f0f0f8;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.theme-toggle:hover::after,
.theme-toggle:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-theme="light"] .theme-toggle::after {
    background: rgba(255, 255, 255, 0.95);
    color: #0f1220;
    box-shadow: 0 8px 24px rgba(15, 18, 32, 0.12);
}

.theme-toggle-icons {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-icon {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-toggle-icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle-icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

[data-theme="light"] .theme-toggle-icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

[data-theme="light"] .theme-toggle-icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ─── TYPOGRAPHY ─── */
/* Display XL: clamp(40–72px) */
.display-xl {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 500;
}

/* Display LG: clamp(32–52px) */
.display-lg {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.028em;
    font-weight: 500;
}

/* Display MD: clamp(24–36px) */
.display-md {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 500;
}

/* Section eyebrow: uppercase, tracked, rose */
.eyebrow {
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.eyebrow::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

/* Body large: 18px, 400 weight */
.body-lg {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink-muted);
}

/* Body: 14–15px, 400 weight */
.body {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--ink-muted);
}

/* Caption: 11–12px */
.caption {
    font-size: 0.6875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ink-faint);
}

/* Mono (code): JetBrains Mono */
.mono {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Legacy: super-title (for compatibility) */
.super-title {
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 0.98;
    letter-spacing: 0;
    font-weight: 700;
    color: #fff;
    font-family: "Bebas Neue", sans-serif;
}

/* Legacy: chapter-title (for compatibility) */
.chapter-title {
    font-size: clamp(1.8rem, 3.4vw, 3.3rem);
    line-height: 1.06;
    letter-spacing: 0;
    font-weight: 680;
    color: #fff;
    font-family: "Bebas Neue", sans-serif;
}

/* Legacy: chapter-copy (for compatibility) */
.chapter-copy {
    color: var(--ink-muted);
    font-size: clamp(1rem, 1.35vw, 1.22rem);
    line-height: 1.6;
    max-width: 56ch;
}

/* ─── LAYOUT ─── */
.chapter {
    width: 100%;
    padding: clamp(3.2rem, 8vw, 7rem) 1.5rem;
}

.chapter-tight {
    padding-top: clamp(2.4rem, 5vw, 4rem);
    padding-bottom: clamp(2.4rem, 5vw, 4rem);
}

.chapter-shell {
    max-width: 72rem;
    margin: 0 auto;
}

.chapter-shell-wide {
    max-width: 90rem;
    margin: 0 auto;
}

.chapter-dark {
    background: var(--surface-2);
    color: var(--ink);
}

.chapter-muted {
    background: rgba(17, 17, 32, 0.5);
}

.chapter-divider {
    border-top: 1px solid var(--border-light);
}

/* ─── COMPONENTS: HERO ─── */
.hero-stage {
    border-radius: 16px;
    background: linear-gradient(145deg, #0f1220, #121428);
    border: 0.5px solid var(--border-light);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.hero-media {
    min-height: 320px;
    border-radius: 12px;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 36, 91, 0.15), transparent 35%),
        radial-gradient(circle at 75% 80%, rgba(255, 36, 91, 0.1), transparent 40%),
        linear-gradient(135deg, #0d0d18, #151a2c);
    position: relative;
    overflow: hidden;
}

.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.2) 45%, transparent 75%);
    transform: translateX(-120%);
    animation: sweep 5.5s ease-in-out infinite;
}

/* ─── COMPONENTS: MEDIA ─── */
.media-frame {
    border-radius: 12px;
    border: 0.5px solid var(--border-light);
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.media-placeholder {
    min-height: clamp(260px, 42vw, 560px);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1.2rem 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 36, 91, 0.2), transparent 32%),
        radial-gradient(circle at 80% 72%, rgba(255, 36, 91, 0.15), transparent 42%),
        linear-gradient(145deg, #1a1f30 0%, #101114 40%, #171b2b 100%);
    background-size: 130% 130%;
    animation: mediaDrift 12s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.media-placeholder::before {
    content: "";
    position: absolute;
    left: -30%;
    top: -10%;
    width: 45%;
    height: 120%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-18deg);
    animation: scanPass 7s linear infinite;
}

.media-placeholder-light {
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 15%, rgba(255, 36, 91, 0.12), transparent 42%),
        radial-gradient(circle at 80% 72%, rgba(255, 36, 91, 0.1), transparent 42%),
        linear-gradient(145deg, #181c2a 0%, #111520 45%, #1a2232 100%);
}

/* ─── COMPONENTS: PANEL ─── */
.panel {
    border-radius: 12px;
    border: 0.5px solid var(--border-light);
    background: var(--surface);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
    position: relative;
}

.panel-hover {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

.panel-hover:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--primary-glow-shadow), 0 20px 34px rgba(0, 0, 0, 0.5);
}

/* ─── COMPONENTS: METRIC ─── */
.metric {
    border-radius: 8px;
    border: 0.5px solid var(--border-light);
    padding: 1.4rem;
    background: rgba(255, 36, 91, 0.04);
}

.metric-value {
    font-size: clamp(1.375rem, 2.5vw, 2.25rem);
    line-height: 1;
    letter-spacing: -0.03em;
    font-weight: 600;
    color: var(--primary);
}

.metric-value span {
    color: var(--primary);
    font-weight: 600;
}

.metric-label {
    margin-top: 0.5rem;
    color: var(--ink-faint);
    font-size: 0.75rem;
}

/* ─── COMPONENTS: BADGE/CHIP ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 999px;
    border: 0.5px solid var(--border-accent);
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    background: rgba(255, 36, 91, 0.1);
    color: var(--primary-bright);
    font-weight: 500;
}

.badge::before {
    content: "";
    width: 0.3125rem;
    height: 0.3125rem;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.chip {
    display: inline-block;
    border-radius: 6px;
    border: 0.5px solid var(--border-light);
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    background: rgba(255, 255, 255, 0.02);
}

/* ─── COMPONENTS: BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    transition: all 0.15s ease;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: #ff4b78;
    box-shadow: var(--primary-glow-shadow);
}

.btn-secondary {
    background: transparent;
    border: 0.5px solid var(--border-light);
    color: var(--ink);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-strong);
}

.btn-outline {
    background: rgba(255, 36, 91, 0.1);
    border: 0.5px solid var(--border-accent);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(255, 36, 91, 0.15);
    border-color: var(--border-accent);
}

/* Legacy button classes for compatibility */
.apple-btn {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.apple-btn-dark {
    background: var(--primary);
    color: #fff;
}

.apple-btn-dark:hover {
    background: #ff4b78;
    box-shadow: var(--primary-glow-shadow);
}

.apple-btn-light {
    background: transparent;
    border: 0.5px solid var(--border-light);
    color: var(--ink);
}

.apple-btn-light:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* ─── COMPONENTS: LOGO ─── */
.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    font-family: "Inter", sans-serif;
    letter-spacing: 0.05em;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.875rem;
}

.logo-icon {
    width: 20px;
    height: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5px;
}

.logo-icon i {
    display: block;
    border-radius: 2px;
    background: var(--primary);
}

.logo-icon i:nth-child(2),
.logo-icon i:nth-child(3) {
    background: rgba(255, 36, 91, 0.6);
}

.logo-icon i:nth-child(4) {
    background: rgba(255, 36, 91, 0.4);
}

/* ─── COMPONENTS: FORM ─── */
input[type="text"]:not(.cta-field-input),
input[type="email"]:not(.cta-field-input),
input[type="tel"]:not(.cta-field-input),
input[type="name"]:not(.cta-field-input),
textarea:not(.cta-field-input),
select:not(.cta-field-input) {
    background: var(--surface-2);
    border: 0.5px solid var(--border-light);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--ink);
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]:not(.cta-field-input)::placeholder,
input[type="email"]:not(.cta-field-input)::placeholder,
input[type="tel"]:not(.cta-field-input)::placeholder,
input[type="name"]:not(.cta-field-input)::placeholder,
textarea:not(.cta-field-input)::placeholder {
    color: var(--ink-faint);
}

input[type="text"]:not(.cta-field-input):focus,
input[type="email"]:not(.cta-field-input):focus,
input[type="tel"]:not(.cta-field-input):focus,
input[type="name"]:not(.cta-field-input):focus,
textarea:not(.cta-field-input):focus,
select:not(.cta-field-input):focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(255, 36, 91, 0.1);
}

/* ─── UTILITIES ─── */
.text-primary {
    color: var(--primary);
}

.text-muted {
    color: var(--ink-muted);
}

.text-faint {
    color: var(--ink-faint);
}

.bg-surface {
    background: var(--surface);
}

.bg-surface-2 {
    background: var(--surface-2);
}

.border-accent {
    border-color: var(--border-accent);
}

.muted {
    color: var(--ink-muted);
}

/* ─── ANIMATIONS ─── */
@keyframes auroraDrift {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

@keyframes mediaDrift {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

@keyframes sweep {
    0% {
        transform: translateX(-120%);
    }
    100% {
        transform: translateX(120%);
    }
}

@keyframes scanPass {
    0% {
        transform: translateX(-120%) skewX(-18deg);
    }
    100% {
        transform: translateX(120%) skewX(-18deg);
    }
}

/* ─── ACCESSIBILITY ─── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .chapter {
        padding: clamp(2rem, 5vw, 3rem) 1rem;
    }
    
    .eyebrow {
        font-size: 0.625rem;
    }
}

@keyframes mediaDrift {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 80%;
    }
}

@keyframes sweep {
    0% {
        transform: translateX(-120%);
    }
    40%,
    100% {
        transform: translateX(130%);
    }
}

@keyframes scanPass {
    0% {
        transform: translateX(-150%) skewX(-18deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        transform: translateX(320%) skewX(-18deg);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-gradient,
    .media-placeholder,
    .media-placeholder::before,
    .hero-media::after {
        animation: none !important;
    }
}

@media (max-width: 768px) {
    .hero-media {
        min-height: 230px;
    }

    .media-placeholder {
        min-height: 220px;
    }
}
