/* ==========================================================================
   Irfandi Abdillah — Editorial Minimalist Portfolio
   Blue-White Frosted Glass · Swiss Asymmetry · Smooth Scroll Animations
   ========================================================================== */

:root {
    /* Light Mode — Crisp Paper White & Deep Oxford Blue */
    --bg-base: #f7f9fc;
    --bg-secondary: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-bg-strong: rgba(255, 255, 255, 0.86);
    --glass-bg-subtle: rgba(255, 255, 255, 0.52);
    --glass-border: rgba(15, 23, 42, 0.08);
    --glass-border-blue: rgba(29, 78, 216, 0.18);
    --glass-border-highlight: rgba(255, 255, 255, 0.96);
    --glass-shadow: 0 10px 30px -12px rgba(15, 32, 68, 0.07), 0 1px 3px rgba(15, 23, 42, 0.03);
    --glass-shadow-hover: 0 18px 38px -14px rgba(29, 78, 216, 0.14), 0 2px 6px rgba(15, 23, 42, 0.04);

    --text-primary: #0c1524;
    --text-secondary: #42526b;
    --text-muted: #6e7f96;

    --accent-primary: #1d4ed8;
    --accent-primary-hover: #1e40af;
    --accent-soft: rgba(29, 78, 216, 0.075);
    --accent-soft-strong: rgba(29, 78, 216, 0.13);
    --accent-gradient: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);

    --orb-1: rgba(37, 99, 235, 0.13);
    --orb-2: rgba(56, 189, 248, 0.11);

    --hairline: rgba(15, 23, 42, 0.085);
    --input-bg: rgba(255, 255, 255, 0.85);
    --input-border: rgba(15, 23, 42, 0.13);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Newsreader', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-notch-spring: cubic-bezier(0.22, 1.2, 0.36, 1);

    /* Adaptive Notch Bar Tokens (Dark Navy-Ink Bar on White/Blue Page) */
    --notch-bg: #091122;
    --notch-fg: #f8fafc;
    --notch-muted: #94a3b8;
    --notch-hover-fg: #e2e8f0;
    --notch-pill-bg: #1d4ed8;
    --notch-pill-fg: #ffffff;
    --notch-slot-bg: #172542;
    --notch-dropdown-hover: #13203a;
    --bezel-size: 8px;
}

html[data-theme="dark"] {
    /* Dark Mode — Deep Ink Navy & Smoked Glass */
    --bg-base: #070c16;
    --bg-secondary: #0c1424;
    --glass-bg: rgba(13, 22, 39, 0.68);
    --glass-bg-strong: rgba(15, 25, 45, 0.84);
    --glass-bg-subtle: rgba(15, 25, 45, 0.45);
    --glass-border: rgba(148, 163, 184, 0.12);
    --glass-border-blue: rgba(96, 165, 250, 0.25);
    --glass-border-highlight: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 14px 36px -12px rgba(2, 6, 18, 0.65);
    --glass-shadow-hover: 0 20px 42px -12px rgba(37, 99, 235, 0.22);

    --text-primary: #eef3fb;
    --text-secondary: #a6b6cf;
    --text-muted: #6f829e;

    --accent-primary: #60a5fa;
    --accent-primary-hover: #93c5fd;
    --accent-soft: rgba(96, 165, 250, 0.1);
    --accent-soft-strong: rgba(96, 165, 250, 0.18);
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);

    --orb-1: rgba(29, 78, 216, 0.2);
    --orb-2: rgba(14, 165, 233, 0.11);

    --hairline: rgba(148, 163, 184, 0.12);
    --input-bg: rgba(10, 18, 34, 0.78);
    --input-border: rgba(148, 163, 184, 0.18);

    /* Inverted Ice-White Notch Bar on Dark Navy Page */
    --notch-bg: #e5edf8;
    --notch-fg: #091122;
    --notch-muted: #4b5c77;
    --notch-hover-fg: #091122;
    --notch-pill-bg: #1d4ed8;
    --notch-pill-fg: #ffffff;
    --notch-slot-bg: #cbd8ec;
    --notch-dropdown-hover: #d3dff2;
}

@view-transition {
    navigation: auto;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: clip;
    transition: background-color 0.35s ease, color 0.35s ease;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.028em;
    font-weight: 600;
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.mono-inline {
    font-family: var(--font-mono);
    font-size: 0.82em;
    letter-spacing: -0.01em;
}

.container {
    width: min(1080px, calc(100% - 2.5rem));
    margin-inline: auto;
}

.section-pad {
    padding-block: 4.5rem;
    position: relative;
    z-index: 1;
}

.section-divider {
    border-top: 1px solid var(--hairline);
}

/* ==========================================================================
   Soft Atmospheric Light Canvas (No Busy Grid)
   ========================================================================== */
.ambient-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    will-change: transform;
}

.orb-primary {
    width: 640px;
    height: 520px;
    top: -190px;
    right: -120px;
    background: radial-gradient(circle, var(--orb-1) 0%, transparent 72%);
}

.orb-secondary {
    width: 580px;
    height: 580px;
    top: 42%;
    left: -210px;
    background: radial-gradient(circle, var(--orb-2) 0%, transparent 72%);
}

/* Scroll Progress Line */
.scroll-progress-track {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 130;
    background: transparent;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    transition: width 0.08s linear;
}

/* ==========================================================================
   Frosted Glass Surfaces
   ========================================================================== */
.glass-surface {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    border: 1px solid var(--glass-border);
    box-shadow:
        inset 0 1px 0 0 var(--glass-border-highlight),
        var(--glass-shadow);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    box-shadow:
        inset 0 1px 0 0 var(--glass-border-highlight),
        var(--glass-shadow);
    border-radius: var(--radius-lg);
    transition:
        transform 0.38s var(--ease-spring),
        box-shadow 0.35s ease,
        border-color 0.28s ease,
        background-color 0.3s ease;
}

.glass-card:hover {
    border-color: var(--glass-border-blue);
    box-shadow:
        inset 0 1px 0 0 var(--glass-border-highlight),
        var(--glass-shadow-hover);
}

/* ==========================================================================
   Shared Primitives (Used by Admin & Inner Pages)
   ========================================================================== */
.brand-monogram {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--text-primary);
    color: var(--bg-secondary);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.78rem;
    display: grid;
    place-items: center;
    letter-spacing: -0.02em;
}

.icon-glass-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-subtle);
    color: var(--text-secondary);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-glass-btn:hover {
    color: var(--text-primary);
    border-color: var(--glass-border-blue);
}

