/*
 * Imbila theme — white + orange restyle of the portfolio.
 * Loaded after every page's inline <style>, so it only swaps colours, type,
 * borders and buttons; layout rules stay in the templates.
 */

:root {
    color-scheme: light;

    --imb-orange: #d8400e;
    --imb-orange-dark: #b33508;
    --imb-orange-tint: #fff7ed;
    --imb-ink: #0a0a0a;
    --imb-dark: #0d0d0d;
    --imb-gray-600: #4b5563;
    --imb-gray-500: #6b7280;
    --imb-gray-400: #9ca3af;
    --imb-gray-300: #d1d5db;
    --imb-gray-200: #e5e7eb;
    --imb-gray-50: #f9fafb;

    --imb-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --imb-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Remap the variables every template already uses */
    --bg-color: #ffffff;
    --bg-gradient: #ffffff;
    --text-color: var(--imb-ink);
    --card-bg: #ffffff;
    --secondary-text: var(--imb-gray-500);
    --accent: var(--imb-orange);
    --accent-gradient: linear-gradient(var(--imb-orange), var(--imb-orange));
    --card-shadow: none;
    --nav-bg: #ffffff;
    --border-color: var(--imb-gray-300);
}

html,
body {
    background: #ffffff;
    background-image: none;
    color: var(--imb-ink);
}

::selection {
    background: var(--imb-orange);
    color: #ffffff;
}

::-webkit-scrollbar-track { background: #ffffff; }
::-webkit-scrollbar-thumb {
    background: var(--imb-orange);
    border-radius: 0;
    border: 3px solid #ffffff;
}
::-webkit-scrollbar-thumb:hover { background: var(--imb-orange-dark); }

.cursor-glow { display: none !important; }

/* ---------- Navigation ---------- */

nav {
    background: #ffffff;
    border-bottom: 1px solid var(--imb-gray-200);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 1rem 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--imb-ink);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.logo::before {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--imb-orange);
    clip-path: polygon(0 0, 100% 0, 100% 65%, 65% 100%, 0 100%);
}

.logo:hover { transform: none; }

.nav-links {
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--imb-gray-300);
    border-radius: 999px;
    color: var(--imb-gray-600);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.nav-links a::after { display: none; }

.nav-links a:hover {
    border-color: var(--imb-gray-400);
    color: var(--imb-ink);
}

.nav-links a.is-active {
    border-color: var(--imb-gray-400);
    color: var(--imb-ink);
    background: var(--imb-gray-50);
}

.new-badge {
    position: static;
    margin: 0;
    padding: 2px 5px;
    background: var(--imb-orange);
    color: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
    font-family: var(--imb-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    animation: none;
}

.hamburger div {
    background: var(--imb-ink);
    border-radius: 0;
}

@media (max-width: 768px) {
    .hamburger div { background: var(--imb-ink); }

    .nav-links {
        width: 18rem;
        max-width: 85%;
        background: #ffffff;
        border-left: 1px solid var(--imb-gray-200);
        box-shadow: -12px 0 30px rgba(0, 0, 0, 0.08);
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding-top: 5rem;
    }

    .nav-links a {
        margin: 0;
        padding: 1rem 1.5rem;
        border: none;
        border-bottom: 1px solid #f3f4f6;
        border-radius: 0;
        color: var(--imb-gray-600);
        font-size: 0.875rem;
    }

    .nav-links a:hover,
    .nav-links a.is-active {
        color: var(--imb-orange);
        background: var(--imb-orange-tint);
    }
}

/* ---------- Shared type + buttons ---------- */

.hero h1,
.headline,
.section-title,
.skills-title,
.error-title,
.experience-card h3 {
    font-family: var(--imb-serif);
    font-weight: 400;
    color: var(--imb-ink);
    background: none;
    -webkit-text-fill-color: currentColor;
    letter-spacing: -0.01em;
}

/* Pages set a font on `*`, so spans inside headings (e.g. the typewriter) need resetting */
.hero h1 *,
.headline *,
.section-title *,
.skills-title *,
.error-title * {
    font-family: inherit;
}

/* Typewriter cursor: show only the orange bar, not the "|" glyph */
.hero .cursor { -webkit-text-fill-color: transparent; }

.button {
    background: var(--imb-orange);
    color: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0.875rem 2rem;
    font-family: var(--imb-mono);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    transition: background 0.2s ease;
}

.button:hover {
    background: var(--imb-orange-dark);
    transform: none;
    box-shadow: none;
}

/* ---------- Home: hero ---------- */

.hero p {
    font-family: var(--imb-mono);
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--imb-gray-600);
}

