:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #4289b2;
    --secondary-accent: #00cec9;
    --card-bg: #1a1a1a;
    --font-heading: 'Helvetica Neue', Helvetica, Inter, Arial, sans-serif;
    --font-main: Avenir, 'Avenir Next', Nunito, 'Segoe UI', sans-serif;
    
    /* Font Sizes */
    --h1-size: 52px;
    --h2-size: 42px;
    --hero-title-size: clamp(55px, 10vw, 90px);
    --section-header-size: 3.5rem;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
}

.content-section[id],
.projects-section[id] {
    scroll-margin-top: calc(2em + 5.5rem);
}

/* Wrapping: headings/nav break only at spaces; body copy may break very long tokens */
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
    -webkit-hyphens: manual;
    text-wrap: pretty;
}

p,
li {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
}

a {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: manual;
    -webkit-hyphens: manual;
}

.nav-link,
.dropdown-link,
.section-header h2,
.content-section h2,
.project-title,
.hero-title,
.prod-text h3,
.pixel-card__active h3 {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
    -webkit-hyphens: manual;
}

/* ── Minimal scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment,
::-webkit-scrollbar-button:start:increment,
::-webkit-scrollbar-button:end:decrement {
    display: none;
    width: 0;
    height: 0;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: 400;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Big project pages: render sections on demand to reduce initial jank */
.content-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
}

/* info-section: keep visible so in-flow previews (e.g. link-preview card) are not paint-clipped upward */
.info-section {
    content-visibility: visible;
}

/* Prevent accidental horizontal scroll from wide media */
img,
video,
iframe {
    max-width: 100%;
}

/* Avoid media creating horizontal overflow */
img,
video,
iframe {
    display: block;
}

h1 {
    font-family: var(--font-heading);
    font-size: var(--h1-size);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

h2 {
    font-family: var(--font-heading);
    font-size: var(--h2-size);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.3px;
    color: var(--accent-color);
}

h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
}

p,
li,
a,
span,
label,
input,
textarea,
button {
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
}

.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    background: #0a0a0a;
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.main-header.hidden {
    transform: translateY(-100%);
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent-color);
    letter-spacing: 2px;
    position: absolute;
    left: 0;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links li:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.3s;
}

.dropdown-content a:hover {
    background-color: #2a2a2a;
    color: var(--accent-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.hero-section {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    text-align: center;
    /* Let pointer events reach .hero-bg-panels behind the centered copy */
    pointer-events: none;
}

.hero-content a,
.hero-content button {
    pointer-events: auto;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: var(--hero-title-size);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -4px;
    margin-bottom: 2rem;
    color: var(--accent-color);
    text-transform: uppercase;
}

.split-word {
    display: inline-block;
    white-space: nowrap;
    font: inherit;
    color: inherit;
}

.split-char {
    display: inline-block;
    font: inherit;
    color: inherit;
    opacity: 0;
    transform: translateY(20px);
    animation: revealChar 0.5s cubic-bezier(0.5, 0, 0.5, 1) forwards;
}

h1.title-split-revealed,
h2.title-split-revealed,
.hero-title.title-split-revealed,
.video-title.title-split-revealed,
.section-header h2.title-split-revealed {
    color: var(--accent-color);
}

@keyframes revealChar {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.4s;
}

.hero-intro {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.5s;
}

.cta-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border: 2px solid #fff;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.6s;
}

.cta-button:hover {
    background: #fff;
    color: #4289b2;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.hero-visual {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    z-index: 1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.6;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-color);
    top: 20%;
    right: 10%;
    animation: float 6s infinite ease-in-out;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary-accent);
    bottom: 10%;
    right: 30%;
    animation: float 8s infinite ease-in-out reverse;
}

.projects-section {
    padding: 5rem 10%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: var(--section-header-size);
}

.tag {
    font-size: 0.8rem;
    color: var(--secondary-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.placeholder-img {
    width: 100%;
    height: 100%;
}

.about-section {
    padding: 5rem 10%;
    background: transparent;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: var(--section-header-size);
    margin-bottom: 2rem;
}

.kw {
    color: #4289b2;
    font-weight: 700;
}

.main-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
    font-size: 0.8rem;
}

.contact-page-section {
    padding: 8rem 10% 5rem;
    min-height: 80vh;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-20px, 20px);
    }
}

.video-showcase-section {
    padding: 0 10% 3rem;
    margin-top: -2rem;
}

.video-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.video-title {
    font-size: var(--section-header-size);
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    /* Do not let content-visibility: auto on ancestor sections skip embed layout/paint */
    content-visibility: visible;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

/* ── Lightweight YouTube embed (lazy) ───────────────────────────── */
.yt-lite {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.yt-lite::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--yt-thumb, #000) center / cover no-repeat;
    filter: saturate(1.02);
    transform: scale(1.01);
}

.yt-lite::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.75));
}

.yt-lite .yt-play {
    position: absolute;
    inset: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 58px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    z-index: 2;
}

.yt-lite:hover .yt-play {
    transform: translate(-50%, -50%) scale(1.05);
    background: rgba(66, 137, 178, 0.22);
    border-color: rgba(66, 137, 178, 0.55);
}

/* After hydrate, pseudos sit above the iframe and block clicks (pause/fullscreen).
   Hide them once the iframe is mounted. */
.yt-lite[data-hydrated='1']::before,
.yt-lite[data-hydrated='1']::after {
    display: none;
}

.yt-lite[data-hydrated='1'] {
    cursor: default;
}

.yt-lite[data-hydrated='1']:focus-visible {
    outline-offset: 4px;
}

.yt-lite .yt-play svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    margin-left: 3px;
}

.yt-lite iframe {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    border: 0;
}

.hero-bg-panels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 0;
}

.bg-panel {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: flex 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-right: 1px solid rgba(0, 0, 0, 0.5);
}

.bg-panel:last-child {
    border-right: none;
}

.panel-1 {
    background: linear-gradient(45deg, #ff6b6b, #556270);
}

.panel-2 {
    background: linear-gradient(45deg, #f7b731, #fa8231);
}

.panel-3 {
    background: linear-gradient(45deg, #4289b2, #45aaf2);
}

.panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: background 0.3s ease;
}

.bg-panel:hover {
    flex: 1.5;
}

.bg-panel:hover .panel-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.hero-visual {
    display: none;
}

/* Project pages often set height:100vh inline; make it mobile-safe */
.project-hero {
    min-height: 100vh;
    min-height: 100svh;
    height: auto !important;
}

@media (max-width: 768px) {
    :root {
        --h1-size: 38px;
        --h2-size: 30px;
        --section-header-size: 2.2rem;
    }

    body {
        font-size: 16px;
    }

    .hero-section {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 0 1.25rem;
    }

    .hero-content {
        max-width: 100%;
    }

    /* .hero-title font-size handled by clamp() in main styles */

    .nav-links {
        display: none;
    }

    /* Override big inline headings used in some pages */
    .hero-section .hero-title {
        font-size: clamp(2.4rem, 10vw, 3.2rem) !important;
        letter-spacing: -1.5px;
    }

    /* Project pages (they define huge sizes in inline <style>) */
    .project-title {
        font-size: clamp(2.25rem, 9vw, 3rem) !important;
        letter-spacing: 1px !important;
    }

    .project-subtitle {
        font-size: clamp(1rem, 4.5vw, 1.25rem) !important;
        letter-spacing: 1px !important;
    }

    .content-section h2 {
        font-size: clamp(1.8rem, 8vw, 2.4rem) !important;
        letter-spacing: 2px !important;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}
