/* ==============================================================================
   Nima Haghighatjoo - Personal Portfolio (2026 Theme Edition)
   Palette: Warm Cream (#FAF7F2), Claude Orange (#CC5A27),
            Matcha Green (#587938), KitKat Chocolate (#4A2C1B)
   Typography: B Mitra for all Persian text & numbers
   Modes: Full Light / Dark Theme Toggle (Day & Night)
   ============================================================================== */

/* ------------------------------------------------------------------------------
   1. Typography & Font-Face (B Mitra)
   ------------------------------------------------------------------------------ */
@font-face {
    font-family: 'B Mitra';
    src: local('B Mitra'), local('BMitra'),
         url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'B Mitra';
    src: local('B Mitra Bold'), local('BMitra-Bold'),
         url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------------------------------------------------------
   2. Design Tokens (Light Mode - Day by Default)
   ------------------------------------------------------------------------------ */
:root {
    /* Color Palette (Day - Light Mode) */
    --bg-base: #FAF7F2;          /* Soft Warm Cream */
    --bg-surface: #F3ECE1;       /* Light Warm Sand */
    --bg-card: rgba(255, 251, 245, 0.9);
    --bg-card-hover: rgba(255, 253, 248, 0.98);
    --bg-card-highlight: rgba(204, 90, 39, 0.04);
    --bg-input: #FFFBF5;
    --bg-glass: rgba(250, 247, 242, 0.85);

    /* Accents */
    --primary: #CC5A27;          /* Claude Terracotta Orange */
    --primary-light: #E06A3B;
    --primary-glow: rgba(204, 90, 39, 0.22);
    --matcha: #587938;           /* Matcha Herbal Green */
    --matcha-light: #6E9447;
    --matcha-glow: rgba(88, 121, 56, 0.22);
    --cyan: #587938;             /* Matcha accent replacement */
    --cyan-glow: rgba(88, 121, 56, 0.22);
    --cream: #FAF7F2;
    --emerald: #587938;
    --rose: #B54D1F;
    --chocolate: #4A2C1B;        /* KitKat Milk Chocolate */
    --chocolate-light: #6E4429;
    --chocolate-deep: #2A1810;
    --chocolate-glow: rgba(74, 44, 27, 0.35);

    /* Text Hierarchy */
    --text-primary: #2C2621;     /* Warm Espresso Charcoal */
    --text-secondary: #584F47;   /* Medium Earth Gray */
    --text-muted: #80766B;       /* Soft Sand Gray */
    --text-dim: #A89E93;

    /* Borders */
    --border-subtle: rgba(44, 38, 33, 0.09);
    --border-medium: rgba(44, 38, 33, 0.16);
    --border-glow: rgba(204, 90, 39, 0.35);
    --border-cyan: rgba(88, 121, 56, 0.35);

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #CC5A27 0%, #6E4429 48%, #587938 100%);
    --gradient-badge: linear-gradient(135deg, rgba(204, 90, 39, 0.12), rgba(88, 121, 56, 0.08));
    --gradient-btn: linear-gradient(135deg, #CC5A27 0%, #E06A3B 100%);
    --gradient-btn-hover: linear-gradient(135deg, #B54D1F 0%, #CC5A27 100%);
    --gradient-progress: linear-gradient(90deg, #CC5A27, #587938, #6E4429);

    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(44, 38, 33, 0.05);
    --shadow-md: 0 10px 30px -5px rgba(44, 38, 33, 0.09);
    --shadow-lg: 0 25px 50px -12px rgba(44, 38, 33, 0.14);
    --shadow-glow: 0 0 40px -5px var(--primary-glow);
    --shadow-cyan-glow: 0 0 40px -5px var(--cyan-glow);

    /* Typography */
    --font-main: 'B Mitra', 'BMitra', 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, serif;
    --font-en: 'B Mitra', 'BMitra', 'Vazirmatn', serif;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Motion Curves */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s var(--ease-out);
    --transition-normal: 0.35s var(--ease-out);
    --transition-slow: 0.6s var(--ease-out);
}

/* ------------------------------------------------------------------------------
   3. Dark Mode (Night - Activated via data-theme="dark")
   ------------------------------------------------------------------------------ */
[data-theme="dark"] {
    --bg-base: #1C100A;          /* Deep KitKat Chocolate */
    --bg-surface: #27170F;       /* Cocoa Surface */
    --bg-card: rgba(58, 36, 24, 0.82);
    --bg-card-hover: rgba(75, 46, 30, 0.94);
    --bg-card-highlight: rgba(226, 109, 56, 0.05);
    --bg-input: rgba(42, 24, 16, 0.94);
    --bg-glass: rgba(28, 16, 10, 0.9);

    /* Accents */
    --primary: #E26D38;          /* Vibrant Claude Warm Orange */
    --primary-light: #F0804D;
    --primary-glow: rgba(226, 109, 56, 0.32);
    --matcha: #8CA95B;           /* Glowing Matcha Green */
    --matcha-light: #A2BF6E;
    --matcha-glow: rgba(140, 169, 91, 0.32);
    --cyan: #8CA95B;
    --cyan-glow: rgba(140, 169, 91, 0.32);
    --chocolate: #6E4429;        /* KitKat Milk Chocolate, lifted for dark mode */
    --chocolate-light: #8A5A38;
    --chocolate-deep: #1C100A;
    --chocolate-glow: rgba(110, 68, 41, 0.4);

    /* Text Hierarchy */
    --text-primary: #F8F4EC;     /* Warm Cream Text */
    --text-secondary: #D2C9BB;   /* Soft Sand */
    --text-muted: #9E9588;       /* Subtle Earth Gray */
    --text-dim: #70685D;

    /* Borders */
    --border-subtle: rgba(248, 244, 236, 0.09);
    --border-medium: rgba(248, 244, 236, 0.16);
    --border-glow: rgba(226, 109, 56, 0.45);
    --border-cyan: rgba(140, 169, 91, 0.45);

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #F0804D 0%, #8A5A38 48%, #8CA95B 100%);
    --gradient-badge: linear-gradient(135deg, rgba(226, 109, 56, 0.16), rgba(140, 169, 91, 0.1));
    --gradient-btn: linear-gradient(135deg, #E26D38 0%, #F0804D 100%);
    --gradient-btn-hover: linear-gradient(135deg, #CC5A27 0%, #E26D38 100%);
    --gradient-progress: linear-gradient(90deg, #E26D38, #8CA95B, #F8F4EC);

    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 40px -5px var(--primary-glow);
    --shadow-cyan-glow: 0 0 40px -5px var(--cyan-glow);
}

/* ------------------------------------------------------------------------------
   4. Reset & Global Styles
   ------------------------------------------------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.9;
    overflow-x: hidden;
    direction: rtl;
    text-align: right;
    position: relative;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.container {
    width: 100%;
    max-width: 1240px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 24px;
    padding-left: 24px;
}

section {
    position: relative;
    z-index: 2;
}

.section-padding {
    padding: 120px 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-normal);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* FontAwesome RTL list adjustment */
.fa-ul {
    margin-right: var(--fa-li-margin, 2.2em);
    margin-left: 0;
    padding-right: 0;
}

.fa-ul .fa-li {
    right: calc(-1 * var(--fa-li-width, 1.8em));
    left: auto;
    text-align: right;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 6px;
    border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

::selection {
    background-color: var(--primary);
    color: var(--cream);
}

/* ------------------------------------------------------------------------------
   5. Scroll Progress Bar & Custom AI Cursor
   ------------------------------------------------------------------------------ */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    background: var(--gradient-progress);
    box-shadow: 0 0 10px var(--primary-glow);
    z-index: 99999;
    will-change: transform;
}

/* Signature moustache cursor: a precise point with a gently trailing silhouette. */
.cursor-dot,
.cursor-outline { opacity: 0; }

body.cursor-live .cursor-dot,
body.cursor-live .cursor-outline { opacity: 1; }

/* Exact click point; the decorative moustache never intercepts input. */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 3px;
    height: 3px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-light), 0 0 16px var(--matcha);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    will-change: transform; /* JS moves it with translate3d, never left/top */
}

/* Curled moustache with velocity-driven tilt and contextual color feedback. */
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    width: 38px;
    height: 19px;
    overflow: visible;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, 4px);
    will-change: transform; /* rasterised once; movement stays on the compositor */
    filter: drop-shadow(0 1px 1px var(--bg-base)) drop-shadow(0 0 4px var(--primary-glow));
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), filter 0.25s ease, opacity 0.3s ease;
}

.cursor-outline path {
    fill: var(--chocolate);
    stroke: var(--primary);
    stroke-width: 1.5;
    transition: stroke 0.25s ease, fill 0.25s ease;
}

.cursor-outline.cursor-hover {
    width: 46px;
    height: 23px;
    filter: drop-shadow(0 0 10px var(--matcha-glow));
}

.cursor-outline.cursor-hover path {
    stroke: var(--matcha);
    fill: var(--primary);
}

.cursor-outline.cursor-click {
    width: 32px;
    height: 16px;
}

.cursor-outline.cursor-click path {
    fill: var(--matcha);
}

@media (hover: none) or (pointer: coarse) {
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

@media (hover: hover) and (pointer: fine) {
    body.cursor-live, body.cursor-live * { cursor: none !important; }
    body.cursor-live input, body.cursor-live textarea, body.cursor-live [contenteditable="true"] { cursor: text !important; }
    body.cursor-live:has(input:hover, textarea:hover, [contenteditable="true"]:hover) .cursor-dot,
    body.cursor-live:has(input:hover, textarea:hover, [contenteditable="true"]:hover) .cursor-outline { opacity: 0; }
}

/* ------------------------------------------------------------------------------
   6. Background Auras & Hero Particle Canvas
   ------------------------------------------------------------------------------ */
.aura {
    /* Perf: this used to be a 650px disc under filter: blur(180px) — a huge
       blur kernel re-evaluated by the compositor on weaker GPUs (Windows
       iGPUs especially). A larger, pre-softened radial gradient looks the
       same and costs nothing. */
    position: fixed;
    width: 1010px;
    height: 1010px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.16;
    transition: opacity var(--transition-slow);
}

.aura-top-right {
    top: -330px;
    right: -330px;
    background: radial-gradient(circle closest-side, var(--primary) 0%, var(--chocolate-light) 38%, transparent 100%);
}

.aura-bottom-left {
    bottom: -330px;
    left: -330px;
    background: radial-gradient(circle closest-side, var(--matcha) 0%, var(--matcha-light) 38%, transparent 100%);
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.65;
}

/* ------------------------------------------------------------------------------
   7. Interactive Spotlight Cards (Mouse Position Glow)
   ------------------------------------------------------------------------------ */
.spotlight-card {
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.spotlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--primary-glow),
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

.spotlight-card:hover::before {
    opacity: 1;
}

.spotlight-card > * {
    position: relative;
    z-index: 1;
}

.tilt-element {
    transition: transform 0.15s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

.magnetic-btn {
    transition: transform 0.2s var(--ease-out);
    will-change: transform;
    display: inline-flex;
}

/* ------------------------------------------------------------------------------
   8. Section Headers & Badges
   ------------------------------------------------------------------------------ */
.section-header {
    margin-bottom: 60px;
}

.sub-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-full);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    backdrop-filter: blur(8px);
}

.sub-title::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.section-title {
    font-size: 2.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.title-line {
    width: 60px;
    height: 4px;
    background: var(--gradient-btn);
    border-radius: var(--radius-full);
    margin: 0 auto;
}

.text-gradient {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-center {
    text-align: center;
}

.text-neon {
    color: var(--primary);
}

/* ------------------------------------------------------------------------------
   9. Buttons & Theme Switcher
   ------------------------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-normal);
    min-height: 48px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-btn);
    color: var(--cream);
    box-shadow: 0 4px 20px -2px rgba(204, 90, 39, 0.4);
}

.btn-primary:hover {
    background: var(--gradient-btn-hover);
    box-shadow: 0 8px 30px rgba(204, 90, 39, 0.6);
    transform: translateY(-2px);
    color: var(--cream);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-medium);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-outline:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 9px 20px;
    font-size: 0.95rem;
    min-height: 40px;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* Day/Night Theme Switcher Toggle */
.theme-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
    transform: rotate(20deg) scale(1.08);
    border-color: var(--primary);
    background: var(--primary-glow);
}

.hidden {
    display: none !important;
}

/* ------------------------------------------------------------------------------
   10. Header & Navigation (Desktop & Mobile Sheet)
   ------------------------------------------------------------------------------ */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 0;
    transition: var(--transition-normal);
}

.main-header.scrolled {
    padding: 7px 0;
    /* No backdrop blur: --bg-glass is already 85–90% opaque, and blurring
       the scaling hero stage behind a fixed header every scroll frame was
       one of the heaviest costs on Windows. */
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text-bold {
    color: var(--text-primary);
    font-weight: 700;
}

.logo-text-light {
    color: var(--primary);
    font-weight: 400;
}

/* NimAI monogram: an "N" with the moustache as its own brand mark, reusing
   the site's chocolate + orange pairing so it always matches the wordmark
   beside it. */
.logo-mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    transition: var(--transition-normal);
}

.logo-mark-n {
    fill: var(--text-primary);
    transition: fill 0.3s ease;
}

.logo-mark-stache {
    fill: var(--primary);
    transition: fill 0.3s ease;
}

.logo:hover .logo-mark {
    transform: rotate(-6deg) scale(1.06);
}

.header-brand-logo {
    width: 78px;
    height: 64px;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid rgba(204, 90, 39, 0.12);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(110,68,41,.07), rgba(42,24,16,.03));
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: hidden;
}

.brand-logo-mask {
    display: block;
    background:
        radial-gradient(circle at 79% 83%, var(--matcha) 0 16%, transparent 18%),
        radial-gradient(ellipse 72% 25% at 50% 61%, var(--primary) 0 68%, transparent 72%),
        linear-gradient(145deg, var(--cream) 0 7%, var(--chocolate) 31% 100%);
    -webkit-mask: url('./nimai-logo-header.png') center / contain no-repeat;
    mask: url('./nimai-logo-header.png') center / contain no-repeat;
}

.site-logo-image {
    display: block;
    width: 66px;
    height: 54px;
    transition: transform 0.45s var(--ease-out), filter 0.45s ease;
}

/* A cream monogram keeps the original silhouette legible on cocoa. */
.header-brand-logo .brand-logo-mask {
    background:
        radial-gradient(circle at 79% 83%, #8CA95B 0 16%, transparent 18%),
        radial-gradient(ellipse 72% 25% at 50% 61%, #CC5A27 0 68%, transparent 72%),
        var(--text-primary);
}

.header-brand-logo:hover .site-logo-image {
    transform: scale(1.045);
    filter: saturate(1.12);
}

/* فقط ul سطح اول (نوار پیل افقی)؛ اگر روی همهٔ ul های داخل .nav-menu اعمال بشه
   (مثل قبل)، روی زیرمنوی کشویی هم نشت می‌کنه و چیدمانش رو به‌هم می‌ریزه. */
.nav-menu > ul {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.nav-link {
    padding: 8px 14px;
    font-size: 0.95rem;
    white-space: nowrap;
    font-weight: 400;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--bg-surface);
}

.nav-link.active {
    color: var(--cream);
    background: var(--primary);
    box-shadow: 0 2px 12px rgba(204, 90, 39, 0.4);
    font-weight: 700;
}

/* Dropdown Navigation Menu */
.nav-item-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-chevron {
    font-size: 0.72rem;
    transition: transform 0.3s var(--ease-out);
    margin-right: 2px;
}

.nav-item-dropdown:hover .dropdown-chevron,
.nav-item-dropdown.open .dropdown-chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-lg), 0 12px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.96);
    transition: all 0.25s var(--ease-out);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    /* صریحاً stretch (رفتار پیش‌فرض flex) تا هر آیتم به عرض کامل کشیده بشه؛
       ریشهٔ اصلی ناهم‌ترازی قبلی، نشتِ «.nav-menu ul» به همین ul تو در تو بود
       که با محدودکردنش به «.nav-menu > ul» رفع شد — این خط فقط برای اطمینانه. */
    align-items: stretch;
    gap: 4px;
    list-style: none;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -14px;
    right: 0;
    left: 0;
    height: 14px;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu,
.nav-item-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.dropdown-item i {
    font-size: 0.95rem;
    color: var(--primary);
    width: 18px;
    text-align: center;
}

.dropdown-item:hover {
    color: var(--primary);
    background: var(--bg-surface);
    transform: translateX(-4px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
}

.mobile-nav-toggle .bar {
    width: 100%;
    height: 2.5px;
    background-color: var(--text-primary);
    border-radius: 4px;
    transition: var(--transition-normal);
}

.mobile-nav-toggle.open .bar:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.mobile-nav-toggle.open .bar:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.open .bar:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* ------------------------------------------------------------------------------
   11. Hero Section
   ------------------------------------------------------------------------------ */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 140px;
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3.35rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 24px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dynamic-text {
    color: var(--matcha);
    border-left: 3px solid var(--matcha);
    padding-left: 8px;
    animation: cursor-blink 0.8s infinite;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.95;
    margin-bottom: 36px;
    max-width: 620px;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-socials {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-size: 1.15rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.hero-socials a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--cream);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(204, 90, 39, 0.4);
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.visual-container {
    position: relative;
    width: 100%;
    max-width: 440px;
}

.glowing-shape {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--primary-glow) 0%, var(--matcha-glow) 50%, transparent 75%);
    filter: blur(50px);
    z-index: 0;
    border-radius: 50%;
}

.hero-img {
    position: relative;
    z-index: 1;
    width: 100%;
    border-radius: var(--radius-xl);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.2));
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.scroll-indicator a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