.hero-image {
    border-radius: 0;
    border: 1px solid var(--imb-gray-300);
    box-shadow: none;
}

.hero-image-container::before,
.hero-image-container::after {
    content: '';
    position: absolute;
    background: var(--imb-orange);
    border-radius: 0;
    filter: none;
    opacity: 1;
    z-index: -1;
}

.hero-image-container::before {
    top: 18%;
    right: -28px;
    left: auto;
    bottom: auto;
    width: 56px;
    height: 72px;
}

.hero-image-container::after {
    top: auto;
    right: auto;
    bottom: -20px;
    left: -20px;
    width: 140px;
    height: 44px;
}

.status-emoji { animation: none; box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px var(--imb-gray-300); }

.status-tooltip {
    background: var(--imb-ink);
    border-radius: 0;
    font-family: var(--imb-mono);
    font-size: 0.75rem;
}

.location-badge {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    padding: 0.875rem 1rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.location-badge svg { fill: var(--imb-orange); opacity: 1; }

.location-badge span {
    color: var(--imb-gray-600);
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    line-height: 1.25;
}

.down-arrow {
    background: var(--imb-orange);
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

@media (max-width: 768px) {
    .down-arrow { box-shadow: none; margin-top: 28px; }

    .hero-image-container::before { right: -16px; width: 32px; height: 48px; }
    .hero-image-container::after { bottom: -12px; left: -12px; width: 90px; height: 28px; }
}

/* ---------- Home: tech strip ---------- */

.skills {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.skills::before { display: none; }

.skills-container img:hover { filter: none; }

/* ---------- Home: sections ---------- */

.projects { border-top: 1px solid var(--imb-gray-200); }

.section-title::before {
    display: block;
    margin-bottom: 0.75rem;
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    letter-spacing: 0;
    color: var(--imb-orange);
}

.projects .section-title { text-align: left; }
.projects .section-title::before { content: '{00}'; }
.contact .section-title::before { content: '{01}'; }

.section-title::after { display: none; }

.contact::before { display: none; }

/* ---------- Cards: projects + hobbies ---------- */

.project-grid { counter-reset: card -1; } /* start at {00} */
.hobby-grid { counter-reset: card -1; }

.project-card,
.hobby-card {
    counter-increment: card;
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: border-color 0.2s ease;
}

.project-card:hover,
.hobby-card:hover {
    border-color: var(--imb-gray-400);
    box-shadow: none;
}

.project-card img,
.hobby-card img { border-bottom: 1px solid var(--imb-gray-300); }

.project-content::before,
.hobby-content::before {
    content: '{' counter(card, decimal-leading-zero) '}';
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    color: var(--imb-orange);
}

.project-card h3,
.hobby-content h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--imb-ink);
}

.project-card:hover h3,
.hobby-card:hover h3 { color: var(--imb-gray-600); }

.project-card p,
.hobby-content p {
    font-family: var(--imb-mono);
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--imb-gray-500);
}

.project-buttons {
    flex-wrap: wrap;
    padding: 0 1.5rem 1.5rem;
    margin-bottom: 0;
}