.icon-glass-btn svg {
    width: 16px;
    height: 16px;
}

html[data-theme="light"] .icon-moon { display: block; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }

/* ==========================================================================
   Adaptive Notch Navigation Bar & Viewport Frame
   ========================================================================== */
.has-notch-nav .page-shell {
    padding-top: 3.4rem;
    padding-inline: var(--bezel-size);
}

.has-notch-nav .site-footer {
    padding-inline: var(--bezel-size);
    padding-bottom: calc(2.25rem + var(--bezel-size));
}

/* Fixed Viewport Perimeter Bezel (p-0 md:p-2) */
.notch-viewport-frame {
    position: fixed;
    inset: 0;
    z-index: 108;
    pointer-events: none;
    color: var(--notch-bg);
    transition: color 0.25s ease;
}

.frame-edge {
    position: fixed;
    background: var(--notch-bg);
    transition: background-color 0.25s ease;
}

.frame-top {
    top: 0;
    left: 0;
    right: 0;
    height: var(--bezel-size);
}

.frame-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bezel-size);
}

.frame-left {
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--bezel-size);
}

.frame-right {
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--bezel-size);
}

/* Concave SVG Wings */
.notch-wing {
    position: absolute;
    width: 16px;
    height: 16px;
    overflow: visible;
    pointer-events: none;
    user-select: none;
    color: var(--notch-bg);
    transition: color 0.25s ease;
}

.notch-wing-left {
    right: 100%;
    top: 0;
}

.notch-wing-right {
    left: 100%;
    top: 0;
}

.notch-corner-tl {
    left: 0;
    top: 100%;
}

.notch-corner-tr {
    right: 0;
    top: 100%;
}

/* Frame Inner Rounded Corners */
.frame-bottom-corners .notch-corner-bl {
    position: fixed;
    bottom: var(--bezel-size);
    left: var(--bezel-size);
}

.frame-bottom-corners .notch-corner-br {
    position: fixed;
    bottom: var(--bezel-size);
    right: var(--bezel-size);
}

.frame-tablet-corners {
    display: none;
}

.frame-tablet-corners .notch-corner-tl {
    position: fixed;
    top: var(--bezel-size);
    left: var(--bezel-size);
}

.frame-tablet-corners .notch-corner-tr {
    position: fixed;
    top: var(--bezel-size);
    right: var(--bezel-size);
}

/* Base Notch Surface */
.notch-surface {
    position: fixed;
    top: var(--bezel-size);
    z-index: 118;
    background: var(--notch-bg);
    color: var(--notch-fg);
    user-select: none;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* 1. Desktop Left Logo Notch */
.notch-desktop-logo {
    left: var(--bezel-size);
    height: 40px;
    padding: 0 20px;
    border-bottom-right-radius: 24px;
    display: flex;
    align-items: flex-start;
}

/* 2. Desktop Center Menu Notch */
.notch-desktop-center {
    left: 50%;
    transform: translateX(-50%);
    height: 44px;
    padding: 0 16px;
    border-radius: 0 0 24px 24px;
    display: flex;
    align-items: flex-start;
}

/* 3. Desktop Right Action Notch */
.notch-desktop-right {
    right: var(--bezel-size);
    height: 40px;
    padding: 0 20px;
    border-bottom-left-radius: 24px;
    display: flex;
    align-items: flex-start;
}

/* Logo & Action Slots */
.notch-logo-slot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    color: var(--notch-fg);
}

.notch-logo-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--notch-slot-bg);
    color: var(--notch-fg);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    display: grid;
    place-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.notch-logo-name,
.notch-logo-name-sm {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.notch-actions-slot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
}

.notch-icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: var(--notch-slot-bg);
    color: var(--notch-fg);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notch-icon-circle:hover {
    opacity: 0.88;
    transform: scale(1.04);
}

.notch-icon-circle svg {
    width: 14px;
    height: 14px;
}

.notch-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--notch-muted);
    transition: color 0.2s ease;
}

.notch-admin-link:hover {
    color: var(--notch-hover-fg);
}

.notch-admin-icon {
    width: 14px;
    height: 14px;
}

/* Desktop Center Nav Items & Spring Pill */
.notch-items-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notch-active-pill {
    position: absolute;
    top: 0;
    left: 0;
    height: 36px;
    border-radius: 999px;
    background: var(--notch-pill-bg);
    transition:
        transform 0.4s var(--ease-notch-spring),
        width 0.36s var(--ease-notch-spring),
        opacity 0.2s ease;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
}

.notch-item {
    position: relative;
    z-index: 1;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 0.855rem;
    font-weight: 500;
    color: var(--notch-muted);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.notch-item:hover {
    color: var(--notch-hover-fg);
}

.notch-item.is-active,
.notch-item.is-pill-target {
    color: var(--notch-pill-fg);
    font-weight: 600;
}

.notch-item-inner {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1;
}

.notch-item-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* 4. Tablet & Mobile Single Compact Notch Island (< 1280px) */
.notch-compact-island {
    display: none;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 16px;
    border-radius: 0 0 24px 24px;
    flex-direction: column;
    width: auto;
    min-width: min(320px, calc(100vw - 40px));
    max-width: calc(100vw - 28px);
}

.notch-compact-bar {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.notch-dropdown-trigger {
    border: none;
    background: transparent;
    color: var(--notch-fg);
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.notch-dropdown-trigger:hover {
    background: var(--notch-dropdown-hover);
}

.notch-trigger-icon {
    width: 15px;
    height: 15px;
    color: var(--notch-muted);
}

.notch-chevron {
    width: 14px;
    height: 14px;
    color: var(--notch-muted);
    transition: transform 0.22s ease;
}

.notch-compact-island.is-open .notch-chevron {
    transform: rotate(180deg);
}

/* Expandable Grid-Row Dropdown Drawer */
.notch-dropdown-drawer {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    pointer-events: none;
    transition: grid-template-rows 0.22s ease-out, opacity 0.2s ease-out;
    width: 100%;
}

.notch-compact-island.is-open .notch-dropdown-drawer {
    grid-template-rows: 1fr;
    opacity: 1;
    pointer-events: auto;
}

.notch-dropdown-inner {
    overflow: hidden;
}

.notch-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 2px 10px;
}

.notch-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--notch-muted);
    transition: background-color 0.18s ease, color 0.18s ease;
}