/* ------------------------------------------------------------------------------
   12. About Me Section
   ------------------------------------------------------------------------------ */
.about-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 60px;
    align-items: center;
}

.about-img-container {
    display: flex;
    justify-content: center;
}

.about-img-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.about-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: var(--transition-slow);
}

.about-img-wrapper:hover .about-img {
    transform: scale(1.03);
}

.border-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-glow);
    pointer-events: none;
}

.about-quote {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.75;
    margin-bottom: 24px;
    padding-right: 20px;
    border-right: 4px solid var(--primary);
    background: var(--bg-card);
    padding: 18px 22px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border: 1px solid var(--border-subtle);
    border-right: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.about-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.95;
}

.about-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 36px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 22px 16px;
    border-radius: var(--radius-lg);
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.stat-num {
    font-size: 2.25rem;
    font-weight: 700;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    transition: transform 0.3s var(--ease-out);
}

.stat-card:hover .stat-num {
    transform: scale(1.08);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ------------------------------------------------------------------------------
   13. Experience & Teaching Section
   ------------------------------------------------------------------------------ */
.tab-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-normal);
    min-height: 48px;
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-surface);
}

.tab-btn.active {
    background: var(--gradient-btn);
    color: var(--cream);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(204, 90, 39, 0.4);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s var(--ease-out);
}

.tab-content.active {
    display: block;
}

/* Career Timeline */
.timeline {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding-right: 36px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: 11px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--matcha) 100%);
    opacity: 0.4;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-dot {
    position: absolute;
    top: 6px;
    right: -36px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 3px solid var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    z-index: 2;
}

.timeline-date {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    padding: 4px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.timeline-content:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateX(-4px);
    box-shadow: var(--shadow-md);
}

.timeline-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.timeline-content .company {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--matcha);
    margin-bottom: 18px;
}

.timeline-tasks li {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.8;
}

/* Teaching & Courses Grid */
.teaching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 28px;
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.course-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    color: var(--text-muted);
}

.course-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.course-date {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--matcha);
    margin-bottom: 14px;
}

.course-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.85;
}

