/* 
 * Professional Dark Mode Portfolio - Design System
 * 
 * Palette:
 * - Background: Pure Dark / Charcoal (#121212)
 * - Surface: Dark Gray (#1e1e20)
 * - Text: Pure White (#ffffff)
 * - Muted: Light Gray (#a1a1aa)
 * - Accent: White / Silver (#ffffff / #e4e4e7)
 */

:root {
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Colors (60-30-10 Design Rule) */
    --bg-dominant: #0B0B0F;   /* 60% - Dominant Background */
    --bg-header: rgba(11, 11, 15, 0.7); /* Header Glassmorphism */
    --text-secondary: #F4F4F5; /* 30% - Secondary Text */
    --color-accent: #7068CC;   /* 10% - Accent Vurgu */

    /* Backgrounds */
    --bg-body: var(--bg-dominant);
    --bg-card: #16161D; /* Subtle offset for cards */
    --bg-card-hover: #1D1D26;

    /* Texts */
    --text-main: var(--text-secondary);
    --text-muted: #A1A1AA; /* Muted text */

    /* Brand / Actions */
    --primary: var(--color-accent);
    --primary-hover: #7068CC;
    --on-primary: #000000; /* Dark mode: text on purple background = black */
    --on-primary-hover-bg: rgba(0, 0, 0, 0.1);
    --on-primary-hover-border: rgba(0, 0, 0, 0.35);

    --border-color: #2A2A35;
    /* Subtle border color */

    /* Spacing & Layout */
    --container-width: 1000px;
    --header-height: 70px;
    --gap-md: 2rem;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --radius-md: 0.5rem;
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg-dominant: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.7);
    --bg-card: #f0f0f0;
    --bg-card-hover: #e8e8e8;
    --text-secondary: #000000;
    --text-muted: #000000;
    --border-color: #cccccc;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --on-primary: #ffffff; /* Light mode: text on purple background = white */
    --on-primary-hover-bg: rgba(255, 255, 255, 0.1);
    --on-primary-hover-border: rgba(255, 255, 255, 0.5);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

/* Header */
header {
    height: var(--header-height);
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 1.25rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.logo span {
    color: inherit;
    transition: inherit;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-md);
    transition: background-color 0.25s ease;
    outline: none;
    white-space: nowrap;
}

.nav-separator {
    color: var(--text-muted);
    opacity: 0.4;
    font-weight: 300;
    font-size: 1.1rem;
    user-select: none;
    pointer-events: none;
    margin: 0 1rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
    background-color: rgba(128, 128, 128, 0.15);
    opacity: 1;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-md);
    transition: background-color 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
}

.theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.15);
}

/* Hero overrides removed */

/* Classic Sun/Moon SVG Toggle Animations */
.theme-toggle svg {
    display: block;
    width: 1.25em;
    height: 1.25em;
    --dur: 400ms;
}

/* Moon mask path – slides in dark mode */
.theme-toggle .toggle-mask {
    transition: d var(--dur) ease, translate var(--dur) ease;
    d: path('M0 0h25a1 1 0 0010 10v14H0Z');
}

[data-theme="dark"] .theme-toggle .toggle-mask {
    d: path('M0 2h13a1 1 0 0010 10v14H0Z');
    transition-delay: calc(var(--dur) * 0.15);
}

/* Circle scales up to full moon in dark mode */
.theme-toggle .toggle-circle {
    transform-origin: center;
    transition: transform var(--dur) ease;
    transform: scale(1);
}

[data-theme="dark"] .theme-toggle .toggle-circle {
    transform: scale(1.7);
}

/* Sun rays fade out in dark mode */
.theme-toggle .toggle-ray {
    transform-box: view-box;
    transform-origin: center;
    transition: transform var(--dur) ease, opacity var(--dur) ease;
    transition-delay: calc(var(--dur) * 0.15);
    opacity: 1;
    transform: scale(1);
}

[data-theme="dark"] .theme-toggle .toggle-ray {
    transform: scale(0);
    opacity: 0;
    transition-delay: 0s;
}

.lang-switch {
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    outline: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    transition: background-color 0.25s ease;
}

.lang-switch:hover {
    background-color: rgba(128, 128, 128, 0.15);
}

/* Lang switch hero override removed */

.menu-toggle {
    display: none;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    /* padding-top removed for perfect vertical centering */
    background-color: var(--bg-body);
    transition: background-color 0.3s ease;
}

.hero .btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.hero .btn-outline:hover {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px rgba(112, 104, 204, 0.3);
}

.content-wrapper {
    position: relative;
    margin-top: 100vh;
    background-color: var(--bg-body);
    z-index: 20;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: none;
    color: var(--text-main);
    text-align: center;
}

.hero p,
.hero .cv-text {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-muted);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    /* Accent button */
    color: #ffffff;
    /* White text for contrast */
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(112, 104, 204, 0.25);
}

.btn-outline {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    transition: var(--transition);
}

.btn-outline:hover {
    border-color: var(--primary-hover);
    color: #ffffff;
    background-color: var(--primary-hover);
}

/* CTA Hierarchy */
.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.cta-group {
    display: flex;
    gap: 1rem;
}

.cv-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    max-width: 500px;
}

.cv-link-block {
    display: block;
    margin-top: 0.5rem;
}

.cv-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity 0.3s ease;
}

.cv-text a:hover {
    text-decoration: none;
}

.file-info {
    font-size: 0.8rem;
    margin-left: 0.3rem;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--gap-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-4px);
    background-color: var(--bg-card-hover);
}

