/* ========================================
   BASE
   ======================================== */

html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

nav,
main,
footer {
    position: relative;
    z-index: 1;
}

/* ========================================
   DOCK NAV
   ======================================== */

/* Sidebar background */
.sidebar {
    background:
        radial-gradient(ellipse 80% 60% at 25% 65%, rgba(15, 50, 90, 0.4) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 35% 55%, rgba(10, 40, 80, 0.2) 0%, transparent 60%),
        rgba(14, 20, 30, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle 1px at 16px 16px, rgba(255, 255, 255, 0.1) 1px, transparent 0);
    background-size: 32px 32px;
    filter: blur(1.5px);
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

/* Hamburger button lines */
.sidebar-toggle-line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

.sidebar-toggle-line + .sidebar-toggle-line {
    margin-top: 4px;
}

.sidebar-toggle:hover .sidebar-toggle-line {
    background: var(--accent);
}

/* Animate to X when open */
.sidebar-toggle-active .sidebar-toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.sidebar-toggle-active .sidebar-toggle-line:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle-active .sidebar-toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Sidebar nav links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent);
}

.sidebar-link-active {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
}

/* Social icons in sidebar footer */
.sidebar-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-social svg {
    width: 20px;
    height: 20px;
}

.sidebar-social:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent);
}

/* ========================================
   LOGO
   ======================================== */

.logo-duma {
    text-decoration: none;
}

