/* ============ Theme tokens ============
   Tailwind'in gray/white/black renkleri bu değişkenlere bağlı (tailwind.config.js).
   Dark mode = html.dark sınıfı; tercih localStorage'da, yoksa sistem teması. */
:root {
    --c-white: 255 255 255;
    --c-black: 0 0 0;
    --g-50: 249 250 251;  --g-100: 243 244 246; --g-200: 229 231 235; --g-300: 209 213 219;
    --g-400: 156 163 175; --g-500: 107 114 128; --g-600: 75 85 99;    --g-700: 55 65 81;
    --g-800: 31 41 55;    --g-900: 17 24 39;    --g-950: 3 7 18;

    --bg: #fdfdfd;
    --bg-glow-1: hsla(253,16%,95%,1);
    --bg-glow-2: hsla(225,39%,95%,1);
    --grid-line: rgba(0,0,0,0.03);
    --ink: #111;
    --glass-1: rgba(255,255,255,0.82);
    --glass-2: rgba(255,255,255,0.45);
    --glass-border: rgba(255,255,255,0.9);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.045);
    --nav-bg: rgba(255,255,255,0.55);
    --nav-border: rgba(255,255,255,0.7);
    --menu-bg: rgba(255,255,255,0.88);
    --chip-bg: rgba(255,255,255,0.8);
    --chip-border: #fff;
    --chip-ink: #4b5563;
    --cover-1: #f9fafb; --cover-2: #e5e7eb;
    --cover-label: rgba(17,24,39,0.12);
    --cover-blend: multiply; --cover-opacity: .7;
    --text-glass: linear-gradient(90deg, #aaa, #333);
    --cursor-dot: rgba(0,0,0,0.2);
    --cursor-hover: rgba(255,255,255,0.35);
    --gh-empty: rgba(0,0,0,0.03);
    --gh-opacity: .3;
    --ok-ink: #166534; --ok-bg: rgba(220,252,231,0.8); --ok-border: rgba(187,247,208,0.9);
    --muted-ink: #6b7280; --muted-bg: rgba(243,244,246,0.8); --muted-border: rgba(229,231,235,0.9);
    color-scheme: light;
}

html.dark {
    --c-white: 14 15 20;
    --c-black: 245 246 248;
    --g-50: 20 22 28;     --g-100: 26 29 36;    --g-200: 44 48 58;    --g-300: 66 71 84;
    --g-400: 122 128 142; --g-500: 148 155 170; --g-600: 176 182 195; --g-700: 204 209 218;
    --g-800: 226 229 235; --g-900: 241 243 246; --g-950: 250 250 251;

    --bg: #0b0c10;
    --bg-glow-1: hsla(265,40%,14%,1);
    --bg-glow-2: hsla(225,45%,12%,1);
    --grid-line: rgba(255,255,255,0.035);
    --ink: #f1f3f6;
    --glass-1: rgba(255,255,255,0.07);
    --glass-2: rgba(255,255,255,0.025);
    --glass-border: rgba(255,255,255,0.09);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.35);
    --nav-bg: rgba(20,22,28,0.55);
    --nav-border: rgba(255,255,255,0.08);
    --menu-bg: rgba(18,20,26,0.92);
    --chip-bg: rgba(255,255,255,0.06);
    --chip-border: rgba(255,255,255,0.08);
    --chip-ink: #b0b6c3;
    --cover-1: #15171d; --cover-2: #1d2027;
    --cover-label: rgba(255,255,255,0.10);
    --cover-blend: screen; --cover-opacity: .22;
    --text-glass: linear-gradient(90deg, #6b7080, #e5e7eb);
    --cursor-dot: rgba(255,255,255,0.35);
    --cursor-hover: rgba(255,255,255,0.08);
    --gh-empty: rgba(255,255,255,0.035);
    --gh-opacity: .45;
    --ok-ink: #86efac; --ok-bg: rgba(34,197,94,0.12); --ok-border: rgba(34,197,94,0.25);
    --muted-ink: #9ca3af; --muted-bg: rgba(255,255,255,0.06); --muted-border: rgba(255,255,255,0.08);
    color-scheme: dark;
}