.project-button {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    padding: 0.35rem 0.8rem;
    color: var(--imb-gray-600);
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.project-button:hover {
    background: #ffffff;
    border-color: var(--imb-gray-400);
    color: var(--imb-ink);
}

.code-button {
    background: var(--imb-orange);
    border-color: var(--imb-orange);
    color: #ffffff;
}

.code-button:hover {
    background: var(--imb-orange-dark);
    border-color: var(--imb-orange-dark);
    color: #ffffff;
}

.visibility-button { background: #ffffff; }
.visibility-button.private { background: var(--imb-gray-50); }

.project-tag {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 0.6rem;
    padding: 0.2rem 0.55rem;
    background: var(--imb-orange);
    color: #ffffff;
    font-family: var(--imb-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-tag--web {
    background: var(--imb-ink);
}

.project-award {
    align-self: flex-start;
    margin: 0 0 0.75rem;
    padding: 0.3rem 0.6rem;
    background: var(--imb-orange-tint);
    border: 1px solid var(--imb-orange);
    color: var(--imb-orange);
    font-family: var(--imb-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.project-award:hover,
.project-award:focus-visible {
    background: var(--imb-orange);
    color: #ffffff;
    outline: none;
}

/* Pointer hand over the badge's right end, clear of the short title */
.project-award::after {
    content: '';
    position: absolute;
    bottom: calc(100% - 4px);
    right: 14px;
    width: 38px;
    height: 38px;
    background: url("../images/pointer-down.02396cdec7b5.png") center / contain no-repeat;
    pointer-events: none;
    animation: compare-point 1.1s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .project-award::after { animation: none; }
}

/* Several tags on one card sit side by side */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.emoji-tag,
.experience-card .role,
.roles-container .role {
    background: var(--imb-orange-tint);
    border: 1px solid rgba(216, 64, 14, 0.25);
    border-radius: 0;
    color: var(--imb-orange);
    font-family: var(--imb-mono);
    font-size: 0.75rem;
}

/* ---------- About + Hobbies ---------- */

.bio,
.hobby-intro {
    font-family: var(--imb-mono);
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--imb-gray-600);
}

.bio strong { color: var(--imb-ink); }

.bio-highlight {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-left: 3px solid var(--imb-orange);
    border-radius: 0;
    box-shadow: none;
    font-family: var(--imb-mono);
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--imb-ink);
}

.skill-tag {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    box-shadow: none;
    color: var(--imb-gray-600);
    font-family: var(--imb-mono);
    font-size: 0.8rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.skill-tag:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--imb-orange);
    color: var(--imb-orange);
}

.experience-card {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    box-shadow: none;
}

.experience-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--imb-gray-400);
}

.experience-card p {
    font-family: var(--imb-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--imb-ink);
}

.experience-card li {
    font-family: var(--imb-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--imb-gray-500);
}

.experience-card li::marker { color: var(--imb-orange); }

/* Architonic link has an inline purple colour */
.experience-card a { color: var(--imb-orange) !important; text-decoration: none; }
.experience-card a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .bio,
    .bio-highlight,
    .hobby-intro { font-size: 0.875rem; }
}

/* ---------- 404 ---------- */

