/* ==========================================================
   SUMAN MUKHERJEE — EDITORIAL PORTFOLIO v3
   Bold. Asymmetric. Not your typical AI site.
   ========================================================== */

:root {
    --black: #0a0a0a;
    --white: #fafaf9;
    --accent: #b5ff4d;
    --accent-dim: #8fcc3d;
    --gray-1: #1a1a1a;
    --gray-2: #2a2a2a;
    --gray-3: #444;
    --gray-4: #888;
    --gray-5: #bbb;
    --gray-6: #e5e5e5;
    --font-sans: 'DM Sans', -apple-system, sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --max-w: 1200px;
    --nav-h: 64px;
}

/* -- LIGHT MODE -- */
[data-theme="light"] {
    --bg: var(--white);
    --bg2: #f0f0ee;
    --fg: var(--black);
    --fg2: #333;
    --fg3: #666;
    --fg4: #999;
    --border: #ddd;
    --card: #fff;
    --card-hover: #f5f5f3;
    --accent: #16a34a;
    --accent-dim: #15803d;
    --code-bg: #f1f1ef;
}

/* -- DARK MODE (default) -- */
body {
    --bg: var(--black);
    --bg2: var(--gray-1);
    --fg: var(--white);
    --fg2: var(--gray-5);
    --fg3: var(--gray-4);
    --fg4: var(--gray-3);
    --border: var(--gray-2);
    --card: var(--gray-1);
    --card-hover: var(--gray-2);
    --code-bg: var(--gray-2);

    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--fg);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    overflow-x: hidden;
}

[data-theme="light"] body {
    --bg: var(--white);
    --bg2: #f0f0ee;
    --fg: var(--black);
    --fg2: #333;
    --fg3: #666;
    --fg4: #999;
    --border: #ddd;
    --card: #fff;
    --card-hover: #f5f5f3;
    --code-bg: #f1f1ef;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--black); }

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2rem);
    /* Safe area for notched phones (iPhone X+, Samsung punch-hole) */
    padding-left: max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-left));
    padding-right: max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-right));
}

/* ======================== GRAIN ======================== */
.grain {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ======================== POPUP MODAL ======================== */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 1rem;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-modal {
    background: var(--gray-1);
    border: 1px solid var(--gray-2);
    border-radius: 20px;
    padding: clamp(2rem, 4vw, 3rem);
    max-width: 420px;
    width: 100%;
    position: relative;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s var(--ease);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .popup-modal {
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15);
}

.popup-overlay.active .popup-modal {
    transform: translateY(0) scale(1);
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--fg3);
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup-close:hover {
    color: var(--fg);
    transform: rotate(90deg);
}

.popup-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1.25rem;
    border: 2px solid var(--accent);
    padding: 2px;
}

.popup-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 85%;
    border-radius: 50%;
}

.popup-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.popup-text {
    font-size: 0.9375rem;
    color: var(--fg2);
    margin-bottom: 1.75rem;
    line-height: 1.6;
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s var(--ease);
}

.popup-btn:hover {
    transform: translateY(-2px);
}

.popup-btn-linkedin {
    background: #0A66C2;
    color: #fff;
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
}

.popup-btn-linkedin:hover {
    background: #004182;
    box-shadow: 0 6px 20px rgba(10, 102, 194, 0.4);
}

.popup-btn-github {
    background: var(--gray-2);
    color: var(--fg);
    border: 1px solid var(--gray-3);
}

[data-theme="light"] .popup-btn-github {
    background: #f3f3f3;
    color: #222;
    border-color: #ddd;
}

.popup-btn-github:hover {
    background: var(--gray-3);
}

.popup-btn i {
    font-size: 1.125rem;
}

.popup-email {
    font-size: 0.8125rem;
    color: var(--fg3);
}

.popup-email a {
    color: var(--accent);
    font-weight: 600;
    transition: opacity 0.2s;
}

.popup-email a:hover { opacity: 0.7; }

