:root{
  --bg:#0b0f14;
  --bg-soft:#0f1520;
  --card:#0f172a;
  --text:#e5e7eb;
  --muted:#9aa4b2;
  --brand1:#7c3aed;
  --brand2:#06b6d4;
  --brand3:#22c55e;
  --accent:#f59e0b;
  --glass:rgba(255,255,255,.06);
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

[data-theme="light"]{
  --bg:#f6f7fb;
  --bg-soft:#eef1f6;
  --card:#fff;
  --text:#0f172a;
  --muted:#475569;
  --glass:rgba(255,255,255,.7);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  font-family:"Poppins", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 800px at 10% 10%, rgba(124,58,237,.15), transparent),
    radial-gradient(800px 600px at 90% 30%, rgba(6,182,212,.1), transparent),
    var(--bg);
  color:var(--text);
  line-height:1.6;
  font-size-adjust:0.52;
}

/* Header */
.site-header{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:saturate(180%) blur(12px);
  background:linear-gradient(to bottom, rgba(11,15,20,.85), rgba(11,15,20,.55) 60%, transparent);
  border-bottom:1px solid rgba(255,255,255,.05);
}

.container{max-width:1200px; margin:0 auto; padding:0 24px}
.nav{display:flex; align-items:center; justify-content:space-between; height:64px}

/* Brand */
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.3px;
  text-decoration:none;
}
.brand:hover{ text-decoration:none; }
.brand i{font-size:22px; color:var(--brand2)}

/* Logo (stabil) */
/* Logo (aşağı indir + mobilde ortala) */
.logo{
  height:160px;
  width:auto;
  display:block;
  margin-top:40px; /* ↓ logoyu aşağı indir (8-14px arası oynayabilirsin) */
  filter:drop-shadow(0 6px 18px rgba(124,58,237,.25));
  transition:transform .2s ease, filter .2s ease, opacity .2s ease;
}
.logo:hover{
  transform:translateY(-1px) scale(1.02);
  filter:drop-shadow(0 10px 28px rgba(6,182,212,.35));
}

/* Mobilde header içinde logo ortada, theme-toggle sağda */
@media (max-width:768px){
  .nav{
    justify-content:center;     /* brand/logo ortalanır */
    position:relative;
  }
  .brand{
    width:100%;
    justify-content:center;     /* logo tam ortada */
  }
  .theme-toggle{
    position:absolute;
    right:24px;                /* container padding ile uyumlu */
    top:50%;
    transform:translateY(-50%);
  }
}

@media (max-width:640px){
  .logo{
    height:80px;
    width:auto;
    margin-top:8px;            /* mobilde de biraz aşağı */
  }
}


.menu a{
  margin:0 10px;
  padding:8px 12px;
  border-radius:10px;
  color:var(--muted);
  text-decoration:none;
  transition:all .25s ease;
  display:inline-block;
}
.menu a:hover{
  color:var(--text);
  background:linear-gradient(to right, rgba(124,58,237,.2), rgba(6,182,212,.15));
  transform:translateY(-1px);
}

.theme-toggle{
  border:0;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-size:18px;
  min-width:44px;
  min-height:44px;
}

/* ---- Link temizleme (mavi görünümü kaldır) ---- */
a, a:visited { color:var(--text); text-decoration:none; }
a:hover, a:focus { opacity:.9; text-decoration:underline; text-underline-offset:2px; }
.clean-link, .clean-link:visited { color:var(--text); text-decoration:none; }
.clean-link:hover { text-decoration:underline; }

.card a, .card a:visited, footer a, footer a:visited{
  color:var(--text);
  text-decoration:none;
}
.card a:hover, footer a:hover{ text-decoration:underline; }

/* Tag rengi sabit */
.tag{ color:var(--text); }

/* ================================
   HERO (CLS/LCP) - TEK KAYNAK
   ================================ */

.hero{
  height:100vh;
  max-height:100vh;
  overflow:hidden;
  display:grid;
  align-items:center;
  padding:90px 0 40px;
  position:relative;
}

.hero-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:40px;
  align-items:center;
}

