:root {
    --bg-1: #0f1724;
    --bg-2: #100d1a;
    --hero-bg-1: #083358;
    --hero-bg-2: #1b3b5b;
    --panel-inner-1: #ffffff;
    --panel-inner-2: #dddddd;
    --text: #f4f4f4;
    --panel: #fbfbfb;
    --accent: #ff2d55;
    --muted: #6b7280;
    --comic: #ffd166;
    --modal: rgba(0, 0, 0, 0.9);
    --max-width: 1100px;
    /* Light theme overrides */
    --bg-light-1: #ffffff;
    --bg-light-2: #eeeeee;
    --hero-bg-light-1: #93c2eb;
    --hero-bg-light-2: #97afe3;
    --text-light: #0b1220;
    --panel-inner-light-1: #2d2d2d;
    --panel-inner-light-2: #000000;
    --panel-light: #2d2d2d;
    --accent-light: #ff7790;
    --modal-light: rgba(100, 100, 100, 0.9);
    --nav-height: 0px;
    --min-panel-width: 90%;
    --min-panel-height: 90%;
    /* Floating button tokens */
    --floating-button-size: 40px;
    --floating-button-padding: 0.45rem;
    --floating-button-radius: 10px;
    --floating-button-bg: rgba(255, 255, 255, 0.05);
    --floating-button-bg-light: rgba(0, 0, 0, 0.05);
    --floating-button-border: 1px solid rgba(255, 255, 255, 0.04);
    --floating-button-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
    --floating-button-shadow-light: 0 8px 20px rgba(255, 255, 255, 0.45);
}

:root.light-theme {
    --bg-1: var(--bg-light-1);
    --bg-2: var(--bg-light-2);
    --hero-bg-1: var(--hero-bg-light-1);
    --hero-bg-2: var(--hero-bg-light-2);
    --panel-inner-1: var(--panel-inner-light-1);
    --panel-inner-2: var(--panel-inner-light-2);
    --panel: var(--panel-light);
    --text: var(--text-light);
    /* --accent: var(--accent-light);*/
    --modal: var(--modal-light);
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: linear-gradient(var(--bg-1), var(--bg-2));
    color: #0b1220;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%
}

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem
}

.site-header {
    /* neutralized - header removed; keep as no-op for safety */
    display: none;
}

.logo {
    font-family: Bangers, cursive;
    color: var(--comic);
    margin: 0;
    font-size: 1.6rem;
}

.main-nav a {
    color: #e6eef8;
    margin-left: 1rem;
    text-decoration: none;
    font-weight: 600;
}

.menu,
.menu-icon,
.hamburger,
.icon-hamburger,
.kebab,
.ellipsis,
.more-button,
.waffle {
    /* Hide common third-party widget classes (conservative).
   NOTE: this intentionally avoids attribute-based selectors (e.g. aria-label*)
   to prevent accidentally matching site controls. If you need to hide a
   specific third-party widget, add its exact class or data-* selector here.
    Conservative hiding without attribute selectors to avoid accidental matches */
    display: none;
    visibility: hidden;
    pointer-events: none;
}

.snap-container {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: calc(100vh - var(--nav-height, 0px))
}

.snap-container::-webkit-scrollbar {
    /* Hide scrollbars while preserving scroll behavior */
    /* WebKit (Chrome, Safari, Edge) */
    width: 0;
    height: 0;
}

.snap-container {
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.panel-inner::-webkit-scrollbar,
.modal::-webkit-scrollbar {
    width: 0;
    height: 0;
}

html,
body {
    -ms-overflow-style: none;
}

.panel {
    min-height: var(--min-panel-height);
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    padding: 3rem 1rem;
    position: relative;
}

.panel-inner {
    width: 90%;
    height: 90dvh;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
    transform-origin: center;
    overflow-y: scroll;
}

/* (Unused)
body::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 250px
} 
*/

.hero {
    background: linear-gradient(var(--hero-bg-1), var(--hero-bg-2));
    color: var(--text);
}

.hero .panel-inner {
    background: transparent;
    box-shadow: none;
    padding: 4rem
}

.hero-title {
    font-size: 2.25rem;
    margin: 0 0 .5rem;
    vertical-align: center;
}

.hero-sub {
    color: var(--text);
}

.hero-img {
    float: right;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.08);
    object-fit: cover;
    object-position: center;
    width: 50%;
    height: auto;
    max-height: 100%;
}

.hero-aide {
    font-size: 0.8em;
    font-style: italic;
    color: #ffffffdd;
}

.cta {
    display: inline-block;
    background: var(--accent);
    color: var(--text);
    border: 1px solid rgba(0, 0, 0, 0.33);
    padding: .6rem 1rem;
    border-radius: 6px;
    text-decoration: none
}

.about,
.projects,
.designs,
.resume,
.contact {
    background: transparent;
}

.about .panel-inner,
.projects .panel-inner,
.designs .panel-inner,
.resume .panel-inner,
.contact .panel-inner {
    background: radial-gradient(#ffffff, #fffffd);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    /* Force at most two equal-height rows; make rows share available grid height */
    grid-template-rows: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    /* Occupy the available vertical space inside the panel so rows can scale to fit */
    height: calc(99% - 4rem);
    min-height: 0;
}

.card {
    padding: 1rem;
    border-radius: 8px;
    background: linear-gradient(#fffefc, #fff);
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.08);
    border: 3px solid #00000008;
    object-fit: contain;
    /* make card a vertical flex container so heading stays natural and image can grow */
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.designs-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    /* allow the image to grow and fill remaining vertical space in the card */
    flex: 1 1 auto;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0
}

.timeline li {
    padding: .4rem 0;
    border-bottom: 1px dashed var(--muted)
}

.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: inherit;
    padding: .4rem .6rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 1rem;
}