/* ======================== NAV ======================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1.25rem, 4vw, 2rem);
    padding-left: max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-left));
    padding-right: max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-right));
    padding-top: env(safe-area-inset-top);
    transition: background 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.nav-logo span {
    color: var(--fg3);
    font-weight: 400;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--fg3);
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--fg); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 3px;
    width: 44px;
    height: 24px;
    display: flex;
    align-items: center;
}

.toggle-track {
    width: 100%;
    height: 100%;
    position: relative;
    display: block;
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--fg);
    display: block;
    transition: transform 0.3s var(--ease);
}

[data-theme="light"] .toggle-thumb { transform: translateX(20px); }

.nav-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: var(--black);
    border-radius: 100px;
    transition: all 0.2s;
}

.nav-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.burger {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.burger span {
    width: 20px;
    height: 1.5px;
    background: var(--fg);
    transition: all 0.3s var(--ease);
    display: block;
}

.burger.active span:first-child { transform: rotate(45deg) translate(4px, 4px); }
.burger.active span:last-child { transform: rotate(-45deg) translate(4px, -4px); }

/* ======================== HERO ======================== */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    padding-top: var(--nav-h);
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem clamp(1.25rem, 4vw, 3rem) 4rem clamp(1.25rem, 4vw, 2rem);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 2rem;
    font-family: var(--font-mono);
}

.tag-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: blink 2s ease infinite;
}

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

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.hero-title em {
    font-style: italic;
    color: var(--accent);
}

.hero-sub {
    font-size: 1.0625rem;
    color: var(--fg2);
    line-height: 1.7;
    max-width: 440px;
    margin-bottom: 2.5rem;
}

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

/* -- Hero right (image) -- */
.hero-right {
    position: relative;
    overflow: hidden;
}

.hero-img-wrap {
    position: absolute;
    inset: 0;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}

.hero-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--bg) 0%, transparent 15%),
                linear-gradient(to bottom, var(--bg) 0%, transparent 8%);
}

.hero-name-strip {
    display: none;
}

/* Fallback background for hero-right */
.hero-right {
    background: linear-gradient(135deg, var(--gray-1) 0%, var(--gray-2) 50%, color-mix(in srgb, var(--accent) 15%, var(--gray-1)) 100%);
}

[data-theme="light"] .hero-right {
    background: linear-gradient(135deg, #e8e8e6 0%, #d8d8d6 50%, color-mix(in srgb, var(--accent) 10%, #e8e8e6) 100%);
}

[data-theme="light"] .hero-img-overlay {
    background: linear-gradient(to right, var(--bg) 0%, transparent 15%),
                linear-gradient(to bottom, var(--bg) 0%, transparent 8%);
}

/* -- Hero floating stats -- */
.hero-floats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
    z-index: 5;
    background: var(--bg);
}

.hf-card {
    padding: 1.25rem 1.5rem;
    border-right: 1px solid var(--border);
    transition: background 0.2s;
}

.hf-card:last-child { border-right: none; }
.hf-card:hover { background: var(--card-hover); }

.hf-num {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--accent);
}

.hf-lbl {
    font-size: 0.75rem;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ======================== BUTTONS ======================== */
.btn-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: var(--black);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 100px;
    border: none;
    transition: all 0.25s var(--ease);
}

.btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent); }

.btn-line {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: transparent;
    color: var(--fg);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    transition: all 0.25s;
}

.btn-line:hover { border-color: var(--fg); }
.btn-full { width: 100%; justify-content: center; }

/* ======================== MARQUEE ======================== */
.marquee-wrap {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg2);
}

.marquee { overflow: hidden; white-space: nowrap; }

.marquee-track {
    display: inline-flex;
    animation: scroll 30s linear infinite;
    gap: 0;
}

.marquee-track span {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg2);
}

.marquee-track .sep {
    color: var(--fg4);
    padding: 1rem 0;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ======================== TRANSFORM ======================== */
.transform-section {
    padding: clamp(4rem, 8vw, 8rem) 0;
}

.big-statement {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 3rem;
}

.big-statement em { font-style: italic; color: var(--accent); }

.transform-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.tf-item {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-right: 1px solid var(--border);
    transition: background 0.2s;
}

.tf-item:last-child { border-right: none; }
.tf-item:hover { background: var(--card-hover); }

.tf-from {
    font-size: 0.9375rem;
    color: var(--fg3);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--fg3) 40%, transparent);
}

.tf-arrow {
    font-size: 1.25rem;
    color: var(--accent);
}

.tf-to {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
}

/* ======================== SECTIONS ======================== */
.section {
    padding: clamp(4rem, 8vw, 7rem) 0;
}

.section-dark { background: var(--bg2); }

.section-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

.label-num {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 600;
}

.label-line {
    width: 40px;
    height: 1px;
    background: var(--border);
}

.section-heading {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: clamp(2rem, 4vw, 4rem);
}

.section-heading em { font-style: italic; color: var(--accent); }

