/* Global Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.7;
  font-size: 15px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--cream);
}
p {
  font-family: var(--body);
}

/* Global Smooth Transitions */
body, nav, section, footer, div, a, button, input, textarea, .expertise-card, .bento-item, .work-item, .custom-context-menu {
  transition: background-color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), 
              color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), 
              border-color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

::selection {
  background: var(--orange);
  color: var(--bg);
}

/* ── FLOATING ACTION BUTTONS (FAB) & PALETTE ── */
.fab-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 9990;
}

.fab-btn {
  height: 50px;
  border-radius: 14px; /* Apple squircle aesthetic */
  background: rgba(var(--bg-rgb), 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--cream-border);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.fab-up {
  width: 50px; /* Square base */
  border-radius: 14px;
  font-size: 18px;
}

.fab-term {
  padding: 0 20px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Terminal button is always visible */
.fab-btn.fab-term {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  animation: termPulse 3s infinite;
}

@keyframes termPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 111, 0, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 111, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 111, 0, 0); }
}

.fab-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab-btn:hover {
  background: rgba(255, 111, 0, 0.1);
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* ── COMMAND PALETTE MODAL ── */
.command-palette-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(2px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: all 0.3s ease;
  pointer-events: none;
}

.command-palette-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.command-palette {
  width: 100%;
  max-width: none;
  background: rgba(13, 12, 12, 0.95);
  border-top: 1px solid var(--cream-border);
  border-radius: 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  position: relative;
}

.command-palette-overlay.active .command-palette {
  transform: translateY(0);
  opacity: 1;
}

.palette-input-wrap {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.palette-output {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 1.5rem;
  padding-bottom: 0.5rem;
  pointer-events: none;
  z-index: 10000;
}

.palette-message {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--bg);
  background: var(--orange);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  margin-bottom: 0.8rem;
  align-self: flex-start;
  box-shadow: 0 5px 15px rgba(255, 111, 0, 0.25);
  animation: floatUpFade 3s ease forwards;
}

@keyframes floatUpFade {
  0% { opacity: 0; transform: translateY(10px); }
  10% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(-10px); }
  100% { opacity: 0; transform: translateY(-20px); }
}

.palette-prompt {
  color: var(--orange);
  font-family: var(--mono);
  margin-right: 15px;
  font-weight: bold;
}

.palette-input {
  background: transparent;
  border: none;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 16px;
  outline: none;
  flex-grow: 1;
  width: 100%;
  position: relative;
  z-index: 2;
}

.palette-suggestion {
  position: absolute;
  left: 48px; /* Rough estimate for prompt width */
  color: rgba(255,255,255,0.2);
  font-family: var(--mono);
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
}

.palette-footer {
  padding: 0.8rem 1.5rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cream-dim);
  display: flex;
  justify-content: space-between;
  background: rgba(255,255,255,0.02);
}

/* Global Fixed Navigation Bar */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 4rem;
  background: rgba(var(--bg-rgb), 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cream-border);
}

.nav-logo {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--cream);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 3rem;
}

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

.nav-links a {
  color: var(--cream-dim);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: var(--transition);
}

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

.nav-contact {
  color: var(--orange) !important;
  border: none;
  padding: 8px 20px;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s !important;
}
.nav-contact:hover {
  background: var(--orange) !important;
  color: var(--bg) !important;
}

/* ── UNIVERSAL CURSOR ── */
.cursor { 
  width: 6px; height: 6px; background: var(--cream); border-radius: 50%; 
  position: fixed; pointer-events: none; transform: translate(-50%, -50%); 
  z-index: 99999999; opacity: 0; mix-blend-mode: difference; 
}
.cursor-ring { 
  width: 30px; height: 30px; border: 1px solid var(--cream-mute); border-radius: 50%; 
  position: fixed; pointer-events: none; transform: translate(-50%, -50%); 
  z-index: 99999998; opacity: 0; transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background-color 0.3s ease; 
  mix-blend-mode: difference; 
}

@media (max-width: 992px) {
  .cursor, .cursor-ring { display: none !important; }
}

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--cream-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange-dim); }

