/* ============================================================
   RAOUL V. KÜBLER — DARK TERMINAL EDITORIAL THEME
   ============================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    --bg-primary: #0a0a0b;
    --bg-surface: rgba(255, 255, 255, 0.035);
    --bg-surface-hover: rgba(255, 255, 255, 0.06);
    --bg-surface-solid: #111113;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --cyan: #00f0ff;
    --coral: #ff3d71;
    --amber: #ffb800;
    --purple: #7c3aed;

    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.35);
    --text-link: var(--cyan);

    --font-display: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --glow-cyan: 0 0 40px rgba(0, 240, 255, 0.12);
    --glow-cyan-strong: 0 0 60px rgba(0, 240, 255, 0.2);
    --glow-coral: 0 0 40px rgba(255, 61, 113, 0.15);

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url('svg/noise-filter.svg');
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Skip to Content --- */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--cyan);
    color: var(--bg-primary);
    padding: 8px 16px;
    z-index: 10000;
    transition: top var(--transition-fast);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.skip-to-content:focus {
    top: 0;
}

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--text-link);
    transition: color var(--transition-fast);
}

a:hover {
    color: #66f7ff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   NAVIGATION — Floating Pill
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: padding var(--transition-base);
}

.navbar.scrolled {
    padding: 0.5rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    min-width: 50px;
}

.nav-logo-text {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--cyan);
    letter-spacing: 0.05em;
}

.nav-pill {
    background: rgba(10, 10, 11, 0.7);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 0.4rem 0.6rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-pill);
    transition: all var(--transition-fast);
    display: block;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--cyan);
    background: rgba(0, 240, 255, 0.06);
}

.nav-link::after {
    display: none;
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(17, 17, 19, 0.95);
    backdrop-filter: blur(40px);
    min-width: 160px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    list-style: none;
    padding: 0.5rem;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropdown-link:hover {
    color: var(--cyan);
    background: rgba(0, 240, 255, 0.06);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.bar {
    width: 20px;
    height: 2px;
    background-color: var(--text-secondary);
    margin: 2px 0;
    transition: var(--transition-base);
    border-radius: 2px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 120px 0 80px;
    background: var(--bg-primary);
}

/* GPU mainboard technical drawing */
.hero-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.07;
    background-image: url('svg/pcb-hero.svg');
    background-size: 800px 800px;
    background-position: center;
    background-repeat: repeat;
    z-index: 0;
}

/* Light mode: use dark strokes for visibility on light bg */
[data-theme="light"] .hero-pcb {
    opacity: 0.18;
    background-image: url('svg/pcb-hero-light.svg');
}

/* Animated gradient mesh */
.hero-mesh {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 240, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(255, 61, 113, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 30%, rgba(0, 240, 255, 0.04) 0%, transparent 40%);
    animation: meshFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes meshFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, -3%) rotate(1deg); }
    50% { transform: translate(-1%, 2%) rotate(-0.5deg); }
    75% { transform: translate(3%, 1%) rotate(0.5deg); }
}

.hero::before,
.hero::after {
    display: none;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.hero-terminal {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    white-space: nowrap;
}

.terminal-prompt {
    color: var(--cyan);
    margin-right: 0.5rem;
    font-weight: 700;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.hero-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cyan);
    padding: 0.35rem 0.8rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-pill);
    background: rgba(0, 240, 255, 0.04);
    letter-spacing: 0.02em;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 0;
}

.stat {
    text-align: center;
    padding: 0 1.5rem;
}

.stat:first-child {
    padding-left: 0;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-subtle);
}

.stat-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--amber);
    line-height: 1;
    margin-bottom: 0.35rem;
}

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

.hero-image {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.profile-placeholder {
    width: 380px;
    height: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--glow-cyan);
    transform: rotate(2deg);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
    background: var(--bg-surface);
}

.profile-placeholder:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: var(--glow-cyan-strong);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

/* ============================================================
   SECTION STYLES
   ============================================================ */
.section {
    padding: 100px 0;
    position: relative;
}

.section-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan);
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    text-align: left;
}

.section-title::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, var(--border-subtle), transparent);
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.subsection {
    margin-bottom: 4rem;
}

.subsection-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: 3rem;
    font-style: italic;
    text-align: left;
}

.bg-light {
    background: rgba(255, 255, 255, 0.015);
}

/* About section PCB — memory/power delivery layout */
.about-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.12;
    overflow: hidden;
    z-index: 0;
    background-image: url('svg/pcb-about.svg');
    background-size: 900px 900px;
    background-position: center;
    background-repeat: repeat;
}

#about,
#media,
#publications,
#research,
#teaching,
#biography,
#consulting,
#books {
    overflow: hidden;
    position: relative;
}

/* Media section PCB — motherboard I/O and bus layout */
.media-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
    background-image: url('svg/pcb-media.svg');
    background-size: 1000px 1000px;
    background-position: center;
    background-repeat: repeat;
}

/* Light mode media PCB */
[data-theme="light"] .media-pcb {
    opacity: 0.18;
    background-image: url('svg/pcb-media-light.svg');
}

/* Publications section PCB — FPGA / SoC array layout */
.publications-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
    background-image: url('svg/pcb-publications.svg');
    background-size: 800px 800px;
    background-position: center;
    background-repeat: repeat;
}

[data-theme="light"] .publications-pcb {
    opacity: 0.18;
    background-image: url('svg/pcb-publications-light.svg');
}

/* Research section PCB — GPU shader core array */
.research-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
    background-image: url('svg/pcb-research.svg');
    background-size: 850px 850px;
    background-position: center;
    background-repeat: repeat;
}

[data-theme="light"] .research-pcb {
    opacity: 0.18;
    background-image: url('svg/pcb-research-light.svg');
}

/* Light mode about PCB */
[data-theme="light"] .about-pcb {
    opacity: 0.18;
    background-image: url('svg/pcb-about-light.svg');
}

/* ============================================================
   ABOUT ME / PERSONAL INFO
   ============================================================ */
.personal-info-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 4rem;
    align-items: start;
}

.personal-info-content h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 1.5rem;
}

.personal-info-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.personal-info-content a {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
    transition: border-color var(--transition-fast);
}

.personal-info-content a:hover {
    border-color: var(--cyan);
}

.contact-card {
    background: var(--bg-surface);
    backdrop-filter: blur(40px);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
}

.contact-card h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.contact-item i {
    color: var(--cyan);
    width: 20px;
    font-size: 0.9rem;
}

.email-protected {
    cursor: pointer;
    position: relative;
}

.email-protected::after {
    content: attr(data-email);
    color: inherit;
}

.social-links {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}

.social-link:hover {
    color: var(--cyan);
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

/* ============================================================
   BIOGRAPHY PCB — PCI Express bus slots on motherboard
   ============================================================ */
.biography-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
    background-image: url('svg/pcb-biography.svg');
    background-size: 1100px 900px;
    background-position: center;
    background-repeat: repeat;
}