/* ======================== BENTO GRID ======================== */
.bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.bento-card {
    background: var(--card);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    transition: background 0.3s, transform 0.3s;
    position: relative;
}

.bento-card:hover { background: var(--card-hover); }

/* Hero card (spans full width) */
.bento-hero-card {
    grid-column: span 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    border-bottom: 3px solid var(--accent);
    position: relative;
    overflow: hidden;
}

.bento-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%);
    pointer-events: none;
}

.bento-hero-card h3 {
    font-size: 1.75rem;
    grid-column: 1 / -1;
}

/* Accent card (AI Agents — spans 2 cols) */
.bento-accent {
    grid-column: span 2;
    border-left: 3px solid var(--accent);
}

/* Featured card (Career Accelerator — spans 2 cols) */
.bento-featured-card {
    grid-column: span 2;
    background: color-mix(in srgb, var(--accent) 5%, var(--card));
    border-left: 3px solid var(--accent);
}

.bento-featured-card:hover {
    background: color-mix(in srgb, var(--accent) 10%, var(--card));
}

.bc-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--black);
    background: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

.bc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.bc-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg3);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.bc-tag i {
    color: var(--accent);
    font-size: 0.75rem;
}

.bc-result {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.bc-featured {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.bc-featured i {
    font-size: 0.625rem;
}

.bento-card h3 {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.bento-card p {
    font-size: 0.9375rem;
    color: var(--fg2);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.bento-card p strong { color: var(--fg); }

.bc-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.bc-tech span {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    padding: 0.25rem 0.625rem;
    background: var(--code-bg);
    border-radius: 4px;
    color: var(--fg2);
}

/* Metrics row for hero card */
.bc-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    grid-column: 1 / -1;
}

.bc-metric {
    text-align: center;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: 8px;
}

.bc-metric-num {
    display: block;
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--accent);
    line-height: 1.2;
}

.bc-metric-lbl {
    display: block;
    font-size: 0.6875rem;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
}

.bc-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: 8px;
}

.bc-stats-row div { text-align: center; }
.bc-stats-row strong { display: block; font-family: var(--font-serif); font-size: 1.5rem; color: var(--accent); }
.bc-stats-row small { font-size: 0.6875rem; color: var(--fg3); text-transform: uppercase; letter-spacing: 0.08em; }

.bc-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    transition: opacity 0.2s;
}

.bc-link:hover { opacity: 0.7; }

/* ======================== TRUST BADGES ======================== */
.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg3);
    background: var(--code-bg);
    padding: 0.4rem 0.875rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.trust-badge i {
    color: var(--accent);
    font-size: 0.625rem;
}

/* ======================== BUBBLE TOOLS SECTION ======================== */
.bubble-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.bubble-category {
    position: relative;
}

.bubble-cat-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--fg2);
}

.bubble-cat-title i {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.875rem;
}

.bubble-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

.bubble-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--card);
    color: var(--fg);
    border: 1px solid var(--border);
    cursor: pointer;
    transform-origin: center center;
    transform: scale(0) rotate(0deg);
    opacity: 0;
    transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.bubble-pill.animated {
    opacity: 1;
    transform: scale(1) rotate(var(--pill-rotation, 0deg));
}

.bubble-pill:hover {
    background: var(--pill-hover-bg, var(--accent));
    color: var(--pill-hover-color, var(--black));
    border-color: var(--pill-hover-bg, var(--accent));
    box-shadow: 0 4px 20px color-mix(in srgb, var(--pill-hover-bg, var(--accent)) 35%, transparent);
    transform: scale(1.08) rotate(0deg) !important;
    z-index: 2;
}

.bubble-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}

.bubble-pill:hover::before {
    opacity: 1;
}

@media (max-width: 768px) {
    .bubble-pills {
        gap: 0.5rem;
    }
    .bubble-pill {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }
}

/* ======================== EXPERTISE ======================== */
.exp-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.exp-col {
    padding: 2rem;
    border-right: 1px solid var(--border);
    transition: background 0.3s;
}

.exp-col:last-child { border-right: none; }
.exp-col:hover { background: var(--card-hover); }

.exp-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 1rem;
}

.exp-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.exp-col h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.exp-col > p {
    font-size: 0.8125rem;
    color: var(--fg3);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.exp-col ul { display: flex; flex-direction: column; gap: 0.5rem; }

.exp-col li {
    font-size: 0.8125rem;
    color: var(--fg2);
    padding-left: 1rem;
    position: relative;
}

.exp-col li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

/* ======================== PROOF ======================== */
.proof-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.proof-item {
    background: var(--card);
    padding: 2rem;
    transition: background 0.2s;
}

.proof-item:hover { background: var(--card-hover); }

.proof-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.proof-item h4 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    color: var(--fg);
}

