/* Clean white theme for the new index layout */
:root {
    --bg: #ffffff;
    --text: #1f2937;
    /* gray-800 */
    --muted: #6b7280;
    /* gray-500 */
    --accent: #0d6efd;
    /* bootstrap primary */
    --card: #f8fafc;
    --border: #e6e6e6;
    /* oil background tuning */
    --oil-drift-duration: 3s;
    /* 400% faster (4x) movement */
}

* {
    box-sizing: border-box
}

html {
    overflow-x: hidden;
    overflow-y: scroll
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.viewport-wrap {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* base used as a fallback for older UA and behind the blurred layer */
    background: linear-gradient(270deg, #ff9a9e, #fad0ca, #fbc2eb, #a18cd1, #9be7ff);
    /* #071029;*/
    /* keep layout-level stacking consistent */
    background-size: 1200% 1200%;
    animation: gradientShift 18s ease infinite;
    z-index: 0;
}

/* Header */
.site-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    position: relative;
    z-index: 30
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px
}

.logo {
    font-size: 22px;
    line-height: 1
}

.brand-name {
    font-weight: 700;
    color: #fff
}

.brand-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85)
}

.header-controls {
    min-width: 160px;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 10px
}

.header-controls .form-select {
    width: 160px
}

/* Header buttons: show on desktop, hide on small screens. Select shows on small screens, hidden on desktop. */
.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center
}

.header-buttons .page-btn {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px
}

/* Default: show buttons, hide select (desktop-first) */
.header-controls .form-select {
    display: none
}

@media (max-width: 640px) {

    /* On small screens show the select and hide the button row */
    .header-buttons {
        display: none
    }

    .header-controls .form-select {
        display: inline-block;
        width: 120px
    }
}

/* Main center area */
.site-main {
    flex: 1;
    padding: 48px 16px
}

.container {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto
}

.center-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px
}

/* Smooth 'oil' background: soft blurred radial blobs for an Apple-like calm feel */

/* Restore gradientShift keyframes so the wrap linear-gradient actually animates */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

/* A blurred, full-viewport layer that creates soft color blobs. Applied to the wrap instead of body. */
.viewport-wrap::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    /* multiple large radial gradients blended together */
    background-image:
        radial-gradient(600px 420px at 10% 20%, rgba(255, 120, 120, 0.90), rgba(255, 120, 120, 0.25) 30%, transparent 60%),
        radial-gradient(520px 380px at 80% 28%, rgba(255, 205, 110, 0.88), rgba(255, 205, 110, 0.22) 28%, transparent 60%),
        /* restored blue to original-ish value from previous grid logic */
        radial-gradient(720px 520px at 50% 78%, rgba(108, 235, 255, 0.95), rgba(108, 235, 255, 0.22) 30%, transparent 65%),
        radial-gradient(520px 420px at 22% 82%, rgba(180, 140, 255, 0.84), rgba(180, 140, 255, 0.20) 26%, transparent 62%);
    background-repeat: no-repeat;
    background-size: cover;
    background-blend-mode: screen, screen, overlay, normal;
    /* heavy blur to melt the blobs into each other for a smooth, oily look */
    filter: blur(120px);
    transform: scale(1.06);
    opacity: 0.96;
    transition: opacity 300ms ease;
    /* very slow, subtle drift to keep the scene alive */
    animation: oilDrift var(--oil-drift-duration) ease-in-out infinite;
}

@keyframes oilDrift {
    0% {
        transform: scale(1.06) translate(0, 0)
    }

    25% {
        transform: scale(1.065) translate(-1.2%, 0.8%)
    }

    50% {
        transform: scale(1.07) translate(0.8%, -0.9%)
    }

    75% {
        transform: scale(1.065) translate(-0.6%, 1.1%)
    }

    100% {
        transform: scale(1.06) translate(0, 0)
    }
}

/* Respect reduced motion: stop drift but keep the visual (no sudden layout changes) */
@media (prefers-reduced-motion:reduce) {
    .viewport-wrap::before {
        animation: none;
    }
}

.button-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center
}

.page-btn {
    appearance: none;
    border: 2px solid var(--border);
    background: transparent;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    transition: all 140ms ease
}

.page-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px)
}

.page-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent)
}

.page-content {
    width: 100%;
    max-width: 860px;
    padding: 24px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 40
}

.page-content h2 {
    margin-top: 0
}

.site-main h1,
.site-main h2 {
    display: none
}

/* Full-bleed hero image styling (edge-to-edge, fills viewport) */
.hero-image {
    width: 100vw;
    position: fixed;
    inset: 0;
    left: 0;
    right: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: block;
    padding: 0;
    pointer-events: none;
    z-index: 0
}

/* Layered hero: each image is absolutely positioned inside the hero container so they can
    overlap and transition independently. */
.hero-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    pointer-events: none;
    /* base transform built from vars: --tx (percentage), --ty (px), --s (scale) */
    --tx: -20%;
    --ty: 0px;
    --s: 1;
    --slide: 40px;
    --slideX: var(--slide);
    --slideY: 0px;
    --rand-scale: 1;
    --rand-ty: 0px;
    transform: translateX(calc(var(--tx) + var(--slideX))) translateY(calc(var(--parallax, 0px) + var(--ty) + var(--slideY) + var(--rand-ty))) scale(calc(var(--s) * var(--rand-scale)));
    will-change: transform, opacity
}