@media (min-width:900px){
  .hero-grid{ grid-template-columns:1.2fr .8fr; }
}

.kicker{
  color:var(--brand2);
  font-weight:700;
  letter-spacing:.15em;
  text-transform:uppercase;
  font-size:12px;
}

.title{
  font-size:clamp(34px, 4vw, 56px);
  line-height:1.15;
  font-weight:800;
  margin:.2em 0;
  letter-spacing:-.02em;
  min-height:3.4em; /* CLS fix */
}

.title .grad{
  background:linear-gradient(92deg, var(--brand1), var(--brand2), var(--brand3));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  filter:drop-shadow(0 10px 30px rgba(124,58,237,.25));
}

.subtitle{
  font-size:18px;
  color:var(--muted);
  line-height:1.55;
  min-height:6.5em; /* CLS fix */
  opacity:1 !important;
  transform:none !important;
  visibility:visible !important;
}

.cta{display:flex; gap:14px; margin-top:22px}

.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:12px 18px;
  border-radius:14px;
  text-decoration:none;
  color:#fff;
  font-weight:700;
  letter-spacing:.2px;
  transition:transform .2s ease, box-shadow .2s ease;
  box-shadow:var(--shadow);
  min-height:44px;
  min-width:44px;
}
.btn.primary{background:linear-gradient(135deg, var(--brand1), var(--brand2))}
.btn.secondary{
  background:linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  color:var(--text);
  border:1px solid rgba(255,255,255,.07);
}
.btn:hover{transform:translateY(-2px)}

.hero-card{
  background:linear-gradient(180deg, rgba(124,58,237,.14), rgba(6,182,212,.12));
  border:1px solid rgba(255,255,255,.09);
  border-radius:24px;
  padding:22px;
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow);
  min-height:340px; /* CLS fix */
}

.hero-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
  margin-top:6px;
  min-height:70px;
}

.stat{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  padding:16px;
  border-radius:16px;
  text-align:center;
}
.stat b{font-size:22px}

@media (max-width:768px){
  .title{ min-height:3.6em; }
  .subtitle{ min-height:7.0em; }
  .hero-card{ min-height:340px; }
}

/* Reveal (hero içinde iptal, diğer yerde aktif) */
.reveal{opacity:0; transform:translateY(16px); transition:all .6s cubic-bezier(.2,.75,.2,1)}
.reveal.visible{opacity:1; transform:none}
.hero .reveal{ opacity:1 !important; transform:none !important; transition:none !important; }

/* Section */
section{padding:70px 0}
.section-head{display:flex; align-items:end; justify-content:space-between; margin-bottom:24px}
.section-head h2{margin:0; font-size:32px}
.section-head p{margin:6px 0 0; color:var(--muted)}

/* Projects */
.grid{display:grid; grid-template-columns:repeat(3,1fr); gap:22px}

.card{
  position:relative;
  border-radius:20px;
  overflow:hidden;
  background:var(--card);
  border:1px solid rgba(255,255,255,.07);
  transform-style:preserve-3d;
  transition:transform .25s ease, box-shadow .25s ease;
}
.card:hover{
  box-shadow:0 20px 60px rgba(0,0,0,.45);
  transform:translateY(-4px) rotate3d(var(--rx,0), var(--ry,0), 0, 6deg) scale(1.03);
}

/* Thumb CLS (tek tanım) */
.thumb{
  width:100%;
  aspect-ratio:16 / 9;
  background-size:cover;
  background-position:center;
  filter:saturate(1.05) contrast(1.05);
}

.card .body{padding:16px}
.tags{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.tag{
  font-family:"JetBrains Mono", monospace;
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
}

.card .overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:end;
  justify-content:space-between;
  padding:16px;
  background:linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55));
  opacity:0;
  transition:opacity .25s ease;
}
.card:hover .overlay{opacity:1}

.visit{
  margin-left:auto;
  background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.2);
  padding:10px 12px;
  border-radius:12px;
  color:#fff;
  text-decoration:none;
  font-weight:700;
}
.visit:hover{background:linear-gradient(135deg, var(--brand2), var(--brand1))}