[data-theme="light"] .biography-pcb {
    opacity: 0.18;
    background-image: url('svg/pcb-biography-light.svg');
}

/* ============================================================
   BIOGRAPHY
   ============================================================ */
.biography-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.biography-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.biography-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.biography-item i {
    font-size: 1.5rem;
    color: var(--cyan);
    margin-top: 0.25rem;
}

.biography-item h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.biography-item ul {
    list-style: none;
    padding: 0;
}

.biography-item li {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.6;
}

.biography-item li::before {
    content: "›";
    color: var(--cyan);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
}

.biography-item li a {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.biography-item li a:hover {
    border-bottom-color: var(--cyan);
}

/* ============================================================
   RESEARCH CARDS — Glass Bento
   ============================================================ */
.research-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.research-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
    position: relative;
}

.research-card:first-child {
    grid-column: auto;
}

.research-card:hover {
    border-color: rgba(0, 240, 255, 0.15);
    box-shadow: var(--glow-cyan);
    transform: translateY(-3px);
}

.research-card.digital-transformation,
.research-card.marketing-society,
.research-card.marketing-technology,
.research-card.corporate-crisis {
    padding: 0;
    display: flex;
    flex-direction: column;
    background-image: none;
}

.card-image-section {
    height: 220px;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-image-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 11, 0.5) 0%, rgba(10, 10, 11, 0.1) 100%);
}

.research-card.digital-transformation .card-image-section {
    background-image: url('./img/circuit-board.jpg');
}

.research-card.marketing-society .card-image-section {
    background-image: url('./img/society.jpg');
    background-position: center 30%;
}

.research-card.marketing-technology .card-image-section {
    background-image: url('./img/technology.jpg');
    background-position: center 40%;
}

.research-card.corporate-crisis .card-image-section {
    background-image: url('./img/crisis.jpg');
}

.card-text-section h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.card-text-section {
    background: transparent;
    padding: 1.5rem;
    flex: 1;
}

.card-text-section p {
    color: var(--text-secondary) !important;
    line-height: 1.7;
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
    text-shadow: none !important;
    filter: none !important;
}

.research-card.digital-transformation p {
    color: var(--text-secondary);
    text-shadow: none;
    font-weight: normal;
}

.research-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.research-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 0.9rem;
}

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

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--cyan);
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-pill);
    background: rgba(0, 240, 255, 0.04);
}

.research-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--cyan);
}

.research-info-field {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-top: 1rem;
}

.research-info-field h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.research-info-field textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.research-info-field textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.publication-search-container {
    margin-bottom: 1.5rem;
}

#publication-search {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#publication-search::placeholder {
    color: var(--text-tertiary);
}

#publication-search:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.publications-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
}