/* ------------------------------------------------------------------------------
   14. Skills & Certifications Section
   ------------------------------------------------------------------------------ */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.skills-box, .certs-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 36px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.skills-box-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.skills-box-title i {
    color: var(--primary);
}

.skill-item {
    margin-bottom: 24px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 700;
}

.skill-name {
    color: var(--text-primary);
}

.skill-percentage {
    color: var(--primary);
}

.skill-bar-bg {
    width: 100%;
    height: 9px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: var(--gradient-btn);
    border-radius: var(--radius-full);
    transition: width 1.2s var(--ease-out);
}

/* Certifications Timeline */
.certs-timeline {
    position: relative;
    padding-right: 28px;
}

.certs-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    right: 7px;
    width: 2px;
    background: var(--border-medium);
}

.cert-item {
    position: relative;
    margin-bottom: 26px;
}

.cert-marker {
    position: absolute;
    top: 5px;
    right: -28px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 3px solid var(--matcha);
}

.cert-meta {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--matcha);
    margin-bottom: 4px;
}

.cert-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.cert-info p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.academic-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 700px;
    margin: 0 auto;
}

.academic-box h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.academic-inst {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ------------------------------------------------------------------------------
   15. Activities, Projects & Media Feed
   ------------------------------------------------------------------------------ */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 90px;
}

.activity-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 36px 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

.activity-panel:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
}

.panel-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 22px;
}

.activity-panel h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.panel-date {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--matcha);
    margin-bottom: 16px;
}

.panel-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 26px;
    flex-grow: 1;
}

/* Feed Section */
.feed-section-container {
    padding-top: 40px;
}

.feed-header {
    margin-bottom: 36px;
}

.feed-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    min-height: 42px;
}

.filter-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--cream);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(204, 90, 39, 0.4);
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.feed-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.feed-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feed-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-normal);
}

.feed-cover-editorial {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Ambient Radial Mesh */
.feed-cover-editorial::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.35;
    transition: transform 0.6s var(--ease-out), opacity 0.4s ease;
}

.feed-cover-claude::before {
    background: radial-gradient(circle, var(--primary) 0%, var(--chocolate-light) 70%, transparent 100%);
    top: -40px;
    right: -40px;
}

.feed-cover-matcha::before {
    background: radial-gradient(circle, var(--matcha) 0%, #8CA95B 70%, transparent 100%);
    bottom: -40px;
    left: -40px;
}

/* Grid overlay */
.feed-cover-editorial::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--border-medium) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.4;
    pointer-events: none;
}

/* Watermark typography */
.feed-cover-watermark {
    position: absolute;
    font-family: var(--font-en), sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    opacity: 0.05;
    user-select: none;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
    transition: transform 0.6s var(--ease-out), opacity 0.4s ease;
}

/* Geometric concentric rings */
.feed-cover-ring {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 1px dashed var(--border-medium);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
    transition: transform 0.6s var(--ease-out), opacity 0.4s ease;
}

.feed-cover-ring-inner {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 1px solid var(--border-glow);
    opacity: 0.35;
    pointer-events: none;
    z-index: 1;
}

/* Floating Center Emblem */
.feed-cover-emblem {
    position: relative;
    z-index: 2;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    color: var(--primary);
    box-shadow: var(--shadow-md), 0 0 20px var(--primary-glow);
    backdrop-filter: blur(10px);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease, border-color 0.4s ease;
}

.feed-cover-matcha .feed-cover-emblem {
    color: var(--matcha);
    border-color: var(--border-cyan);
    box-shadow: var(--shadow-md), 0 0 20px var(--matcha-glow);
}

/* Card Hover Reactions */
.feed-card:hover .feed-cover-emblem {
    transform: scale(1.12) rotate(-5deg);
}

.feed-card:hover .feed-cover-watermark {
    transform: scale(1.06) translateY(-4px);
    opacity: 0.09;
}

.feed-card:hover .feed-cover-ring {
    transform: rotate(45deg);
    opacity: 0.8;
}

.feed-card:hover .feed-cover-editorial::before {
    opacity: 0.55;
    transform: scale(1.15);
}

.feed-badge-type {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    backdrop-filter: blur(8px);
    z-index: 3;
}

/* --- کارت مقالات واقعی وبلاگ (posts): تصویر شاخص واقعی به‌جای کاور انتزاعی --- */
.blog-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

.feed-card:hover .blog-card-image img {
    transform: scale(1.06);
}

.blog-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-dim);
    background: var(--bg-surface);
}

/* ------------------------------------------------------------------------------
   Post — صفحهٔ تکی مقالهٔ وبلاگ (post.php)
   ------------------------------------------------------------------------------ */
.post-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.post-hero-image {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 36px;
    box-shadow: var(--shadow-md);
}

/* محتوای مقاله توسط ادمین به‌صورت HTML نوشته می‌شود (نه ورودی کاربر مهمان)،
   پس عمداً بدون escape مستقیم چاپ می‌شود؛ این کلاس فقط تایپوگرافی تگ‌های
   داخل آن (پاراگراف/تیتر/لیست/تصویر/نقل‌قول) را با ظاهر کلی سایت هماهنگ می‌کند */
.post-content {
    font-size: 1.08rem;
    line-height: 2.1;
    color: var(--text-secondary);
    max-width: 760px;
    margin: 0 auto;
}

.post-content h2 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 40px 0 16px;
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 30px 0 14px;
}

.post-content p { margin: 0 0 22px; }

.post-content img {
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content ul,
.post-content ol {
    margin: 0 0 22px;
    padding-inline-start: 26px;
}

.post-content li { margin-bottom: 10px; }

.post-content blockquote {
    margin: 28px 0;
    padding: 16px 22px;
    border-inline-start: 4px solid var(--primary);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-style: italic;
}

.post-newsletter-box {
    max-width: 760px;
    margin: 56px auto 0;
    padding: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    text-align: center;
}

.post-newsletter-box h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.post-newsletter-box p {
    color: var(--text-muted);
    margin-bottom: 22px;
}

.feed-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.feed-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.feed-tag {
    color: var(--matcha);
    font-weight: 700;
}

.feed-title-link {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.feed-card-desc {
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.8;
    margin-bottom: 20px;
    flex-grow: 1;
}

.feed-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.feed-link-btn:hover {
    color: var(--primary-light);
    transform: translateX(-4px);
}

/* ------------------------------------------------------------------------------
   16. Contact Section & Forms
   ------------------------------------------------------------------------------ */
.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 50px;
    align-items: start;
}

.contact-column-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.contact-column-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.85;
    margin-bottom: 30px;
}

.contact-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 18px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.contact-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateX(-4px);
}

.contact-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
    flex-shrink: 0;
}

.contact-card-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.contact-card-details span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.contact-card-details strong {
    font-size: 1.05rem;
    color: var(--text-primary);
    direction: ltr;
    text-align: right;
}

.copy-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.copy-btn:hover {
    color: var(--cream);
    background: var(--primary);
    border-color: var(--primary);
}

/* Contact Form */
.contact-form-column {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 38px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group select option {
    background: var(--bg-base);
    color: var(--text-primary);
}

.form-status {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    animation: fadeIn 0.3s ease-out;
}

.form-status.success {
    background: rgba(88, 121, 56, 0.15);
    border: 1px solid rgba(88, 121, 56, 0.4);
    color: var(--matcha);
}

.form-status.error {
    background: rgba(204, 90, 39, 0.15);
    border: 1px solid rgba(204, 90, 39, 0.4);
    color: var(--rose);
}

/* ------------------------------------------------------------------------------
   17. Footer
   ------------------------------------------------------------------------------ */
.main-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 70px 0 40px;
    position: relative;
    z-index: 2;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-logo .logo-mark {
    width: 26px;
    height: 26px;
}

.footer-brand-mark {
    width: 58px;
    height: 48px;
    flex: 0 0 auto;
    filter: drop-shadow(0 8px 12px rgba(74, 44, 27, 0.14));
}

.footer-brand-name {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 28px;
}

.footer-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
}

.footer-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-size: 1.15rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.footer-socials a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--cream);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(204, 90, 39, 0.4);
}

.footer-divider {
    border: none;
    height: 1px;
    background: var(--border-medium);
    margin-bottom: 28px;
}

.copy-text {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* ------------------------------------------------------------------------------
   17.5 Newsletter Subscribe Forms (Hero dock / Pre-footer section / Footer)
   ------------------------------------------------------------------------------ */
.newsletter-input-row {
    display: flex;
    gap: 10px;
    max-width: 420px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-fast);
}

.newsletter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.newsletter-status {
    display: block;
    margin-top: 10px;
    font-size: 0.88rem;
    font-weight: 700;
}

.newsletter-status.success { color: var(--matcha); }
.newsletter-status.error   { color: var(--rose); }