.proof-item p {
    font-size: 0.9375rem;
    color: var(--fg2);
    line-height: 1.7;
}

.proof-item p strong { color: var(--fg); font-size: 1.125rem; }

.proof-item a {
    color: var(--accent);
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.proof-item a:hover { border-bottom-color: var(--accent); }

/* ======================== WRITING ======================== */
.writing-list {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.writing-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    gap: 2rem;
}

.writing-item:last-child { border-bottom: none; }
.writing-item:hover { background: var(--card-hover); }

.wi-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--fg3);
}

.writing-item h3 {
    font-size: 1rem;
    font-weight: 500;
}

.wi-arrow {
    font-size: 1.25rem;
    color: var(--fg4);
    transition: color 0.2s, transform 0.2s;
}

.writing-item:hover .wi-arrow { color: var(--accent); transform: translate(2px, -2px); }

/* ======================== CONTACT ======================== */
.contact-sub {
    font-size: 1.0625rem;
    color: var(--fg2);
    margin-bottom: 3rem;
}

.contact-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-links { display: flex; flex-direction: column; gap: 0; }

.cl-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.2s;
}

.cl-item:hover { padding-left: 0.5rem; }

.cl-item i {
    width: 20px;
    text-align: center;
    color: var(--fg3);
    font-size: 1rem;
}

.cl-item strong { display: block; font-size: 0.875rem; }
.cl-item span { font-size: 0.8125rem; color: var(--fg3); }

/* Form */
.contact-form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.contact-form h3 {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.form-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 0.75rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--fg4); }

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    border-color: var(--accent);
}

.contact-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.contact-form textarea { resize: vertical; min-height: 100px; }

/* ======================== FOOTER ======================== */
.footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-left p { font-size: 0.8125rem; color: var(--fg3); margin-top: 0.25rem; }

.footer-right {
    display: flex;
    gap: 1rem;
}

.footer-right a {
    color: var(--fg3);
    font-size: 1rem;
    transition: color 0.2s;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--fg4);
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.footer-v { font-family: var(--font-mono); }

/* Back to top */
.btt {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--black);
    border: none;
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s var(--ease);
    z-index: 50;
}

.btt.visible { opacity: 1; transform: translateY(0); }
.btt:hover { transform: translateY(-2px); }

/* ======================== REVEAL ======================== */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: var(--d, 0s);
}

.reveal-up.visible { opacity: 1; transform: none; }

/* ======================== RESPONSIVE ======================== */

/* --- iPad Pro / Large Tablets (1024px) --- */
@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .hero-left { padding: calc(var(--nav-h) + 2rem) 2rem 6rem; }
    .hero-right { height: 45vh; min-height: 300px; position: relative; }
    .hero-floats { position: relative; grid-template-columns: repeat(4, 1fr); }
    .hero-actions { gap: 0.75rem; }

    .transform-grid { grid-template-columns: 1fr; }
    .tf-item { border-right: none; border-bottom: 1px solid var(--border); }
    .tf-item:last-child { border-bottom: none; }

    .bento { grid-template-columns: 1fr 1fr; }
    .bento-hero-card { grid-column: span 2; grid-template-columns: 1fr; }
    .bento-accent { grid-column: span 2; }
    .bento-featured-card { grid-column: span 2; }

    .exp-cols { grid-template-columns: 1fr 1fr; }
    .exp-col { border-bottom: 1px solid var(--border); }
    .exp-col:nth-child(2) { border-right: none; }
    .exp-col:nth-child(3) { border-right: 1px solid var(--border); }

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

    .bubble-cat-title { font-size: 1.125rem; }
}