.notch-dropdown-item:hover {
    background: var(--notch-dropdown-hover);
    color: var(--notch-hover-fg);
}

.notch-dropdown-item.is-selected {
    background: var(--notch-pill-bg);
    color: var(--notch-pill-fg);
    font-weight: 600;
}

.notch-dropdown-item-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.notch-dropdown-icon {
    width: 15px;
    height: 15px;
}

.notch-check-icon {
    width: 14px;
    height: 14px;
}

/* Dropdown Blur Backdrop */
.notch-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 112;
    background: rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}

.notch-dropdown-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Notch Breakpoints (Matches xl: 1280px & md: 768px in TSX) */
@media (max-width: 1279px) {
    .notch-desktop-logo,
    .notch-desktop-center,
    .notch-desktop-right {
        display: none;
    }

    .notch-compact-island {
        display: flex;
    }

    .frame-tablet-corners {
        display: block;
    }
}

@media (max-width: 767px) {
    :root {
        --bezel-size: 0px;
    }

    .notch-wing {
        width: 11px;
        height: 11px;
    }

    .frame-tablet-corners,
    .frame-bottom-corners {
        display: none;
    }

    .notch-logo-name-sm {
        display: none;
    }
}

/* ==========================================================================
   Buttons & Inline Links
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.66rem 1.15rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.24s var(--ease-spring);
    white-space: nowrap;
}

.btn svg {
    width: 15px;
    height: 15px;
}

.btn-sm {
    padding: 0.46rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 4px 14px -3px rgba(29, 78, 216, 0.35);
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

html[data-theme="dark"] .btn-primary {
    background: #2563eb;
    color: #ffffff;
}

html[data-theme="dark"] .btn-primary:hover {
    background: #3b82f6;
}

.btn-glass {
    background: var(--glass-bg-strong);
    color: var(--text-primary);
    border-color: var(--glass-border);
    backdrop-filter: blur(12px);
}

.btn-glass:hover {
    border-color: var(--glass-border-blue);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--glass-border);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--accent-soft);
}

.copy-mini-btn {
    padding: 0.22rem 0.54rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

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

/* ==========================================================================
   Page Shell & Editorial Layout Grid
   ========================================================================== */
.page-shell {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 200px);
}

/* Editorial Asymmetric Split (Left Label / Right Content) */
.editorial-split {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
}

.split-label {
    position: sticky;
    top: 96px;
}

.split-index {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--accent-primary);
    margin-bottom: 0.35rem;
}

.split-label h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.split-label p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.split-label-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent-primary);
}

.split-label-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Editorial Hero (Home) — Grounded, Clean, Zero AI Clutter
   ========================================================================== */
.editorial-hero {
    padding-top: 3.5rem;
    padding-bottom: 3.25rem;
}

.hero-top-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 2.75rem;
    align-items: center;
}

.hero-kicker {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--accent-primary);
    margin-bottom: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-kicker::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--accent-primary);
}

.hero-title {
    font-size: clamp(2.25rem, 4.2vw, 3.35rem);
    font-weight: 700;
    letter-spacing: -0.036em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.hero-lead {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 2vw, 1.48rem);
    line-height: 1.45;
    color: var(--text-primary);
    font-weight: 400;
    margin-bottom: 1rem;
    max-width: 52ch;
}

.hero-bio-text {
    font-size: 0.96rem;
    color: var(--text-secondary);
    max-width: 60ch;
    margin-bottom: 1.75rem;
    line-height: 1.7;
}

.hero-actions-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0;
}

/* Minimalist Portrait Card on Right */
.portrait-glass-panel {
    padding: 0.9rem;
}

.portrait-box {
    width: 100%;
    aspect-ratio: 4 / 4.15;
    border-radius: 13px;
    overflow: hidden;
    margin-bottom: 0.95rem;
    border: 1px solid var(--glass-border);
    background: var(--accent-soft);
    display: grid;
    place-items: center;
}

.portrait-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.portrait-initials {
    font-family: var(--font-serif);
    font-size: 3.25rem;
    color: var(--accent-primary);
}

.portrait-meta-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-inline: 0.25rem;
}

.portrait-meta-row {
    padding-top: 0.55rem;
    border-top: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.portrait-meta-row:first-child {
    border-top: none;
    padding-top: 0;
}

.portrait-meta-row span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.portrait-meta-row strong {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.portrait-meta-row small,
.portrait-meta-row a {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.portrait-meta-row a:hover {
    color: var(--accent-primary);
}

/* Frosted Glass Ledger Strip (Academic & Affiliation Bar) */
.affiliation-strip {
    margin-top: 2rem;
    padding: 1.15rem 1.4rem;
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1.1fr;
    gap: 1.5rem;
    border-radius: var(--radius-md);
}

.strip-col {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.strip-col + .strip-col {
    border-left: 1px solid var(--hairline);
    padding-left: 1.5rem;
}

.strip-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.strip-col strong {
    font-size: 0.9rem;
    font-weight: 600;
}

.strip-col small {
    font-size: 0.81rem;
    color: var(--text-secondary);
}

.inline-index-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.15rem;
}

.inline-index-links a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent-primary);
    border-bottom: 1px solid rgba(29, 78, 216, 0.25);
    padding-bottom: 1px;
    transition: border-color 0.2s ease;
}

.inline-index-links a:hover {
    border-color: var(--accent-primary);
}

/* ==========================================================================
   Inner Page Header (Editorial, Clean, Unboxed)
   ========================================================================== */
.page-intro {
    padding-top: 3.5rem;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--hairline);
}

.page-intro-grid {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.page-intro h1 {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.032em;
    margin-bottom: 0.55rem;
}

.page-intro p {
    color: var(--text-secondary);
    max-width: 58ch;
    font-size: 0.98rem;
}

.section-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.section-title {
    font-size: clamp(1.5rem, 2.5vw, 1.95rem);
    font-weight: 600;
}

.section-subtitle {
    color: var(--text-secondary);
    max-width: 56ch;
    font-size: 0.93rem;
    margin-top: 0.35rem;
}

.section-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

/* ==========================================================================
   Research & Publications (Editorial Scholarly Entries)
   ========================================================================== */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.publication-card {
    padding: 1.5rem 1.7rem;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: start;
}

.publication-card:hover {
    transform: translateY(-2px);
}

.pub-index {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.35rem;
    color: var(--accent-primary);
    line-height: 1.2;
    padding-top: 0.1rem;
}

.pub-meta-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
}