/* --- بخش خبرنامه ته صفحه، قبل از فوتر (index.php) --- */
.newsletter-section {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.newsletter-card {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-card .section-title { margin-bottom: 10px; }
.newsletter-card .deck-hint { margin-bottom: 26px; }
.newsletter-card .newsletter-status { text-align: center; }

/* --- فرم داخل فوتر (سراسر سایت) --- */
.newsletter-form-footer {
    max-width: 480px;
    margin: 0 auto 32px;
}

.newsletter-form-footer .newsletter-status { text-align: center; }

/* --- نسخهٔ فشرده داخل داک همیشه‌ثابت هیرو ---
   فقط در دسکتاپ‌های خیلی عریض نشون داده می‌شه؛ چون داک هیرو از قبل با
   متن نقش + دو دکمه + آیکون‌های شبکهٔ اجتماعی شلوغه، اضافه‌کردن این فرم
   روی دسکتاپ‌های معمولی/موبایل باعث سرریز می‌شد. دو نمونهٔ دیگهٔ فرم
   (ته صفحه و فوتر) همیشه در همه‌جا نمایش داده می‌شن. */
.cine-dock-newsletter {
    display: none;
    position: relative;
    align-items: center;
    gap: 6px;
    padding-right: 10px;
    border-right: 1px solid rgba(251, 247, 240, 0.16);
}

@media (min-width: 1300px) {
    .cine-dock-newsletter { display: flex; }
}

.cine-dock-newsletter .newsletter-input {
    width: 150px;
    padding: 8px 12px;
    background: rgba(251, 247, 240, 0.08);
    border: 1px solid rgba(251, 247, 240, 0.22);
    border-radius: var(--radius-full);
    color: var(--cine-ink);
    font-size: 0.85rem;
}

.cine-dock-newsletter .newsletter-input::placeholder { color: var(--cine-ink-dim); }

.cine-dock-newsletter .newsletter-input:focus {
    border-color: var(--matcha-light, #8CA95B);
    box-shadow: none;
}

.cine-dock-newsletter button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--primary);
    color: var(--cream, #FAF7F2);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.cine-dock-newsletter button:hover { transform: translateY(-2px); }
.cine-dock-newsletter button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.cine-dock-newsletter .newsletter-status {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    white-space: nowrap;
    font-size: 0.75rem;
    background: rgba(18, 13, 9, 0.85);
    color: var(--cine-ink);
    padding: 6px 12px;
    border-radius: var(--radius-full);
}

/* ------------------------------------------------------------------------------
   18. Animations Keyframes
   ------------------------------------------------------------------------------ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cursor-blink {
    50% { border-color: transparent; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -8px); }
    60% { transform: translate(-50%, -4px); }
}

/* ------------------------------------------------------------------------------
   19. Mobile & Responsive Media Queries
   ------------------------------------------------------------------------------ */
@media (max-width: 1024px) {
    .section-padding {
        padding: 90px 0;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-subtitle {
        justify-content: center;
    }

    .hero-description {
        margin-right: auto;
        margin-left: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-socials {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .activities-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 75px 0;
    }

    .section-title {
        font-size: 1.85rem;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .header-actions .btn {
        display: none;
    }

    .header-brand-logo {
        width: 66px;
        height: 54px;
        padding: 4px 7px;
        border-radius: 15px;
    }

    .site-logo-image {
        width: 56px;
        height: 46px;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    /* Parked with a transform rather than `right: -100%`: an off-viewport fixed
       element widens the document and gives the whole page a horizontal scroll. */
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 85%;
        max-width: 380px;
        height: 100vh;
        background: var(--bg-glass);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-left: 1px solid var(--border-medium);
        padding: 100px 30px 40px;
        transform: translateX(105%);
        transition: transform 0.4s var(--ease-out);
        z-index: 1000;
        box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.open {
        right: 0;
        transform: translateX(0);
    }

    .nav-menu > ul {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
        gap: 12px;
        box-shadow: none;
    }

    .nav-link {
        display: block;
        padding: 12px 20px;
        font-size: 1.05rem;
        border-radius: var(--radius-md);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form-column {
        padding: 24px;
    }

    .feed-filters {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
        scrollbar-width: none;
    }

    .nav-item-dropdown {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-item-dropdown .dropdown-toggle {
        justify-content: space-between;
        width: 100%;
    }

    .nav-menu.open .nav-item-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 1px solid var(--border-subtle);
        background: var(--bg-surface);
        margin-top: 6px;
        padding: 8px 12px;
        display: flex;
    }

    .feed-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0;
    }
}

/* ------------------------------------------------------------------------------
   20. Dedicated Standalone Pages Styling (Courses, Creations, Blog, Consulting)
   ------------------------------------------------------------------------------ */
.page-hero {
    padding: 160px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.breadcrumbs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    background: var(--bg-card);
    padding: 6px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.breadcrumbs a {
    color: var(--primary);
    font-weight: 700;
}

.breadcrumbs span {
    color: var(--text-dim);
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 18px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 36px;
    line-height: 1.9;
}

/* Category Grid & Cards */
.category-block {
    margin-bottom: 80px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-medium);
}

.category-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title i {
    color: var(--primary);
}

/* Creations / Project Cards */
.creation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 34px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.creation-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
}

.creation-badge {
    align-self: flex-start;
    padding: 5px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: var(--gradient-badge);
    color: var(--primary);
    border: 1px solid var(--border-glow);
    margin-bottom: 18px;
}

.creation-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 22px;
}

.creation-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.creation-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.85;
    margin-bottom: 24px;
    flex-grow: 1;
}

.creation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.creation-tag {
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--matcha);
    background: var(--bg-surface);
    border: 1px solid var(--border-cyan);
    border-radius: var(--radius-full);
}

/* Consulting Roadmap & Services */
.consulting-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 70px;
}

.consulting-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 38px 30px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.consulting-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
}

.consulting-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: var(--primary);
    margin-bottom: 22px;
}

.consulting-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.consulting-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 24px;
    flex-grow: 1;
}

.consulting-features {
    margin-bottom: 30px;
}

.consulting-features li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.consulting-features li i {
    color: var(--matcha);
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 80px;
}

.roadmap-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 30px 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition-normal);
}

.roadmap-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
}

.roadmap-step-num {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
    opacity: 0.8;
    margin-bottom: 12px;
}

.roadmap-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.roadmap-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.75;
}

@media (max-width: 1024px) {
    .consulting-grid {
        grid-template-columns: 1fr;
    }
    .roadmap-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2.2rem;
    }
    .roadmap-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------------------
   21. Cinematic Hero Stage ("داده و روایت — یک ذهن")
   Full-bleed editorial stage with corner-anchored display type, scroll-driven
   scale/blur choreography and a progressive manifesto reveal.
   ------------------------------------------------------------------------------ */

/* Display weight for the oversized Persian headline */
@font-face {
    font-family: 'Nima Display';
    src: local('B Mitra Bold'),
         url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-display: 'Nima Display', 'B Mitra', 'Vazirmatn', serif;
    --font-mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
    --cine-ink: #FBF7F0;              /* Type colour on the stage (both themes) */
    --cine-ink-dim: rgba(251, 247, 240, 0.72);
    --cine-shell: #2E1B10;            /* KitKat chocolate letterbox behind the stage */
    --cine-page: var(--bg-base);
}

[data-theme="dark"] {
    --cine-shell: #1E1109;
}

/* --- Scroll track: the sticky stage travels over 220vh of scroll ------------- */
.cine-hero {
    position: relative;
    height: 220vh;
    margin-bottom: 0;
    background: var(--cine-page);
}

.cine-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

/* --- The stage ------------------------------------------------------------- */
.cine-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--cine-shell);
    transform-origin: 50% 46%;
    will-change: transform;
    /* driven by JS: --p goes 0 -> 1 across the scroll track */
    transform: scale(calc(1 - (var(--p, 0) * 0.16)));
    border-radius: calc(var(--p, 0) * 30px);
    /* Static shadow: at p=0 it sits below the viewport edge anyway, and a
       fixed shadow is rasterised once instead of on every scroll frame. */
    box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.65);
}

/* The new video supplies four continuous sequences. Canvas handles desktop
   pointer control; the video underneath handles touch devices and fallback. */
.cine-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: var(--cine-shell);
    perspective: 1200px;
}

.cine-video,
.cine-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    /* The contrast/saturation grade is baked into hero-grok/v2/* — a CSS
       filter here meant a full-viewport filter pass on every pointer frame.
       The scroll defocus only exists while it's actually running
       (.is-defocus is toggled by script.js once --blur-p > 0). */
    filter: none;
    transform: scale(calc(1 + (var(--blur-p, 0) * 0.06)));
    transform-origin: 50% 46%;
    will-change: transform;
}

.cine-sticky.is-defocus .cine-video,
.cine-sticky.is-defocus .cine-canvas {
    filter: blur(calc(var(--blur-p, 0) * 16px))
            brightness(calc(1 - (var(--blur-p, 0) * 0.2)));
}

.cine-video {
    object-fit: cover;
    object-position: 50% 38%;
}

.cine-canvas { opacity: 0; pointer-events: none; }
.cine-canvas.is-rendered { opacity: 1; }
.cine-interaction-hint[hidden] { display: none; }

/* Night theme used a brightness(0.92) filter; a static 8% veil is identical
   and never re-filters the moving canvas. */
[data-theme="dark"] .cine-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.08);
    pointer-events: none;
}

/* Warm accent aura bleeding out of the artwork — the identity's answer to the
   reference's green glow. */
.cine-aura {
    position: absolute;
    inset: -10%;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(38% 42% at 74% 32%, rgba(226, 109, 56, 0.34) 0%, transparent 68%),
        radial-gradient(46% 40% at 22% 78%, rgba(140, 169, 91, 0.20) 0%, transparent 70%);
    /* Perf: was blur(40px) + mix-blend-mode: screen, which re-blended the
       whole viewport every time the portrait canvas changed. The gradients
       already fade to transparent, so plain alpha looks the same. */
    opacity: calc(0.55 + (var(--p, 0) * 0.45));
    will-change: opacity;
}

/* Keep corner headlines legible while leaving the new portrait unobscured. */
.cine-scrim {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        radial-gradient(62% 52% at 96% 2%, rgba(28, 16, 9, 0.88) 0%, transparent 74%),
        radial-gradient(62% 54% at 4% 100%, rgba(28, 16, 9, 0.90) 0%, transparent 74%),
        radial-gradient(52% 46% at 100% 98%, rgba(28, 16, 9, 0.86) 0%, transparent 76%),
        radial-gradient(52% 46% at 0% 0%, rgba(28, 16, 9, 0.80) 0%, transparent 76%),
        linear-gradient(to bottom, rgba(28, 16, 9, 0.42) 0%, transparent 24%,
                                    transparent 48%, rgba(28, 16, 9, 0.25) 68%,
                                    rgba(28, 16, 9, 0.85) 100%);
}

/* Fine film grain, drawn as a repeating SVG noise — keeps the stage cinematic
   instead of flat-digital. */