/* About */
.about{display:grid; grid-template-columns:1.1fr .9fr; gap:24px}
.about .card{padding:22px}
.skills{display:flex; flex-wrap:wrap; gap:10px}
.chip{
  padding:8px 10px;
  border-radius:12px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.1);
  transition:transform .2s ease;
}
.chip:hover{transform:translateY(-2px)}

/* Contact */
form{display:grid; gap:12px}
.input, textarea{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  outline:none;
}
textarea{min-height:140px; resize:vertical}

.toast{
  position:fixed;
  right:24px;
  bottom:24px;
  padding:14px 16px;
  border-radius:14px;
  background:#0d1b0f;
  color:#c6f6d5;
  border:1px solid rgba(34,197,94,.35);
  box-shadow:var(--shadow);
}
.toast.error{
  background:#1b0d0d;
  color:#fecaca;
  border-color:rgba(239,68,68,.35);
}

/* Utilities */
.muted{color:var(--muted)}
.divider{
  height:1px;
  background:linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.12), rgba(255,255,255,.06));
  margin:28px 0;
}

/* Responsive */
@media(max-width:1000px){
  .hero-grid{grid-template-columns:1fr}
  .grid{grid-template-columns:repeat(2,1fr)}
  .about{grid-template-columns:1fr}
}
@media(max-width:640px){
  .title{font-size:38px}
  .grid{grid-template-columns:1fr}
}
@media(max-width:768px){
  .menu{display:none}
}

/* Fancy BG Ornaments */
.orb{
  position:absolute;
  border-radius:50%;
  filter:blur(60px);
  opacity:.5;
  mix-blend-mode:screen;
  animation:float 12s ease-in-out infinite;
}
.orb.one{
  width:480px;
  height:480px;
  background:radial-gradient(circle at 30% 30%, #7c3aed, #06b6d4);
  top:-120px;
  right:-140px;
}
.orb.two{
  width:360px;
  height:360px;
  background:radial-gradient(circle at 40% 60%, #22c55e, #06b6d4);
  bottom:-120px;
  left:-120px;
}
@keyframes float{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(16px)}
}

/* 3D Tilt Effect – GPU dostu, reflow yapmaz */
[data-tilt]{
  transform:perspective(900px) rotateX(calc(var(--rx, 0) * 6deg)) rotateY(calc(var(--ry, 0) * 6deg));
  transform-style:preserve-3d;
  transition:transform .15s ease-out;
  will-change:transform;
}
[data-tilt] *{ transform-style:preserve-3d; }

/* CV Modal (tam ekran iframe) */
.cv-modal.hidden{
  visibility:hidden;
  opacity:0;
  pointer-events:none;
}
.cv-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
}
.cv-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.65);
  backdrop-filter:blur(6px);
}
.cv-wrap{
  position:relative;
  width:96vw;
  height:92vh;
  border-radius:18px;
  overflow:hidden;
  background:var(--bg-soft);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 20px 80px rgba(0,0,0,.6);
  animation:cvIn .25s ease;
}
@keyframes cvIn{
  from{transform:scale(.98); opacity:0}
  to{transform:scale(1); opacity:1}
}
.cv-frame{
  width:100%;
  height:100%;
  border:0;
  background:var(--bg);
}
.cv-close{
  position:absolute;
  top:10px;
  right:10px;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.15);
  color:#fff;
  width:40px;
  height:40px;
  border-radius:12px;
  display:grid;
  place-items:center;
  cursor:pointer;
  z-index:2;
}
.cv-close:hover{ background:rgba(0,0,0,.5); }

@media (max-width:640px){
  .cv-wrap{ width:98vw; height:92vh; border-radius:12px; }
}

/* Nav clickable area */
nav a{
  padding:12px 18px;
  display:inline-block;
}

/* Icon (tek tanım) */
.icon{
  width:1em;
  height:1em;
  vertical-align:-0.15em;
  fill:currentColor;
}
.btn .icon{ margin-right:6px; }