.pub-role {
    font-weight: 600;
    color: var(--accent-primary);
}

.pub-sep {
    color: var(--text-muted);
}

.pub-type-text {
    color: var(--text-secondary);
}

.pub-date {
    color: var(--text-muted);
}

.pub-title {
    font-family: var(--font-serif);
    font-size: 1.24rem;
    font-weight: 500;
    line-height: 1.38;
    letter-spacing: -0.012em;
    margin-bottom: 0.4rem;
}

.pub-title a:hover {
    color: var(--accent-primary);
}

.pub-venue {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
}

.pub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-chip {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.16rem 0.52rem;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--text-secondary);
}

.pub-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: flex-end;
}

/* ==========================================================================
   Scroll-Driven Timeline (Experience & Education)
   ========================================================================== */
.timeline-track {
    position: relative;
    padding-left: 1.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.timeline-line-bg {
    position: absolute;
    left: 5px;
    top: 10px;
    bottom: 10px;
    width: 1.5px;
    background: var(--hairline);
}

.timeline-line-fill {
    position: absolute;
    left: 5px;
    top: 10px;
    width: 1.5px;
    height: 0%;
    background: var(--accent-primary);
    transition: height 0.12s linear;
}

.timeline-item {
    position: relative;
    padding: 1.25rem 1.45rem;
}

.timeline-dot {
    position: absolute;
    left: -1.85rem;
    top: 1.55rem;
    transform: translateX(0.5px);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 2px solid var(--text-muted);
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item.is-active-node .timeline-dot,
.timeline-item.is-current .timeline-dot {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-soft-strong);
}

.timeline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.timeline-period {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.active-pill {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.14rem 0.5rem;
    border-radius: 5px;
    background: var(--accent-soft-strong);
    color: var(--accent-primary);
}

.timeline-role {
    font-size: 1.02rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.timeline-org {
    font-size: 0.87rem;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.timeline-org span {
    color: var(--text-muted);
}

.timeline-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   Certificates Ledger Grid
   ========================================================================== */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.cert-card {
    padding: 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cert-card:hover {
    transform: translateY(-2px);
}

.cert-thumb {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: #ffffff;
}

.cert-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.cert-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
}

.cert-issuer {
    font-weight: 600;
    color: var(--accent-primary);
}

.cert-year {
    color: var(--text-muted);
}

.cert-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
}

.cert-credential-box {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.65rem;
    border-radius: 7px;
    background: var(--glass-bg-subtle);
    border: 1px solid var(--hairline);
    font-size: 0.76rem;
    color: var(--text-muted);
}

.cert-credential-box code {
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cert-footer {
    padding-top: 0.55rem;
    border-top: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.cert-verify-link {
    font-weight: 500;
    color: var(--accent-primary);
}

.cert-verify-link:hover {
    text-decoration: underline;
}

.cert-verified-label {
    color: var(--text-muted);
    font-size: 0.76rem;
}

/* ==========================================================================
   Featured Slide Showcase (Clean Swiss Specimen — No Fake Browser Dots!)
   ========================================================================== */
.featured-slider-wrapper {
    padding: 1.35rem 1.5rem 1.5rem;
    margin-bottom: 2.5rem;
    overflow: hidden;
}

.slider-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--hairline);
}

.slider-label-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.slider-counter {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--accent-primary);
}

.slider-caption {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.slider-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-subtle);
    color: var(--text-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider-nav-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.slider-nav-btn svg {
    width: 15px;
    height: 15px;
}

.slider-dots {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    border: none;
    background: var(--hairline);
    cursor: pointer;
    transition: all 0.32s var(--ease-spring);
}

.slider-dot.active {
    width: 20px;
    background: var(--accent-primary);
}

.slider-viewport {
    overflow: hidden;
}

.slider-track {
    display: flex;
    transition: transform 0.62s var(--ease-spring);
    will-change: transform;
}

.slide-item {
    flex: 0 0 100%;
    min-width: 100%;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}

.slide-visual {
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 9.6;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-subtle);
}

.slide-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Architectural Typographic Specimen (Replaces fake window dots) */
.specimen-sheet {
    width: 100%;
    height: 100%;
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at 88% 18%, var(--accent-soft-strong) 0%, transparent 55%),
        linear-gradient(180deg, var(--glass-bg-strong) 0%, var(--glass-bg-subtle) 100%);
    position: relative;
}

.specimen-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 0.65rem;
}

.specimen-title-wrap {
    margin-block: auto;
    padding-block: 0.75rem;
}

.specimen-title-wrap strong {
    display: block;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(1.6rem, 2.5vw, 2.15rem);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.specimen-title-wrap small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.specimen-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-primary);
}

.slide-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
}

.slide-details h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.slide-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.slide-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   Sliding Filter Tabs & Projects Grid
   ========================================================================== */
.filter-bar-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sliding-tabs {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem;
    border-radius: 10px;
}

.sliding-pill-indicator {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    height: calc(100% - 0.6rem);
    border-radius: 7px;
    background: var(--text-primary);
    transition: transform 0.36s var(--ease-spring), width 0.36s var(--ease-spring);
    z-index: 0;
    pointer-events: none;
}

.filter-tab {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.83rem;
    font-weight: 500;
    padding: 0.44rem 0.9rem;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    transition: color 0.22s ease;
}

.filter-tab.active {
    color: var(--bg-secondary);
}

.tab-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    opacity: 0.72;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-card.is-hidden {
    display: none;
}

.project-card.slide-in-anim {
    animation: cardSlideIn 0.45s var(--ease-spring) both;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-preview {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-bottom: 1px solid var(--hairline);
    background: var(--glass-bg-subtle);
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.55s var(--ease-out-expo);
}

.project-card:hover .project-preview img {
    transform: scale(1.04);
}

.project-placeholder {
    width: 100%;
    height: 100%;
    padding: 1.05rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at 90% 12%, var(--accent-soft-strong) 0%, transparent 60%),
        var(--glass-bg-subtle);
    transition: background-color 0.3s ease;
}

.placeholder-top-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.placeholder-brand strong {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.32rem;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.placeholder-brand small {
    font-family: var(--font-mono);
    font-size: 0.71rem;
    color: var(--accent-primary);
}

.project-body {
    padding: 1.15rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.project-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
}

.project-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    line-height: 1.58;
}

.project-footer {
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--hairline);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-primary);
}

.project-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Contact & Forms
   ========================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3rem;
    align-items: start;
}

.contact-ledger {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--hairline);
}