.cine-grain {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    /* Normal blending at a lower opacity: overlay blending forced a
       full-viewport re-blend on every portrait frame. */
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* A quiet affordance for the mouse-led portrait. It disappears after the
   first real pointer movement so it never competes with the editorial type. */
.cine-interaction-hint {
    position: absolute;
    left: 50%;
    bottom: clamp(92px, 11vh, 122px);
    z-index: 9;
    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
    padding: 8px 12px;
    border: 1px solid rgba(251, 247, 240, 0.18);
    border-radius: var(--radius-full);
    background: rgba(18, 13, 9, 0.72);
    color: rgba(251, 247, 240, 0.72);
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    transform: translateX(-50%);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.cine-stage.is-pointer-live .cine-interaction-hint,
.cine-stage.has-seen-pointer .cine-interaction-hint {
    opacity: 0;
    transform: translateX(-50%) translateY(7px);
}

.cine-stage[data-portrait-state="loading"] .cine-interaction-hint {
    opacity: 1;
    transform: translateX(-50%);
}

.cine-interaction-orbit {
    position: relative;
    width: 22px;
    height: 14px;
    flex: 0 0 auto;
    border: 1px solid rgba(251, 247, 240, 0.34);
    border-radius: 50%;
}

.cine-interaction-orbit > span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-light, #E26D38);
    box-shadow: 0 0 10px rgba(226, 109, 56, 0.9);
    animation: cinePointerOrbit 2.6s ease-in-out infinite;
}

@keyframes cinePointerOrbit {
    0%, 100% { transform: translate(-50%, -50%); }
    20% { transform: translate(4px, -50%); }
    40% { transform: translate(-50%, -5px); }
    60% { transform: translate(-9px, -50%); }
    80% { transform: translate(-50%, 0); }
}

/* --- Corner-anchored display type ------------------------------------------ */
.cine-type {
    position: absolute;
    inset: 0;
    z-index: 6;
    padding: clamp(84px, 9vh, 130px) clamp(24px, 5vw, 78px) clamp(112px, 13vh, 150px);
    pointer-events: none;
    opacity: calc(1 - (var(--p, 0) / 0.42));
    transform: translateY(calc(var(--p, 0) * -34px));
    will-change: opacity, transform;
}

.cine-eyebrow {
    position: absolute;
    top: clamp(84px, 9vh, 130px);
    right: clamp(24px, 5vw, 78px);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: clamp(0.62rem, 0.78vw, 0.76rem);
    letter-spacing: 0.24em;
    color: var(--cine-ink-dim);
    direction: ltr;
}

.cine-eyebrow .cine-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-light, #E26D38);
    box-shadow: 0 0 12px 2px rgba(226, 109, 56, 0.85);
    animation: cineDotPulse 2.4s ease-in-out infinite;
}

@keyframes cineDotPulse {
    0%, 100% { opacity: 0.45; transform: scale(0.82); }
    50%      { opacity: 1;    transform: scale(1.15); }
}

.cine-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 0.94;
    letter-spacing: -0.035em;
    color: var(--cine-ink);
    text-shadow: 0 6px 40px rgba(10, 7, 5, 0.55);
}

.cine-title > span {
    position: absolute;
    display: block;
    font-size: clamp(2.6rem, 7.4vw, 7rem);
}

/* RTL mirror of the reference: the phrase opens top-right and lands bottom-left */
.cine-title .t-open {
    top: calc(clamp(84px, 9vh, 130px) + 34px);
    right: clamp(24px, 5vw, 78px);
    text-align: right;
}

.cine-title .t-close {
    bottom: clamp(112px, 13vh, 150px);
    left: clamp(24px, 5vw, 78px);
    text-align: left;
}

.cine-title .t-thin {
    display: block;
    font-size: 0.52em;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cine-ink-dim);
}

/* Small mono caption block, mirrored to the bottom-right */
.cine-lede {
    position: absolute;
    bottom: calc(clamp(112px, 13vh, 150px) + 6px);
    right: clamp(24px, 5vw, 78px);
    max-width: min(42ch, 32vw);
    font-size: clamp(0.78rem, 0.95vw, 0.94rem);
    font-weight: 400;
    letter-spacing: 0;
    line-height: 2.25;
    color: rgba(251, 247, 240, 0.84);
    text-align: right;
    text-shadow: 0 2px 16px rgba(10, 7, 5, 0.9);
}

/* --- Manifesto revealed as the stage recedes ------------------------------- */
.cine-manifesto {
    position: absolute;
    inset: 0;
    z-index: 7;
    opacity: calc((var(--p, 0) - 0.34) / 0.26);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 0 clamp(24px, 8vw, 140px);
    text-align: center;
    pointer-events: none;
}

.cine-manifesto-tag {
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--matcha-light, #8CA95B);
    direction: rtl;
}

.cine-manifesto-text {
    max-width: 62ch;
    font-size: clamp(1.05rem, 1.9vw, 1.85rem);
    font-weight: 700;
    line-height: 2.05;
    color: var(--cine-ink);
    text-shadow: 0 4px 30px rgba(10, 7, 5, 0.7);
}

/* Per-word reveal: JS sets --w (0..1) on the paragraph, each word carries --i */
/* Opacity-only wave: shifting each word vertically would break the baseline
   and leave the paragraph looking ragged mid-reveal. */
.cine-manifesto-text .w {
    display: inline-block;
    opacity: calc((var(--w, 0) * var(--n, 1)) - var(--i, 0));
}

/* --- Always-visible action dock -------------------------------------------- */
.cine-dock {
    position: absolute;
    left: 50%;
    bottom: clamp(18px, 3.2vh, 34px);
    transform: translateX(-50%);
    animation: cineDockIn 0.7s 0.35s var(--ease-out) both;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    max-width: calc(100% - 32px);
    border-radius: var(--radius-full);
    /* Opaque-ish glass instead of backdrop-filter: a backdrop blur over the
       live portrait canvas is recomputed on every frame of pointer motion. */
    background: rgba(18, 13, 9, 0.78);
    border: 1px solid rgba(251, 247, 240, 0.16);
    box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.8);
}