.filter-btn.active,
.filter-btn:hover {
    background: rgba(0, 240, 255, 0.08);
    color: var(--cyan);
    border-color: rgba(0, 240, 255, 0.3);
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.publication-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    padding-top: 1.75rem;
    border-radius: 4px;
    border: 1.5px solid rgba(0, 240, 255, 0.25);
    transition: all var(--transition-base);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    /* IC chip pin notches via repeating gradients on each side */
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 14px, rgba(0, 240, 255, 0.15) 14px, rgba(0, 240, 255, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to right, transparent, transparent 14px, rgba(0, 240, 255, 0.15) 14px, rgba(0, 240, 255, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 14px, rgba(0, 240, 255, 0.15) 14px, rgba(0, 240, 255, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 14px, rgba(0, 240, 255, 0.15) 14px, rgba(0, 240, 255, 0.15) 16px, transparent 16px, transparent 26px);
    background-size:
        100% 3px,
        100% 3px,
        3px 100%,
        3px 100%;
    background-position:
        0 0,
        0 100%,
        0 0,
        100% 0;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

/* Pin traces extending from card edges */
.publication-card::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px dashed rgba(0, 240, 255, 0.08);
    border-radius: 6px;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 12px, rgba(0, 240, 255, 0.12) 12px, rgba(0, 240, 255, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to right, transparent, transparent 12px, rgba(0, 240, 255, 0.12) 12px, rgba(0, 240, 255, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 12px, rgba(0, 240, 255, 0.12) 12px, rgba(0, 240, 255, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 12px, rgba(0, 240, 255, 0.12) 12px, rgba(0, 240, 255, 0.12) 14px, transparent 14px, transparent 26px);
    background-size:
        100% 8px,
        100% 8px,
        8px 100%,
        8px 100%;
    background-position:
        8px 0,
        8px 100%,
        0 8px,
        100% 8px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

/* Chip orientation notch (top-left corner dot) */
.publication-card::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.06);
    pointer-events: none;
}

.publication-card:hover {
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1), inset 0 0 30px rgba(0, 240, 255, 0.02);
}

/* Light mode IC chip publication cards */
[data-theme="light"] .publication-card {
    border-color: rgba(0, 157, 170, 0.3);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 14px, rgba(0, 157, 170, 0.15) 14px, rgba(0, 157, 170, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to right, transparent, transparent 14px, rgba(0, 157, 170, 0.15) 14px, rgba(0, 157, 170, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 14px, rgba(0, 157, 170, 0.15) 14px, rgba(0, 157, 170, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 14px, rgba(0, 157, 170, 0.15) 14px, rgba(0, 157, 170, 0.15) 16px, transparent 16px, transparent 26px);
    background-size:
        100% 3px,
        100% 3px,
        3px 100%,
        3px 100%;
    background-position:
        0 0,
        0 100%,
        0 0,
        100% 0;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

[data-theme="light"] .publication-card::before {
    border-color: rgba(0, 157, 170, 0.1);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 12px, rgba(0, 157, 170, 0.12) 12px, rgba(0, 157, 170, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to right, transparent, transparent 12px, rgba(0, 157, 170, 0.12) 12px, rgba(0, 157, 170, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 12px, rgba(0, 157, 170, 0.12) 12px, rgba(0, 157, 170, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 12px, rgba(0, 157, 170, 0.12) 12px, rgba(0, 157, 170, 0.12) 14px, transparent 14px, transparent 26px);
    background-size:
        100% 8px,
        100% 8px,
        8px 100%,
        8px 100%;
    background-position:
        8px 0,
        8px 100%,
        0 8px,
        100% 8px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

[data-theme="light"] .publication-card::after {
    border-color: rgba(0, 157, 170, 0.35);
    background: rgba(0, 157, 170, 0.08);
}

[data-theme="light"] .publication-card:hover {
    border-color: rgba(0, 157, 170, 0.5);
    box-shadow: 0 2px 20px rgba(0, 157, 170, 0.08), inset 0 0 20px rgba(0, 157, 170, 0.02);
}

.publication-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.publication-type-container {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.publication-header h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-type {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.publication-type.journal {
    background: rgba(0, 240, 255, 0.08);
    color: var(--cyan);
    border: 1px solid rgba(0, 240, 255, 0.15);
}

.publication-type.conference {
    background: rgba(255, 184, 0, 0.08);
    color: var(--amber);
    border: 1px solid rgba(255, 184, 0, 0.15);
}

.publication-type.book {
    background: rgba(124, 58, 237, 0.08);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.publication-type.digital-transformation {
    background: rgba(0, 240, 255, 0.05);
    color: rgba(0, 240, 255, 0.7);
    border: 1px solid rgba(0, 240, 255, 0.1);
}

.publication-type.marketing-society {
    background: rgba(255, 61, 113, 0.05);
    color: rgba(255, 61, 113, 0.7);
    border: 1px solid rgba(255, 61, 113, 0.1);
}

.publication-type.marketing-technology {
    background: rgba(16, 185, 129, 0.05);
    color: rgba(16, 185, 129, 0.7);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.publication-type.corporate-crisis {
    background: rgba(255, 184, 0, 0.05);
    color: rgba(255, 184, 0, 0.7);
    border: 1px solid rgba(255, 184, 0, 0.1);
}

.publication-authors {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.85rem;
}

.publication-venue {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.publication-award {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--coral);
    padding-left: 0.75rem;
    border-left: 2px solid var(--coral);
}

.publication-abstract {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
    flex: 1;
}

.publication-links {
    display: flex;
    gap: 1.5rem;
    padding-top: 0.5rem;
    order: 2;
}

.publication-link {
    text-decoration: none;
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--transition-fast);
}

.publication-link:hover {
    color: #66f7ff;
}

.publication-logo {
    width: 14px;
    height: 14px;
    margin-right: 0.25rem;
    filter: brightness(0.7);
}

.open-access-logo {
    width: calc((1em + 10px) * 3);
    height: auto;
    align-self: flex-end;
    object-fit: contain;
    opacity: 0.5;
    order: 1;
}

/* ============================================================
   MEDIA SECTION
   ============================================================ */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.media-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    padding-top: 1.75rem;
    border-radius: 4px;
    border: 1.5px solid rgba(0, 240, 255, 0.25);
    transition: all var(--transition-base);
    position: relative;
    display: flex;
    flex-direction: column;
    /* IC chip pin notches via repeating gradients on each side */
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 14px, rgba(0, 240, 255, 0.15) 14px, rgba(0, 240, 255, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to right, transparent, transparent 14px, rgba(0, 240, 255, 0.15) 14px, rgba(0, 240, 255, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 14px, rgba(0, 240, 255, 0.15) 14px, rgba(0, 240, 255, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 14px, rgba(0, 240, 255, 0.15) 14px, rgba(0, 240, 255, 0.15) 16px, transparent 16px, transparent 26px);
    background-size:
        100% 3px,
        100% 3px,
        3px 100%,
        3px 100%;
    background-position:
        0 0,
        0 100%,
        0 0,
        100% 0;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

/* Pin traces extending from card edges */
.media-card::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px dashed rgba(0, 240, 255, 0.08);
    border-radius: 6px;
    pointer-events: none;
    /* Pin stubs on all sides */
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 12px, rgba(0, 240, 255, 0.12) 12px, rgba(0, 240, 255, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to right, transparent, transparent 12px, rgba(0, 240, 255, 0.12) 12px, rgba(0, 240, 255, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 12px, rgba(0, 240, 255, 0.12) 12px, rgba(0, 240, 255, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 12px, rgba(0, 240, 255, 0.12) 12px, rgba(0, 240, 255, 0.12) 14px, transparent 14px, transparent 26px);
    background-size:
        100% 8px,
        100% 8px,
        8px 100%,
        8px 100%;
    background-position:
        8px 0,
        8px 100%,
        0 8px,
        100% 8px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

/* Chip orientation notch (top-left corner dot) */
.media-card::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.06);
    pointer-events: none;
}

.media-card:hover {
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1), inset 0 0 30px rgba(0, 240, 255, 0.02);
}

/* Light mode chip cards */
[data-theme="light"] .media-card {
    border-color: rgba(0, 157, 170, 0.3);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 14px, rgba(0, 157, 170, 0.15) 14px, rgba(0, 157, 170, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to right, transparent, transparent 14px, rgba(0, 157, 170, 0.15) 14px, rgba(0, 157, 170, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 14px, rgba(0, 157, 170, 0.15) 14px, rgba(0, 157, 170, 0.15) 16px, transparent 16px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 14px, rgba(0, 157, 170, 0.15) 14px, rgba(0, 157, 170, 0.15) 16px, transparent 16px, transparent 26px);
    background-size:
        100% 3px,
        100% 3px,
        3px 100%,
        3px 100%;
    background-position:
        0 0,
        0 100%,
        0 0,
        100% 0;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

[data-theme="light"] .media-card::before {
    border-color: rgba(0, 157, 170, 0.1);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 12px, rgba(0, 157, 170, 0.12) 12px, rgba(0, 157, 170, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to right, transparent, transparent 12px, rgba(0, 157, 170, 0.12) 12px, rgba(0, 157, 170, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 12px, rgba(0, 157, 170, 0.12) 12px, rgba(0, 157, 170, 0.12) 14px, transparent 14px, transparent 26px),
        repeating-linear-gradient(to bottom, transparent, transparent 12px, rgba(0, 157, 170, 0.12) 12px, rgba(0, 157, 170, 0.12) 14px, transparent 14px, transparent 26px);
    background-size:
        100% 8px,
        100% 8px,
        8px 100%,
        8px 100%;
    background-position:
        8px 0,
        8px 100%,
        0 8px,
        100% 8px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

[data-theme="light"] .media-card::after {
    border-color: rgba(0, 157, 170, 0.35);
    background: rgba(0, 157, 170, 0.08);
}

[data-theme="light"] .media-card:hover {
    border-color: rgba(0, 157, 170, 0.5);
    box-shadow: 0 2px 20px rgba(0, 157, 170, 0.08), inset 0 0 20px rgba(0, 157, 170, 0.02);
}

.media-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--cyan);
}

.media-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 3px;
}

.country-flag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.1rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
}

.media-card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.media-outlet {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--cyan);
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.media-date {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.media-card p:not(.media-outlet):not(.media-date) {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
    flex: 1;
}

.media-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--cyan);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.media-link i {
    transition: transform var(--transition-fast);
}

.media-link:hover i {
    transform: translateX(3px);
}

.media-link:hover {
    color: #66f7ff;
}

/* ============================================================
   TEACHING PCB — DDR DIMM slot motherboard layout
   ============================================================ */
.teaching-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
    background-image: url('svg/pcb-teaching.svg');
    background-size: 1000px 800px;
    background-position: center;
    background-repeat: repeat;
}

[data-theme="light"] .teaching-pcb {
    opacity: 0.18;
    background-image: url('svg/pcb-teaching-light.svg');
}

/* ============================================================
   TEACHING & SPEAKING
   ============================================================ */
.teaching-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* DDR RAM stick card styling */
.teaching-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    padding-bottom: 1.75rem;
    border-radius: 4px 4px 0 0;
    border: 1.5px solid rgba(0, 240, 255, 0.25);
    border-bottom: 3px solid rgba(0, 240, 255, 0.4);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    /* Gold contact fingers along the bottom edge */
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 6px, rgba(255, 200, 50, 0.2) 6px, rgba(255, 200, 50, 0.2) 10px, transparent 10px, transparent 14px);
    background-size: 100% 6px;
    background-position: 0 100%;
    background-repeat: repeat-x;
}

/* DDR keying notch (bottom edge gap) */
.teaching-card::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 38%;
    width: 16px;
    height: 8px;
    background: var(--bg-primary);
    border-left: 1.5px solid rgba(0, 240, 255, 0.25);
    border-right: 1.5px solid rgba(0, 240, 255, 0.25);
    border-top: 1.5px solid rgba(0, 240, 255, 0.25);
    border-radius: 3px 3px 0 0;
    pointer-events: none;
}

/* Memory chip outlines on card surface */
.teaching-card::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;
    height: 20px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 2px;
    pointer-events: none;
    box-shadow:
        -70px 0 0 0 transparent,
        -70px 0 0 0 transparent;
    outline: 1px solid rgba(0, 240, 255, 0.06);
    outline-offset: 3px;
}

.teaching-card:hover {
    border-color: rgba(0, 240, 255, 0.4);
    border-bottom-color: rgba(255, 200, 50, 0.5);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1), 0 6px 20px rgba(255, 200, 50, 0.05);
    transform: translateY(-3px);
}

/* Light mode DDR RAM cards */
[data-theme="light"] .teaching-card {
    border-color: rgba(0, 157, 170, 0.3);
    border-bottom-color: rgba(180, 140, 20, 0.4);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 6px, rgba(180, 140, 20, 0.2) 6px, rgba(180, 140, 20, 0.2) 10px, transparent 10px, transparent 14px);
    background-size: 100% 6px;
    background-position: 0 100%;
    background-repeat: repeat-x;
}

[data-theme="light"] .teaching-card::before {
    background: var(--bg-primary);
    border-color: rgba(0, 157, 170, 0.3);
}

[data-theme="light"] .teaching-card::after {
    border-color: rgba(0, 157, 170, 0.12);
    outline-color: rgba(0, 157, 170, 0.06);
}

[data-theme="light"] .teaching-card:hover {
    border-color: rgba(0, 157, 170, 0.45);
    border-bottom-color: rgba(180, 140, 20, 0.55);
    box-shadow: 0 0 30px rgba(0, 157, 170, 0.08), 0 6px 20px rgba(180, 140, 20, 0.05);
}

.teaching-blue .teaching-icon,
.speaking-green .teaching-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    margin-right: 1rem;
    font-size: 1.2rem;
    color: var(--cyan);
    flex-shrink: 0;
}

.teaching-blue .teaching-icon img,
.speaking-green .teaching-icon img {
    filter: brightness(0.9) saturate(0.8);
}

.teaching-card .teaching-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.teaching-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.teaching-blue .teaching-type,
.speaking-green .teaching-type {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--cyan);
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.teaching-institution {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.teaching-card p:not(.teaching-type):not(.teaching-institution) {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

.teaching-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.teaching-blue .teaching-semester,
.teaching-blue .teaching-students,
.speaking-green .teaching-date,
.speaking-green .teaching-audience {
    font-family: var(--font-mono);
    background: rgba(0, 240, 255, 0.06);
    color: var(--cyan);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid rgba(0, 240, 255, 0.1);
}

.card-click-hint {
    margin-top: 0.75rem;
    padding: 0.4rem;
    background: rgba(0, 240, 255, 0.04);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.teaching-card:hover .card-click-hint {
    opacity: 1;
}

/* Keynotes full-width */
.keynotes-full-width {
    width: 100%;
}

.keynote-card-full + .keynote-card-full {
    margin-top: 1.5rem;
}

.keynote-card-full {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    width: 100%;
    transition: all var(--transition-base);
}

.keynote-card-full:hover {
    border-color: rgba(0, 240, 255, 0.15);
}

.keynote-card-full .keynote-card-image {
    width: 100%;
    aspect-ratio: 21/9;
    overflow: hidden;
    background: var(--bg-surface-solid);
    position: relative;
}

.keynote-card-full .keynote-card-image img.keynote-card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.7) brightness(0.7);
    transition: filter var(--transition-base);
}

.keynote-card-full:hover .keynote-card-image img.keynote-card-bg {
    filter: saturate(0.9) brightness(0.8);
}

.keynote-card-full .keynote-card-title-box {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 260px;
    height: 260px;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(20px);
    border: 1.5px solid rgba(0, 240, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    /* CPU pin notches on all 4 edges */
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 10px, rgba(0, 240, 255, 0.18) 10px, rgba(0, 240, 255, 0.18) 13px, transparent 13px, transparent 20px),
        repeating-linear-gradient(to right, transparent, transparent 10px, rgba(0, 240, 255, 0.18) 10px, rgba(0, 240, 255, 0.18) 13px, transparent 13px, transparent 20px),
        repeating-linear-gradient(to bottom, transparent, transparent 10px, rgba(0, 240, 255, 0.18) 10px, rgba(0, 240, 255, 0.18) 13px, transparent 13px, transparent 20px),
        repeating-linear-gradient(to bottom, transparent, transparent 10px, rgba(0, 240, 255, 0.18) 10px, rgba(0, 240, 255, 0.18) 13px, transparent 13px, transparent 20px);
    background-size:
        100% 4px,
        100% 4px,
        4px 100%,
        4px 100%;
    background-position:
        0 0,
        0 100%,
        0 0,
        100% 0;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    background-color: rgba(10, 10, 18, 0.85);
}

/* CPU pin traces extending from title box */
.keynote-card-full .keynote-card-title-box::before {
    content: '';
    position: absolute;
    inset: -10px;
    border: 1px dashed rgba(0, 240, 255, 0.1);
    border-radius: 6px;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 8px, rgba(0, 240, 255, 0.1) 8px, rgba(0, 240, 255, 0.1) 11px, transparent 11px, transparent 20px),
        repeating-linear-gradient(to right, transparent, transparent 8px, rgba(0, 240, 255, 0.1) 8px, rgba(0, 240, 255, 0.1) 11px, transparent 11px, transparent 20px),
        repeating-linear-gradient(to bottom, transparent, transparent 8px, rgba(0, 240, 255, 0.1) 8px, rgba(0, 240, 255, 0.1) 11px, transparent 11px, transparent 20px),
        repeating-linear-gradient(to bottom, transparent, transparent 8px, rgba(0, 240, 255, 0.1) 8px, rgba(0, 240, 255, 0.1) 11px, transparent 11px, transparent 20px);
    background-size:
        100% 10px,
        100% 10px,
        10px 100%,
        10px 100%;
    background-position:
        10px 0,
        10px 100%,
        0 10px,
        100% 10px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

/* CPU orientation triangle (pin 1 marker) */
.keynote-card-full .keynote-card-title-box::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 0;
    height: 0;
    border-left: 6px solid rgba(0, 240, 255, 0.35);
    border-top: 6px solid transparent;
    border-bottom: 0;
    border-right: 6px solid transparent;
    pointer-events: none;
    transform: rotate(-45deg);
}

.keynote-card-full.keynote-card-title-right .keynote-card-title-box {
    left: auto;
    right: 1.5rem;
}

.keynote-card-full .keynote-card-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    text-align: center;
}

.keynote-card-full .keynote-card-logos {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.keynote-card-full .keynote-card-logos .keynote-card-logo,
.keynote-card-full .keynote-card-logo {
    position: static;
    max-width: 100px;
    width: 100px;
    height: auto;
    object-fit: contain;
    display: block;
    filter: brightness(0.9);
}

.keynote-card-full .keynote-card-logos-bottom-left {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 2;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.keynote-card-full .keynote-card-logo-bottom {
    max-width: 100px;
    width: 100px;
    height: auto;
    object-fit: contain;
    display: block;
}

.keynote-card-full .keynote-card-description {
    margin: 0;
    padding: 1.5rem 2rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ============================================================
   CONSULTING
   ============================================================ */
/* ============================================================
   CONSULTING PCB — Apple-style motherboard layout
   ============================================================ */
.consulting-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
    background-image: url('svg/pcb-consulting.svg');
    background-size: 1100px 900px;
    background-position: center;
    background-repeat: repeat;
}

[data-theme="light"] .consulting-pcb {
    opacity: 0.18;
    background-image: url('svg/pcb-consulting-light.svg');
}

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

/* DDR RAM stick card styling for consulting */
.consulting-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    padding: 0;
    border-radius: 4px 4px 0 0;
    border: 1.5px solid rgba(0, 240, 255, 0.25);
    border-bottom: 3px solid rgba(0, 240, 255, 0.4);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* Gold contact fingers along the bottom edge */
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 6px, rgba(255, 200, 50, 0.2) 6px, rgba(255, 200, 50, 0.2) 10px, transparent 10px, transparent 14px);
    background-size: 100% 6px;
    background-position: 0 100%;
    background-repeat: repeat-x;
    background-color: var(--bg-surface);
}

/* DDR keying notch (bottom edge gap) */
.consulting-card::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 38%;
    width: 16px;
    height: 8px;
    background: var(--bg-primary);
    border-left: 1.5px solid rgba(0, 240, 255, 0.25);
    border-right: 1.5px solid rgba(0, 240, 255, 0.25);
    border-top: 1.5px solid rgba(0, 240, 255, 0.25);
    border-radius: 3px 3px 0 0;
    pointer-events: none;
    z-index: 2;
}

/* Memory chip outline on card surface */
.consulting-card::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 50px;
    height: 16px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 2px;
    pointer-events: none;
    outline: 1px solid rgba(0, 240, 255, 0.06);
    outline-offset: 3px;
    z-index: 2;
}

.consulting-card:hover {
    border-color: rgba(0, 240, 255, 0.4);
    border-bottom-color: rgba(255, 200, 50, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1), 0 6px 20px rgba(255, 200, 50, 0.05);
}

/* Light mode DDR RAM consulting cards */
[data-theme="light"] .consulting-card {
    border-color: rgba(0, 157, 170, 0.3);
    border-bottom-color: rgba(180, 140, 20, 0.4);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 6px, rgba(180, 140, 20, 0.2) 6px, rgba(180, 140, 20, 0.2) 10px, transparent 10px, transparent 14px);
    background-size: 100% 6px;
    background-position: 0 100%;
    background-repeat: repeat-x;
    background-color: var(--bg-surface);
}

