:root {
    color-scheme: dark;
    --bg: #140b06;
    --surface: rgba(34, 19, 12, 0.92);
    --surface-strong: rgba(255, 178, 120, 0.16);
    --text: #fff1e6;
    --muted: #d8b8a0;
    --accent: #ff9a3c;
    --accent-2: #ffd166;
    --border: rgba(255, 180, 120, 0.18);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at top left, rgba(255, 161, 66, 0.22), transparent 22%),
                radial-gradient(circle at 80% 10%, rgba(255, 106, 45, 0.16), transparent 20%),
                linear-gradient(180deg, #140b06 0%, #1a0d07 52%, #0d0604 100%);
    color: var(--text);
}

body.portfolio-page {
    background: radial-gradient(circle at 20% 5%, rgba(255, 148, 72, 0.14), transparent 22%),
                radial-gradient(circle at 78% 9%, rgba(214, 118, 255, 0.10), transparent 20%),
                linear-gradient(180deg, #0b0604 0%, #0a0605 45%, #070404 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea {
    font: inherit;
}

.page-shell {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(180deg, rgba(38, 18, 10, 0.56), rgba(22, 10, 6, 0.42));
    border-bottom: 1px solid rgba(255, 170, 110, 0.2);
    backdrop-filter: blur(20px) saturate(130%);
    transition: transform 0.35s ease, opacity 0.35s ease;
}

body.home-page .site-header.hidden-on-top {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
}

body.portfolio-page .site-header {
    background: linear-gradient(180deg, rgba(18, 10, 10, 0.42), rgba(11, 7, 8, 0.28));
    border-bottom: 1px solid rgba(255, 167, 103, 0.16);
    backdrop-filter: blur(22px) saturate(125%);
}

.site-header .brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.logo {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 14px;
}

.brand-title {
    display: grid;
    gap: 0.25rem;
}

.brand-title h1 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-title p {
    margin: 0;
    color: var(--muted);
    font-size: 0.91rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1.2rem;
    font-size: 0.95rem;
}

.site-nav a {
    color: var(--muted);
    transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: #fff;
}

.hero {
    position: relative;
    min-height: calc(100vh - 86px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 3rem;
    padding: 4rem 2rem;
    overflow: visible;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 156, 80, 0.2), transparent 20%),
                radial-gradient(circle at 80% 18%, rgba(255, 196, 92, 0.14), transparent 18%);
    pointer-events: none;
    opacity: 0.9;
}

.hero-copy {
    max-width: 640px;
}

.hero-copy .eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.78rem;
    color: var(--accent);
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 0.98;
}

body.portfolio-page .hero-copy h1,
body.portfolio-page .hero-copy p,
body.portfolio-page .hero-copy .eyebrow {
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
}

.hero-copy p {
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.05rem;
    margin: 1.6rem 0 2rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
    background: linear-gradient(135deg, rgba(255, 122, 48, 1), rgba(255, 198, 91, 1));
    color: #fff;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

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

.hero-panel {
    padding: 2rem;
    border-radius: 30px;
    background: rgba(25, 12, 8, 0.96);
    border: 1px solid rgba(255, 170, 108, 0.18);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.28);
}

.hero-panel h2 {
    margin-top: 0;
    font-size: 1.75rem;
}

.hero-panel p {
    color: var(--muted);
    line-height: 1.8;
}

.section {
    padding: 5rem 2rem;
}

.section-title {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.section-title .eyebrow {
    color: var(--accent);
}

.section-title h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3.2rem);
}

.grid-3,
.grid-2,
.project-grid {
    display: grid;
    gap: 1.5rem;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.project-card,
.skill-card {
    padding: 2rem;
    border-radius: 28px;
    background: rgba(12, 18, 32, 0.98);
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.project-card:hover,
.skill-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.24);
}

.card h3,
.project-card h3,
.skill-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.card p,
.project-card p,
.skill-card p {
    color: var(--muted);
    line-height: 1.8;
}