@keyframes cineDockIn {
    from { opacity: 0; transform: translateX(-50%) translateY(18px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.cine-dock-role {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px 0 6px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--cine-ink);
    white-space: nowrap;
    border-left: 1px solid rgba(251, 247, 240, 0.16);
}

.cine-dock-role .dynamic-text {
    color: var(--matcha-light, #8CA95B);
    border-left: 2px solid var(--matcha-light, #8CA95B);
    padding-left: 6px;
}

.cine-dock .btn {
    padding: 10px 18px;
    font-size: 0.92rem;
    white-space: nowrap;
}

.cine-dock .btn-ghost {
    background: transparent;
    border: 1px solid rgba(251, 247, 240, 0.22);
    color: var(--cine-ink);
}

.cine-dock .btn-ghost:hover {
    background: rgba(251, 247, 240, 0.12);
    border-color: rgba(251, 247, 240, 0.4);
    color: var(--cine-ink);
    transform: translateY(-2px);
}

.cine-dock-socials {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 6px;
    border-right: 1px solid rgba(251, 247, 240, 0.16);
}

.cine-dock-socials a {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.95rem;
    color: var(--cine-ink-dim);
    transition: var(--transition-fast);
}

.cine-dock-socials a:hover {
    color: var(--cine-ink);
    background: rgba(251, 247, 240, 0.14);
    transform: translateY(-2px);
}

@media (min-width: 993px) and (max-width: 1300px) {
    .nav-menu > ul { gap: 2px; padding: 5px 8px; }
    .nav-link { padding: 7px 9px; font-size: 0.86rem; }
    .header-actions .btn-sm { padding: 8px 14px; font-size: 0.86rem; }
}

/* --- Header treatment while it floats over the stage ------------------------ */
body:has(.cine-hero) .main-header:not(.scrolled) .logo,
body:has(.cine-hero) .main-header:not(.scrolled) .logo-text-bold {
    color: var(--cine-ink);
    text-shadow: 0 2px 18px rgba(10, 7, 5, 0.7);
}

body:has(.cine-hero) .main-header:not(.scrolled) .logo-text-light {
    color: var(--primary-light, #E26D38);
    text-shadow: 0 2px 18px rgba(10, 7, 5, 0.7);
}

body:has(.cine-hero) .main-header:not(.scrolled) .logo-mark-n {
    fill: var(--cine-ink);
}

body:has(.cine-hero) .main-header:not(.scrolled) .logo-mark-stache {
    fill: var(--primary-light, #E26D38);
}

body:has(.cine-hero) .main-header:not(.scrolled) .nav-menu > ul {
    background: rgba(18, 13, 9, 0.72);
    border-color: rgba(251, 247, 240, 0.16);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 12px 34px -16px rgba(0, 0, 0, 0.8);
}

body:has(.cine-hero) .main-header:not(.scrolled) .nav-link {
    color: var(--cine-ink-dim);
}

body:has(.cine-hero) .main-header:not(.scrolled) .nav-link:hover {
    color: var(--cine-ink);
    background: rgba(251, 247, 240, 0.12);
}

body:has(.cine-hero) .main-header:not(.scrolled) .theme-toggle-btn {
    color: var(--cine-ink);
    background: rgba(18, 13, 9, 0.72);
    border-color: rgba(251, 247, 240, 0.16);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body:has(.cine-hero) .main-header:not(.scrolled) .mobile-nav-toggle .bar {
    background: var(--cine-ink);
}

/* --- Scroll cue ------------------------------------------------------------ */
.cine-cue {
    position: absolute;
    right: clamp(24px, 5vw, 78px);
    bottom: clamp(112px, 13vh, 150px);
    z-index: 8;
    display: none;
}

/* --- Reduced motion & small screens: no choreography, plain editorial hero -- */
@media (prefers-reduced-motion: reduce) {
    .cine-hero { height: auto; }
    .cine-sticky { position: static; height: auto; }
    .cine-stage { transform: none; border-radius: 0; height: 100vh; }
    .cine-canvas { filter: none; transform: none; }
    .cine-interaction-hint { display: none; }
    .cine-type { opacity: 1; transform: none; }
    .cine-manifesto { position: static; opacity: 1; padding: 56px 24px 76px; background: var(--bg-surface); }
    .cine-manifesto-text { color: var(--text-primary); text-shadow: none; }
    .cine-manifesto-tag { color: var(--matcha); }
    .cine-manifesto-text .w { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
    .cine-hero { height: auto; }
    .cine-sticky { position: static; height: auto; }

    .cine-stage {
        height: min(78vh, 620px);
        transform: none;
        border-radius: 0;
        box-shadow: none;
    }

    .cine-video,
    .cine-canvas {
        filter: none;
        transform: none;
        will-change: auto;
    }

    /* Phones: the grain tile over a playing video is pure overhead. */
    .cine-grain { display: none; }

    .cine-interaction-hint { display: none; }

    .cine-aura { opacity: 0.7; }
    .cine-type { opacity: 1; transform: none; padding: 78px 20px 96px; }

    .cine-title span { font-size: clamp(2.3rem, 11vw, 3.4rem); }
    .cine-title .t-open { top: 104px; right: 20px; }
    .cine-title .t-close { bottom: 92px; left: 20px; }

    .cine-lede { display: none; }

    /* Manifesto drops below the stage as a normal editorial block */
    .cine-manifesto {
        position: static;
        opacity: 1;
        padding: 52px 22px 64px;
        background: var(--bg-surface);
        gap: 16px;
    }

    .cine-manifesto-text {
        color: var(--text-primary);
        text-shadow: none;
        font-size: 1.02rem;
        line-height: 2.1;
    }

    .cine-manifesto-text .w { opacity: 1; transform: none; }
    .cine-manifesto-tag { color: var(--matcha); }

    /* Dock unpins and becomes a stacked action block */
    .cine-dock {
        position: static;
        transform: none;
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin: 0 auto;
        padding: 16px;
        border-radius: 0;
        width: 100%;
        max-width: none;
        background: var(--bg-surface);
        border: none;
        border-bottom: 1px solid var(--border-subtle);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }

    .cine-dock-role {
        width: 100%;
        justify-content: center;
        border-left: none;
        padding: 0 0 4px;
        color: var(--text-primary);
    }

    .cine-dock-role .dynamic-text { color: var(--matcha); border-left-color: var(--matcha); }

    .cine-dock .btn-ghost { border-color: var(--border-medium); color: var(--text-primary); }
    .cine-dock .btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }

    .cine-dock-socials {
        border-right: none;
        padding-right: 0;
        gap: 2px;
        width: 100%;
        justify-content: center;
    }

    .cine-dock-socials a { color: var(--text-muted); }
    .cine-dock-socials a:hover { color: var(--primary); background: var(--bg-card-hover); }
}

/* ------------------------------------------------------------------------------
   22. Metrics Deck — a dark band that carries the hero's cinema through one more
   screen before the page opens into the light editorial sections.
   ------------------------------------------------------------------------------ */
.synapse-cards-section {
    position: relative;
    overflow: hidden;
    background: var(--cine-shell);
    color: var(--cine-ink);
    padding: 84px 0 40px;
    margin-top: -1px;
}

/* Warm accent haze, echoing the hero's aura */
.synapse-cards-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(52% 44% at 50% 22%, rgba(226, 109, 56, 0.22) 0%, transparent 70%),
        radial-gradient(44% 40% at 12% 88%, rgba(140, 169, 91, 0.14) 0%, transparent 72%);
}

/* Dissolve into the page background so the band has no hard seam */
.synapse-cards-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 110px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-base) 100%);
}

.synapse-cards-section > .container {
    position: relative;
    z-index: 2;
}

/* Section header inverted for the dark band */
.synapse-cards-section .section-title { color: var(--cine-ink); }
.synapse-cards-section .sub-title {
    color: var(--matcha-light, #8CA95B);
    background: rgba(140, 169, 91, 0.12);
    border-color: rgba(140, 169, 91, 0.28);
}
.synapse-cards-section .deck-hint {
    color: var(--cine-ink-dim);
    font-size: 0.95rem;
    margin-top: 10px;
}
.synapse-cards-section .title-line {
    background: linear-gradient(90deg, transparent, var(--primary-light, #E26D38), transparent);
}

/* --- Track ----------------------------------------------------------------- */
.synapse-carousel-viewport {
    width: 100%;
    overflow: hidden;
    padding: 46px 10px 30px;
    cursor: grab;
    user-select: none;
    perspective: 1500px;
    position: relative;
}

.synapse-carousel-viewport.grabbing { cursor: grabbing; }

.synapse-carousel-track {
    display: flex;
    gap: 26px;
    transition: transform 0.45s var(--ease-out);
    transform-style: preserve-3d;
    will-change: transform;
    padding: 12px 0;
}

/* --- Cards ----------------------------------------------------------------- */
.synapse-3d-card {
    flex: 0 0 clamp(268px, 24vw, 336px);
    width: clamp(268px, 24vw, 336px);
    min-height: 400px;
    padding: 30px 26px 26px;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background: linear-gradient(168deg, rgba(52, 38, 27, 0.92) 0%, rgba(24, 17, 12, 0.94) 100%);
    border: 1px solid rgba(251, 247, 240, 0.13);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 30px 60px -32px rgba(0, 0, 0, 0.95);
    color: var(--cine-ink);
    position: relative;
    overflow: hidden;
    opacity: 0.62;
    transition: opacity 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.synapse-3d-card:hover { opacity: 0.9; }

.synapse-3d-card.active {
    opacity: 1;
    border-color: rgba(226, 109, 56, 0.55);
    box-shadow: 0 44px 80px -34px rgba(0, 0, 0, 0.95),
                0 0 70px -14px rgba(226, 109, 56, 0.4);
    z-index: 3;
}

/* Accent hairline along the top edge of the focused card */
.synapse-3d-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-light, #E26D38), transparent);
}

.card-top-kicker {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: rgba(251, 247, 240, 0.48);
    text-transform: uppercase;
    margin-bottom: 18px;
    direction: ltr;
    text-align: right;
    unicode-bidi: isolate;
}

.card-big-metric {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 3vw, 3.1rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--cine-ink);
    margin-bottom: 10px;
    text-shadow: 0 4px 30px rgba(226, 109, 56, 0.35);
    -webkit-text-fill-color: currentColor;
    background: none;
}

.card-metric-label {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--primary-light, #E26D38);
    margin-bottom: 20px;
}

.card-feature-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    flex-grow: 1;
}

.card-feature-bullets li {
    font-size: 0.92rem;
    color: rgba(251, 247, 240, 0.74);
    margin-bottom: 10px;
    line-height: 1.85;
    position: relative;
    padding-right: 16px;
}

.card-feature-bullets li::before {
    content: '';
    position: absolute;
    top: 0.82em;
    right: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--matcha-light, #8CA95B);
    box-shadow: 0 0 8px rgba(140, 169, 91, 0.8);
}

.card-bottom-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    color: var(--matcha-light, #8CA95B);
    text-transform: uppercase;
    border-top: 1px solid rgba(251, 247, 240, 0.1);
    padding-top: 16px;
    direction: ltr;
    text-align: right;
    unicode-bidi: isolate;
}

/* --- Controls --------------------------------------------------------------- */
.synapse-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
    position: relative;
    z-index: 2;
}

.carousel-nav-btn {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background: rgba(251, 247, 240, 0.08);
    border: 1px solid rgba(251, 247, 240, 0.2);
    color: var(--cine-ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: var(--transition-normal);
}

.carousel-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--cream);
    transform: scale(1.08);
}

.carousel-nav-btn:disabled {
    opacity: 0.32;
    cursor: default;
    transform: none;
}

.carousel-nav-btn:disabled:hover {
    background: rgba(251, 247, 240, 0.08);
    border-color: rgba(251, 247, 240, 0.2);
    color: var(--cine-ink);
    transform: none;
}

.carousel-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    background: rgba(251, 247, 240, 0.26);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: var(--transition-normal);
}

.carousel-dot:hover { background: rgba(251, 247, 240, 0.5); }

.carousel-dot.active {
    width: 28px;
    background: var(--primary-light, #E26D38);
}

@media (max-width: 768px) {
    .synapse-cards-section { padding: 60px 0 90px; }

    .synapse-3d-card {
        flex: 0 0 84vw;
        width: 84vw;
        min-height: 360px;
        padding: 26px 22px 22px;
    }

    .card-big-metric { font-size: 2.3rem; }
}

/* ==============================================================================
   23. Site-wide refinements
   Tightens the vertical rhythm, gives headings the display face introduced by
   the hero, and unifies the card language across every section and page.
   ============================================================================== */

/* --- Rhythm ---------------------------------------------------------------- */
.section-padding {
    padding: clamp(64px, 8vw, 104px) 0;
}

.section-header {
    margin-bottom: clamp(36px, 4.5vw, 56px);
}

/* --- Headings --------------------------------------------------------------- */
.section-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.7rem, 3.1vw, 2.5rem);
    letter-spacing: -0.03em;
    line-height: 1.3;
}

.sub-title {
    font-size: 0.86rem;
    font-weight: 700;
    padding: 5px 15px;
    letter-spacing: 0;
}

.title-line {
    width: 44px;
    height: 3px;
    opacity: 0.9;
}

/* --- Shared button variant used by the hero dock and secondary CTAs --------- */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    color: var(--primary);
}

/* --- About: editorial portrait + full-width metric band --------------------- */
.about-grid {
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

.about-portrait {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

/* Offset accent block behind the photo — a printed-page gesture rather than
   another glow. */
.about-portrait::before {
    content: '';
    position: absolute;
    inset: 18px -18px -18px 18px;
    border-radius: var(--radius-xl);
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    z-index: 0;
}

.about-img-wrapper {
    position: relative;
    z-index: 1;
    max-width: none;
    box-shadow: var(--shadow-lg);
}

.about-img {
    display: block;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 50% 22%;
}

.about-portrait-cap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 22px;
    padding-right: 14px;
    border-right: 3px solid var(--primary);
}

.about-portrait-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.about-portrait-role {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.about-quote {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.9;
    margin-bottom: 26px;
}

.about-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: clamp(40px, 5vw, 64px);
}

.stat-card {
    padding: 26px 18px;
    border-radius: var(--radius-lg);
    text-align: right;
}

.stat-num {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2rem, 3vw, 2.6rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 8px;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--primary);
}

