:root {
    --bg: var(--wp--preset--color--black, #000000);
    --fg: var(--wp--preset--color--white, #ffffff);
    --gray: var(--wp--preset--color--gray, #888888);
    --tracking: 0.1em;
    /* --accent-color is injected via wp_add_inline_style */
}

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

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main#swup {
    flex: 1;
}

/* Accent Utilities */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color, #00ff00);
}

/* Accessibility: Focus States & Skip Link */
:focus-visible {
    outline: 2px solid var(--accent-color, #00f2ff);
    outline-offset: 4px;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link {
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 999999;
}

.skip-link:focus {
    background-color: var(--accent-color, #00f2ff);
    color: #000;
    clip: auto;
    clip-path: none;
    height: auto;
    left: 2rem;
    top: 2rem;
    width: auto;
    padding: 1rem 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.corner-nav {
    padding: 2.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: var(--tracking);
    text-transform: uppercase;
    z-index: 1000;
}

/* Horizontal Menus */
.corner-nav ul,
.site-top-bar ul,
.site-bottom-bar ul {
    list-style: none !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: var(--nav-gap, 2rem) !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media screen and (max-width: 768px) {
    .site-bottom-bar ul {
        justify-content: center !important;
        gap: 1rem !important;
    }
}

@media screen and (max-width: 1024px) {
    :root { --nav-gap: 1.5rem; }
}

.corner-nav li {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hero Section */
.hero-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    min-height: 80vh;
    margin: 0 auto;
    padding: 2rem;
    overflow: hidden;
    z-index: 1;
}

.hero-video-bg,
.hero-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-video-bg iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: brightness(0.6);
}

@media (min-aspect-ratio: 16/9) {
    .hero-video-bg iframe {
        height: 56.25vw;
    }
}

@media (max-aspect-ratio: 16/9) {
    .hero-video-bg iframe {
        width: 177.78vh;
    }
}

.hero-image-bg {
    background-size: cover;
    background-position: center;
}

.hero-media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero-content-wrapper {
    position: relative;
    z-index: 3;
    max-width: 1200px;
}

.hero-title {
    font-size: var(--wp--preset--font-size--huge, clamp(3rem, 12vw, 8rem));
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.9;
    text-transform: uppercase;
    color: var(--fg);
}

.hero-subtitle {
    color: var(--accent-color, #00ff00);
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    margin-top: 2rem;
    text-transform: uppercase;
}

/* ==========================================================================
   Hero Slider (CUST-002)
   ========================================================================== */
/* Variable heights are now injected via wp_add_inline_style in functions.php */
:root {
    --slider-height-desktop: 100vh;
    --slider-height-mobile: 70vh;
}

.gnn-hero-slider-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    height: var(--slider-height-desktop, 100vh);
    overflow: hidden;
    background: #000;
}

.gnn-hero-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.gnn-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    z-index: 1;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    overflow: hidden;
}

.gnn-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.gnn-slide .slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.1); /* Default scale for Ken Burns start */
    transition: transform 8s linear;
}

.gnn-slide.is-active .slide-bg {
    transform: scale(1); /* Ken Burns zoom out effect */
}

.slider-nav {
    position: absolute;
    bottom: 2.5rem;
    right: 2.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.slider-nav button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.slider-nav button:hover {
    background: var(--accent-color, #00f2ff);
    color: #000;
    border-color: var(--accent-color, #00f2ff);
    transform: scale(1.05);
}

.slider-dots {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 100;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.is-active {
    background: var(--accent-color, #00f2ff);
    transform: scale(1.5);
    box-shadow: 0 0 15px var(--accent-color, #00f2ff);
}

@media screen and (max-width: 768px) {
    .gnn-hero-slider-wrapper {
        min-height: 70vh;
        height: var(--slider-height-mobile, 70vh);
    }
    
    .slider-nav {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .slider-dots {
        bottom: 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}


/* ==========================================================================
   Static Hero Image (HERO-001)
   Uses the same height variables as the slider for consistent sizing.
   ========================================================================== */
.gnn-hero-static-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    height: var(--slider-height-desktop, 100vh);
    overflow: hidden;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.gnn-hero-static-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.gnn-hero-static-wrapper .hero-media-overlay {
    z-index: 2;
}

.gnn-hero-static-wrapper .hero-content-wrapper {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    padding: 0 2rem;
}

@media screen and (max-width: 768px) {
    .gnn-hero-static-wrapper {
        min-height: 70vh;
        height: var(--slider-height-mobile, 70vh);
    }
}


.gnn-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent-color, #00f2ff);
    color: #000;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

.gnn-btn:hover {
    background: #fff;
    transform: translateY(-3px);
}


/* Brutalist Glitch Animation */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
}

.glitch:hover::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-color, #00ff00);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch:hover::after {
    left: -2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
    }

    20% {
        clip: rect(62px, 9999px, 42px, 0);
    }

    40% {
        clip: rect(16px, 9999px, 78px, 0);
    }

    60% {
        clip: rect(89px, 9999px, 13px, 0);
    }

    80% {
        clip: rect(54px, 9999px, 37px, 0);
    }

    100% {
        clip: rect(76px, 9999px, 92px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(12px, 9999px, 58px, 0);
    }

    40% {
        clip: rect(93px, 9999px, 24px, 0);
    }

    60% {
        clip: rect(41px, 9999px, 81px, 0);
    }

    80% {
        clip: rect(27px, 9999px, 63px, 0);
    }

    100% {
        clip: rect(19px, 9999px, 45px, 0);
    }
}

/* Post Canvas */
.post-canvas {
    padding: 0 2rem 20vh;
}

.canvas-item {
    max-width: 900px;
    margin: 8rem auto;
    opacity: 1;
}

/* AJAX Transitions (Swup) */
.transition-fade {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}

html.is-animating .transition-fade {
    opacity: 0;
    transform: translateY(20px);
}

.site-branding img.custom-logo {
    max-height: 48px;
    width: auto;
    display: block;
}

.site-branding .custom-logo-link {
    display: inline-flex;
    align-items: center;
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    z-index: 3000;
}

#mobile-menu-overlay.is-active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Hamburger Styling */
#hamburger-menu {
    width: 44px;
    height: 44px;
    padding: 0;
    position: relative;
    cursor: pointer;
    z-index: 4000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    color: var(--fg, #fff);
}

#hamburger-menu span {
    display: block;
    width: 25px;
    height: 2px;
    background: currentColor;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

#hamburger-menu span:first-child {
    transform: translateY(-5px);
}

#hamburger-menu span:last-child {
    transform: translateY(5px);
}

#hamburger-menu.is-active span:first-child {
    transform: translateY(0) rotate(45deg);
}

#hamburger-menu.is-active span:last-child {
    transform: translateY(0) rotate(-45deg);
}

#mobile-menu-overlay ul {
    list-style: none;
    text-align: center;
}

#mobile-menu-overlay li {
    margin: 2rem 0;
}

#mobile-menu-overlay a {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

#mobile-menu-overlay a:hover {
    color: var(--accent-color, #00ff00);
    transform: translateX(10px);
}

/* Custom Blocks - Brutalist Styles */
.gnn-project-list-container {
    border-top: 2px solid var(--fg);
    margin: 4rem 0;
}

.gnn-project-list-container div {
    padding: 2rem 0;
    border-bottom: 1px solid var(--gray);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: padding 0.3s ease, border-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gnn-project-list-container div:hover {
    padding-left: 2rem;
    border-bottom-color: var(--accent-color, #00ff00);
    color: var(--accent-color, #00ff00);
}

.gnn-service-card {
    border: 2px solid var(--fg);
    padding: 3rem;
    margin: 2rem 0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.gnn-service-card:hover {
    background: var(--accent-color, #00ff00);
    color: #000;
    transform: translateY(-5px);
}

.gnn-service-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.gnn-references-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4rem;
    margin: 6rem 0;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gnn-references-list>* {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.gnn-references-list>*:hover {
    opacity: 1;
    color: var(--accent-color, #00ff00);
}

/* Block Editor Overrides */
.gnn-block-editor {
    background: #111;
    border: 1px dashed var(--gray);
    padding: 2rem;
    color: #fff;
    margin: 1rem 0;
}

/* Okunabilirlik: paragraf ve satır aralığı */
.entry-content,
.entry-content p,
.page-content,
.page-content p,
.post-content,
.post-content p {
    line-height: 1.65;
}

.entry-content p,
.page-content p,
.post-content p {
    margin: 0 0 1em;
}

/* Liste ve başlıklar da düzgün dursun */
.entry-content ul,
.entry-content ol,
.page-content ul,
.page-content ol {
    margin: 0 0 1em 1.2em;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    line-height: 1.15;
    margin: 0 0 0.6em;
}

/* --- Dropdown (sub-menu) --- */
.corner-nav li {
    position: relative;
}

/* Alt menü gizli başlasın */
.corner-nav .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 9999;

    min-width: 220px;
    padding: 10px 0;
    margin: 0;

    list-style: none;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    backdrop-filter: blur(6px);
}

/* Hover / klavye ile aç (CSS Fallback) */
.corner-nav li:hover > .sub-menu,
.corner-nav li:focus-within > .sub-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Submenu Toggle Support */
.corner-nav li.submenu-open > .sub-menu {
    display: block !important;
    opacity: 1 !important;
    position: static !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 1rem 0 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Alt menü linkleri */
.corner-nav .sub-menu a {
    display: block;
    padding: 10px 14px;
    white-space: nowrap;
}

/* İkinci seviye (sub-menu içinde sub-menu) */
.corner-nav .sub-menu li {
    position: relative;
}

.corner-nav .sub-menu .sub-menu {
    top: 0;
    left: calc(100% + 10px);
}

/* --- Mobile submenu --- */
@media (max-width: 768px) {
    .corner-nav .sub-menu {
        display: none;
        padding-left: 14px;
    }

    .corner-nav li.submenu-open>.sub-menu {
        display: block;
    }

    .corner-nav li.menu-item-has-children>a {
        position: relative;
        padding-right: 24px;
    }

    .corner-nav li.menu-item-has-children>a::after {
        content: "▾";
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.7;
    }
}


/* Responsive */
@media screen and (max-width: 768px) {

    .hero-container {
        min-height: 60vh;
        padding: 4rem 1rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .corner-nav {
        padding: 1.5rem;
    }

    .nav-right-container {
        margin-right: 1.5rem;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }


    .gnn-references-list {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gnn-service-card {
        padding: 2rem;
    }

    #hamburger-menu {
        display: flex;
    }
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */

.gnn-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease;
    z-index: 1500;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gnn-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gnn-back-to-top:hover {
    background: var(--accent-color, #00f2ff);
    color: #000;
    border-color: var(--accent-color, #00f2ff);
    transform: translateY(-3px);
}

@media screen and (max-width: 768px) {
    .gnn-back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================================
   Custom Magnetic Cursor (UI-002)
   ========================================================================== */

/* Disable default cursor only on non-touch devices if body has .has-custom-cursor */
@media (pointer: fine) {
    body.has-custom-cursor,
    body.has-custom-cursor a,
    body.has-custom-cursor button,
    body.has-custom-cursor input,
    body.has-custom-cursor textarea,
    body.has-custom-cursor select {
        cursor: none !important;
    }
}

.gnn-cursor,
.gnn-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2147483647; /* Maximum possible z-index to ensure it stays on top of everything */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: none; /* Hidden by default, shown by JS on mousemove */
}

@media (pointer: fine) {
    body.has-custom-cursor .gnn-cursor,
    body.has-custom-cursor .gnn-cursor-follower {
        display: block;
    }
}

.gnn-cursor {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color, #00f2ff);
    /* No transition on the main cursor to keep it snappy */
}

.gnn-cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    /* Smooth GSAP tracking will handle movement, but add transition for scale/bg */
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Hover States */
body.has-custom-cursor .gnn-cursor-follower.is-hovering {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    backdrop-filter: blur(2px);
}

body.has-custom-cursor .gnn-cursor.is-hovering {
    display: none; /* Hide the center dot when hovering links */
}