.logo-text {
    font-family: "IBM Plex Sans Thai", system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.logo-duma-sm .logo-text {
    font-size: 1.1rem;
    position: relative;
    top: -1px;
}

.logo-smile {
    color: var(--accent);
}

.logo-duma:hover .logo-text {
    color: var(--text);
}

/* ========================================
   HERO ANIMATION
   ======================================== */

.hero-entry {
    opacity: 0;
    transform: translateY(20px);
    animation: hero-fade-in 0.8s ease-out 0.1s forwards;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(12px);
    animation: hero-fade-in 0.6s ease-out 0.5s forwards;
}

@keyframes hero-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pointer-down-svg {
    color: var(--accent);
    margin: 1.5rem auto 0;
    opacity: 0;
    display: block;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.4s ease, color 0.2s ease;
    animation: pointer-fade-in 0.5s ease-out 1s forwards, pointer-bounce 2s ease-in-out 1.5s infinite;
}

.pointer-down-svg:hover {
    color: #ffffff;
}

@keyframes pointer-fade-in {
    to {
        opacity: 0.8;
    }
}

.pointer-down-svg.pointer-hidden {
    animation: pointer-fade-out 0.5s ease forwards !important;
}

@keyframes pointer-fade-out {
    from {
        opacity: 0.8;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

@keyframes pointer-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(5px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-entry,
    .hero-subtitle {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .scroll-animate {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ========================================
   CODE WINDOW (macOS frame)
   ======================================== */

.code-window {
    position: relative;
    top: -2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(6, 8, 16, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(146, 184, 216, 0.06);
}

.code-window-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(12, 15, 21, 0.9);
    border-bottom: 1px solid var(--border);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot-red    { background: #ff5f57; }
.code-dot-yellow { background: #febc2e; }
.code-dot-green  { background: #28c840; }

.code-window-title {
    margin-left: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.code-window-body {
    margin: 0;
    padding: 1.25rem 1.5rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-secondary);
    overflow-x: auto;
}

.code-window-body code {
    font-family: inherit;
}

/* Syntax colors */
.syn-kw   { color: #c792ea; }
.syn-fn   { color: #82aaff; }
.syn-cls  { color: #ffcb6b; }
.syn-self { color: #f07178; font-style: italic; }
.syn-str  { color: #c3e88d; }
.syn-op   { color: #89ddff; }
.syn-p    { color: var(--muted); }
.syn-cm   { color: #546e7a; font-style: italic; }

.code-window-body .typewriter-cursor {
    display: inline;
    color: var(--accent);
    animation: blink-cursor 0.6s step-end infinite;
}

@keyframes blink-cursor {
    50% { opacity: 0; }
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

.scroll-animate {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.5s ease,
        transform 0.6s ease;
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children > .scroll-animate:nth-child(1) { transition-delay: 0.1s; }
.stagger-children > .scroll-animate:nth-child(2) { transition-delay: 0.2s; }
.stagger-children > .scroll-animate:nth-child(3) { transition-delay: 0.3s; }
.stagger-children > .scroll-animate:nth-child(4) { transition-delay: 0.4s; }

/* ========================================
   BUTTONS
   ======================================== */

.btn-gradient {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 3rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg);
    background: var(--accent);
    text-decoration: none;
    border: none;
    border-radius: 12px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.btn-gradient:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

.btn-shine {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    border: 1px solid var(--border);
    transition:
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
}

.btn-shine:hover {
    color: var(--text);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ========================================
   CARDS
   ======================================== */

.card-shine {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition:
        border-color 0.3s ease,
        transform 0.3s ease;
}

.card-shine:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

/* ========================================
   BIO SECTION
   ======================================== */

.bio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .bio-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

.bio-stats {
    display: flex;
    gap: 3rem;
}

.bio-stat {
    text-align: left;
}

.bio-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.bio-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bio-right {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bio-card {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.3s ease;
    position: relative;
}

.bio-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bio-card:hover {
    padding-left: 1rem;
}

.bio-card:hover::before {
    opacity: 1;
}

.bio-card:last-child {
    border-bottom: none;
}

.bio-card-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.bio-card-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ========================================
   SERVICES SECTION
   ======================================== */

.services-list {
    display: flex;
    flex-direction: column;
}

.service-item {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: transform 0.3s ease, background 0.3s ease;
    cursor: default;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}

.service-item:first-child {
    border-top: none;
}

.service-item:hover {
    transform: translateX(0.5rem);
    background: rgba(0, 0, 0, 0.5);
}

.service-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.service-number {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    font-family: "IBM Plex Sans Thai", system-ui, sans-serif;
}

.service-arrow {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--muted);
    margin-left: auto;
    transition: color 0.3s ease, transform 0.3s ease;
}

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

.service-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.service-body {
    padding-left: 3.5rem;
    margin-top: 1rem;
}

.service-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.service-tags-inline {
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

/* ========================================
   TECH STACK MARQUEE
   ======================================== */

.marquee-section {
    overflow: hidden;
    position: relative;
    margin-top: 3rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.velocity-marquee {
    overflow: hidden;
}

.marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.marquee-content {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.marquee-item {
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text);
    letter-spacing: 0.05em;
    padding: 0 0.5rem;
    white-space: nowrap;
}

.marquee-dot {
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 800;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .marquee-item {
        font-size: 2rem;
        padding: 0 0.75rem;
    }
    .marquee-dot {
        font-size: 2rem;
        padding: 0 0.5rem;
    }
}

@media (min-width: 768px) {
    .marquee-item {
        font-size: 3rem;
        padding: 0 1.25rem;
    }
    .marquee-dot {
        font-size: 3rem;
        padding: 0 0.75rem;
    }
}

/* ========================================
   PROJECT WINDOWS (macOS stacked cards)
   ======================================== */

.projects-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .projects-layout {
        grid-template-columns: 1fr 1.2fr;
        gap: 4rem;
    }
}

.projects-stack {
    position: relative;
    height: 480px;
}

.mac-window {
    position: absolute;
    width: 450px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(6, 8, 16, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.4s ease,
                opacity 0.4s ease,
                filter 0.4s ease,
                border-color 0.3s ease;
}

.mac-window-hit {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: auto;
}

.mac-window-hit-short {
    bottom: 45%;
}

.mac-window-back .mac-window-hit {
    bottom: 65%;
}

.mac-window-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(12, 15, 21, 0.95);
    border-bottom: 1px solid var(--border);
}

.mac-window-content img {
    width: 100%;
    display: block;
}

.card-active {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(146, 184, 216, 0.15), 0 16px 48px rgba(0, 0, 0, 0.5);
    transform: scale(1.03);
    z-index: 10 !important;
}

.card-dimmed {
    opacity: 0.35;
    filter: brightness(0.5);
}

.projects-left {
    position: relative;
    min-height: 280px;
}

.projects-left > div {
    position: absolute;
    inset: 0;
}

.project-tech-tag {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Stacked positions — back to front, offset like the reference image */
.mac-window-back {
    --tx: 0px;
    --ty: 0px;
    top: 0;
    right: 0;
    z-index: 1;
}

.mac-window-mid {
    --tx: 0px;
    --ty: 0px;
    top: 60px;
    right: 60px;
    z-index: 2;
}

.mac-window-front {
    --tx: 0px;
    --ty: 0px;
    top: 120px;
    right: 120px;
    z-index: 3;
}

@media (min-width: 768px) {
    .mac-window {
        width: 500px;
    }
    .projects-stack {
        height: 520px;
    }
}

@media (max-width: 1023px) {
    .projects-stack {
        height: 320px;
        margin: 0 auto;
        width: 100%;
        max-width: 500px;
    }
    .mac-window {
        width: 320px;
    }
    .mac-window-back {
        top: 0;
        right: 0;
    }
    .mac-window-mid {
        top: 45px;
        right: 40px;
    }
    .mac-window-front {
        top: 90px;
        right: 80px;
    }
}

@media (max-width: 480px) {
    .mac-window {
        width: 240px;
    }
    .projects-stack {
        height: 280px;
    }
    .mac-window-mid {
        top: 35px;
        right: 30px;
    }
    .mac-window-front {
        top: 70px;
        right: 60px;
    }
}

/* ========================================
   CONTACT SECTION
   ======================================== */

.contact-links {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: padding-left 0.3s ease;
}

.contact-link:first-child {
    border-top: 1px solid var(--border);
}

.contact-link:hover {
    padding-left: 0.75rem;
}

.contact-link-name {
    font-weight: 600;
    color: var(--text);
    min-width: 5rem;
}

.contact-link-handle {
    font-size: 0.9rem;
}

.contact-input:focus {
    border-color: var(--accent) !important;
}

/* ========================================
   FEATURE CARDS (project detail pages)
   ======================================== */

.feature-cards-stagger {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-card {
    max-width: 500px;
}

.feature-card-left {
    align-self: flex-start;
}

.feature-card-right {
    align-self: flex-end;
}

@media (max-width: 768px) {
    .feature-card-left,
    .feature-card-right {
        align-self: stretch;
        max-width: 100%;
    }
}

/* ========================================
   VIDEO SHOWCASE
   ======================================== */

.showcase-frame {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.showcase-video {
    display: block;
    width: 100%;
}

/* ========================================
   README CONTENT
   ======================================== */

.readme-content {
    line-height: 1.7;
}

.readme-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.readme-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.readme-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.readme-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.readme-content ul,
.readme-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.readme-content li {
    margin-bottom: 0.25rem;
}

.readme-content code {
    background: var(--surface);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

.readme-content pre {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
    position: relative;
    border: 1px solid var(--border);
}

.readme-content pre code {
    background: none;
    padding: 0;
    color: var(--text-secondary);
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.readme-content pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.copy-btn.copied {
    color: var(--accent);
}

.readme-content a {
    color: var(--accent);
    text-decoration: underline;
}

.readme-content a:hover {
    opacity: 0.8;
}

.readme-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}

.readme-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--muted);
}

/* ========================================
   GALLERY & LIGHTBOX
   ======================================== */

.gallery-item {
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-item.scroll-animate {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.gallery-item.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item.scroll-animate.animate-in:hover {
    transform: translateY(-4px);
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 101;
}

.lightbox-close:hover {
    background: var(--border);
    color: var(--text);
    border-color: var(--accent);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    margin-top: 1.5rem;
    text-align: center;
    max-width: 600px;
}

/* ========================================
   MOBILE NAV
   ======================================== */

@media (max-width: 768px) {
    .nav-pill-inner {
        background: var(--surface) !important;
    }
}

@media (max-width: 480px) {
    .nav-pill-inner {
        gap: 0.25rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .nav-links-group .nav-link {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
        font-size: 0.65rem !important;
        letter-spacing: 0.03em !important;
    }
}

/* ========================================
   SERVICE CARD COLLAPSIBLE (mobile)
   ======================================== */

@media (max-width: 767px) {
    .service-item {
        cursor: pointer;
    }
    .service-body {
        padding-left: 0;
    }
}

.service-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .service-body {
        display: flex !important;
    }
}

/* ========================================
   CONTACT SECTION ORDER (mobile)
   ======================================== */

@media (max-width: 1023px) {
    .contact-form-col { order: 2; }
    .contact-cards-col { order: 1; }
}

/* ========================================
   MOBILE PERFORMANCE
   ======================================== */

@media (max-width: 768px) {
    * {
        backdrop-filter: none !important;
    }
}

/* ========================================
   LIGHT MODE OVERRIDES
   ======================================== */

html:not(.dark) {
    color-scheme: light;
}

/* ========================================
   ALPINE X-CLOAK
   ======================================== */

[x-cloak] { display: none !important; }

/* ========================================
   PAGE LOADER
   ======================================== */

#page-loader {
    position: fixed;
    inset: 0;
    background: #060810;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 99999;
    transition: opacity 0.5s ease-out;
}

#page-loader.loader-fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-scene {
    perspective: 500px;
    perspective-origin: 50% 50%;
    filter: drop-shadow(0 0 18px rgba(146, 184, 216, 0.3));
}

.loader-object {
    position: relative;
    transform-style: preserve-3d;
    animation: loaderSpin 3s linear infinite;
}

@keyframes loaderSpin {
    0%   { transform: rotateY(0deg)   rotateX(20deg); }
    100% { transform: rotateY(360deg) rotateX(20deg); }
}

.loader-pixel {
    position: absolute;
}

.loader-hint {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.15em;
}