.stat-label {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (max-width: 992px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-portrait { margin-bottom: 12px; }
    .about-portrait::before { inset: 14px -14px -14px 14px; }
    .about-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .about-stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 20px 14px; }
}

/* --- Footer ----------------------------------------------------------------- */
.main-footer {
    position: relative;
}

.footer-logo {
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.footer-socials a:hover {
    transform: translateY(-3px);
}

/* --- Timeline: two-column cards --------------------------------------------- */
.timeline {
    max-width: 940px;
}

.timeline-item {
    margin-bottom: 26px;
}

.timeline-content {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 10px 34px;
    padding: 26px 28px;
    align-items: start;
}

.timeline-role {
    position: relative;
    padding-left: 26px;
}

.timeline-role::after {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 1px;
    background: var(--border-subtle);
}

.timeline-content h3 {
    font-size: 1.22rem;
    margin-bottom: 4px;
    line-height: 1.5;
}

.timeline-content .company {
    margin-bottom: 0;
    font-size: 0.98rem;
}

.timeline-tasks {
    margin: 0;
}

.timeline-tasks li {
    font-size: 0.98rem;
    margin-bottom: 8px;
}

.timeline-tasks li:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .timeline-content {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 22px 20px;
    }

    .timeline-role {
        padding-left: 0;
        padding-bottom: 14px;
    }

    .timeline-role::after {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: 1px;
    }
}

/* --- Section banding: alternating surfaces make the vertical rhythm legible -- */
.experience-section,
.activities-section {
    background: var(--bg-surface);
}

.about-section,
.skills-section,
.contact-section {
    background: var(--bg-base);
}

/* ==============================================================================
   24. Inner-page opening band — cinema variant (opt-in via .page-hero--cine)
   Kept for pages that want the homepage's dark stage; the default inner-page
   hero is now the light editorial one in section 26, so the dark cinema is a
   deliberate accent rather than the default.
   ============================================================================== */
.page-hero--cine {
    padding: clamp(140px, 17vh, 190px) 0 clamp(72px, 9vh, 104px);
    background: var(--cine-shell);
    color: var(--cine-ink);
    isolation: isolate;
}

.page-hero--cine::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(48% 58% at 78% 6%, rgba(226, 109, 56, 0.30) 0%, transparent 70%),
        radial-gradient(46% 52% at 16% 96%, rgba(140, 169, 91, 0.16) 0%, transparent 72%);
}

/* Same fine grain as the hero stage, plus a dissolve into the page below so the
   band has no hard seam. */
.page-hero--cine::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.13;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.page-hero--cine .breadcrumbs {
    background: rgba(251, 247, 240, 0.08);
    border-color: rgba(251, 247, 240, 0.18);
    color: var(--cine-ink-dim);
    font-size: 0.86rem;
    margin-bottom: 22px;
}

.page-hero--cine .breadcrumbs a { color: var(--primary-light, #E26D38); }
.page-hero--cine .breadcrumbs span { color: rgba(251, 247, 240, 0.45); }

.page-hero--cine .page-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    letter-spacing: -0.035em;
    line-height: 1.18;
    color: var(--cine-ink);
    text-shadow: 0 6px 40px rgba(10, 7, 5, 0.5);
}

.page-hero--cine .page-subtitle {
    color: var(--cine-ink-dim);
    max-width: 62ch;
    margin-left: auto;
    margin-right: auto;
}

.page-hero--cine .btn-secondary,
.page-hero--cine .btn-outline {
    background: rgba(251, 247, 240, 0.06);
    border: 1px solid rgba(251, 247, 240, 0.22);
    color: var(--cine-ink);
}

.page-hero--cine .btn-secondary:hover,
.page-hero--cine .btn-outline:hover {
    background: rgba(251, 247, 240, 0.14);
    border-color: rgba(251, 247, 240, 0.42);
    color: var(--cine-ink);
}

/* The floating header sits on this band too, so it needs the same inverted ink. */
.page-hero--cine .page-hero-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-base) 100%);
}

/* Keep the accent gradient warm on the dark band — the matcha stop goes muddy
   against it. */
.page-hero--cine .text-gradient {
    background: linear-gradient(120deg, var(--primary-light, #E26D38) 0%, var(--matcha-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body:has(.page-hero--cine) .main-header:not(.scrolled) .logo,
body:has(.page-hero--cine) .main-header:not(.scrolled) .logo-text-bold {
    color: var(--cine-ink);
    text-shadow: 0 2px 18px rgba(10, 7, 5, 0.7);
}

body:has(.page-hero--cine) .main-header:not(.scrolled) .logo-text-light {
    color: var(--primary-light, #E26D38);
}

body:has(.page-hero--cine) .main-header:not(.scrolled) .logo-mark-n {
    fill: var(--cine-ink);
}

body:has(.page-hero--cine) .main-header:not(.scrolled) .logo-mark-stache {
    fill: var(--primary-light, #E26D38);
}

body:has(.page-hero--cine) .main-header:not(.scrolled) .nav-menu > ul {
    background: rgba(18, 13, 9, 0.5);
    border-color: rgba(251, 247, 240, 0.16);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

body:has(.page-hero--cine) .main-header:not(.scrolled) .nav-link { color: var(--cine-ink-dim); }

body:has(.page-hero--cine) .main-header:not(.scrolled) .nav-link:hover {
    color: var(--cine-ink);
    background: rgba(251, 247, 240, 0.12);
}

body:has(.page-hero--cine) .main-header:not(.scrolled) .theme-toggle-btn {
    color: var(--cine-ink);
    background: rgba(18, 13, 9, 0.5);
    border-color: rgba(251, 247, 240, 0.16);
}

body:has(.page-hero--cine) .main-header:not(.scrolled) .mobile-nav-toggle .bar {
    background: var(--cine-ink);
}

/* The active nav pill keeps its filled treatment in both header states. */
body:has(.page-hero--cine) .main-header:not(.scrolled) .nav-link.active,
body:has(.cine-hero) .main-header:not(.scrolled) .nav-link.active {
    color: var(--cream);
    background: var(--primary);
}

/* ==============================================================================
   25. Homepage "Explore More" CTA grid
   Homepage now ends after the metrics deck; this grid is the funnel into the
   standalone pages that carry the rest of the site's content.
   ============================================================================== */
.explore-section {
    background: var(--bg-base);
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.explore-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 26px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.explore-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.explore-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: var(--gradient-badge);
    border: 1px solid var(--border-glow);
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 18px;
    transition: var(--transition-normal);
}

.explore-card:hover .explore-icon {
    background: var(--primary);
    color: var(--cream);
    transform: scale(1.08) rotate(-4deg);
}

.explore-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.explore-card p {
    font-size: 0.94rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 20px;
    flex-grow: 1;
}

.explore-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary);
    transition: var(--transition-fast);
}

.explore-card:hover .explore-link {
    gap: 12px;
}

@media (max-width: 560px) {
    .explore-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------------------
   24. حساب کاربری (ورود / ثبت‌نام / حساب من)
   ------------------------------------------------------------------------------ */

/* --- لینک‌های حساب کاربری در هدر (دسکتاپ) --- */
.auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: transparent;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.auth-link-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-card-highlight);
}

.auth-link-btn-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.auth-link-btn-primary:hover {
    background: var(--primary);
    color: #FFFBF5;
}

/* چیپ نام کاربر پس از ورود */
.auth-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 190px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-medium);
    background: var(--bg-surface);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.auth-user-chip i {
    color: var(--primary);
    font-size: 1.05rem;
}

.auth-user-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.auth-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.auth-logout-btn:hover {
    color: var(--rose);
    border-color: var(--rose);
    background: rgba(204, 90, 39, 0.1);
}

/* نسخهٔ منوی موبایل فقط در حالت موبایل نمایش داده می‌شود */
.nav-auth-mobile {
    display: none;
}

/* --- کارت فرم‌های احراز هویت --- */
.auth-section .auth-card {
    max-width: 620px;
    margin: 0 auto;
}

.auth-card-desc {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-bottom: 24px;
}

.auth-inline-link {
    color: var(--primary);
    font-weight: 700;
}

.auth-inline-link:hover {
    text-decoration: underline;
}

.field-required {
    color: var(--primary);
}

.auth-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--text-muted);
    background: var(--bg-card-highlight);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin: 0;
}

.auth-hint i {
    color: var(--matcha);
    margin-top: 4px;
}

/* چند خطی شدن باکس خطاها */
.form-status.error > div + div {
    margin-top: 6px;
}

/* --- جدول اطلاعات حساب در داشبورد --- */
.account-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.account-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.account-info-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
}

.account-info-label i {
    color: var(--primary);
}

.account-info-value {
    font-size: 1rem;
    color: var(--text-primary);
    text-align: left;
    word-break: break-word;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 768px) {
    /* در موبایل، لینک‌های هدر جای خود را به آیتم‌های منو می‌دهند */
    .auth-actions {
        display: none;
    }

    .nav-auth-mobile {
        display: block;
    }

    .account-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .account-info-value {
        text-align: right;
    }

    .account-actions .btn {
        width: 100%;
    }
}