.ledger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--hairline);
}

.ledger-row-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ledger-row-left span {
    font-family: var(--font-mono);
    font-size: 0.71rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ledger-row-left a {
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.ledger-row-left a:hover {
    color: var(--accent-primary);
}

.contact-form-panel {
    padding: 1.85rem;
}

.contact-form-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.form-helper {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.35rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.9rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.68rem 0.88rem;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-alert {
    padding: 0.72rem 0.95rem;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.form-alert.is-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #059669;
}
html[data-theme="dark"] .form-alert.is-success { color: #34d399; }

.form-alert.is-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #dc2626;
}
html[data-theme="dark"] .form-alert.is-error { color: #f87171; }

/* ==========================================================================
   Footer & Toast
   ========================================================================== */
.site-footer {
    position: relative;
    z-index: 1;
    padding-top: 2rem;
    padding-bottom: 2.5rem;
}

.footer-inner {
    padding: 1.35rem 1.65rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand strong {
    font-size: 0.92rem;
    font-weight: 600;
}

.footer-brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.15rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-copy {
    width: 100%;
    padding-top: 0.85rem;
    border-top: 1px solid var(--hairline);
    font-size: 0.76rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.glass-toast {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 200;
    padding: 0.62rem 1rem;
    border-radius: 8px;
    background: var(--text-primary);
    color: var(--bg-secondary);
    box-shadow: var(--glass-shadow-hover);
    font-size: 0.82rem;
    font-weight: 500;
    animation: toastSlideUp 0.26s var(--ease-spring);
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Scroll Animation Engine ([data-scroll] + Optical De-blur + Stagger)
   ========================================================================== */
[data-scroll],
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 0;
    will-change: transform, opacity, filter;
    transition:
        opacity 0.78s var(--ease-out-expo),
        transform 0.78s var(--ease-out-expo),
        filter 0.65s var(--ease-out-expo);
    transition-delay: var(--delay, var(--stagger, 0ms));
}

[data-scroll="up"],
.reveal-up {
    transform: translate3d(0, 38px, 0);
    filter: blur(5px);
}

[data-scroll="left"],
.reveal-left {
    transform: translate3d(-38px, 0, 0);
    filter: blur(4px);
}

[data-scroll="right"],
.reveal-right {
    transform: translate3d(38px, 0, 0);
    filter: blur(4px);
}

[data-scroll="scale"] {
    transform: translate3d(0, 28px, 0) scale(0.955);
    filter: blur(5px);
}

[data-scroll].is-visible,
.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    [data-scroll],
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
    .hero-top-row,
    .editorial-split,
    .contact-grid,
    .slide-item {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .portrait-glass-panel {
        max-width: 360px;
    }

    .split-label {
        position: static;
    }

    .affiliation-strip {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .strip-col + .strip-col {
        border-left: none;
        border-top: 1px solid var(--hairline);
        padding-left: 0;
        padding-top: 0.9rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .publication-card {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .pub-actions {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .section-pad {
        padding-block: 3.25rem;
    }

    .certificates-grid,
    .projects-grid,
    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .sliding-pill-indicator {
        display: none;
    }

    .filter-tab.active {
        background: var(--text-primary);
    }
}


/* ==========================================================================
   Scroll-Stacking Project Deck (3D Pinned Cards + Cut-Out Corner Visit)
   ========================================================================== */
.project-deck {
    position: relative;
    width: 100%;
    height: calc(max(1, var(--deck-count, 4)) * 95svh);
}

.project-deck-stage {
    position: sticky;
    top: 0;
    height: 100svh;
    display: grid;
    place-items: center;
    overflow: hidden;
    perspective: 1800px;
    padding-inline: clamp(1.1rem, 4vw, 3.25rem);
}

.deck-card-item {
    grid-column: 1;
    grid-row: 1;
    margin-top: 4.5svh;
    width: min(100%, calc(78svh * 16 / 9), 1260px);
    transform-origin: 50% 25%;
    will-change: transform, filter;
}

.deck-card-shell {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    box-shadow: 0 50px 90px -35px rgba(10, 12, 20, 0.5);
    transition: background-color 0.35s ease;
}

.deck-card-media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center;
    background: #0b1120;
}

/* Art-Directed Full-Bleed Preview Canvas (Fallback when no screenshot uploaded) */
.deck-generated-canvas {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1.35rem, 3vw, 2.5rem);
    color: #f8fafc;
    background:
        radial-gradient(circle at 82% 20%, var(--canvas-glow, rgba(96, 165, 250, 0.28)) 0%, transparent 55%),
        radial-gradient(circle at 15% 88%, rgba(29, 78, 216, 0.24) 0%, transparent 50%),
        linear-gradient(140deg, var(--canvas-bg1, #0b1933) 0%, var(--canvas-bg2, #17376e) 100%);
    overflow: hidden;
}

.deck-generated-canvas::after {
    content: '';
    position: absolute;
    inset: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.canvas-topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.canvas-brand-pill {
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.015em;
    color: #ffffff;
}

.canvas-nav-mock {
    display: flex;
    gap: 1.35rem;
    font-size: 0.78rem;
    color: rgba(241, 245, 249, 0.58);
}

.canvas-index {
    font-size: 0.76rem;
    color: rgba(241, 245, 249, 0.65);
}

.canvas-hero-body {
    position: relative;
    z-index: 1;
    max-width: 62ch;
    margin-block: auto;
    padding-block: 1rem;
}

.canvas-kicker {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: #93c5fd;
    margin-bottom: 0.65rem;
}

.canvas-headline {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(2rem, 4.4vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: #ffffff;
    margin-bottom: 0.45rem;
}

.canvas-sub {
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    font-weight: 500;
    color: rgba(226, 232, 240, 0.92);
    margin-bottom: 0.65rem;
}

.canvas-summary {
    font-size: clamp(0.84rem, 1.15vw, 0.96rem);
    color: rgba(203, 213, 225, 0.8);
    max-width: 52ch;
    line-height: 1.6;
}

.canvas-bottom-meta {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.78);
}

/* Cut-Out Bottom-Right Visit Button */
.deck-visit-wrap {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 10;
    color: var(--bg-base);
    transition: color 0.35s ease;
}

.deck-cutout-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.deck-cutout-corner svg {
    display: block;
    width: 18px;
    height: 18px;
}

.deck-cutout-top {
    right: 0;
    bottom: 100%;
}

.deck-cutout-left {
    right: 100%;
    bottom: 0;
}

.deck-visit-btn {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    border-top-left-radius: 20px;
    padding: 0.85rem 0.35rem 0.85rem 1.55rem;
    background: var(--bg-base);
    color: var(--text-primary);
    outline: none;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.deck-visit-text {
    display: flex;
    flex-direction: column;
    line-height: 1.24;
}

.deck-visit-name {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.deck-visit-host {
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-underline-offset: 4px;
}

.deck-visit-btn:hover .deck-visit-host,
.deck-visit-btn:focus-visible .deck-visit-host {
    text-decoration: underline;
}

.deck-visit-arrow {
    width: 50px;
    height: 50px;
    border-radius: 999px;
    background: var(--card-accent, #1d4ed8);
    color: #ffffff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: transform 0.22s ease-out;
}

.deck-visit-arrow svg {
    width: 22px;
    height: 22px;
}

.deck-visit-btn:hover .deck-visit-arrow {
    transform: rotate(45deg);
}

.deck-visit-btn:active .deck-visit-arrow {
    transform: scale(0.9);
}

/* Dimming Overlay for Covered Cards */
.deck-card-dim {
    position: absolute;
    inset: 0;
    background: #0a0c14;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

@media (max-width: 640px) {
    .deck-card-item {
        width: 100%;
    }

    .deck-generated-canvas.deck-card-media {
        aspect-ratio: 4 / 5;
    }

    img.deck-card-media,
    .deck-pdf-canvas.deck-card-media {
        aspect-ratio: 16 / 9;
    }

    .canvas-nav-mock,
    .canvas-bottom-meta {
        display: none;
    }

    .canvas-hero-body {
        padding-bottom: 3.5rem;
    }

    .deck-visit-btn {
        gap: 0.85rem;
        padding: 0.7rem 0.25rem 0.7rem 1.15rem;
    }

    .deck-visit-name {
        font-size: 0.96rem;
    }

    .deck-visit-host {
        font-size: 0.78rem;
    }

    .deck-visit-arrow {
        width: 42px;
        height: 42px;
    }

    .deck-visit-arrow svg {
        width: 19px;
        height: 19px;
    }
}


/* ==========================================================================
   Academic Book List & 3D Monograph Covers (Papers Section)
   ========================================================================== */
.book-cover-link {
    display: block;
    outline: none;
}

.book-stage {
    perspective: 950px;
    width: 100%;
}

.book-3d {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.42;
    transform-style: preserve-3d;
    transition: transform 0.45s var(--ease-spring);
}

/* Fore-edge paper block (right side pages) */
.book-pages {
    position: absolute;
    top: 4px;
    bottom: 4px;
    right: -5px;
    width: 14px;
    border-radius: 0 3px 3px 0;
    background:
        repeating-linear-gradient(
            90deg,
            #f8fafc 0px,
            #f8fafc 2px,
            #cbd5e1 2px,
            #cbd5e1 3px
        );
    box-shadow: inset -1px 0 2px rgba(15, 23, 42, 0.18), 4px 8px 18px rgba(9, 17, 34, 0.16);
    transition: right 0.45s var(--ease-spring), transform 0.45s var(--ease-spring);
    z-index: 0;
}

/* Front Hardcover */
.book-cover {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 3px 9px 9px 3px;
    padding: 0.95rem 0.95rem 0.9rem 1.35rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: left center;
    transition:
        transform 0.48s var(--ease-spring),
        box-shadow 0.45s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 16px 28px -10px rgba(9, 17, 34, 0.34),
        -1px 0 3px rgba(9, 17, 34, 0.2);
}

/* Bookbinding Hinge / Spine Crease */
.book-spine-groove {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 14px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(0, 0, 0, 0.08) 28%,
        rgba(0, 0, 0, 0.3) 68%,
        rgba(255, 255, 255, 0.16) 84%,
        transparent 100%
    );
    pointer-events: none;
}

/* Hover 3D Open-Cover Interaction */
.book-cover-link:hover .book-3d,
.book-catalog-row:hover .book-3d,
.bookshelf-item:hover .book-3d {
    transform: translateY(-4px);
}

.book-cover-link:hover .book-cover,
.book-catalog-row:hover .book-cover,
.bookshelf-item:hover .book-cover {
    transform: rotateY(-16deg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        12px 22px 34px -10px rgba(9, 17, 34, 0.42);
}

.book-cover-link:hover .book-pages,
.book-catalog-row:hover .book-pages,
.bookshelf-item:hover .book-pages {
    right: -8px;
}

/* Edition Colorways */
.edition-navy .book-cover {
    background: linear-gradient(155deg, #0d2040 0%, #081326 100%);
    color: #f8fafc;
}

.edition-cobalt .book-cover {
    background: linear-gradient(155deg, #1d4ed8 0%, #153594 100%);
    color: #ffffff;
}

.edition-linen .book-cover {
    background: linear-gradient(155deg, #f4f8ff 0%, #e1ecfd 100%);
    color: #0c1b36;
    border: 1px solid rgba(29, 78, 216, 0.2);
}

.edition-linen .book-spine-groove {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(15, 23, 42, 0.08) 65%,
        rgba(255, 255, 255, 0.65) 84%,
        transparent 100%
    );
}

.edition-cerulean .book-cover {
    background: linear-gradient(155deg, #0f3459 0%, #0a2038 100%);
    color: #f8fafc;
}

/* Book Cover Typography */
.book-cover-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.54rem;
    letter-spacing: 0.06em;
    opacity: 0.76;
}

.book-imprint {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-vol {
    flex-shrink: 0;
}

.book-cover-rule {
    height: 1px;
    width: 100%;
    background: currentColor;
    opacity: 0.18;
    margin: 0.5rem 0 0.65rem;
}

.book-cover-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
}

.book-cover-title {
    font-family: var(--font-serif);
    font-size: 0.86rem;
    line-height: 1.28;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-cover-footer {
    padding-top: 0.55rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.62rem;
    opacity: 0.86;
}

.edition-linen .book-cover-footer {
    border-top-color: rgba(15, 23, 42, 0.12);
}

.book-cover-author {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-cover-year {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    flex-shrink: 0;
}

[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Book Catalog List (Home & Research Pages)
   -------------------------------------------------------------------------- */
.book-catalog-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.book-catalog-row {
    display: grid;
    grid-template-columns: 152px minmax(0, 1fr);
    gap: 1.85rem;
    padding: 1.55rem 1.75rem;
    align-items: center;
}

.book-catalog-cover {
    width: 144px;
}

.book-catalog-details {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.book-catalog-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.book-edition-pill {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.14rem 0.5rem;
    border-radius: 5px;
    background: var(--accent-soft-strong);
    color: var(--accent-primary);
}

.book-catalog-title {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 2vw, 1.42rem);
    font-weight: 500;
    line-height: 1.34;
}

.book-catalog-title a:hover {
    color: var(--accent-primary);
}

.book-catalog-venue {
    font-size: 0.89rem;
    color: var(--text-secondary);
}

.book-catalog-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-top: 0.55rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--hairline);
}

@media (max-width: 640px) {
    .book-catalog-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .book-catalog-cover {
        width: 148px;
        margin-inline: auto;
    }
}


/* ==========================================================================
   5 Curated Font Pairing Presets & Live Font Picker Popover
   ========================================================================== */
html[data-font="editorial"] {
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Newsreader', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-font="swiss"] {
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-font="scholar"] {
    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-serif: 'Libre Baskerville', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-font="studio"] {
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-font="tech"] {
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.notch-aa-label {
    font-family: var(--font-serif);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
}

.font-picker-popover {
    position: fixed;
    top: calc(var(--bezel-size) + 50px);
    right: max(16px, calc(var(--bezel-size) + 12px));
    z-index: 125;
    width: min(296px, calc(100vw - 32px));
    padding: 0.85rem;
    border-radius: var(--radius-md);
    animation: popoverDropIn 0.22s var(--ease-spring);
}

@keyframes popoverDropIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.font-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.15rem 0.4rem 0.6rem;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 0.45rem;
}

.font-picker-header span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.font-picker-header small {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.font-picker-options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.font-option-btn {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary);
    padding: 0.52rem 0.6rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.font-option-btn:hover {
    background: var(--accent-soft);
}

.font-option-btn.is-active {
    background: var(--accent-soft-strong);
    border-color: var(--glass-border-blue);
}

.font-option-sample {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    display: grid;
    place-items: center;
    font-size: 0.96rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.font-option-sample[data-sample="editorial"] { font-family: 'Newsreader', Georgia, serif; font-style: italic; }
.font-option-sample[data-sample="swiss"] { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; }
.font-option-sample[data-sample="scholar"] { font-family: 'Libre Baskerville', Georgia, serif; font-weight: 700; }
.font-option-sample[data-sample="studio"] { font-family: 'Outfit', sans-serif; font-weight: 600; }
.font-option-sample[data-sample="tech"] { font-family: 'Space Grotesk', sans-serif; font-weight: 700; }

.font-option-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.font-option-info strong {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
}

.font-option-info small {
    font-size: 0.71rem;
    color: var(--text-muted);
    margin-top: 0.12rem;
}

.font-option-check {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.font-option-btn.is-active .font-option-check {
    opacity: 1;
}

@media (max-width: 1279px) {
    .font-picker-popover {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    @keyframes popoverDropIn {
        from {
            opacity: 0;
            transform: translate(-50%, -8px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translate(-50%, 0) scale(1);
        }
    }
}


/* ==========================================================================
   PDF Document Canvas Previews (Full Page, No Scrollbars, No Badge)
   ========================================================================== */
.cert-pdf-thumb,
.project-pdf-thumb {
    position: relative;
    display: block;
    width: 100%;
    background: #ffffff;
    overflow: hidden;
}

.project-pdf-thumb {
    height: 100%;
}

.pdf-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #ffffff;
}

.project-pdf-thumb .pdf-canvas,
.deck-pdf-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}


/* ==========================================================================
   Platform, App & Institution SVG Icons
   ========================================================================== */
.brand-svg-icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

.brand-svg-icon.is-xs {
    width: 14px;
    height: 14px;
}

.brand-svg-icon.is-sm {
    width: 16px;
    height: 16px;
}

.brand-svg-icon.is-md {
    width: 20px;
    height: 20px;
}

.meta-label-with-icon,
.strip-label-icon,
.cert-issuer-with-icon,
.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.platform-chip-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.24rem 0.62rem;
    border-radius: 7px;
    background: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.platform-chip-link:hover {
    border-color: var(--glass-border-blue) !important;
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.ledger-row-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.ledger-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: var(--accent-primary);
}


/* ==========================================================================
   HoverBorderGradient — Applied to All Borders Across the Site
   (Clockwise TOP -> RIGHT -> BOTTOM -> LEFT orbit + #3275F8 hover bloom)
   ========================================================================== */
@property --hbg-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 50%;
}

@property --hbg-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 100%;
}

@keyframes hbgOrbit {
    0%   { --hbg-x: 50%;  --hbg-y: 100%; }
    25%  { --hbg-x: 0%;   --hbg-y: 50%;  }
    50%  { --hbg-x: 50%;  --hbg-y: 0%;   }
    75%  { --hbg-x: 100%; --hbg-y: 50%;  }
    100% { --hbg-x: 50%;  --hbg-y: 100%; }
}

@keyframes hbgDiagonal {
    0%   { --hbg-x: 8%;   --hbg-y: 8%;   }
    25%  { --hbg-x: 92%;  --hbg-y: 92%;  }
    50%  { --hbg-x: 92%;  --hbg-y: 8%;   }
    75%  { --hbg-x: 8%;   --hbg-y: 92%;  }
    100% { --hbg-x: 8%;   --hbg-y: 8%;   }
}

@keyframes hbgSweep {
    0%   { --hbg-x: 0%;   --hbg-y: 15%;  }
    33%  { --hbg-x: 100%; --hbg-y: 15%;  }
    66%  { --hbg-x: 100%; --hbg-y: 85%;  }
    100% { --hbg-x: 0%;   --hbg-y: 15%;  }
}

:root {
    --hbg-spot: #3275F8;
    --hbg-spot-mid: rgba(50, 117, 248, 0.32);
    --hbg-highlight: #3275F8;
}

html[data-theme="dark"] {
    --hbg-spot: #ffffff;
    --hbg-spot-mid: rgba(96, 165, 250, 0.45);
    --hbg-highlight: #3275F8;
}

.glass-card,
.glass-surface,
.btn,
.platform-chip-link,
.skill-chip,
.copy-mini-btn,
.icon-glass-btn,
.slider-nav-btn,
.deck-card-shell,
.portrait-box,
.ledger-icon-box,
.cert-credential-box,
.admin-list-item,
.login-card {
    position: relative;
}

.font-picker-popover.glass-surface {
    position: fixed;
}

.glass-card::before,
.glass-surface::before,
.btn::before,
.platform-chip-link::before,
.skill-chip::before,
.copy-mini-btn::before,
.icon-glass-btn::before,
.slider-nav-btn::before,
.deck-card-shell::before,
.portrait-box::before,
.ledger-icon-box::before,
.cert-credential-box::before,
.admin-list-item::before,
.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 4;
    background: radial-gradient(
        22% 52% at var(--hbg-x) var(--hbg-y),
        var(--hbg-spot) 0%,
        var(--hbg-spot-mid) 45%,
        transparent 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation-name: var(--hbg-anim, hbgOrbit);
    animation-duration: var(--hbg-dur, 14s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-direction: var(--hbg-dir, normal);
    animation-delay: var(--hbg-delay, 0s);
    transition: opacity 0.35s ease, filter 0.35s ease;
    opacity: 0.85;
}

/* Built-in CSS variations even before JS runs */
.glass-card:nth-child(2n)::before,
.btn:nth-child(2n)::before {
    --hbg-anim: hbgDiagonal;
    --hbg-dur: 16.5s;
    --hbg-dir: reverse;
    --hbg-delay: -5.2s;
}

.glass-card:nth-child(3n)::before,
.platform-chip-link:nth-child(2n)::before {
    --hbg-anim: hbgSweep;
    --hbg-dur: 13s;
    --hbg-delay: -8.7s;
}

.glass-card:nth-child(4n)::before {
    --hbg-anim: hbgOrbit;
    --hbg-dur: 18s;
    --hbg-dir: reverse;
    --hbg-delay: -3.4s;
}

/* Hover Bloom: Pauses orbit & illuminates full border with #3275F8 */
.glass-card:hover::before,
.glass-surface:hover::before,
.btn:hover::before,
.platform-chip-link:hover::before,
.skill-chip:hover::before,
.copy-mini-btn:hover::before,
.icon-glass-btn:hover::before,
.slider-nav-btn:hover::before,
.deck-card-shell:hover::before,
.portrait-box:hover::before,
.ledger-icon-box:hover::before,
.cert-credential-box:hover::before,
.admin-list-item:hover::before,
.login-card:hover::before {
    animation-play-state: paused;
    opacity: 1;
    background: radial-gradient(
        75% 181.16% at 50% 50%,
        var(--hbg-highlight) 0%,
        rgba(50, 117, 248, 0.55) 58%,
        rgba(255, 255, 255, 0) 100%
    );
}

/* Form inputs & hairline dividers pick up #3275F8 highlight on hover/focus */
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(50, 117, 248, 0.5);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3275F8;
    box-shadow: 0 0 0 3px rgba(50, 117, 248, 0.16);
}

@media (prefers-reduced-motion: reduce) {
    .glass-card::before,
    .glass-surface::before,
    .btn::before,
    .platform-chip-link::before,
    .skill-chip::before,
    .copy-mini-btn::before,
    .icon-glass-btn::before,
    .slider-nav-btn::before,
    .deck-card-shell::before,
    .portrait-box::before,
    .ledger-icon-box::before,
    .cert-credential-box::before,
    .admin-list-item::before,
    .login-card::before {
        animation: none;
    }
}

/* ── Skills & Applications (Experience Page) ── */
.skills-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
}

.skill-group-card {
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.skill-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
}

.skill-group-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.skill-group-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
}

.skill-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    padding: 0.42rem 0.78rem;
    border-radius: 10px;
    background: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.2;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.skill-chip:hover {
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.skill-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.skill-chip-name {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .skills-groups-grid {
        grid-template-columns: 1fr;
    }
}

/* ── PDF Preview Modal ── */
.pdf-modal-backdrop[hidden] {
    display: none;
}

.pdf-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pdf-modal-dialog {
    width: min(920px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: var(--glass-bg-strong, var(--glass-bg));
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--border-subtle);
}

.pdf-modal-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    min-width: 0;
}

.pdf-modal-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-modal-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.pdf-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pdf-modal-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-subtle);
    color: var(--text-primary);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pdf-modal-close:hover {
    background: rgba(50, 117, 248, 0.14);
    border-color: #3275F8;
    color: #3275F8;
}

.pdf-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.04);
}

.pdf-modal-status {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pdf-modal-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.pdf-modal-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.pdf-modal-fallback {
    width: 100%;
    height: 74vh;
    border: 0;
    border-radius: 10px;
    background: #ffffff;
}

/* ── Product Packaging Studio Gallery Cards ── */
.packaging-home-showcase {
    margin-top: 3.5rem;
    padding-bottom: 4.5rem;
}

.packaging-home-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.packaging-home-title {
    margin: 0.2rem 0 0;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    letter-spacing: -0.02em;
}

.project-packaging-card {
    display: flex;
    flex-direction: column;
}

.packaging-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    padding: 0.85rem;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.98) 0%, rgba(235, 243, 255, 0.88) 72%, rgba(220, 233, 252, 0.78) 100%);
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

[data-theme="dark"] .packaging-stage {
    background:
        radial-gradient(circle at 50% 42%, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.packaging-stage-trigger {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.packaging-stage-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    filter: drop-shadow(0 10px 22px rgba(15, 23, 42, 0.14));
    transition: transform 0.35s var(--ease-out-expo);
}

.packaging-stage-trigger:hover .packaging-stage-img {
    transform: scale(1.03);
}

.packaging-count-pill {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .packaging-count-pill {
    background: rgba(15, 23, 42, 0.8);
}

.packaging-thumbs {
    display: flex;
    gap: 0.45rem;
    padding: 0.65rem 1rem 0;
    overflow-x: auto;
}

.packaging-thumb-btn {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    padding: 3px;
    border-radius: 9px;
    border: 1.5px solid var(--glass-border);
    background: #ffffff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.packaging-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.packaging-thumb-btn.is-active,
.packaging-thumb-btn:hover {
    border-color: #3275F8;
    transform: translateY(-1px);
}

.packaging-empty-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    color: var(--text-muted);
}

.packaging-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.packaging-empty-stage strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.packaging-empty-stage span {
    font-size: 0.78rem;
}

.image-lightbox-dialog {
    width: min(860px, 100%);
}

.image-lightbox-body {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.05);
    max-height: calc(90vh - 68px);
    overflow: auto;
}

.image-lightbox-img {
    max-width: 100%;
    max-height: 76vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}