[data-theme="light"] .consulting-card::before {
    background: var(--bg-primary);
    border-color: rgba(0, 157, 170, 0.3);
}

[data-theme="light"] .consulting-card::after {
    border-color: rgba(0, 157, 170, 0.12);
    outline-color: rgba(0, 157, 170, 0.06);
}

[data-theme="light"] .consulting-card:hover {
    border-color: rgba(0, 157, 170, 0.45);
    border-bottom-color: rgba(180, 140, 20, 0.55);
    box-shadow: 0 0 30px rgba(0, 157, 170, 0.08), 0 6px 20px rgba(180, 140, 20, 0.05);
}

.consulting-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--bg-surface-solid);
}

.consulting-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.6) brightness(0.7);
    transition: all var(--transition-base);
}

.consulting-card:hover .consulting-card-image {
    filter: saturate(0.9) brightness(0.85);
    transform: scale(1.03);
}

.consulting-icon {
    width: 48px;
    height: 48px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #a78bfa;
}

.consulting-card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    padding: 1.25rem 1.25rem 0;
    line-height: 1.4;
}

.consulting-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
    padding: 0 1.25rem;
}

.consulting-company-link {
    display: inline-block;
    margin: 0 1.25rem 1.25rem;
    color: var(--cyan);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.consulting-company-link:hover {
    color: #66f7ff;
}

.consulting-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0 1.25rem;
}