.theme-toggle:focus {
    outline: 3px solid rgba(255, 255, 255, 0.08);
}

.floating-nav {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 80;
    display: flex;
    align-items: flex-start;
}

.nav-menu {
    right: 0;
    top: 2.6rem;
}

.theme-menu-item {
    background: transparent;
    border: none;
    color: inherit;
    padding: .5rem .6rem;
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    cursor: pointer;
}

.theme-menu-item:focus {
    outline: 3px solid rgba(255, 255, 255, 0.06);
}

html,
body,
.panel-inner,
.card,
.site-header {
    /* Smooth theme transitions */
    transition: background-color 320ms ease, color 320ms ease, border-color 320ms ease, box-shadow 320ms ease;
}

.nav-toggle {
    background: transparent;
    border: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.floating-button {
    /* Shared floating button visual (used by nav toggle and modal close) */
    width: var(--floating-button-size);
    height: var(--floating-button-size);
    padding: var(--floating-button-padding);
    border-radius: var(--floating-button-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--floating-button-bg);
    border: var(--floating-button-border);
    box-shadow: var(--floating-button-shadow);
    color: var(--text);
}

.floating-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

:root.light-theme .floating-button {
    /* Light-theme floating button tokens override */
    --floating-button-border: 1px solid rgba(2, 6, 23, 0.06);
}


.floating-nav .nav-toggle {
    /* Ensure the floating nav toggle is visible even if broad selectors hide menu icons */
    display: inline-flex;
    visibility: visible;
    pointer-events: auto;
    color: inherit;
}

.floating-nav.is-hidden-due-to-modal,
.floating-nav.is-hidden-due-to-modal .nav-toggle,
.nav-menu.is-hidden-due-to-modal {
    /* When modal is open, we add a per-element helper class to hide nav controls.
   This avoids using !important and keeps the rule cascade-safe. JS toggles
   the class `is-hidden-due-to-modal` on the floating nav and nav menu. */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.nav-menu {
    position: absolute;
    right: 1rem;
    top: 3.6rem;
    /* Opaque dark background for legibility */
    background-color: rgba(8, 12, 20, 0.98);
    color: #e6eef8;
    border-radius: 10px;
    padding: .2rem;
    list-style: none;
    margin: 0;
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.04);
    min-width: 12rem;
    z-index: 60;
}

.nav-menu li a {
    display: block;
    padding: .6rem .8rem;
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
}

.nav-menu li a:hover,
.nav-menu li a:focus {
    background: rgba(255, 255, 255, 0.06);
}

:root.light-theme .nav-menu {
    /* Light theme override: opaque light background */
    background-color: #ffffff;
    color: var(--text-light);
    border: 1px solid rgba(2, 6, 23, 0.06);
    box-shadow: 0 8px 28px rgba(2, 6, 23, 0.06);
}

:root.light-theme .nav-menu li a:hover,
:root.light-theme .nav-menu li a:focus {
    background: rgba(2, 6, 23, 0.04);
}

.nav-menu[hidden] {
    /* Hide menu by default when using [hidden] */
    display: none;
}

.icon-sun {
    display: none;
}

:root.light-theme .icon-sun {
    display: inline;
}

:root.light-theme .icon-moon {
    display: none;
}

.panel-inner {
    /* Entry animations */
    transform: translateY(25px) scale(.98);
    opacity: 1;
}

.panel.is-visible .panel-inner {
    transform: translateY(0) scale(1);
    opacity: 1;
    transition: transform 2s cubic-bezier(.2, .9, .2, 1), opacity .6s
}

.card:hover,
.card:focus-within {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.2)
}

.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1;
    /* Sit on top */
    padding-top: 100px;
    /* Location of the box */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: var(--modal);
    /* Black w/ opacity */
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.modal-content,
#caption {
    /* Short modal animation */
    animation-name: fade;
    animation-duration: 0.6s;
}

@keyframes fade {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.close {
    /* Uses shared .floating-button for visuals */
    position: fixed;
    top: 1rem;
    right: 1rem;
    /* rely on .floating-button for color, background, border, shadow and sizing */
    color: inherit;
    font-size: 16px;
    font-weight: 700;
    transition: 0.15s ease;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus {
    text-decoration: none;
    cursor: pointer;
}

.close:focus {
    /* Keep the close button keyboard-accessible with a visible focus ring */
    outline: 3px solid rgba(255, 255, 255, 0.08);
    outline-offset: 2px;
}

.close svg {
    /* Make sure SVG inherits the text color and is centered inside the floating button */
    display: block;
    width: 16px;
    height: 16px;
    color: var(--text);
}

.floating-button svg {
    /* Ensure floating-button SVGs inherit currentColor and scale to fit the button so they follow --text (and light-theme overrides) without additional rules. */
    display: block;
    width: 18px;
    height: 18px;
    color: var(--text);
}

@media (max-width:720px) {
    .hero-title {
        font-size: 1.6rem
    }

    .hero-img {
        float: none;
        object-fit: cover;
        object-position: 50% 36%;
        width: 100%;
        height: 50%;
    }

    .site-header .wrap {
        padding: .5rem
    }

    .panel-inner {
        overflow-y: scroll;
        padding: 1.25rem;
        border-radius: 8px;
    }

    :not(.hero)>.panel-inner::before {
        background-image: none;
    }

    .panel-inner::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .panel::before {
        left: .5rem;
        top: .5rem;
        font-size: 1.2rem
    }

    .card h3 {
        display: none;
    }

    .modal-content {
        width: 100%;
    }
}

@media (prefers-reduced-motion:reduce) {

    .panel-inner,
    .panel::before,
    .card {
        transition: none
    }
}