.error-card {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.error-image { filter: none; }

.error-message {
    font-family: var(--imb-mono);
    font-size: 0.95rem;
    color: var(--imb-gray-600);
}

body::before { display: none; }

/* ---------- Holiday banner ---------- */

.holiday-banner {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-left: 3px solid var(--imb-orange);
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.holiday-banner::before { display: none; }

.holiday-banner-image {
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    box-shadow: none;
}

.holiday-banner-title {
    color: var(--imb-ink);
    font-family: var(--imb-serif);
    font-weight: 400;
    text-shadow: none;
}

.holiday-banner-title svg { color: var(--imb-orange); }

.holiday-banner-message {
    color: var(--imb-gray-600);
    font-family: var(--imb-mono);
    font-size: 0.8rem;
    text-shadow: none;
}

.holiday-banner-close {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    color: var(--imb-gray-600);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.holiday-banner-close:hover {
    background: var(--imb-gray-50);
    color: var(--imb-ink);
    box-shadow: none;
}

@media (max-width: 768px) {
    .holiday-banner,
    .holiday-banner-image { border-radius: 0; }
}

/* ---------- Footer (Imbila's dark footer) ---------- */

.footer {
    background: var(--imb-dark);
    border-top: 1px solid var(--imb-dark);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #ffffff;
}

.contact-info h3 {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: #ffffff;
    font-family: var(--imb-mono);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.contact-info a {
    color: #ffffff;
    font-family: var(--imb-mono);
    font-size: 0.875rem;
}

.contact-info a:hover { color: var(--imb-orange); }

.social-links a {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 0;
    box-shadow: none;
    color: #ffffff;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.social-links a:hover {
    transform: none;
    background: var(--imb-orange);
    border-color: var(--imb-orange);
    color: #ffffff;
}

.social-links svg { fill: currentColor; }

.copyright {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--imb-gray-400);
    font-family: var(--imb-mono);
    font-size: 0.75rem;
}

/* ---------- Floating buttons + music player ---------- */

.scroll-to-top {
    background: var(--imb-orange);
    border-radius: 0;
    box-shadow: none;
}

.scroll-to-top:hover { box-shadow: none; background: var(--imb-orange-dark); }

.music-button {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.music-button svg { fill: var(--imb-orange); }

.portfolio-explore-text {
    color: var(--imb-gray-600);
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    opacity: 1;
}

.music-player-card {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--imb-ink);
}

.player-art { border-bottom: 1px solid var(--imb-gray-300); }

.player-text h4 {
    font-family: var(--imb-serif);
    font-weight: 400;
}

.player-text p,
.player-progress {
    color: var(--imb-gray-500);
    font-family: var(--imb-mono);
    font-size: 0.8rem;
}

.player-progress input[type="range"] {
    background: var(--imb-gray-200);
    border-radius: 0;
}

.player-progress input[type="range"]::-webkit-slider-thumb {
    background: var(--imb-orange);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--imb-orange);
}

.ctrl-btn {
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
}

.ctrl-btn:hover { border-color: var(--imb-gray-400); }
.ctrl-btn svg { fill: var(--imb-ink); }

.ctrl-btn.play {
    background: var(--imb-orange);
    border: none;
}

.ctrl-btn.play svg { fill: #ffffff; }

.player-close { border-radius: 0; }

/* ---------- Before / after comparison modal ---------- */

.compare-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(13, 13, 13, 0.6);
}

.compare-modal[hidden] { display: none; }

.compare-dialog {
    width: min(1100px, 100%);
    max-height: calc(100vh - 3rem);
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    padding: 1.5rem;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.compare-eyebrow {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    color: var(--imb-orange);
}

.compare-header h3 {
    font-family: var(--imb-serif);
    font-weight: 400;
    font-size: 1.6rem;
    color: var(--imb-ink);
}

.compare-close {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    color: var(--imb-ink);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.compare-close:hover { border-color: var(--imb-orange); color: var(--imb-orange); }

.compare-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-top: 2.75rem; /* room for the pointer hand above the tabs */
}

.compare-tab,
.project-button[data-compare-open] { position: relative; }

/* Room above the card's buttons for the pointer hand */
.project-buttons:has([data-compare-open]) { padding-top: 1.5rem; }

/* Hand pointing down at the card's Before / After button and at whichever tab is not selected */
.project-button[data-compare-open]::after,
.compare-tab:not(.is-active)::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    width: 42px;
    height: 42px;
    margin-left: -14px; /* the fingertip sits left of the image centre */
    background: url("../images/pointer-down.02396cdec7b5.png") center / contain no-repeat;
    pointer-events: none;
    animation: compare-point 1.1s ease-in-out infinite;
}

@keyframes compare-point {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .project-button[data-compare-open]::after,
    .compare-tab:not(.is-active)::after { animation: none; }
}

.compare-tab {
    padding: 0.5rem 1.25rem;
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    border-radius: 999px;
    color: var(--imb-gray-600);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.compare-tab:hover { border-color: var(--imb-gray-400); color: var(--imb-ink); }

.compare-tab.is-active {
    background: var(--imb-orange);
    border-color: var(--imb-orange);
    color: #ffffff;
}

.compare-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--imb-gray-300);
    background: var(--imb-gray-50);
    user-select: none;
    -webkit-user-select: none;
}

.compare-stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    pointer-events: none;
}