.feature {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--cyan);
    padding: 0.2rem 0.6rem;
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-pill);
    background: rgba(0, 240, 255, 0.04);
}

/* ============================================================
   BOOKS
   ============================================================ */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.book-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    border-color: rgba(0, 240, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: var(--glow-cyan);
}

.book-cover {
    height: 180px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.05), rgba(124, 58, 237, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-content h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.book-authors {
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.book-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex: 1;
    font-size: 0.9rem;
}

.book-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.book-year,
.book-pages,
.book-publisher {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-pill);
}

.book-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.book-link {
    text-decoration: none;
    color: var(--cyan);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--transition-fast);
}

.book-link:hover {
    color: #66f7ff;
}

/* ============================================================
   BOOKS PCB — SSD (M.2 NVMe) blueprint layout
   ============================================================ */
.books-pcb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
    background-image: url('svg/pcb-books.svg');
    background-size: 100% auto;
    background-position: center;
    background-repeat: repeat;
}

[data-theme="light"] .books-pcb {
    opacity: 0.06;
    background-image: url('svg/pcb-books-light.svg');
}

/* Books intro card — DDR RAM chip style */
.books-intro-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    padding: 2rem 2.5rem;
    border-radius: 4px 4px 0 0;
    border: 1.5px solid rgba(0, 240, 255, 0.25);
    border-bottom: 3px solid rgba(0, 240, 255, 0.4);
    position: relative;
    margin-bottom: 2.5rem;
    /* Gold contact fingers along the bottom edge */
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 6px, rgba(255, 200, 50, 0.2) 6px, rgba(255, 200, 50, 0.2) 10px, transparent 10px, transparent 14px);
    background-size: 100% 6px;
    background-position: 0 100%;
    background-repeat: repeat-x;
    background-color: var(--bg-surface);
}