.hero-layer.visible {
    opacity: 1;
    /* animate slide to zero */
    --slide: 0px;
    --slideX: 0px;
    --slideY: 0px
}

/* Different slide directions for stacked hero sections */
.hero-image.hero-one .hero-layer {
    --slideX: 34px;
    --slideY: 0px
}

.hero-image.hero-two .hero-layer {
    --slideX: -34px;
    --slideY: 0px
}

.hero-image.hero-three .hero-layer {
    --slideX: 0px;
    --slideY: 26px
}

}

/* Smooth transition for hero image when swapping or moving between states */
.hero-layer {
    transition: transform 480ms cubic-bezier(.22, .9, .3, 1), opacity 420ms ease
}

.hero-layer.switching {
    opacity: 0.28;
    filter: blur(0.6px)
}

/* Per-layer positioning states: each hero layer gets its own base transform. The --parallax var
    is applied so the parallax effect affects all layers consistently. */
.hero-layer.home {
    --tx: -20%;
    --ty: 0px;
    --s: 1
}

.hero-layer.about {
    --tx: 0%;
    --ty: -40px;
    --s: 1.03
}

.hero-layer.blog {
    --tx: 20%;
    --ty: -10px;
    --s: 1.02
}

.hero-layer.projects {
    --tx: -10%;
    --ty: -20px;
    --s: 1.01
}

.hero-layer.contact {
    --tx: 10%;
    --ty: -5px;
    --s: 1.00
}

/* Ensure main content sits above fixed heroes; normal flow for footer */
.site-main {
    flex: 1;
    padding: 28px 16px;
    margin-top: 0;
    padding-top: 140px;
    position: relative;
    z-index: 2;
    background: transparent
}

/* Filler paragraph under hero image */
.filler-text {
    max-width: 900px;
    margin: 20px auto;
    color: #fff;
    line-height: 1.6;
    position: relative;
    z-index: 40
}

.secondary-content {
    max-width: 900px;
    margin: 12px auto;
    color: #fff;
    line-height: 1.6;
    position: relative;
    z-index: 40;
    padding: 8px
}

/* New static text block under the page content. This will be updated from JS when the active page changes. */
.static-text {
    max-width: 900px;
    margin: 16px auto;
    color: #fff;
    line-height: 1.6;
    position: relative;
    z-index: 40;
    padding: 8px;
    background: transparent
}

.static-text.fading {
    opacity: 0.5;
    transition: opacity 160ms ease
}

.static-text {
    opacity: 1;
    transition: opacity 200ms ease
}

/* Project card for the Projects section */
.project-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0 8px
}

.project-card {
    position: relative;
    display: block;
    width: 360px;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: transform 160ms ease, box-shadow 160ms ease
}

.project-card:hover {
    transform: translateY(-2px)
}

.project-card img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover
}

.project-card .tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase
}

/* Platform link cards for Enough */
.platform-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 14px 0 6px
}

.platform-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-width: 180px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease
}

.platform-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.35)
}

.platform-card .platform-label {
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 15px
}

.platform-card .platform-note {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 4px
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 42px 16px;
    min-height: 156px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 3;
    background: rgba(255, 255, 255, 0.92)
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%
}

.footer-left {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.01em
}

.site-footer .footer-left,
.site-footer .footer-right {
    color: var(--text)
}

.footer-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.footer-icon {
    width: 50px;
    height: 50px;
    display: block;
    object-fit: contain;
}

/* Accessibility helpers */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap
}

/* Responsive tweaks */
@media (max-width: 640px) {
    .header-inner {
        padding: 12px
    }

    .header-controls {
        min-width: 120px
    }

    .header-controls .form-select {
        width: 120px
    }

    .page-btn {
        padding: 9px 12px
    }

    .footer-inner {
        flex-direction: column;
        align-items: center
    }

    .footer-right {
        order: -1;
        margin-bottom: 12px;
    }
}

/* Honor reduced motion preference */
@media (prefers-reduced-motion:reduce) {

    .page-btn,
    .page-content {
        transition: none
    }
}

/* Responsive hero height: shrink vertically on tablets and mobile */
@media (max-width: 1024px) {
    .hero-image {
        height: 52vh
    }

    .hero-image img {
        height: calc(100% - 6vh)
    }

    .site-main {
        margin-top: 0;
        padding-top: 120px
    }

    .filler-text {
        margin-top: 0
    }

    .secondary-content {
        margin-top: 0
    }

    .static-text {
        margin-top: 8px
    }
}

@media (max-width: 640px) {
    .hero-image {
        height: 42vh;
        padding-left: 6vw;
        padding-top: 4vh;
        margin-bottom: -70px
    }

    .hero-image img {
        height: calc(100% - 4vh)
    }

    .site-main {
        margin-top: 0;
        padding-top: 50px
    }

    .filler-text {
        margin-top: 0
    }

    .secondary-content {
        margin-top: 0
    }

    .static-text {
        margin-top: 6px
    }
}

/* Page heading (3D text header at top of screen) */
.page-heading {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
    z-index: 60
}

/* Brand layout */
.brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px
}

/* Hide brand text on tablets and mobile */
@media (max-width: 1024px) {
    .brand-text {
        display: none
    }
}