/* Old design sits on top and is clipped to the left of the handle */
.compare-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }

.compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 2px;
    background: var(--imb-orange);
    transform: translateX(-1px);
    pointer-events: none;
}

.compare-handle span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--imb-orange);
    color: #ffffff;
    font-family: var(--imb-mono);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.compare-label {
    position: absolute;
    top: 0.75rem;
    padding: 0.25rem 0.6rem;
    font-family: var(--imb-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}

.compare-label--before { left: 0.75rem; background: var(--imb-ink); color: #ffffff; }
.compare-label--after { right: 0.75rem; background: var(--imb-orange); color: #ffffff; }

/* Invisible full-size range input: gives mouse, touch and keyboard dragging for free */
.compare-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    outline: none;
    cursor: col-resize;
    -webkit-appearance: none;
    appearance: none;
}

.compare-note {
    margin-top: 1rem;
    font-family: var(--imb-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--imb-gray-500);
}

.compare-note a { color: var(--imb-orange); text-decoration: none; }
.compare-note a:hover { text-decoration: underline; }

body.compare-open { overflow: hidden; }

@media (max-width: 576px) {
    .compare-modal { padding: 0.75rem; }
    .compare-dialog { padding: 1rem; }
    .compare-header h3 { font-size: 1.25rem; }
}

/* ---------- Footer visitor stats ---------- */

.visitor-stats {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--imb-gray-400);
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    cursor: pointer;
    opacity: 0; /* hidden until the counter itself is hovered */
    transition: opacity 0.3s ease, border-color 0.2s ease, color 0.2s ease;
}

.visitor-stats:hover,
.visitor-stats:focus-visible { opacity: 1; }

.visitor-stats[hidden] { display: none; }

.visitor-stats:hover,
.visitor-stats:focus-visible {
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    outline: none;
}

.visitor-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.visitor-stat-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.visitor-stat-sep { color: rgba(255, 255, 255, 0.25); }

@media (prefers-reduced-motion: reduce) {
    .visitor-stat-dot { animation: none; }
}

/* ---------- Analytics password prompt ---------- */

.analytics-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(13, 13, 13, 0.6);
}

.analytics-modal[hidden] { display: none; }

.analytics-dialog {
    position: relative;
    width: min(380px, 100%);
    background: #ffffff;
    border: 1px solid var(--imb-gray-300);
    padding: 1.75rem 1.5rem 1.5rem;
    color: var(--imb-ink);
}

.analytics-dialog .compare-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.analytics-dialog h3 {
    font-family: var(--imb-serif);
    font-weight: 400;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.analytics-eyebrow {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    color: var(--imb-orange);
}

.analytics-unlock-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 380px;
}

.analytics-unlock-form label {
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    color: var(--imb-gray-600);
}

.analytics-unlock-form input {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--imb-gray-300);
    border-radius: 0;
    font-family: var(--imb-mono);
    font-size: 0.95rem;
    color: var(--imb-ink);
    background: #ffffff;
}

.analytics-unlock-form input:focus {
    outline: none;
    border-color: var(--imb-orange);
}

.analytics-unlock-form .button { align-self: flex-start; cursor: pointer; }

.analytics-error {
    margin-bottom: 1rem;
    padding: 0.6rem 0.8rem;
    border-left: 3px solid var(--imb-orange);
    background: var(--imb-orange-tint);
    font-family: var(--imb-mono);
    font-size: 0.85rem;
    color: var(--imb-ink);
}

.analytics-locked { margin-top: 140px; padding-bottom: 4rem; }

/* ---------- Analytics dashboard ---------- */

.analytics { margin-top: 120px; padding-bottom: 3rem; }

.analytics-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.analytics .headline { opacity: 1; transform: none; margin-bottom: 0.5rem; }

.analytics-sub {
    font-family: var(--imb-mono);
    font-size: 0.8rem;
    color: var(--imb-gray-500);
}

.analytics-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.analytics-tile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem;
    border: 1px solid var(--imb-gray-300);
    background: #ffffff;
}