.books-intro-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.books-intro-card p:last-child {
    margin-bottom: 0;
}

.books-intro-educators {
    color: var(--cyan) !important;
    font-family: var(--font-mono);
    font-size: 0.85rem !important;
    padding: 0.75rem 1rem;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 3px;
    margin-top: 0.5rem;
}

/* DDR keying notch */
.books-intro-card::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 38%;
    width: 16px;
    height: 8px;
    background: var(--bg-primary);
    border-left: 1.5px solid rgba(0, 240, 255, 0.25);
    border-right: 1.5px solid rgba(0, 240, 255, 0.25);
    border-top: 1.5px solid rgba(0, 240, 255, 0.25);
    border-radius: 3px 3px 0 0;
    pointer-events: none;
    z-index: 2;
}

/* Memory chip outline */
.books-intro-card::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 50px;
    height: 16px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 2px;
    pointer-events: none;
    outline: 1px solid rgba(0, 240, 255, 0.06);
    outline-offset: 2px;
}

/* Light mode DDR intro card */
[data-theme="light"] .books-intro-card {
    border-color: rgba(0, 157, 170, 0.3);
    border-bottom-color: rgba(0, 157, 170, 0.4);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 6px, rgba(160, 130, 30, 0.2) 6px, rgba(160, 130, 30, 0.2) 10px, transparent 10px, transparent 14px);
    background-size: 100% 6px;
    background-position: 0 100%;
    background-repeat: repeat-x;
}

[data-theme="light"] .books-intro-card::before {
    background: var(--bg-primary);
    border-color: rgba(0, 157, 170, 0.3);
}

[data-theme="light"] .books-intro-card::after {
    border-color: rgba(0, 157, 170, 0.15);
    outline-color: rgba(0, 157, 170, 0.08);
}

[data-theme="light"] .books-intro-educators {
    color: #009daa !important;
    background: rgba(0, 157, 170, 0.04);
    border-color: rgba(0, 157, 170, 0.15);
}

/* Large Books Grid — SD Card Style */
.books-grid-large {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.book-card-large {
    background: var(--bg-surface);
    border: 1.5px solid rgba(0, 240, 255, 0.25);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    /* SD card shape: notched top-right corner */
    border-radius: 6px 6px 4px 4px;
    clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%);
    overflow: visible;
}

/* SD card notch outline */
.book-card-large::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 240, 255, 0.06) 50%);
    border-bottom-left-radius: 2px;
    z-index: 2;
    pointer-events: none;
}

/* SD card contact pads at the bottom */
.book-card-large::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 12px;
    background:
        repeating-linear-gradient(to right,
            transparent,
            transparent 4px,
            rgba(212, 175, 55, 0.35) 4px,
            rgba(212, 175, 55, 0.35) 12px,
            transparent 12px,
            transparent 16px
        );
    border-radius: 0 0 2px 2px;
    pointer-events: none;
    z-index: 2;
}

.book-card-large:hover {
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.12), inset 0 0 30px rgba(0, 240, 255, 0.02);
}

.book-cover-large {
    height: 350px;
    background: var(--bg-surface-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

/* SD card label area — dashed border around cover */
.book-cover-large::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(0, 240, 255, 0.12);
    border-radius: 3px;
    pointer-events: none;
    z-index: 1;
}

/* Capacity label badge */
.book-cover-large::after {
    content: 'SD';
    position: absolute;
    top: 16px;
    left: 16px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(0, 240, 255, 0.3);
    padding: 2px 6px;
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 2px;
    z-index: 2;
}

.book-image {
    max-width: 85%;
    max-height: 90%;
    object-fit: contain;
    transition: transform var(--transition-slow);
    filter: saturate(0.8);
    position: relative;
    z-index: 1;
}

.book-card-large:hover .book-image {
    transform: scale(1.05);
    filter: saturate(1);
}

.book-content-large {
    padding: 1.75rem 2rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-content-large h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.book-content-large .book-authors {
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.book-content-large .book-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
    flex: 1;
    font-size: 0.95rem;
}

.book-content-large .book-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.book-content-large .book-year,
.book-content-large .book-pages,
.book-content-large .book-publisher {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-tertiary);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-subtle);
}

.book-content-large .book-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.book-content-large .book-link {
    text-decoration: none;
    color: var(--cyan);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(0, 240, 255, 0.04);
    transition: all var(--transition-fast);
}

.book-content-large .book-link:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--cyan);
}

/* Light mode SD card overrides */
[data-theme="light"] .book-card-large {
    border-color: rgba(0, 157, 170, 0.3);
}

[data-theme="light"] .book-card-large::before {
    background: linear-gradient(135deg, transparent 50%, rgba(0, 157, 170, 0.06) 50%);
}

[data-theme="light"] .book-card-large::after {
    background:
        repeating-linear-gradient(to right,
            transparent,
            transparent 4px,
            rgba(160, 130, 30, 0.3) 4px,
            rgba(160, 130, 30, 0.3) 12px,
            transparent 12px,
            transparent 16px
        );
}

[data-theme="light"] .book-cover-large {
    border-bottom-color: rgba(0, 157, 170, 0.1);
}

[data-theme="light"] .book-cover-large::before {
    border-color: rgba(0, 157, 170, 0.12);
}

