:root {
    --warm-ivory: #F7F3EA;
    --soft-white: #FFFDF8;
    --tevarix-gold: #C89A3D;
    --emerald: #2F7F68;
    --amber: #E7A94F;
    --deep-slate: #1E2933;
    --slate-grey: #66717C;
}

body {
    background: var(--warm-ivory);
    color: var(--deep-slate);
}

.logo-mark,
.nav-cta,
.footer-logo {
    background: var(--tevarix-gold) !important;
    color: var(--deep-slate) !important;
}

.hero,
.projects-section,
.contact-section,
.premium-footer {
    background: var(--deep-slate) !important;
    color: var(--warm-ivory) !important;
}

.hero h1,
.hero h2,
.hero h3,
.hero p,
.projects-section > .section-heading h2,
.projects-section > .section-heading p,
.contact-section h2,
.contact-section p,
.premium-footer strong,
.premium-footer small,
.premium-footer a {
    color: var(--warm-ivory) !important;
}

.section-eyebrow,
.section-heading h2 span,
.contact-section h2 span,
.hero-eyebrow,
.project-number,
.project-type {
    color: var(--tevarix-gold) !important;
}

.hero .btn.primary,
.hero .btn.secondary,
.nav-cta,
.project-live-link {
    border-color: var(--tevarix-gold) !important;
}

.hero .btn.primary,
.project-live-link {
    background: var(--tevarix-gold) !important;
    color: var(--deep-slate) !important;
}

.hero .btn.secondary {
    background: transparent !important;
    color: var(--warm-ivory) !important;
}

.about-section,
#education,
.skills-section,
.engineering-section,
.experience-section,
section.fade:not(.hero):not(.projects-section):not(.contact-section) {
    background: var(--warm-ivory) !important;
    color: var(--deep-slate) !important;
}

.about-section p,
#education p,
.skills-section p,
.engineering-section p,
.experience-section p,
section.fade:not(.hero):not(.projects-section):not(.contact-section) p {
    color: var(--slate-grey) !important;
}

.glass,
.card,
.about-section .glass,
.skills-section .glass,
.engineering-section .glass,
.experience-section .glass,
.contact-shell {
    background: var(--soft-white) !important;
    border-color: #C89A3D33 !important;
    box-shadow: 0 16px 36px #1E29331A !important;
}

.glass h1,
.glass h2,
.glass h3,
.glass h4,
.glass strong,
.glass a {
    color: var(--deep-slate) !important;
}

.glass p,
.glass small,
.glass span:not(.section-eyebrow):not(.project-number):not(.project-type):not(.focus-icon):not(.skill-category-icon):not(.experience-icon):not(.engineering-icon):not(.engineering-identity-icon) {
    color: var(--slate-grey) !important;
}

.experience-company a {
    color: var(--slate-grey) !important;
    text-decoration: none;
}

.experience-company a:hover,
.experience-company a:focus-visible {
    color: var(--tevarix-gold) !important;
    text-decoration: underline;
}

.projects-section .project-card,
.projects-section .projects-note {
    background: var(--soft-white) !important;
    border-color: #C89A3D4D !important;
    box-shadow: 0 18px 36px #1E29334D !important;
}

.projects-section .project-card h3,
.projects-section .projects-note strong {
    color: var(--deep-slate) !important;
}

.projects-section .project-card p,
.projects-section .projects-note span {
    color: var(--slate-grey) !important;
}

.project-tech span,
.experience-tags span,
.engineering-tags span {
    background: #2F7F681A !important;
    border-color: #2F7F684D !important;
    color: var(--emerald) !important;
}

.project-status {
    color: var(--emerald) !important;
}

.project-status > span,
.contact-status > span,
.status-dot {
    background: var(--emerald) !important;
}

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

.project-image--website {
    display: grid;
    min-height: 220px;
    place-items: center;
    overflow: hidden;
    background: var(--deep-slate) !important;
    border-bottom: 1px solid #C89A3D4D;
}