.software-carousel {
    overflow: hidden;
    position: relative;
    width: 100%;
    margin-top: 2rem;
    cursor: grab;
}

.software-carousel:active {
    cursor: grabbing;
}

.carousel-track {
    display: flex;
    gap: 2rem;
}

.skill-item {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-item:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 155, 76, 0.45);
}

.software-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.skill-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
}

.skill-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.meta {
    display: inline-flex;
    margin-top: 1rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.84rem;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.05);
    color: #d8dce7;
}

.software-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.software-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d8dce7;
}

.software-tag img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.media-preview {
    max-width: 200px;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    float: right;
    margin-left: 1rem;
    margin-bottom: 0.5rem;
}

.media-preview-video {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
}

.media-preview-placeholder {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #ffe7cf;
    font-size: 0.9rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 125, 58, 0.22), rgba(124, 72, 255, 0.16));
    border: 1px solid rgba(255, 190, 122, 0.16);
}

.media-caption {
    margin: -0.5rem 0 0.35rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.project-doc-frame {
    width: 100%;
    max-width: 100%;
    height: min(76vh, 920px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #ffffff;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.form-group input[readonly] {
    background: rgba(255, 255, 255, 0.03);
    cursor: not-allowed;
}

.social-links {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.social-links h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.social-links p {
    margin: 0;
}

.social-links a {
    color: var(--accent);
    text-decoration: none;
}

.social-links a:hover {
    text-decoration: underline;
}

.cta-banner {
    padding: 2rem;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(255, 137, 63, 0.16), rgba(255, 197, 89, 0.14));
    border: 1px solid rgba(255, 176, 109, 0.2);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
}

.cta-banner h2 {
    margin: 0;
    font-size: 1.7rem;
}

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

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 0 1rem;
    color: var(--muted);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
    font-weight: 600;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.3rem;
    border-radius: 999px;
    background: rgba(255, 146, 68, 0.22);
    border: 1px solid rgba(255, 181, 116, 0.22);
    color: #fff;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}

.footer-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 169, 82, 0.34);
}

.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.video {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(12, 18, 32, 0.98);
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.video:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.24);
}

.video video {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.video p {
    margin: 0;
    padding: 1rem;
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
}

.image-gallery .heading {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--accent);
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.image {
    border-radius: 28px;
    overflow: hidden;
    background: rgba(12, 18, 32, 0.98);
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.image:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.24);
}

.image img {
    width: 100%;
    height: auto;
    display: block;
}

details {
    width: 100%;
    display: grid;
    gap: 1.5rem;
}

summary {
    cursor: pointer;
    list-style: none;
    display: grid;
    gap: 1rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: none;
}

.details-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 1.5rem;
}

details[open] .details-content {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    grid-template-columns: minmax(280px, 1.5fr) minmax(220px, 1fr);
    gap: 2rem;
    align-items: start;
}

details:not([open]) .details-content {
    display: grid;
}

.media-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.68);
}

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.78);
}

.project-modal.open {
    display: flex;
}

.modal-shell {
    width: min(1400px, 95%);
    max-height: calc(100vh - 3rem);
    overflow: auto;
    border-radius: 28px;
    background: rgba(10, 14, 24, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.35);
    position: relative;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.modal-layout {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 2rem;
    align-items: start;
}

.modal-media {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media-group {
    width: 100%;
    display: grid;
    gap: 1rem;
}

.modal-media video,
.modal-media img {
    width: 100%;
    height: auto;
    border-radius: 24px;
    object-fit: contain;
}

.modal-media video {
    aspect-ratio: 16 / 9;
    background: #000;
    max-height: 72vh;
}

.modal-media iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: 72vh;
    border-radius: 24px;
    border: none;
    background: #000;
}

.modal-copy {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-copy h2 {
    margin: 0;
    font-size: clamp(2rem, 2.4vw, 2.4rem);
}

.modal-meta-wrap {
    display: grid;
    gap: 0.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

body.no-scroll {
    overflow: hidden;
}

@media (max-width: 900px) {
    .modal-layout {
        grid-template-columns: 1fr;
    }

    .media-container video,
    .media-container img,
    .media-container iframe {
        max-width: 100%;
    }
}

.media-container video,
.media-container img {
    width: 100%;
    max-width: 900px;
    height: auto;
    border-radius: 12px;
    display: block;
    cursor: pointer;
    margin: 0 auto;
}

.media-container iframe {
    width: 100%;
    max-width: 900px;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    border: none;
    display: block;
    margin: 0 auto;
}

#threejs-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.42;
    pointer-events: none;
}

body.home-page .hero,
body.portfolio-page .hero {
    grid-template-columns: 1fr;
}

body.portfolio-page #threejs-bg {
    opacity: 0.3;
    filter: saturate(120%) brightness(0.88);
}

body.vr-page .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: 2rem;
}