.analytics-tile-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--imb-mono);
    font-size: 0.72rem;
    color: var(--imb-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.analytics-tile-label em { font-style: normal; text-transform: none; letter-spacing: 0; }

.analytics-tile-value {
    font-family: var(--imb-serif);
    font-size: 2.25rem;
    line-height: 1;
    color: var(--imb-ink);
    font-variant-numeric: tabular-nums;
}

.analytics-panel {
    border: 1px solid var(--imb-gray-300);
    background: #ffffff;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    min-width: 0;
}

.analytics-panel-title {
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--imb-gray-600);
    margin-bottom: 1rem;
}

/* Visits-per-day bars: single series, so no legend; the title names it */
.analytics-chart {
    display: flex;
    gap: 0.5rem;
    height: 200px;
}

.analytics-chart-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: var(--imb-mono);
    font-size: 0.7rem;
    color: var(--imb-gray-500);
    text-align: right;
    min-width: 1.5rem;
}

.analytics-chart-bars {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    border-bottom: 1px solid var(--imb-gray-300);
    background-image: linear-gradient(var(--imb-gray-200) 1px, transparent 1px);
    background-size: 100% 50%;
}

/* Full-height column = hit target bigger than the bar */
.analytics-bar-col {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    outline: none;
}

.analytics-bar {
    width: 100%;
    min-height: 2px;
    background: var(--imb-orange);
    border-radius: 4px 4px 0 0;
}

.analytics-bar-col:hover .analytics-bar,
.analytics-bar-col:focus .analytics-bar { background: var(--imb-orange-dark); }

/* Tooltip sits just above the top of the plot area, over the hovered column */
.analytics-bar-tip {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, calc(-100% - 6px));
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 0.4rem 0.6rem;
    background: var(--imb-ink);
    color: #ffffff;
    font-family: var(--imb-mono);
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

.analytics-bar-tip strong { font-weight: 700; }

.analytics-bar-col:hover .analytics-bar-tip,
.analytics-bar-col:focus .analytics-bar-tip { display: flex; }

/* Keep edge tooltips inside the panel */
.analytics-bar-col:nth-child(-n+3) .analytics-bar-tip { left: 0; transform: translate(0, calc(-100% - 6px)); }
.analytics-bar-col:nth-last-child(-n+3) .analytics-bar-tip { left: auto; right: 0; transform: translate(0, calc(-100% - 6px)); }

.analytics-chart-dates {
    display: flex;
    justify-content: space-between;
    margin: 0.4rem 0 0 2rem;
    font-family: var(--imb-mono);
    font-size: 0.7rem;
    color: var(--imb-gray-500);
}

.analytics-table-toggle { margin-top: 1rem; }

.analytics-table-toggle summary {
    cursor: pointer;
    font-family: var(--imb-mono);
    font-size: 0.75rem;
    color: var(--imb-orange);
}

.analytics-table-wrap { overflow-x: auto; }

.analytics-table {
    width: 100%;
    margin-top: 0.75rem;
    border-collapse: collapse;
    font-family: var(--imb-mono);
    font-size: 0.78rem;
}

.analytics-table th,
.analytics-table td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--imb-gray-200);
    white-space: nowrap;
}

.analytics-table th {
    font-weight: 600;
    color: var(--imb-gray-500);
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0 1.5rem;
}

.analytics-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.analytics-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.3rem 0.75rem;
    font-family: var(--imb-mono);
    font-size: 0.78rem;
}

.analytics-list-label {
    color: var(--imb-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-list-value {
    color: var(--imb-gray-600);
    font-variant-numeric: tabular-nums;
}

.analytics-list-bar {
    grid-column: 1 / -1;
    height: 4px;
    min-width: 2px;
    background: var(--imb-orange);
    border-radius: 0 4px 4px 0;
}

.analytics-empty {
    font-family: var(--imb-mono);
    font-size: 0.8rem;
    color: var(--imb-gray-500);
}

@media (max-width: 576px) {
    .analytics-tile-value { font-size: 1.75rem; }
    .analytics-chart { height: 160px; }
}