/* Tema değişirken yumuşak geçiş (sadece toggle anında) */
html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
    transition: background-color .35s ease, border-color .35s ease, color .35s ease, fill .35s ease !important;
}

/* ============ Base ============ */
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    background-image: radial-gradient(at 0% 0%, var(--bg-glow-1) 0, transparent 50%),
                      radial-gradient(at 100% 100%, var(--bg-glow-2) 0, transparent 50%);
    background-attachment: fixed;
    overflow-x: hidden;
}
section[id], article[id] { scroll-margin-top: 100px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.grid-bg {
    position: fixed; inset: 0;
    background-size: 50px 50px;
    background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
                      linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    z-index: -2; pointer-events: none;
}

/* ============ Custom cursor (only mouse / trackpad) ============ */
.cursor { display: none; }
.has-custom-cursor body, .has-custom-cursor a, .has-custom-cursor button { cursor: none; }
.has-custom-cursor .cursor {
    display: flex;
    width: 12px; height: 12px;
    background: var(--cursor-dot);
    border-radius: 50%;
    position: fixed; top: 0; left: 0; pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width .3s ease, height .3s ease, background .3s ease, border .3s ease;
    align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: transparent; letter-spacing: 1px;
}
.has-custom-cursor .cursor.hovered {
    width: 85px; height: 85px;
    background: var(--cursor-hover);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: var(--ink);
}

/* ============ Glass ============ */
.glass-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--nav-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.glass-card {
    background: linear-gradient(135deg, var(--glass-1) 0%, var(--glass-2) 100%);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Theme toggle */
.theme-toggle {
    width: 38px; height: 38px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink); transition: transform .3s ease;
}
.theme-toggle:hover { transform: rotate(-15deg); }
.theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }

/* Mobile menu */
.mobile-menu {
    position: fixed; top: 76px; left: 16px; right: 16px; z-index: 49;
    display: flex; flex-direction: column;
    background: var(--menu-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px; padding: 8px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
    color: var(--ink);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a { padding: 14px 18px; font-size: 13px; font-weight: 700; letter-spacing: .15em; border-radius: 16px; }
.mobile-menu a:active { background: var(--chip-bg); }

/* ============ Typography ============ */
.text-outline { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.text-glass {
    color: transparent;
    background: var(--text-glass);
    -webkit-background-clip: text; background-clip: text;
}
.section-title { font-size: clamp(2.25rem, 6vw, 3.75rem); font-weight: 800; letter-spacing: -0.05em; margin-bottom: 3rem; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: rgb(var(--g-400)); }
.link-underline { display: inline-flex; gap: .5rem; font-weight: 700; font-size: .8rem; letter-spacing: .15em; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }

/* Chips & pills */
.chip {
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--chip-ink);
    padding: 6px 12px; border-radius: 8px; background: var(--chip-bg); border: 1px solid var(--chip-border);
}
.status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ok-ink);
    padding: 5px 12px; border-radius: 999px; background: var(--ok-bg); border: 1px solid var(--ok-border);
}
.status-pill--muted { color: var(--muted-ink); background: var(--muted-bg); border-color: var(--muted-border); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.filter-chip {
    font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--chip-ink);
    padding: 9px 16px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--chip-border);
    backdrop-filter: blur(10px); transition: all .2s ease;
}
.filter-chip:hover { color: var(--ink); border-color: var(--ink); }
.filter-chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ============ Hero ============ */
.hero-blob {
    position: absolute; right: -10%; top: 10%;
    width: min(500px, 80vw); height: min(600px, 95vw);
    opacity: .6; filter: blur(2px);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    transform: rotate(15deg);
    animation: float 9s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: rotate(15deg) translateY(0); } 50% { transform: rotate(18deg) translateY(-20px); } }