/* Custom Context Menu / Modal */
.custom-context-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 10000;
  background: rgba(var(--bg-rgb), 0.95);
  border: 1px solid var(--cream-border);
  padding: 2rem;
  width: 300px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-context-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.ctx-header {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--orange);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--orange-mute);
  padding-bottom: 0.5rem;
}

.ctx-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-family: var(--mono);
  font-size: 9px;
}

.ctx-label {
  color: var(--cream-mute);
}

.ctx-value {
  color: var(--cream);
}

/* Common Animations */
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

.glitch {
  position: relative;
}

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

.glitch:hover::before {
  animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
  color: #ff00ff;
  z-index: -1;
}

.glitch:hover::after {
  animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) reverse both infinite;
  color: #00ffff;
  z-index: -2;
}

/* ── SCROLL REVEAL ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  filter: blur(5px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform, filter;
}

.reveal.active, .reveal-left.active, .reveal-right.active {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  filter: blur(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px) scale(0.98);
  filter: blur(5px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform, filter;
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px) scale(0.98);
  filter: blur(5px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform, filter;
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* ── PAGE TRANSITION ANIMATIONS ── */
body {
  opacity: 0;
  transition: background-color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), 
              color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), 
              opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.page-loaded {
  opacity: 1;
}

body.page-exit {
  opacity: 0;
}

/* ── MOUSE TRACKING GLOW ── */
.glow-card {
  position: relative;
  overflow: hidden;
}

.glow-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    600px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
    rgba(255, 111, 0, 0.08),
    transparent 40%
  );
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  opacity: 0;
}

.glow-card:hover::before {
  opacity: 1;
}

.glow-card > * {
  position: relative;
  z-index: 1;
}

/* ── CINEMATIC NOISE (Removed) ── */

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 111, 0, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}

/* ── SITE FOOTER ── */
.site-footer {
  padding: 6rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  border-top: 1px solid var(--cream-border);
  background: linear-gradient(to top, rgba(255, 111, 0, 0.02), transparent);
  margin-top: 4rem;
}

.footer-info {
  display: flex;
  gap: 4rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cream-mute);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.footer-center {
  text-align: center;
}

.footer-sig {
  font-family: var(--display);
  font-size: 2.5rem;
  color: var(--cream);
  opacity: 0.8;
  font-style: italic;
  letter-spacing: 0.1em;
}

.footer-copy {
  font-size: 10px;
  color: var(--cream-mute);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.footer-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--orange), transparent);
  opacity: 0.4;
}

/* ── MOBILE RESPONSIVENESS (GLOBAL) ── */
@media (max-width: 768px) {
  nav {
    padding: 1.2rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
    width: 100vw;
  }
  .nav-right {
    gap: 1rem;
    width: 100%;
    justify-content: center;
  }
  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-links a {
    font-size: 9.5px;
    letter-spacing: 0.1em;
  }
  .fab-container {
    bottom: 15px;
    right: 15px;
    transform: scale(0.9);
    transform-origin: bottom right;
  }
  .site-footer {
    padding: 3rem 1.5rem;
    width: 100vw;
    overflow: hidden;
  }
  .footer-info {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
  }
  .footer-sig {
    font-size: 2rem;
  }
}

/* ── GRID MOUSE TRAIL EFFECT ── */
#bg-grid-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: grid;
  z-index: 0; 
  pointer-events: none;
  overflow: hidden;
}

.bg-grid-cell {
  width: 100%;
  height: 100%;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 1s ease-out, background-color 1s ease-out, box-shadow 1s ease-out;
  transform: scale(0.9);
}

.bg-grid-cell.active {
  opacity: 0.25;
  transform: scale(1);
  transition: opacity 0s, transform 0.1s;
}

/* ── MİNİMALİST NAV & SCROLLSPY (YENİ) ── */
.site-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2rem 4rem; width: 100%; z-index: 1000;
  background: transparent; border: none;
  border-bottom: 1px solid var(--cream-border);
}
.nav-brand a {
  font-family: var(--display); font-size: 1.5rem; font-style: italic;
  color: var(--cream); text-decoration: none; letter-spacing: 0.05em;
}
.nav-menu { display: none; /* Klasik menü gizlendi */ }
.nav-theme { display: flex; gap: 1rem; align-items: center; }
.nav-theme button {
  background: none; border: 1px solid var(--cream-mute); color: var(--cream);
  padding: 6px 15px; border-radius: 20px; font-family: var(--mono); font-size: 10px;
  cursor: pointer; transition: all 0.3s;
}
.nav-theme button:hover { border-color: var(--orange); color: var(--orange); }