/* --- هماهنگی لینک‌های حساب کاربری با هدر شفاف روی هیروی تیره --- */
body:has(.cine-hero) .main-header:not(.scrolled) .auth-link-btn,
body:has(.page-hero--cine) .main-header:not(.scrolled) .auth-link-btn,
body:has(.cine-hero) .main-header:not(.scrolled) .auth-logout-btn,
body:has(.page-hero--cine) .main-header:not(.scrolled) .auth-logout-btn,
body:has(.cine-hero) .main-header:not(.scrolled) .auth-user-chip,
body:has(.page-hero--cine) .main-header:not(.scrolled) .auth-user-chip {
    color: var(--cine-ink);
    background: rgba(18, 13, 9, 0.72);
    border-color: rgba(251, 247, 240, 0.16);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body:has(.cine-hero) .main-header:not(.scrolled) .auth-link-btn:hover,
body:has(.page-hero--cine) .main-header:not(.scrolled) .auth-link-btn:hover,
body:has(.cine-hero) .main-header:not(.scrolled) .auth-user-chip:hover,
body:has(.page-hero--cine) .main-header:not(.scrolled) .auth-user-chip:hover {
    background: rgba(251, 247, 240, 0.16);
    border-color: rgba(251, 247, 240, 0.35);
    color: var(--cine-ink);
}

body:has(.cine-hero) .main-header:not(.scrolled) .auth-user-chip i,
body:has(.page-hero--cine) .main-header:not(.scrolled) .auth-user-chip i {
    color: var(--primary-light, #E26D38);
}

/* در عرض‌های میانی، دکمه‌های حساب کاربری فشرده‌تر می‌شوند تا هدر شلوغ نشود */
@media (min-width: 769px) and (max-width: 1300px) {
    .auth-link-btn { padding: 7px 11px; font-size: 0.82rem; }
    .auth-user-chip { max-width: 140px; padding: 6px 11px; font-size: 0.82rem; }
    .auth-logout-btn { width: 34px; height: 34px; }
    .auth-actions { gap: 6px; }
}

/* ==============================================================================
   25. Creations — interactive learning lab
   The featured game card + Agentology sit in one row; the three workshops read
   as compact list-links under them so the section stays one visual unit.
   ============================================================================== */
.creations-body { padding-top: 12px; }
.category-header .sub-title { margin-bottom: 0; }

.lab-grid-featured {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 28px;
    margin-bottom: 20px;
}

.creation-card-featured {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(60% 70% at 100% 0%, var(--primary-glow) 0%, transparent 70%),
        radial-gradient(50% 60% at 0% 100%, var(--matcha-glow) 0%, transparent 70%),
        var(--bg-card);
    border-color: var(--border-glow);
}

.creation-card-featured .creation-title {
    font-size: clamp(1.55rem, 2.2vw, 1.9rem);
    letter-spacing: -0.02em;
}

.creation-card-featured .btn { align-self: flex-start; }

.creation-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.creation-facts li { display: inline-flex; align-items: center; gap: 8px; }
.creation-facts i { color: var(--matcha); }

.quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.quick-link:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.quick-link-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    color: var(--matcha);
    font-size: 1.15rem;
}

.quick-link-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quick-link-text strong { font-size: 1.08rem; font-weight: 700; }
.quick-link-text small { color: var(--text-secondary); font-size: 0.9rem; }

.quick-link-arrow {
    margin-right: auto;
    color: var(--primary);
    transition: var(--transition-fast);
}

.quick-link:hover .quick-link-arrow { transform: translateX(-4px); }

@media (max-width: 992px) {
    .lab-grid-featured { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: 1fr; }
}

/* ==============================================================================
   26. Inner-page hero — light editorial (default)
   One opening for every inner page: a quiet breadcrumb, a large display title,
   a short lede and, when needed, a row of actions. Same rhythm as the learning
   pages, so the whole site reads as one system; the dark cinema stays on the
   homepage where it belongs.
   ============================================================================== */
.page-hero {
    padding: clamp(128px, 15vh, 168px) 0 0;
    text-align: start;
    overflow: visible;
}

.page-hero .container {
    padding-bottom: clamp(36px, 5vh, 52px);
    border-bottom: 1px solid var(--border-medium);
}

.page-hero .page-hero-fade { display: none; }

.page-hero .breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: none;
    border: 0;
    padding: 0;
    margin-bottom: 26px;
    font-size: 0.98rem;
    color: var(--text-secondary);
    backdrop-filter: none;
}

.page-hero .breadcrumbs a { color: var(--primary); font-weight: 700; }
.page-hero .breadcrumbs span { color: var(--text-secondary); }
.page-hero .breadcrumbs span:last-child { color: var(--text-primary); }
.page-hero .breadcrumbs a + span { color: var(--text-dim); }

.page-hero .page-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.5rem, 5.4vw, 4.6rem);
    letter-spacing: -0.04em;
    line-height: 1.12;
    color: var(--text-primary);
    max-width: 18ch;
    margin: 0 0 22px;
    text-shadow: none;
}

.page-hero .page-subtitle {
    font-size: clamp(1.1rem, 1.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 58ch;
    margin: 0 0 30px;
    line-height: 1.85;
}

.page-hero .page-hero-actions,
.page-hero .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    margin: 0;
}

.page-hero .btn-secondary,
.page-hero .btn-outline {
    background: var(--bg-card);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.page-hero .btn-secondary:hover,
.page-hero .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-card-hover);
}

/* Compact variant for utility pages (login, register, dashboard, single post) */
.page-hero--compact { padding-top: clamp(112px, 13vh, 140px); }
.page-hero--compact .page-title { font-size: clamp(2rem, 4vw, 3.2rem); }
.page-hero--compact .container { padding-bottom: 28px; }

/* Content directly under the hero needs breathing room but not a double gap */
.page-hero + .section-padding { padding-top: clamp(48px, 6vw, 72px); }

@media (max-width: 768px) {
    .page-hero { padding-top: 108px; }
    .page-hero .page-title { font-size: 2.3rem; max-width: none; }
    .page-hero .breadcrumbs { margin-bottom: 18px; font-size: 0.9rem; }
    .page-hero .page-hero-actions .btn,
    .page-hero .hero-buttons .btn { width: 100%; }
}

/* Blog rhythm: channel strip sits tight under the hero, feed follows */
.blog-posts-section { padding-bottom: 20px; }
.blog-channels-section { padding-top: 0; padding-bottom: 0; }
.page-hero + .blog-channels-section { padding-top: clamp(40px, 5vw, 56px); }
.blog-feed-section { padding-top: clamp(48px, 6vw, 72px); }
.feed-load-more-container { margin-top: 50px; }

@media (max-width: 768px) {
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .category-title { font-size: 1.4rem; }
    .creation-card-featured .btn { width: 100%; }
}

/* ==============================================================================
   27. Accessibility baseline — one focus ring for the whole site, a skip link,
   and calmer motion for people who asked for it.
   ============================================================================== */
.skip-link {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2000;
    padding: 10px 18px;
    background: var(--primary);
    color: var(--cream);
    border-radius: var(--radius-md);
    font-weight: 700;
    box-shadow: var(--shadow-md);
    transform: translateY(-200%);
    transition: transform var(--transition-fast);
}

.skip-link:focus-visible { transform: none; outline: 3px solid var(--matcha); outline-offset: 3px; }

#content-start { position: relative; scroll-margin-top: 96px; }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--matcha);
    outline-offset: 3px;
    border-radius: 6px;
}

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible,
.newsletter-input:focus-visible {
    outline: 3px solid var(--matcha-glow);
    outline-offset: 0;
}

@media (prefers-reduced-motion: reduce) {
    [data-aos] { opacity: 1 !important; transform: none !important; transition: none !important; }
    .magnetic-btn, .spotlight-card { transition: none !important; }
    .scroll-progress-bar { transition: none !important; }
}

/* ==============================================================================
   28. Article body — everything the admin visual editor can produce
   (headings h1–h4, highlight, alignment, tables, code, captions, hr)
   ============================================================================== */
.post-content h1 { font-size: 1.9rem; font-weight: 800; color: var(--text-primary); margin: 44px 0 18px; line-height: 1.4; }
.post-content h4 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 26px 0 12px; }
.post-content h1:first-child, .post-content h2:first-child, .post-content h3:first-child { margin-top: 0; }
.post-content mark, .post-content span[style*="background"] { border-radius: 4px; padding: 0 3px; }
.post-content [style*="text-align: justify"] { text-align: justify; text-justify: inter-word; }
.post-content hr { border: 0; border-top: 1px solid var(--border-medium); margin: 36px auto; width: 40%; }
.post-content pre, .post-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.post-content code { background: var(--bg-surface); padding: 2px 6px; border-radius: 6px; }
.post-content pre { background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 16px 18px; border-radius: var(--radius-md); overflow-x: auto; direction: ltr; text-align: left; margin: 0 0 22px; }
.post-content pre code { background: none; padding: 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 0.98rem; display: block; overflow-x: auto; }
.post-content th, .post-content td { border: 1px solid var(--border-medium); padding: 10px 14px; vertical-align: top; }
.post-content th { background: var(--bg-surface); color: var(--text-primary); font-weight: 700; }
.post-content figure { margin: 26px 0; }
.post-content figure img { margin: 0; }
.post-content figcaption { font-size: 0.9rem; color: var(--text-muted); text-align: center; margin-top: 10px; }
.post-content img[style*="float: left"], .post-content img.align-left { float: left; margin: 6px 22px 16px 0; max-width: 45%; }
.post-content img[style*="float: right"], .post-content img.align-right { float: right; margin: 6px 0 16px 22px; max-width: 45%; }
.post-content::after { content: ''; display: table; clear: both; }
.post-content u { text-underline-offset: 4px; }
.post-content s, .post-content del { opacity: 0.7; }
.post-content sub, .post-content sup { font-size: 0.75em; }

/* ------------------------------------------------------------------------------
   Perf-lite mode (set on <html> by script.js on weak hardware or when the
   first second after load runs under ~30fps). Keeps the design, drops the
   GPU-heavy extras: backdrop blur, grain, auras, cursor glow.
   ------------------------------------------------------------------------------ */
.perf-lite *,
.perf-lite *::before,
.perf-lite *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.perf-lite .aura,
.perf-lite .cine-grain,
.perf-lite .cine-aura { display: none; }
.perf-lite .cursor-outline { filter: none; }
.perf-lite .cine-sticky.is-defocus .cine-video,
.perf-lite .cine-sticky.is-defocus .cine-canvas { filter: brightness(calc(1 - (var(--blur-p, 0) * 0.35))); }