/* --- iPad / Standard Tablets (768px) --- */
@media (max-width: 768px) {
    body { font-size: 15px; }

    .nav-links { display: none; }
    .nav-btn { display: none; }
    .burger { display: flex; }
    .nav { padding: 0 1rem; }
    .nav-logo { font-size: 1rem; }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg);
        padding: 2rem;
        gap: 0;
        z-index: 99;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.open a {
        font-size: 1.5rem;
        font-family: var(--font-serif);
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
        color: var(--fg);
    }

    .hero-left { padding: calc(var(--nav-h) + 1.5rem) 1.25rem 5rem; }
    .hero-right { height: 40vh; min-height: 260px; }
    .hero-sub { font-size: 0.9375rem; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn-main,
    .hero-actions .btn-line { width: 100%; justify-content: center; text-align: center; }
    .hero-trust { gap: 0.4rem; }
    .trust-badge { font-size: 0.625rem; padding: 0.3rem 0.625rem; }

    .hero-floats { grid-template-columns: repeat(2, 1fr); }
    .hf-card { padding: 1rem; }
    .hf-num { font-size: 1.5rem; }
    .hf-lbl { font-size: 0.6875rem; }

    .marquee-track span { padding: 0.75rem 1rem; font-size: 0.75rem; }

    .big-statement { font-size: clamp(2rem, 6vw, 3rem); }
    .section-heading { font-size: clamp(1.75rem, 5vw, 2.5rem); }
    .section { padding: clamp(3rem, 6vw, 5rem) 0; }

    .bento { grid-template-columns: 1fr; }
    .bento-hero-card,
    .bento-accent,
    .bento-featured-card { grid-column: span 1; }
    .bento-card { padding: clamp(1.25rem, 3vw, 2rem); }
    .bento-card h3 { font-size: 1.25rem; }
    .bento-card p { font-size: 0.875rem; }
    .bc-metrics { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .bc-metric { padding: 0.75rem 0.5rem; }
    .bc-metric-num { font-size: 1.5rem; }
    .bc-stats-row { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.75rem; }
    .bc-stats-row strong { font-size: 1.25rem; }
    .bc-tech { gap: 0.3rem; }
    .bc-tech span { font-size: 0.625rem; padding: 0.2rem 0.5rem; }

    .bubble-grid { gap: 2rem; }
    .bubble-cat-title { font-size: 1rem; gap: 0.5rem; margin-bottom: 1rem; }
    .bubble-cat-title i { width: 28px; height: 28px; font-size: 0.75rem; }
    .bubble-pills { gap: 0.4rem; }
    .bubble-pill { font-size: 0.75rem; padding: 0.5rem 0.875rem; }

    .exp-cols { grid-template-columns: 1fr; }
    .exp-col { border-right: none !important; padding: 1.5rem; }
    .exp-col h3 { font-size: 1.125rem; }

    .proof-row { grid-template-columns: 1fr; }
    .proof-item { padding: 1.5rem; }
    .proof-item h4 { font-size: 1.125rem; }
    .proof-item p { font-size: 0.875rem; }

    .writing-item { grid-template-columns: 70px 1fr auto; padding: 1rem; gap: 0.75rem; }
    .writing-item h3 { font-size: 0.9375rem; }
    .wi-date { font-size: 0.6875rem; }

    .contact-sub { font-size: 0.9375rem; margin-bottom: 2rem; }
    .form-duo { grid-template-columns: 1fr; }
    .contact-form { padding: 1.5rem; }
    .contact-form h3 { font-size: 1.25rem; }
    .cl-item { padding: 0.875rem 0; gap: 0.75rem; }
    .cl-item strong { font-size: 0.8125rem; }
    .cl-item span { font-size: 0.75rem; }

    .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
    .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

    .popup-modal { padding: 1.5rem; max-width: 360px; }
    .popup-title { font-size: 1.25rem; }
    .popup-text { font-size: 0.875rem; }
    .popup-btn { font-size: 0.875rem; padding: 0.75rem 1.25rem; }

    .btt { width: 36px; height: 36px; font-size: 0.75rem; bottom: 1rem; right: 1rem; }
}

/* --- Samsung Galaxy / Standard Phones (480px) --- */
@media (max-width: 480px) {
    body { font-size: 14px; }

    .hero-title { font-size: clamp(2.25rem, 9vw, 3rem); }
    .hero-sub { font-size: 0.875rem; max-width: 100%; }
    .hero-left { padding: calc(var(--nav-h) + 1rem) 1rem 4rem; }
    .hero-right { height: 35vh; min-height: 220px; }
    .hero-floats { grid-template-columns: 1fr 1fr; }
    .hf-card { padding: 0.75rem; }
    .hf-num { font-size: 1.25rem; }
    .hf-lbl { font-size: 0.625rem; letter-spacing: 0.06em; }
    .hero-trust { margin-top: 1.5rem; padding-top: 1rem; }
    .trust-badge { font-size: 0.5625rem; padding: 0.25rem 0.5rem; }

    .big-statement { font-size: clamp(1.75rem, 7vw, 2.5rem); margin-bottom: 2rem; }

    .tf-item { padding: 1.25rem; }
    .tf-from { font-size: 0.8125rem; }
    .tf-to { font-size: 1rem; }

    .section-heading { font-size: clamp(1.5rem, 6vw, 2rem); margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
    .section-label { font-size: 0.75rem; gap: 0.75rem; }

    .bc-metrics { grid-template-columns: repeat(3, 1fr); }
    .bc-metric-num { font-size: 1.25rem; }
    .bc-metric-lbl { font-size: 0.5625rem; }
    .bc-stats-row { grid-template-columns: repeat(3, 1fr); }
    .bc-stats-row strong { font-size: 1.125rem; }
    .bc-stats-row small { font-size: 0.5625rem; }

    .bubble-pill { font-size: 0.6875rem; padding: 0.4rem 0.75rem; }
    .bubble-cat-title { font-size: 0.9375rem; }

    .exp-col { padding: 1.25rem; }
    .exp-col li { font-size: 0.75rem; }
    .exp-col > p { font-size: 0.75rem; }
    .exp-icon { width: 36px; height: 36px; }

    .writing-item { grid-template-columns: 60px 1fr auto; padding: 0.875rem; gap: 0.5rem; }
    .writing-item h3 { font-size: 0.875rem; }

    .contact-form input,
    .contact-form textarea,
    .contact-form select { font-size: 16px; /* prevents iOS zoom on focus */ }

    .popup-modal { margin: 1rem; max-width: 100%; border-radius: 16px; }
    .popup-actions { gap: 0.5rem; }
    .popup-btn { padding: 0.625rem 1rem; font-size: 0.8125rem; }
}

/* --- Small phones (Galaxy S series, iPhone SE, etc - 360px) --- */
@media (max-width: 360px) {
    .hero-title { font-size: 2rem; }
    .hero-sub { font-size: 0.8125rem; }
    .hero-left { padding: calc(var(--nav-h) + 0.75rem) 0.875rem 3.5rem; }
    .hero-right { height: 30vh; min-height: 180px; }
    .hero-actions .btn-main,
    .hero-actions .btn-line { font-size: 0.8125rem; padding: 0.75rem 1.25rem; }

    .hf-num { font-size: 1.125rem; }
    .hf-lbl { font-size: 0.5625rem; }

    .section { padding: 2.5rem 0; }
    .big-statement { font-size: 1.5rem; }
    .section-heading { font-size: 1.375rem; }

    .bubble-pill { font-size: 0.625rem; padding: 0.35rem 0.625rem; }

    .writing-item { grid-template-columns: 50px 1fr auto; }
    .writing-item h3 { font-size: 0.8125rem; }
    .wi-date { font-size: 0.625rem; }
}

/* --- iPad landscape & touch improvements --- */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .nav-links.open a { padding: 1.25rem 0; min-height: 48px; }
    .bubble-pill { min-height: 40px; }
    .cl-item { min-height: 48px; }
    .btn-main, .btn-line { min-height: 48px; }
    .writing-item { min-height: 56px; }
    .btt { width: 44px; height: 44px; }
    .popup-close { width: 40px; height: 40px; font-size: 2rem; }
    .theme-toggle { width: 48px; height: 28px; }
    .burger { padding: 8px; }
    .burger span { width: 22px; }

    /* Disable hover-dependent animations on touch */
    .bubble-pill:hover {
        transform: scale(1) rotate(var(--pill-rotation, 0deg)) !important;
        box-shadow: none;
    }
    .tf-item:hover, .hf-card:hover, .exp-col:hover,
    .proof-item:hover, .bento-card:hover { background: var(--card); }
}

/* --- Landscape phones --- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { min-height: auto; }
    .hero-left { padding: calc(var(--nav-h) + 1rem) 2rem 3rem; }
    .hero-right { height: 50vh; min-height: 200px; }
    .hero-floats { grid-template-columns: repeat(4, 1fr); }
    .popup-overlay { align-items: flex-start; padding-top: 1rem; }
    .popup-modal { max-height: 90vh; overflow-y: auto; }
}

/* --- Samsung fold / Ultra narrow --- */
@media (max-width: 300px) {
    .container { padding: 0 0.75rem; }
    .hero-title { font-size: 1.75rem; }
    .hero-floats { grid-template-columns: 1fr; }
    .bc-metrics, .bc-stats-row { grid-template-columns: 1fr; }
    .trust-badge { font-size: 0.5rem; }
}