/* ============ Timeline ============ */
.timeline { position: relative; padding-left: 36px; display: flex; flex-direction: column; gap: 28px; }
.timeline::before {
    content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px;
    background: linear-gradient(to bottom, #c084fc, var(--grid-line));
}
.timeline-item { position: relative; }
.timeline-dot {
    position: absolute; left: -36px; top: 34px; width: 20px; height: 20px; border-radius: 50%;
    background: var(--bg); border: 2px solid #9333ea; box-shadow: 0 0 0 6px rgba(192,132,252,0.18);
}

/* ============ Project covers ============ */
.cover {
    position: relative; overflow: hidden; width: 100%;
    border-radius: 1.5rem; border: 1px solid var(--glass-border);
    background: linear-gradient(135deg, var(--cover-1), var(--cover-2));
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.04);
}
.cover-blob {
    position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
    filter: blur(48px); opacity: var(--cover-opacity); mix-blend-mode: var(--cover-blend);
    transition: transform .7s ease;
}
.group:hover .cover-blob { transform: scale(1.25); }
.cover-label { position: relative; font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 900; letter-spacing: -0.04em; color: var(--cover-label); text-transform: uppercase; }

/* ============ GitHub matrix easter egg ============ */
.github-matrix-container {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg) scale(1.5);
    z-index: -1; opacity: var(--gh-opacity); pointer-events: none;
    mask-image: radial-gradient(circle, #000 0%, transparent 60%);
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 60%);
}
.gh-grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 6px; }
.gh-cell { width: 14px; height: 14px; border-radius: 3px; transition: background-color .8s ease; background-color: var(--gh-empty); }
.gh-cell[data-level="1"] { background-color: #e9d5ff; }
.gh-cell[data-level="2"] { background-color: #c084fc; }
.gh-cell[data-level="3"] { background-color: #9333ea; }
.gh-cell[data-level="4"] { background-color: #581c87; }
html.dark .gh-cell[data-level="1"] { background-color: #3b1d5e; }
html.dark .gh-cell[data-level="2"] { background-color: #6b21a8; }
html.dark .gh-cell[data-level="3"] { background-color: #9333ea; }
html.dark .gh-cell[data-level="4"] { background-color: #c084fc; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* ============ Easter eggs ============ */
.egg-overlay {
    position: fixed; inset: 0; z-index: 9000;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(0,0,0,0.25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .25s ease;
}
.egg-overlay.is-in { opacity: 1; }
.egg-window {
    width: min(680px, 100%); max-height: calc(100vh - 32px); overflow: auto;
    border-radius: 24px; color: var(--ink);
    background: var(--menu-bg);
    transform: translateY(16px) scale(.98); transition: transform .25s ease;
}
.egg-window--wide { width: min(820px, 100%); }
.egg-overlay.is-in .egg-window { transform: none; }
.egg-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--glass-border); }
.egg-dots { display: flex; gap: 6px; }
.egg-dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.egg-dots i:nth-child(2) { background: #febc2e; } .egg-dots i:nth-child(3) { background: #28c840; }
.egg-title { flex: 1; text-align: center; font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: rgb(var(--g-500)); }
.egg-close { font-size: 14px; color: rgb(var(--g-500)); padding: 2px 6px; border-radius: 6px; }
.egg-close:hover { color: var(--ink); background: var(--chip-bg); }
.egg-body { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.egg-hud { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
    font: 600 11px Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: rgb(var(--g-500)); }
.egg-hud b { color: var(--ink); }
.egg-canvas { display: block; max-width: 100%; touch-action: none; border-radius: 12px; }
.egg-canvas--chart { background: var(--chip-bg); border: 1px solid var(--glass-border); cursor: crosshair; }
.egg-hint { font-size: 12px; color: rgb(var(--g-500)); text-align: center; max-width: 560px; line-height: 1.5; }
.egg-result { width: 100%; text-align: center; padding-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.egg-result-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.egg-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.egg-btn { font: 700 12px Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--bg); }
.egg-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }

/* Terminal */
.term { width: 100%; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.term-out { max-height: 50vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.term-row { margin-bottom: 6px; }
.term-row a { color: #9333ea; text-decoration: underline; }
html.dark .term-row a { color: #c084fc; }
.term-echo { color: var(--ink); margin-top: 6px; }
.term-dim, .term-row .term-dim { color: rgb(var(--g-500)); }
.term-err { color: #dc2626; } html.dark .term-err { color: #f87171; }
.term-ok { color: #16a34a; } html.dark .term-ok { color: #4ade80; }
.term-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.term-prompt { color: #9333ea; font-weight: 700; } html.dark .term-prompt { color: #c084fc; }
.term-in { flex: 1; background: transparent; border: 0; outline: none; color: var(--ink); font: inherit; caret-color: #9333ea; }

/* Toast */
.egg-toast {
    position: fixed; left: 50%; bottom: 28px; z-index: 9500; transform: translate(-50%, 20px); opacity: 0;
    padding: 12px 20px; border-radius: 999px; font: 600 13px Inter, sans-serif;
    background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all .3s ease; pointer-events: none; white-space: nowrap;
}
.egg-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* Car */
.egg-car-layer { position: fixed; inset: 0; z-index: 8000; pointer-events: none; }
.egg-car-hud {
    position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 8001;
    padding: 8px 16px; border-radius: 999px; font: 600 12px Inter, sans-serif; color: var(--ink);
    background: var(--menu-bg); border: 1px solid var(--glass-border); backdrop-filter: blur(12px); white-space: nowrap;
}
@keyframes egg-bump { 0%,100% { transform: none; } 20% { transform: translate(-6px, 2px) rotate(-1deg); } 40% { transform: translate(5px, -2px) rotate(.8deg); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, 0); } }
.egg-bump { animation: egg-bump .45s ease; }

/* Footer hint */
.egg-hint-btn { font: 600 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: rgb(var(--g-400)); letter-spacing: .02em; transition: color .2s ease; }
.egg-hint-btn:hover { color: #9333ea; }


/* ============ Ambient background (scroll-driven aurora) ============
   Sadece opacity + translate değişir → GPU'da çalışır, repaint yok. */
.aurora { position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden; }
.aurora-blob {
    position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
    will-change: transform, opacity, translate;
    animation: aurora-drift 26s ease-in-out infinite alternate;
}
.a1 { left: -25vmax; top: -25vmax; background: radial-gradient(circle, rgba(168,85,247,var(--aurora-a)) 0%, transparent 62%); }
.a2 { right: -28vmax; top: 10vh;  background: radial-gradient(circle, rgba(251,146,60,var(--aurora-a)) 0%, transparent 62%); animation-duration: 31s; animation-delay: -8s; opacity: 0; }
.a3 { left: -10vmax; bottom: -35vmax; background: radial-gradient(circle, rgba(236,72,153,var(--aurora-a)) 0%, transparent 62%); animation-duration: 23s; animation-delay: -14s; opacity: 0; }
.a4 { right: -20vmax; bottom: -30vmax; background: radial-gradient(circle, rgba(59,130,246,var(--aurora-b)) 0%, transparent 62%); animation-duration: 35s; animation-delay: -4s; }
@keyframes aurora-drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(6vmax, 4vmax) scale(1.08); }
    100% { transform: translate(-4vmax, 7vmax) scale(0.95); }
}
:root { --aurora-a: .28; --aurora-b: .16; }
html.dark { --aurora-a: .30; --aurora-b: .20; }

.spotlight {
    position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px;
    border-radius: 50%; z-index: -1; pointer-events: none; opacity: 0;
    background: radial-gradient(circle, rgba(168,85,247,.10) 0%, transparent 65%);
    transition: opacity .6s ease; will-change: transform;
}
html.dark .spotlight { background: radial-gradient(circle, rgba(192,132,252,.12) 0%, transparent 65%); }
.has-custom-cursor .spotlight { opacity: 1; }

.scroll-progress {
    position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 60; pointer-events: none;
    background: linear-gradient(90deg, #9333ea, #fb923c, #ec4899);
    transform-origin: 0 50%; transform: scaleX(0);
}

/* Gizli link — çok belirgin değil ama dikkatli bakan görür */
.love-link {
    margin-left: 10px; font: 600 9px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .25em; text-transform: lowercase;
    color: rgb(var(--g-400)); opacity: .45; transition: color .3s ease, opacity .3s ease;
}
.love-link:hover, .love-link:focus-visible { color: #ec4899; opacity: 1; }
