/* =========================================================================
   DESIGN TOKENS & BASE SETTINGS
   ========================================================================= */
:root {
  /* Colors - "Siber-Minimalist Laboratuvar" */
  --bg-void: #09090b;
  --surface-base: #131315;
  --surface-card: #18181b;
  --surface-border: rgba(255, 255, 255, 0.05);
  
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.5);
  
  --accent-blue: #06b6d4;
  --accent-blue-glow: rgba(6, 182, 212, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  /* Typography */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Layout */
  --container-max: 1200px;
  --spacing-base: 1rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background-color: var(--accent-purple);
  color: #fff;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

/* =========================================================================
   UTILITIES (Glassmorphism, Glows, etc)
   ========================================================================= */

.glass-panel {
  background: rgba(24, 24, 27, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
}

.glow-text {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px var(--accent-purple-glow);
}

.btn-primary.breathing {
  animation: breathing 3s ease-in-out infinite;
}

@keyframes breathing {
  0%, 100% { box-shadow: 0 0 20px 0px rgba(6, 182, 212, 0.3); }
  50% { box-shadow: 0 0 40px 10px rgba(139, 92, 246, 0.4); }
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================================
   NAVBAR
   ========================================================================= */

.navbar {
  position: fixed;
  top: 1.5rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  max-width: 90%;
  padding: 0.75rem 2.5rem;
  border-radius: 9999px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  z-index: 100;
  /* Glass */
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  cursor: pointer;
}

.nav-brand:hover {
  color: var(--accent-cyan);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

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

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s ease, text-shadow 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-main);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: transparent;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active::after {
  background-color: var(--accent-purple);
  box-shadow: 0 0 8px var(--accent-purple);
}

.nav-links a:hover:not(.active)::after {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* =========================================================================
   HERO SECTION
   ========================================================================= */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
}

/* Ambient Background Glows */
.hero::before, .hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  animation: float-glow 20s ease-in-out infinite alternate;
}

.hero::before {
  background: rgba(6, 182, 212, 0.15);
  top: -10%;
  left: -10%;
}

.hero::after {
  background: rgba(139, 92, 246, 0.15);
  bottom: -10%;
  right: -10%;
  animation-delay: -10s;
}

@keyframes float-glow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(100px, 50px); }
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.hero-text h1 {
  font-size: clamp(3rem, 5vw, 4.5rem);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.typewriter-container {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--accent-blue);
  margin-bottom: 2rem;
  height: 2rem;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background-color: var(--accent-blue);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-text p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 80%;
  margin-bottom: 3rem;
}

.hero-3d {
  width: 100%;
  height: 600px;
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.hero-3d spline-viewer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% + 70px) !important; /* Pushes watermark outside container */
}

/* =========================================================================
   TECH STACK (Infinite Marquee)
   ========================================================================= */

.tech-stack {
  padding: 5rem 0;
  background-color: var(--surface-base);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  position: relative;
}

.marquee-wrapper {
  overflow: hidden;
  display: flex;
  width: 100%;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
  display: flex;
  align-items: center;
  gap: 4rem;
  animation: marquee 30s linear infinite;
  padding-right: 4rem;
}

.marquee-content:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } /* requires duplicating content to 2x width */
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  opacity: 0.4;
  filter: grayscale(1);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

.tech-item i {
  font-size: 3rem;
}

.tech-item span {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
}

.tech-item:hover {
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1.1) translateY(-4px);
}

.tech-item.python:hover { color: #3776AB; }
.tech-item.swift:hover { color: #F05138; }
.tech-item.flutter:hover { color: #02569B; }
.tech-item.html:hover { color: #E34F26; }
.tech-item.css:hover { color: #1572B6; }
.tech-item.js:hover { color: #F7DF1E; }
.tech-item.ai:hover { color: var(--accent-purple); }

/* =========================================================================
   PROJECTS (Bento Grid)
   ========================================================================= */

.projects {
  padding: 4rem 0;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 600px;
}

.bento-grid {
  column-count: 3;
  column-gap: 1rem;
  width: 100%;
  max-width: 900px; /* Force compactness to keep heights reasonable on large screens */
  margin: 0 auto;
}

.item-tall {
  aspect-ratio: 9 / 16;
}

.item-wide {
  aspect-ratio: 16 / 9;
}

/* Base item */
.bento-item {
  position: relative;
  overflow: hidden;
  padding: 1.5rem; /* Smaller internal padding */
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  background: rgba(24, 24, 27, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
  break-inside: avoid;
  margin-bottom: 1rem; /* Matched to gap */
  width: 100%;
}

.bento-item::before {
  /* Inner gradient hover effect */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.06), transparent 40%);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.bento-item:hover::before {
  opacity: 1;
}

.bento-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.15);
}

.bento-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.bento-item h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  margin-top: auto;
}

.bento-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.bento-icon {
  font-size: 2rem;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.video-placeholder {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(139,92,246,0.1));
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.5s;
  object-fit: cover; /* Required for native HTML <video> elements to fill the bounds completely */
  pointer-events: none; /* Prevents users from pausing or interacting with background video directly */
}
.bento-item:hover .video-placeholder {
  opacity: 0.9;
}

.bento-tag {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =========================================================================
   TERMINAL CONTACT
   ========================================================================= */

.contact {
  padding: 8rem 0;
  background-color: var(--surface-base);
}

.terminal-window {
  max-width: 800px;
  margin: 0 auto;
  background-color: #000;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.terminal-header {
  background-color: #1f1f22;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.term-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.term-btn.close { background-color: #ff5f56; }
.term-btn.min { background-color: #ffbd2e; }
.term-btn.max { background-color: #27c93f; }

.term-title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.5;
  height: 300px;
  overflow-y: auto;
}

.terminal-line {
  margin-bottom: 0.5rem;
}

.prompt {
  color: var(--accent-blue);
  font-weight: 600;
  margin-right: 0.5rem;
}

.term-input-line {
  display: flex;
  align-items: center;
}

.term-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  flex: 1;
  outline: none;
}

.social-links {
  margin-top: 4rem;
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  font-size: 1.5em;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.social-btn:hover {
  transform: translateY(-5px);
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-purple);
}

/* =========================================================================
   FOOTER
   ========================================================================= */

footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--surface-border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-3d {
    display: none !important; /* Mobile performance: 3D modeli yok et */
  }
  .hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .typewriter-container {
    justify-content: center;
  }
  .bento-grid {
    column-count: 1; /* Stack vertically on mobile */
  }
  .navbar {
    width: 95%;
    max-width: 95%;
    padding: 0.75rem 1rem;
    gap: 0.8rem;
    flex-direction: column; /* Mobilde logoyu ve linkleri alt alta koy */
    border-radius: 1.5rem;
  }
  .nav-brand {
    font-size: 1.1rem;
  }
  .nav-links {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-links a {
    font-size: 0.85rem;
  }
}

/* =========================================================================
   BACKGROUND MATRIX TYPING
   ========================================================================= */
#bg-code-layer {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   pointer-events: none;
   z-index: -10;
}

.bg-code-snippet {
   position: absolute;
   font-family: var(--font-mono);
   color: #22c55e;
   font-size: 1rem;
   text-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
   opacity: 0.45;
   transition: opacity 2s ease;
   white-space: nowrap;
   z-index: -10;
}