[data-theme="light"] .book-cover-large::after {
    color: rgba(0, 157, 170, 0.35);
    border-color: rgba(0, 157, 170, 0.2);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: 1px solid var(--border-subtle);
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    z-index: 1001;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-header .modal-type {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.modal-body {
    padding: 2rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section h3 i {
    color: var(--cyan);
    font-size: 0.9rem;
}

.modal-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.modal-list {
    list-style: none;
    padding: 0;
}

.modal-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.modal-list li:last-child {
    border-bottom: none;
}

.modal-list li i {
    color: var(--cyan);
    width: 16px;
    margin-top: 0.15rem;
    font-size: 0.75rem;
}

.modal-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.modal-meta span {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-subtle);
}

.modal-meta .blue-meta {
    background: rgba(0, 240, 255, 0.06);
    color: var(--cyan);
    border-color: rgba(0, 240, 255, 0.1);
}

.modal-meta .green-meta {
    background: rgba(16, 185, 129, 0.06);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.1);
}

/* ============================================================
   FOOTER — Minimal Terminal
   ============================================================ */
.footer {
    background: transparent;
    border-top: 1px solid var(--border-subtle);
    padding: 4rem 0 2rem;
}

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

.footer-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-role {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    color: var(--cyan);
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.footer-line {
    width: 60px;
    height: 1px;
    background: var(--cyan);
    margin: 0 auto 1.5rem;
    opacity: 0.4;
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.4);
}

/* ============================================================
   PAGE LOAD
   ============================================================ */
body {
    opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .publications-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .books-grid-large {
        grid-template-columns: 1fr;
    }

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

    .research-card:first-child {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .hero-terminal {
        white-space: normal;
        word-break: break-word;
    }

    .nav-pill {
        display: none;
    }

    .nav-pill.active {
        display: block;
        position: fixed;
        top: 70px;
        left: 1rem;
        right: 1rem;
        border-radius: var(--radius-md);
        padding: 1rem;
    }

    .nav-pill.active .nav-menu {
        flex-direction: column;
        gap: 0.25rem;
    }

    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 2rem;
    }

    .hero-image {
        justify-content: center;
        order: -1;
    }

    .profile-placeholder {
        width: 220px;
        height: 220px;
        transform: rotate(0deg);
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-terminal {
        white-space: normal;
        word-break: break-word;
        overflow-x: hidden;
        font-size: 0.8rem;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .stat-divider {
        display: none;
    }

    .stat {
        padding: 0 1rem;
    }

    .personal-info-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .biography-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .teaching-grid,
    .publications-grid,
    .consulting-grid,
    .media-grid,
    .books-grid {
        grid-template-columns: 1fr;
    }

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

    .publications-filter {
        flex-wrap: wrap;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }

    .book-content-large {
        padding: 1.5rem;
    }

    .book-cover-large {
        height: 220px;
    }

    .keynote-card-full .keynote-card-title-box {
        width: 200px;
        height: 200px;
        padding: 1rem;
    }

    .keynote-card-full .keynote-card-title-box h3 {
        font-size: 1.1rem;
    }

    .book-card-large {
        clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
    }

    .nav-pill.active .dropdown-menu {
        position: static;
        min-width: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: none;
        backdrop-filter: none;
        padding: 0 0 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 90px 0 40px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .section {
        padding: 60px 0;
    }

    .container {
        padding: 0 16px;
    }

    .hero-terminal {
        font-size: 0.7rem;
    }

    .hero-tags {
        gap: 0.35rem;
    }

    .hero-tag {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }

    .profile-placeholder {
        width: min(70vw, 200px);
        height: min(70vw, 200px);
    }

    .stat {
        padding: 0 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .publication-card::before,
    .media-card::before {
        inset: -4px;
    }

    .keynote-card-full .keynote-card-title-box {
        width: 150px;
        height: 150px;
        bottom: 0.75rem;
        left: 0.75rem;
        padding: 0.75rem;
    }

    .keynote-card-full .keynote-card-title-box h3 {
        font-size: 0.9rem;
    }

    .book-card-large {
        clip-path: none;
        border-radius: var(--radius-md);
    }

    .contact-card {
        padding: 1.25rem;
    }

    .consulting-image {
        height: 120px;
    }

    .media-grid {
        gap: 1.5rem;
    }

    .publications-grid {
        gap: 1.5rem;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
}

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
    background: rgba(0, 240, 255, 0.2);
    color: var(--text-primary);
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(0, 240, 255, 0.06);
}

/* ============================================================
   BACK TO TOP BUTTON (moved from JS inline styles)
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(0, 240, 255, 0.1);
    color: var(--cyan);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 0.9rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: rgba(0, 240, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

/* ============================================================
   LIGHT MODE OVERRIDES
   ============================================================ */
[data-theme="light"] {
    --bg-primary: #f5f3ef;
    --bg-surface: rgba(0, 0, 0, 0.03);
    --bg-surface-hover: rgba(0, 0, 0, 0.05);
    --bg-surface-solid: #ffffff;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);

    --cyan: #009daa;
    --text-primary: #1a1a1e;
    --text-secondary: #5a5a66;
    --text-tertiary: #8a8a99;
    --text-link: var(--cyan);

    --glow-cyan: 0 2px 12px rgba(0, 0, 0, 0.06);
    --glow-cyan-strong: 0 4px 20px rgba(0, 0, 0, 0.1);
    --glow-coral: 0 2px 12px rgba(255, 61, 113, 0.08);
}

/* Nav pill — light mode */
[data-theme="light"] .nav-pill {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Nav link hover — light mode */
[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
    background: rgba(0, 157, 170, 0.08);
}

/* Dropdown — light mode */
[data-theme="light"] .dropdown-menu {
    background: rgba(255, 255, 255, 0.97);
}

[data-theme="light"] .dropdown-link:hover {
    background: rgba(0, 157, 170, 0.08);
}

/* Hero mesh gradient — softened pastels */
[data-theme="light"] .hero-mesh {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 157, 170, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(255, 61, 113, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 30%, rgba(0, 157, 170, 0.03) 0%, transparent 40%);
}

/* Hero terminal — light mode */
[data-theme="light"] .hero-terminal {
    background: rgba(0, 0, 0, 0.03);
}

/* Hero tags — light mode */
[data-theme="light"] .hero-tag {
    border-color: rgba(0, 157, 170, 0.25);
    background: rgba(0, 157, 170, 0.06);
}

/* Grain overlay — reduced for light mode */
[data-theme="light"] .grain-overlay {
    opacity: 0.015;
}

/* Card image overlays — lighter gradient */
[data-theme="light"] .card-image-section::after {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.1) 100%);
}

/* Research card hover — light mode */
[data-theme="light"] .research-card:hover,
[data-theme="light"] .media-card:hover,
[data-theme="light"] .book-card:hover {
    border-color: rgba(0, 157, 170, 0.2);
}

[data-theme="light"] .book-card-large:hover {
    border-color: rgba(0, 157, 170, 0.5);
    box-shadow: 0 2px 30px rgba(0, 157, 170, 0.1), inset 0 0 20px rgba(0, 157, 170, 0.02);
}

/* Filter buttons — light mode */
[data-theme="light"] .filter-btn.active,
[data-theme="light"] .filter-btn:hover {
    background: rgba(0, 157, 170, 0.1);
    border-color: rgba(0, 157, 170, 0.3);
}

/* Tags & features — light mode */
[data-theme="light"] .tag,
[data-theme="light"] .feature {
    border-color: rgba(0, 157, 170, 0.2);
    background: rgba(0, 157, 170, 0.06);
}

/* Publication type badges — light mode */
[data-theme="light"] .publication-type.journal {
    background: rgba(0, 157, 170, 0.1);
    border-color: rgba(0, 157, 170, 0.2);
}

/* Teaching semester/meta pills — light mode */
[data-theme="light"] .teaching-blue .teaching-semester,
[data-theme="light"] .teaching-blue .teaching-students,
[data-theme="light"] .speaking-green .teaching-date,
[data-theme="light"] .speaking-green .teaching-audience {
    background: rgba(0, 157, 170, 0.08);
    border-color: rgba(0, 157, 170, 0.15);
}

[data-theme="light"] .teaching-blue .teaching-icon,
[data-theme="light"] .speaking-green .teaching-icon {
    background: rgba(0, 157, 170, 0.1);
    border-color: rgba(0, 157, 170, 0.2);
}

/* Research icon — light mode */
[data-theme="light"] .research-icon {
    background: rgba(0, 157, 170, 0.1);
    border-color: rgba(0, 157, 170, 0.2);
}

/* Card click hint — light mode */
[data-theme="light"] .card-click-hint {
    background: rgba(0, 157, 170, 0.06);
}

/* Book cover gradient — light mode */
[data-theme="light"] .book-cover {
    background: linear-gradient(135deg, rgba(0, 157, 170, 0.06), rgba(124, 58, 237, 0.06));
}

/* Book meta badges — light mode */
[data-theme="light"] .book-year,
[data-theme="light"] .book-pages,
[data-theme="light"] .book-publisher,
[data-theme="light"] .book-content-large .book-year,
[data-theme="light"] .book-content-large .book-pages,
[data-theme="light"] .book-content-large .book-publisher {
    background: rgba(0, 0, 0, 0.04);
}

/* Book link buttons — light mode */
[data-theme="light"] .book-content-large .book-link {
    border-color: rgba(0, 157, 170, 0.25);
    background: rgba(0, 157, 170, 0.05);
}

[data-theme="light"] .book-content-large .book-link:hover {
    background: rgba(0, 157, 170, 0.12);
}

/* Keynote title box — light mode CPU */
[data-theme="light"] .keynote-card-full .keynote-card-title-box {
    background-color: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 157, 170, 0.3);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 10px, rgba(0, 157, 170, 0.18) 10px, rgba(0, 157, 170, 0.18) 13px, transparent 13px, transparent 20px),
        repeating-linear-gradient(to right, transparent, transparent 10px, rgba(0, 157, 170, 0.18) 10px, rgba(0, 157, 170, 0.18) 13px, transparent 13px, transparent 20px),
        repeating-linear-gradient(to bottom, transparent, transparent 10px, rgba(0, 157, 170, 0.18) 10px, rgba(0, 157, 170, 0.18) 13px, transparent 13px, transparent 20px),
        repeating-linear-gradient(to bottom, transparent, transparent 10px, rgba(0, 157, 170, 0.18) 10px, rgba(0, 157, 170, 0.18) 13px, transparent 13px, transparent 20px);
}

[data-theme="light"] .keynote-card-full .keynote-card-title-box::before {
    border-color: rgba(0, 157, 170, 0.1);
    background-image:
        repeating-linear-gradient(to right, transparent, transparent 8px, rgba(0, 157, 170, 0.1) 8px, rgba(0, 157, 170, 0.1) 11px, transparent 11px, transparent 20px),
        repeating-linear-gradient(to right, transparent, transparent 8px, rgba(0, 157, 170, 0.1) 8px, rgba(0, 157, 170, 0.1) 11px, transparent 11px, transparent 20px),
        repeating-linear-gradient(to bottom, transparent, transparent 8px, rgba(0, 157, 170, 0.1) 8px, rgba(0, 157, 170, 0.1) 11px, transparent 11px, transparent 20px),
        repeating-linear-gradient(to bottom, transparent, transparent 8px, rgba(0, 157, 170, 0.1) 8px, rgba(0, 157, 170, 0.1) 11px, transparent 11px, transparent 20px);
}

[data-theme="light"] .keynote-card-full .keynote-card-title-box::after {
    border-left-color: rgba(0, 157, 170, 0.35);
}

/* Keynote card hover — light mode */
[data-theme="light"] .keynote-card-full:hover {
    border-color: rgba(0, 157, 170, 0.2);
}

/* Social link hover — light mode */
[data-theme="light"] .social-link:hover {
    color: #009daa;
    border-color: rgba(0, 157, 170, 0.3);
}

/* Footer social hover — light mode */
[data-theme="light"] .footer-social a:hover {
    border-color: rgba(0, 157, 170, 0.3);
}

/* Modal overlay — light mode */
[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* Modal list border — light mode */
[data-theme="light"] .modal-list li {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* Modal meta — light mode */
[data-theme="light"] .modal-meta span {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .modal-meta .blue-meta {
    background: rgba(0, 157, 170, 0.08);
    border-color: rgba(0, 157, 170, 0.15);
}

/* bg-light sections — light mode */
[data-theme="light"] .bg-light {
    background: rgba(0, 0, 0, 0.02);
}

/* Input fields — light mode */
[data-theme="light"] #publication-search {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .research-info-field textarea {
    background: rgba(0, 0, 0, 0.03);
}

/* Scrollbar — light mode */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 157, 170, 0.25);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 157, 170, 0.45);
}

/* Selection — light mode */
[data-theme="light"] ::selection {
    background: rgba(0, 157, 170, 0.2);
}

/* Link hover — light mode */
[data-theme="light"] a:hover {
    color: #007a85;
}

[data-theme="light"] .publication-link:hover,
[data-theme="light"] .media-link:hover,
[data-theme="light"] .book-link:hover,
[data-theme="light"] .consulting-company-link:hover {
    color: #007a85;
}

/* Country flag — light mode */
[data-theme="light"] .country-flag {
    background: rgba(0, 0, 0, 0.04);
}

/* Personal info link — light mode */
[data-theme="light"] .personal-info-content a {
    border-bottom-color: rgba(0, 157, 170, 0.3);
}

/* Back to top — light mode */
[data-theme="light"] .back-to-top {
    background: rgba(0, 157, 170, 0.1);
    color: var(--cyan);
    border-color: rgba(0, 157, 170, 0.25);
}

[data-theme="light"] .back-to-top:hover {
    background: rgba(0, 157, 170, 0.18);
    border-color: rgba(0, 157, 170, 0.4);
    box-shadow: 0 2px 12px rgba(0, 157, 170, 0.12);
}

/* Consulting image brightness — light mode */
[data-theme="light"] .consulting-card-image {
    filter: saturate(0.8) brightness(0.85);
}

[data-theme="light"] .consulting-card:hover .consulting-card-image {
    filter: saturate(1) brightness(0.95);
}

/* Keynote image brightness — light mode */
[data-theme="light"] .keynote-card-full .keynote-card-image img.keynote-card-bg {
    filter: saturate(0.8) brightness(0.85);
}

[data-theme="light"] .keynote-card-full:hover .keynote-card-image img.keynote-card-bg {
    filter: saturate(1) brightness(0.9);
}

/* Theme toggle icon swap */
[data-theme="light"] .theme-toggle {
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

[data-theme="light"] .theme-toggle:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(0, 157, 170, 0.08);
}

/* ============================================================
   STYLES MOVED FROM JS — active nav, cursor, animations
   ============================================================ */
.nav-link.active {
    color: var(--cyan);
}

.terminal-cursor {
    color: var(--cyan);
    animation: cursorBlink 1s step-end infinite;
    font-weight: 300;
    margin-left: 1px;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

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

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}