.nav-status {
  display: flex; align-items: center; gap: 8px; margin-left: 20px;
  font-family: var(--mono); font-size: 9px; color: var(--cream-dim); text-transform: uppercase;
}
.status-dot { width: 6px; height: 6px; background: #00ff00; border-radius: 50%; box-shadow: 0 0 8px #00ff00; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

.scrollspy {
  position: fixed; right: 40px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 20px; z-index: 1000;
  opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease;
}
.scrollspy.is-visible {
  opacity: 1; visibility: visible;
}
.spy-line {
  position: absolute; right: 4px; top: 5px; bottom: 5px; width: 1px;
  background: var(--cream-mute); opacity: 0.2; z-index: -1;
}
.spy-item {
  display: flex; align-items: center; justify-content: flex-end; gap: 15px; text-decoration: none; cursor: pointer;
}
.spy-text {
  font-family: var(--mono); font-size: 10px; color: var(--cream-mute);
  text-transform: uppercase; letter-spacing: 0.1em; opacity: 0; transform: translateX(10px); transition: all 0.3s ease;
}
.spy-item:hover .spy-text { opacity: 1; transform: translateX(0); color: var(--cream); }
.spy-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--cream-mute); transition: all 0.3s ease;
}
.spy-item.active .spy-dot { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 10px rgba(255, 111, 0, 0.5); transform: scale(1.3); }
.spy-item.active .spy-text { opacity: 1; transform: translateX(0); color: var(--orange); }

@media (max-width: 768px) {
  .scrollspy { display: none; }
  .site-nav { padding: 1.5rem 1rem !important; flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
  .nav-right { width: 100%; justify-content: center; margin-top: 0.5rem; }
  .nav-status { margin-left: 0; justify-content: center; }
  .nav-links { gap: 1rem; font-size: 11px; }
}

/* ── MODERN SIDEBAR MENU ── */
.menu-btn {
  display: flex; align-items: center; gap: 15px; background: none; border: none; cursor: pointer; color: var(--cream);
}
.menu-text { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; }
.hamburger { display: flex; flex-direction: column; gap: 6px; width: 35px; }
.hamburger span { display: block; width: 100%; height: 1px; background: var(--cream); transition: 0.3s; }
.menu-btn:hover .hamburger span:first-child { width: 60%; transform: translateX(10px); }

.sidebar-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(15px);
  z-index: 9998; opacity: 0; visibility: hidden; transition: all 0.5s ease;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.side-menu {
  position: fixed; top: 0; right: 0; width: 450px; max-width: 100vw; height: 100vh;
  background: rgba(13, 12, 12, 0.95); border-left: 1px solid rgba(255,255,255,0.05);
  z-index: 9999; transform: translateX(100%); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column; justify-content: center; padding: 4rem;
}
.side-menu.active { transform: translateX(0); }

.close-menu {
  position: absolute; top: 30px; right: 40px; background: none; border: none;
  color: var(--cream); font-size: 28px; cursor: pointer; transition: 0.3s; opacity: 0.5;
}
.close-menu:hover { opacity: 1; transform: scale(1.1) rotate(90deg); color: var(--orange); }

.side-nav-links { list-style: none; display: flex; flex-direction: column; gap: 30px; }
.side-link {
  font-family: var(--body); font-weight: 300; font-size: 36px; color: var(--cream); text-decoration: none;
  transition: 0.4s; position: relative; opacity: 0.6; display: inline-block; letter-spacing: 0.05em;
}
.side-link:hover { opacity: 1; padding-left: 20px; color: var(--orange); }

.side-footer { margin-top: 60px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-family: var(--mono); font-size: 10px; color: var(--cream-mute); }
.side-socials { display: flex; gap: 20px; margin-top: 15px; }
.side-socials a { color: var(--cream); text-decoration: none; transition: 0.3s; text-transform: uppercase; letter-spacing: 1px; }
.side-socials a:hover { color: var(--orange); }