.card:has(.org-card-img:hover) {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(112, 104, 204, 0.15);
}

.org-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.org-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: block;
}

.org-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.org-card-content h3 {
    margin-bottom: 0.5rem;
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card h3 a {
    color: var(--text-main);
}

.card h3 a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.card-link-action {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid transparent;
}

.card-link-action:hover {
    border-bottom-color: var(--primary);
}

.text-link {
    display: inline-block;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.text-link:hover {
    border-bottom-color: var(--primary);
    color: var(--primary-hover);
}

/* Footer */
footer {
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    background-color: var(--bg-dominant);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 20;
}

footer p {
    margin-bottom: 0;
    color: var(--text-muted);
}

.footer-credit {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.footer-credit a {
    color: var(--text-main);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.footer-credit a:hover {
    color: var(--primary);
    opacity: 1;
}

/* Blog Detail & Comments */
.blog-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.comments-section {
    max-width: 800px;
    margin: 4rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    color: var(--text-main);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: none;
}

.giscus-frame {
    min-height: 200px;
    width: 100%;
}

/* Intermediate Desktop/Tablet Responsive styling to prevent header breakage */
@media (max-width: 1024px) {
    .nav-container {
        gap: 0.9rem;
    }
    .nav-links {
        gap: 0.9rem;
    }
    .nav-separator {
        margin: 0 0.85rem;
    }
    .header-controls {
        gap: 0.9rem;
        margin-left: 0.85rem;
    }
}

@media (max-width: 920px) {
    .nav-container {
        gap: 0.7rem;
    }
    .nav-links {
        gap: 0.7rem;
    }
    .nav-separator {
        margin: 0 0.55rem;
    }
    .header-controls {
        gap: 0.7rem;
        margin-left: 0.55rem;
    }
    .nav-links a {
        padding: 0.3rem 0.5rem;
        font-size: 0.95rem;
    }
    .logo {
        font-size: 1.15rem;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero {
        padding-top: var(--header-height);
        padding-bottom: 2rem;
    }

    .hero h1 {
        font-size: 2.25rem;
        margin-bottom: 0.75rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }

    /* Hamburger Menu Button */
    .menu-toggle {
        display: flex;
        background: none;
        border: none;
        outline: none;
        color: var(--text-main);
        cursor: pointer;
        padding: 0.35rem;
        border-radius: var(--radius-md);
        transition: background-color 0.25s ease;
        align-items: center;
        justify-content: center;
        width: 2.25rem;
        height: 2.25rem;
        position: relative;
    }

    .menu-toggle:hover {
        background-color: rgba(128, 128, 128, 0.15);
    }

    /* Hero overrides removed */

    .menu-toggle svg {
        display: block;
    }

    .menu-toggle svg line {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    }

    .menu-toggle .line-1 {
        transform-origin: 12px 6px;
    }

    .menu-toggle .line-2 {
        transform-origin: 12px 12px;
    }

    .menu-toggle .line-3 {
        transform-origin: 12px 18px;
    }

    .menu-toggle.active .line-1 {
        transform: translateY(6px) rotate(45deg);
    }

    .menu-toggle.active .line-2 {
        opacity: 0;
        transform: scale(0);
    }

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

    /* Mobile Navigation Drawer */
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--bg-dominant);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem 2rem;
        gap: 1.25rem;
        transform: translateY(-150%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s;
        z-index: 99;
        box-shadow: var(--shadow-md);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-separator {
        display: none;
    }

    .nav-container {
        justify-content: space-between;
        gap: 0;
    }

    .header-controls {
        margin-left: 0;
        gap: 0.75rem;
    }

    /* Hero overrides removed */

    .cta-container {
        width: 100%;
        margin-top: 1rem;
        gap: 0.75rem;
    }

    .cta-group {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .hero .cv-text {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    .btn,
    .btn-outline {
        width: 100%;
        text-align: center;
        margin-left: 0;
        padding: 0.65rem 1.25rem;
        /* Reset margin for vertical stack */
    }
}

/* Organization Card Overrides */
.org-card-img {
    width: 100%;
    height: 220px;
    object-fit: contain; /* Keep original aspect ratio within bounds */
    background-color: rgba(0,0,0,0.05); /* subtle backdrop */
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.org-card-img:hover {
    opacity: 0.85;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.lightbox-close:hover {
    color: var(--primary);
}

.tech-tag {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Carousel Yapısı */
.carousel-wrapper {
    position: relative;
    width: 100%;
}
.carousel-track {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox için gizle */
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-top: -1rem; /* Hover anında kartın üstten kesilmemesi için boşluk */
}
.carousel-track::-webkit-scrollbar { 
    display: none; /* Chrome/Safari için gizle */
}
.carousel-slide {
    flex: 0 0 calc(50% - 1rem); /* Aynı anda tam 2 kart gösterir */
    scroll-snap-align: start;
    min-width: 0;
}

.carousel-btn {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 2.5rem; /* İkonu büyüttük */
    padding: 0;
}
.carousel-btn:hover {
    color: var(--text-main);
    transform: translateY(-50%) scale(1.1); /* Sadece hafifçe büyür */
    border: none; /* Önceki hover'dan kalma border varsa ezmek için */
}
.btn-prev { left: -40px; }
.btn-next { right: -40px; }

/* Mobil Ekranlarda Tekli Kart Görünümü */
@media (max-width: 768px) {
    .carousel-slide { flex: 0 0 100%; }
    .btn-prev { left: 0; }
    .btn-next { right: 0; }
}