.project-image--tevarix {
    background: var(--warm-ivory) !important;
}

.project-overlay {
    background: #1E293399 !important;
}

.project-website-preview {
    display: grid;
    gap: 0.45rem;
    justify-items: center;
    padding: 2rem;
    text-align: center;
}

.project-website-preview strong {
    color: var(--soft-white) !important;
    font-size: 1.5rem;
    line-height: 1.15;
}

.project-image--tevarix .project-website-preview strong {
    color: var(--deep-slate) !important;
}

.project-website-preview strong span {
    color: var(--tevarix-gold) !important;
}

.project-website-preview small {
    color: var(--warm-ivory) !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-image--tevarix .project-website-preview small {
    color: var(--slate-grey) !important;
}

.project-website-mark {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    border: 1px solid var(--tevarix-gold);
    border-radius: 50%;
    background: var(--tevarix-gold);
    color: var(--deep-slate) !important;
    font-weight: 700;
}

.project-image--tevarix .project-website-mark {
    background: var(--deep-slate);
    color: var(--tevarix-gold) !important;
}

.project-card--website .project-content {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.project-live-link {
    display: inline-flex;
    width: fit-content;
    gap: 0.55rem;
    align-items: center;
    margin-top: 1.35rem;
    padding: 0.72rem 1rem;
    border: 1px solid var(--tevarix-gold);
    border-radius: 0.45rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.project-live-link:hover,
.project-live-link:focus-visible {
    background: var(--emerald) !important;
    border-color: var(--emerald) !important;
    color: var(--soft-white) !important;
    transform: translateY(-2px);
}

.project-live-link:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--amber) !important;
    outline-offset: 3px;
}

.contact-shell,
.contact-action {
    background: var(--deep-slate) !important;
    border-color: #C89A3D4D !important;
}

.contact-action:hover,
.contact-action:focus-visible {
    border-color: var(--emerald) !important;
}

.contact-action strong,
.contact-action small,
.contact-action i {
    color: var(--warm-ivory) !important;
}

.contact-action-icon {
    background: #2F7F6833 !important;
    color: var(--emerald) !important;
}

.contact-shell h2,
.contact-shell p,
.contact-shell .section-eyebrow,
.contact-shell .contact-status {
    color: var(--warm-ivory) !important;
}

.premium-footer {
    border-color: #C89A3D33 !important;
}

/* Keep the floating navigation crisp instead of inheriting the old glass effect. */
.premium-nav {
    background: var(--soft-white) !important;
    opacity: 1 !important;
    border: 1px solid #C89A3D4D !important;
    box-shadow: 0 12px 28px #1E29331A !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.premium-nav::before,
.premium-nav::after,
.premium-nav .nav-inner::before,
.premium-nav .nav-inner::after {
    display: none !important;
    background: none !important;
}

.premium-nav .nav-inner {
    background: transparent !important;
}

.premium-nav .nav-links a,
.premium-nav .logo-text,
.premium-nav .nav-menu-toggle {
    color: var(--deep-slate) !important;
}

.premium-nav .logo-text span {
    color: var(--tevarix-gold) !important;
}

.premium-nav .nav-links a::after {
    background: var(--tevarix-gold) !important;
}

.premium-nav .nav-links a:hover,
.premium-nav .nav-links a:focus-visible {
    color: var(--tevarix-gold) !important;
    background: transparent !important;
}

.premium-nav .nav-cta {
    background: var(--tevarix-gold) !important;
    border-color: var(--tevarix-gold) !important;
    box-shadow: none !important;
    color: var(--deep-slate) !important;
}

.premium-nav .nav-cta:hover,
.premium-nav .nav-cta:focus-visible {
    background: var(--tevarix-gold) !important;
    border-color: var(--tevarix-gold) !important;
    color: var(--deep-slate) !important;
}

.premium-nav .nav-menu-toggle {
    border-color: #C89A3D4D !important;
    background: transparent !important;
}

.premium-nav .nav-menu-toggle span {
    background: var(--deep-slate) !important;
}

@media (max-width: 850px) {
    .premium-nav .nav-links {
        background: var(--soft-white) !important;
        border-color: #C89A3D4D !important;
        box-shadow: 0 12px 28px #1E29331A !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

@media (max-width: 700px) {
    .project-image--website {
        min-height: 185px;
    }

    .project-live-link {
        width: 100%;
        justify-content: center;
    }
}

/* Targeted portfolio polish: shared light surface, readable headings, and warm card interactions. */
body,
.about-section,
#education,
.skills-section,
.engineering-section,
.experience-section,
section.fade:not(.hero):not(.projects-section):not(.contact-section) {
    background: var(--soft-white) !important;
}

.journey-header h3 {
    color: var(--deep-slate) !important;
}

.section-heading h2 span,
.contact-content h2 span {
    background: none !important;
    color: var(--tevarix-gold) !important;
    -webkit-text-fill-color: currentColor;
}

.about-intro::before,
.about-focus::before,
.skill-category::before,
.engineering-card::after,
.engineering-identity::before {
    background: radial-gradient(circle, #C89A3D26, transparent 70%) !important;
}

.about-icon,
.focus-icon,
.skill-category-icon,
.experience-icon,
.engineering-icon,
.engineering-identity-icon {
    background: #C89A3D1A !important;
    border-color: #C89A3D4D !important;
    color: var(--tevarix-gold) !important;
}

.glass span.focus-icon,
.glass span.skill-category-icon,
.glass span.experience-icon,
.glass span.engineering-icon,
.glass span.engineering-identity-icon {
    color: var(--tevarix-gold) !important;
}

.premium-timeline::before,
.experience-timeline::before {
    background: linear-gradient(to bottom, #C89A3D99, #C89A3D1A, transparent) !important;
}

.timeline-dot,
.experience-marker {
    background: var(--soft-white) !important;
    border-color: #C89A3D99 !important;
    box-shadow: 0 0 0 5px #C89A3D14, 0 10px 20px #1E29331A !important;
}

.timeline-year,
.experience-period,
.projects-note > i,
.identity-flow i {
    color: var(--tevarix-gold) !important;
}

.skill-fill {
    background: var(--tevarix-gold) !important;
    box-shadow: 0 0 12px #C89A3D4D !important;
}

.identity-account {
    background: var(--soft-white) !important;
    border-color: #C89A3D33 !important;
}

.identity-account a {
    color: var(--deep-slate) !important;
}

.identity-account a:hover,
.identity-account a:focus-visible {
    color: var(--tevarix-gold) !important;
}

.card,
.stat,
.skill-category,
.project-card,
.experience-card,
.engineering-card,
.engineering-identity,
.timeline-content,
.identity-account {
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.stat:hover,
.skill-category:hover,
.project-card:hover,
.experience-card:hover,
.engineering-card:hover,
.engineering-identity:hover,
.timeline-content:hover,
.identity-account:hover {
    transform: translateY(-4px) !important;
    background: var(--warm-ivory) !important;
    border-color: #C89A3D80 !important;
    box-shadow: 0 16px 32px #1E293326 !important;
}

.experience-card--tevarix:hover,
.experience-card--tevarix:focus-within {
    transform: translateY(-4px) !important;
    background: #EFF6F1 !important;
    border-color: var(--emerald) !important;
    box-shadow: 0 16px 32px #2F7F6826 !important;
}

.experience-card--tevarix .experience-company a:focus-visible {
    outline: 2px solid var(--tevarix-gold);
    outline-offset: 3px;
}

.project-link:hover:not(.disabled) {
    border-color: var(--tevarix-gold) !important;
    background: #C89A3D1A !important;
    box-shadow: 0 8px 20px #1E29331A !important;
}

.contact-action:hover,
.contact-action:focus-visible {
    transform: translateY(-4px) !important;
    background: #26323D !important;
    border-color: var(--tevarix-gold) !important;
    box-shadow: 0 16px 32px #C89A3D33 !important;
}

@media (max-width: 850px) {
    body {
        padding-top: 86px;
        transition: padding-top 0.25s ease;
    }

    .portfolio-collapsed body,
    .portfolio-collapsing body {
        padding-top: 0;
    }
}

.premium-nav,
.footer-links {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.premium-nav[hidden],
.footer-links[hidden] {
    display: none !important;
}

html.entrance-locked.portfolio-collapsing .premium-nav,
html.entrance-locked.portfolio-collapsed .premium-nav {
    opacity: 0 !important;
    pointer-events: none;
    transform: translateY(-12px);
}

html.entrance-locked.portfolio-collapsing .footer-links,
html.entrance-locked.portfolio-collapsed .footer-links {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
}

.footer-tevarix {
    justify-self: end;
    margin: 0;
    color: var(--warm-ivory);
    font-size: 11px;
}

.footer-tevarix a {
    color: var(--tevarix-gold) !important;
    font-weight: 600;
    text-decoration: none;
}

.footer-tevarix a:hover,
.footer-tevarix a:focus-visible {
    text-decoration: underline;
}

.premium-footer {
    padding: 28px 24px;
    margin-top: 0;
}

.footer-main {
    width: min(100%, 1180px);
    margin: 0 auto;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 32px;
}

.footer-brand,
.footer-tevarix {
    align-self: center;
}

.footer-brand {
    justify-self: start;
}

html.entrance-locked.portfolio-collapsed .footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

html.entrance-locked.portfolio-collapsed .footer-tevarix {
    grid-column: auto;
}

.premium-skill-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: start;
    gap: 12px;
}

.premium-skill-top span:last-child {
    white-space: nowrap;
    text-align: right;
}

@media (max-width: 850px) {
    .premium-footer {
        padding: 26px 20px;
    }

    .footer-main,
    html.entrance-locked.portfolio-collapsed .footer-main {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-brand,
    .footer-tevarix {
        justify-self: center;
    }

    html.entrance-locked.portfolio-collapsed .footer-tevarix {
        grid-column: auto;
    }
}

@media (max-width: 700px) {
    .skills-grid {
        gap: 16px;
        margin-top: 28px;
    }

    .skill-category {
        padding: 20px !important;
    }

    .skill-category-header {
        gap: 12px;
        margin-bottom: 20px;
    }

    .skill-list {
        gap: 14px;
    }

.premium-skill-top {
        margin-bottom: 6px;
    }
}

/* Projects follow the shared light section treatment while retaining distinct cards. */
.projects-section {
    background: var(--soft-white) !important;
    color: var(--deep-slate) !important;
}

.projects-section > .section-heading h2 {
    color: var(--deep-slate) !important;
}

.projects-section > .section-heading p {
    color: var(--slate-grey) !important;
}

.projects-section .project-card,
.projects-section .projects-note {
    background: var(--warm-ivory) !important;
    border-color: #C89A3D4D !important;
    box-shadow: 0 16px 32px #1E29331A !important;
}

.projects-section .project-card:hover {
    background: #F1EADD !important;
}

/* Progressive portfolio reveal: JavaScript adds these classes, so content remains available without it. */
.portfolio-reveal-target {
    transition: max-height 0.45s ease, margin 0.45s ease, padding 0.45s ease, opacity 0.35s ease, transform 0.35s ease;
}

.portfolio-collapsed .portfolio-reveal-target,
.portfolio-revealing .portfolio-reveal-target:not(.portfolio-revealed),
.portfolio-collapsing .portfolio-reveal-target.portfolio-collapsing {
    max-height: 0;
    min-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
    opacity: 0 !important;
    transform: translateY(18px) !important;
    pointer-events: none;
}

.portfolio-revealed .portfolio-reveal-target,
.portfolio-revealing .portfolio-reveal-target.portfolio-revealed,
.portfolio-collapsing .portfolio-reveal-target:not(.portfolio-collapsing) {
    max-height: 8000px;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

#portfolio-reveal[hidden] {
    display: none;
}

#portfolio-reveal {
    cursor: pointer;
}

#portfolio-reveal:disabled {
    cursor: progress;
    opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
    body,
    .portfolio-reveal-target,
    .premium-nav,
    .footer-links {
        transition: none;
    }

    .experience-card--tevarix:hover,
    .experience-card--tevarix:focus-within {
        transform: none !important;
    }
}

/* The inline marker collapses the portfolio before the page renders; the fallback removes it if the main script cannot initialize. */
html.entrance-locked .premium-nav,
html.entrance-locked body > section:not(#home):not(#contact) {
    max-height: 0;
    min-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
    opacity: 0 !important;
    pointer-events: none;
    transform: translateY(18px) !important;
}

html.entrance-locked .premium-nav {
    transform: translateY(-12px) !important;
}

.theme-choice-dialog {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #1E29331A;
}

.theme-choice-dialog[hidden] {
    display: none;
}

.theme-choice-panel {
    width: min(100%, 430px);
    padding: 28px;
    border: 1px solid #C89A3D66;
    border-radius: 18px;
    background: var(--soft-white) !important;
    box-shadow: 0 24px 60px #1E293333 !important;
}

.theme-choice-panel h2 {
    margin: 10px 0 8px;
    color: var(--deep-slate) !important;
    font-size: 1.45rem;
    line-height: 1.3;
}

.theme-choice-panel p {
    color: var(--slate-grey) !important;
    font-size: 0.9rem;
}

.theme-choice-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.theme-choice {
    display: inline-flex;
    flex-direction: column;
    gap: 9px;
    align-items: flex-start;
    min-height: 96px;
    padding: 16px;
    border: 1px solid #C89A3D4D;
    border-radius: 12px;
    background: var(--warm-ivory);
    color: var(--deep-slate);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-choice i {
    color: var(--tevarix-gold);
    font-size: 1.1rem;
}

.theme-choice:hover,
.theme-choice:focus-visible {
    border-color: var(--emerald);
    background: #EFF6F1;
    box-shadow: 0 10px 22px #2F7F681F;
    transform: translateY(-2px);
}

/* Dark theme is scoped to the current document only through html[data-theme="dark"]. */
html[data-theme="dark"] body,
html[data-theme="dark"] .about-section,
html[data-theme="dark"] #education,
html[data-theme="dark"] .skills-section,
html[data-theme="dark"] .engineering-section,
html[data-theme="dark"] .experience-section,
html[data-theme="dark"] section.fade:not(.hero):not(.projects-section):not(.contact-section),
html[data-theme="dark"] .projects-section {
    background: #121A21 !important;
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .hero,
html[data-theme="dark"] .contact-section,
html[data-theme="dark"] .premium-footer,
html[data-theme="dark"] .contact-shell {
    background: #1E2933 !important;
}

html[data-theme="dark"] .glass,
html[data-theme="dark"] .card,
html[data-theme="dark"] .projects-section .project-card,
html[data-theme="dark"] .projects-section .projects-note,
html[data-theme="dark"] .identity-account {
    background: #26343F !important;
    border-color: #C89A3D4D !important;
    box-shadow: 0 16px 36px #121A214D !important;
}

html[data-theme="dark"] .glass h1,
html[data-theme="dark"] .glass h2,
html[data-theme="dark"] .glass h3,
html[data-theme="dark"] .glass h4,
html[data-theme="dark"] .glass strong,
html[data-theme="dark"] .glass a,
html[data-theme="dark"] .projects-section > .section-heading h2,
html[data-theme="dark"] .journey-header h3,
html[data-theme="dark"] .section-heading h2 {
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .glass p,
html[data-theme="dark"] .glass small,
html[data-theme="dark"] .glass span:not(.section-eyebrow):not(.project-number):not(.project-type):not(.focus-icon):not(.skill-category-icon):not(.experience-icon):not(.engineering-icon):not(.engineering-identity-icon),
html[data-theme="dark"] .projects-section > .section-heading p,
html[data-theme="dark"] .projects-section .project-card p,
html[data-theme="dark"] .projects-section .projects-note span {
    color: #F7F3EA !important;
}

html[data-theme="dark"] .premium-nav,
html[data-theme="dark"] .premium-nav .nav-links {
    background: #1E2933 !important;
    border-color: #C89A3D66 !important;
    box-shadow: 0 12px 28px #121A2166 !important;
}

html[data-theme="dark"] .premium-nav .nav-links a,
html[data-theme="dark"] .premium-nav .logo-text,
html[data-theme="dark"] .premium-nav .nav-menu-toggle {
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .premium-nav .nav-menu-toggle span {
    background-color: #FFFDF8 !important;
}

html[data-theme="dark"] .premium-nav .logo-text,
html[data-theme="dark"] .premium-nav .nav-menu-toggle {
    background-color: transparent !important;
}

html[data-theme="dark"] .project-filter,
html[data-theme="dark"] .theme-choice-panel {
    background: #26343F !important;
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .project-filter:hover,
html[data-theme="dark"] .project-filter.is-active,
html[data-theme="dark"] .theme-choice:hover,
html[data-theme="dark"] .theme-choice:focus-visible {
    background: #2F7F68 !important;
    border-color: #2F7F68 !important;
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .contact-action {
    background: #26343F !important;
    border-color: #C89A3D4D !important;
}

html[data-theme="dark"] .contact-action:hover,
html[data-theme="dark"] .contact-action:focus-visible {
    background: #2F7F68 !important;
    border-color: #C89A3D !important;
}

html[data-theme="dark"] .experience-card--tevarix:hover,
html[data-theme="dark"] .experience-card--tevarix:focus-within {
    background: #284137 !important;
    border-color: #2F7F68 !important;
    box-shadow: 0 16px 32px #2F7F6840 !important;
}

html[data-theme="dark"] .theme-choice-panel h2 {
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .theme-choice-panel p {
    color: #F7F3EA !important;
}

@media (max-width: 520px) {
    .theme-choice-panel {
        padding: 24px;
    }

    .theme-choice-actions {
        grid-template-columns: 1fr;
    }

    .theme-choice {
        min-height: 74px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-choice {
        transition: none;
    }

    .theme-choice:hover,
    .theme-choice:focus-visible {
        transform: none;
    }
}


/* Tevarix career-card call to action. */
.tevarix-reality-link {
    display: inline-block;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    color: var(--emerald) !important;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    transform: translateY(6px);
    transition: max-height 0.2s ease, margin-top 0.2s ease, opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.experience-card--tevarix:hover .tevarix-reality-link,
.experience-card--tevarix:focus-within .tevarix-reality-link {
    max-height: 32px;
    margin-top: 18px;
    opacity: 1;
    transform: translateY(0);
}

.tevarix-reality-link:hover,
.tevarix-reality-link:focus-visible {
    color: var(--tevarix-gold) !important;
    text-decoration: underline;
}

.tevarix-reality-link:focus-visible {
    outline: 2px solid var(--tevarix-gold);
    outline-offset: 3px;
}

/* Dark-theme dialog contrast and restrained interactive card treatment. */
html[data-theme="dark"] .theme-choice-panel .section-eyebrow {
    color: #E7A94F !important;
}

html[data-theme="dark"] .theme-choice-panel h2 {
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .theme-choice-panel p {
    color: #F7F3EA !important;
}

html[data-theme="dark"] .theme-choice {
    background: #1E2933 !important;
    border-color: #66717C !important;
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .theme-choice span,
html[data-theme="dark"] .theme-choice i {
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .theme-choice i {
    color: #C89A3D !important;
}

html[data-theme="dark"] .theme-choice:hover,
html[data-theme="dark"] .theme-choice:focus-visible {
    background: #2F7F68 !important;
    border-color: #C89A3D !important;
    box-shadow: 0 10px 22px #C89A3D26 !important;
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .theme-choice:hover i,
html[data-theme="dark"] .theme-choice:focus-visible i {
    color: #FFFDF8 !important;
}

html[data-theme="dark"] .card:not(.experience-card--tevarix):hover,
html[data-theme="dark"] .card:not(.experience-card--tevarix):focus-within {
    transform: translateY(-3px) !important;
    border-color: #C89A3D !important;
    box-shadow: 0 16px 32px #C89A3D26 !important;
}

html[data-theme="dark"] .experience-card--tevarix .tevarix-reality-link {
    color: #C89A3D !important;
}

html[data-theme="dark"] .experience-card--tevarix .tevarix-reality-link:hover,
html[data-theme="dark"] .experience-card--tevarix .tevarix-reality-link:focus-visible {
    color: #FFFDF8 !important;
}

@media (prefers-reduced-motion: reduce) {
    .tevarix-reality-link,
    html[data-theme="dark"] .card:not(.experience-card--tevarix):hover,
    html[data-theme="dark"] .card:not(.experience-card--tevarix):focus-within {
        transition: none;
        transform: none !important;
    }
}


/* Post-entry middle-section control. */
.portfolio-collapse-control {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 1050;
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid #C89A3D99;
    border-radius: 14px;
    background: var(--soft-white);
    box-shadow: 0 12px 28px #1E293326;
    color: var(--deep-slate);
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.portfolio-collapse-control[hidden] {
    display: none;
}

.portfolio-collapse-control:hover,
.portfolio-collapse-control:focus-visible {
    transform: translateY(-3px);
    border-color: var(--tevarix-gold);
    box-shadow: 0 16px 30px #C89A3D33;
}

.portfolio-collapse-control:focus-visible {
    outline: 2px solid var(--emerald);
    outline-offset: 3px;
}

.portfolio-collapse-control::after {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: max-content;
    max-width: min(220px, calc(100vw - 40px));
    padding: 7px 10px;
    border-radius: 7px;
    background: var(--deep-slate);
    color: var(--soft-white);
    content: attr(data-tooltip);
    font-size: 0.76rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.portfolio-collapse-control:hover::after,
.portfolio-collapse-control:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

html[data-theme="dark"] .portfolio-collapse-control {
    background: #26343F;
    border-color: #C89A3D;
    box-shadow: 0 12px 28px #121A2166;
    color: #C89A3D;
}

html[data-theme="dark"] .portfolio-collapse-control:hover,
html[data-theme="dark"] .portfolio-collapse-control:focus-visible {
    background: #1E2933;
    box-shadow: 0 16px 30px #C89A3D26;
}

html[data-theme="dark"] .portfolio-collapse-control::after {
    background: #FFFDF8;
    color: #1E2933;
}

@media (max-width: 520px) {
    .portfolio-collapse-control {
        right: max(16px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-collapse-control,
    .portfolio-collapse-control::after {
        transition: none;
    }

    .portfolio-collapse-control:hover,
    .portfolio-collapse-control:focus-visible,
    .portfolio-collapse-control:hover::after,
    .portfolio-collapse-control:focus-visible::after {
        transform: none;
    }
}


/* Dark-mode support for the original floating-card treatment. */
html[data-theme="dark"] .floating-card {
    background: #26343F;
    border-color: #C89A3D99;
    box-shadow: 0 15px 40px #121A2166;
    color: #FFFDF8;
}

html[data-theme="dark"] .floating-card i {
    color: #C89A3D;
}

html[data-theme="dark"] .floating-card:hover {
    border-color: #C89A3D;
    box-shadow: 0 18px 42px #C89A3D26;
}