body.vr-page .hero-copy {
    max-width: 760px;
}

body.vr-page .section-title {
    max-width: 760px;
}

body.vr-page .section-title p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

body.vr-page .project-grid {
    grid-template-columns: 1fr;
}

body.vr-page .project-card {
    padding: clamp(1.4rem, 2vw, 2rem);
    background: linear-gradient(180deg, rgba(12, 18, 32, 0.96), rgba(9, 14, 24, 0.98));
}

body.vr-page summary {
    gap: 1.1rem;
}

body.vr-page summary p {
    max-width: 68ch;
    margin: 0;
}

body.vr-page details[open] .details-content {
    display: block;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vr-highlight-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.vr-highlight-list span {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 172, 88, 0.12);
    border: 1px solid rgba(255, 189, 113, 0.18);
    color: #ffe7cf;
    font-size: 0.9rem;
}

.vr-project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.95fr);
    gap: 2rem;
    align-items: start;
}

.vr-project-copy {
    display: grid;
    gap: 1.25rem;
}

.vr-copy-block,
.vr-media-card {
    padding: 1.35rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.vr-copy-block .eyebrow {
    display: inline-block;
    margin-bottom: 0.75rem;
}

.vr-copy-block p,
.vr-media-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

.vr-project-media {
    display: grid;
    gap: 1.25rem;
    position: sticky;
    top: 104px;
}

.vr-media-card .media-container {
    margin-top: 0;
    margin-bottom: 1rem;
}

.vr-media-card .hero-actions {
    margin-top: 1.1rem;
}

body.vr-page .media-container video,
body.vr-page .media-container iframe {
    max-width: 100%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.24);
}

body.vr-page .vr-presentation-frame {
    width: 100%;
    max-width: 100%;
    height: min(78vh, 980px);
    aspect-ratio: auto;
    border-radius: 16px;
    overflow: auto;
    background: rgba(255, 255, 255, 0.96);
}

@media (max-width: 980px) {
    .hero,
    .cta-banner {
        grid-template-columns: 1fr;
    }

    .grid-3,
    .project-grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .page-shell {
        padding: 0 0.5rem 2.5rem;
    }

    .hero {
        padding: 4rem 1rem;
    }

    .site-header .brand-row {
        padding: 1rem 1rem;
    }

    .vr-project-layout {
        grid-template-columns: 1fr;
    }

    .vr-project-media {
        position: static;
    }
}

@media (max-width: 720px) {
    .site-header .brand-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0.5rem;
    }

    .site-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .hero {
        padding-top: 3rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .page-shell {
        padding: 0 0.25rem 2rem;
    }

    .contact-form {
        gap: 1rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .media-preview {
        max-width: 120px;
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        float: none;
        margin-left: 0;
        margin-bottom: 1rem;
    }

    .vr-copy-block,
    .vr-media-card {
        padding: 1rem;
        border-radius: 20px;
    }

    body.vr-page .vr-presentation-frame {
        height: 68vh;
    }

    .vr-highlight-list span {
        font-size: 0.82rem;
    }
}
