/* =========================================================
   iamberkay.com — stiller
   1) Tasarım değişkenleri   2) Animasyon ayarları
   3) Temel                  4) Bileşenler
   5) Bölümler               6) Animasyonlar   7) Responsive
   ========================================================= */

/* ---------- 1) Tasarım değişkenleri ---------- */
:root {
  --accent: #6457f0;
  --accent-hover: #5246e0;
  --accent-soft: #eeedfd;
  --accent-soft-2: #c9c4fa;

  --bg: #ffffff;
  --surface: #ffffff;
  --blob: #f1f0fd;
  --text: #1e1c3a;
  --muted: #5d5b75;          /* tasarımdakinden koyu: WCAG AA kontrast */
  --border: #e6e5f2;
  --dark: #2a2840;
  --skin: #f5b38a;
  --green: #1f9e6e;
  --green-soft: #eaf7f1;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30, 28, 58, .04), 0 8px 24px rgba(30, 28, 58, .06);
  --shadow-hover: 0 2px 4px rgba(30, 28, 58, .05), 0 18px 40px rgba(100, 87, 240, .16);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1120px;
  --gutter: 24px;
  --section-gap: 140px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #8b80ff;
    --accent-hover: #a097ff;
    --accent-soft: #24223f;
    --accent-soft-2: #4a4490;
    --bg: #0f0e1a;
    --surface: #18172a;
    --blob: #1a1930;
    --text: #ecebf7;
    --muted: #a5a3bd;
    --border: #2b2944;
    --dark: #3b3960;
    --green: #3ccf95;
    --green-soft: #142a24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 40px rgba(139, 128, 255, .18);
  }
}
:root[data-theme="dark"] {
  --accent: #8b80ff;
  --accent-hover: #a097ff;
  --accent-soft: #24223f;
  --accent-soft-2: #4a4490;
  --bg: #0f0e1a;
  --surface: #18172a;
  --blob: #1a1930;
  --text: #ecebf7;
  --muted: #a5a3bd;
  --border: #2b2944;
  --dark: #3b3960;
  --green: #3ccf95;
  --green-soft: #142a24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 40px rgba(139, 128, 255, .18);
}

/* ---------- 2) Animasyon ayarları ----------
   Hızı/mesafeyi buradan değiştir. Bir animasyonu kapatmak için
   ilgili süreyi 0s yapman yeterli.                                */
:root {
  --anim-ease: cubic-bezier(.2, .7, .2, 1);
  --anim-reveal-duration: .8s;   /* scroll ile belirme süresi       */
  --anim-reveal-distance: 24px;  /* aşağıdan kayma mesafesi         */
  --anim-stagger: .09s;          /* --d başına gecikme              */
  --anim-float-duration: 6s;     /* illüstrasyon süzülme döngüsü    */
  --anim-float-distance: 8px;
  --anim-hover-lift: -4px;       /* kart/buton hover yükselmesi     */
}

/* ---------- 3) Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; line-height: 1.1; }
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 24px; }
h3 { font-size: 1.4rem; font-weight: 700; }
p { margin: 0 0 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: calc(var(--section-gap) / 2) 0; }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.split--rev > :first-child { order: 0; }
.center { text-align: center; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 700; letter-spacing: .14em; margin-bottom: 10px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- 4) Bileşenler ---------- */

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  transition: background-color .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.logo { font-family: "Caveat", cursive; font-size: 1.6rem; color: var(--accent); white-space: nowrap; }
.logo span { color: var(--text); }
.nav__links { display: flex; gap: 28px; font-size: .9rem; font-weight: 500; }
.nav__links a { position: relative; color: var(--muted); transition: color .2s; padding: 4px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--anim-ease);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__tools { display: flex; align-items: center; gap: 10px; }
.lang { background: none; border: 0; font-size: .85rem; font-weight: 600; color: var(--muted); padding: 6px; }
.lang__sep { margin: 0 3px; opacity: .5; }
html[lang="tr"] .lang [data-lang="tr"], html[lang="en"] .lang [data-lang="en"] { color: var(--text); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  transition: transform .2s, background-color .2s;
}
.icon-btn:hover { transform: rotate(-12deg) scale(1.05); }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-sun { display: block; }
  :root:not([data-theme="light"]) .ico-moon { display: none; }
}
.menu-btn { display: none; }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 10px;
  font-weight: 600; font-size: .92rem; border: 1.5px solid transparent;
  transition: transform .25s var(--anim-ease), box-shadow .25s, background-color .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn--primary svg { transition: transform .25s var(--anim-ease); }
.btn--primary:hover svg { transform: translate(2px, -2px); }
.btn--outline { border-color: var(--accent); color: var(--accent); }
.btn--outline:hover { background: var(--accent-soft); }
.btn--ghost { background: var(--accent-soft); color: var(--text); }
.btn--ghost:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent-soft-2)); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions--tight { margin-top: 12px; }

/* Chips */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li {
  padding: 6px 12px; border-radius: 8px; font-size: .82rem; font-weight: 600;
  background: var(--accent-soft); color: var(--text);
  transition: transform .2s var(--anim-ease), background-color .2s;
}
.chips li:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--accent-soft) 60%, var(--accent-soft-2)); }

/* Check listesi */
.checks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 28px; color: var(--muted); font-size: .94rem; }
.checks li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; font-size: .88rem; font-weight: 600;
  transition: opacity .25s, transform .25s var(--anim-ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* İllüstrasyon renkleri (karanlık modda otomatik değişir) */
.illu { width: 100%; height: auto; overflow: visible; }
.i-blob { fill: var(--blob); }
.i-card { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.i-line { fill: var(--accent-soft-2); }
.i-line-d { fill: #8a88a8; }
.i-soft { fill: var(--accent-soft); }
.i-soft2 { fill: var(--accent-soft-2); }
.i-accent { fill: var(--accent); }
.i-accent-stroke { stroke: var(--accent); stroke-width: 4; }
.i-dark { fill: var(--dark); }
.i-skin { fill: var(--skin); }
.i-ground { stroke: var(--accent-soft-2); stroke-width: 2; }
.i-stroke { stroke: var(--dark); stroke-width: 3; }
.i-bg-stroke { stroke: var(--bg); stroke-width: 2; }
.i-cap-top { fill: #fff; opacity: .06; }
.dash { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 6; }
.trail { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 6 8; }

/* ---------- 5) Bölümler ---------- */

/* Hero */
.hero { padding-top: 48px; }
.hero h1 { margin: 18px 0 22px; }
.hero .lead { color: var(--muted); font-size: 1.04rem; max-width: 520px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
  font-size: .8rem; font-weight: 700;
}
.badge i, .live i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative;
}
.badge i::after, .live i::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green);
  animation: ping 2s var(--anim-ease) infinite;
}
.socials { display: flex; gap: 10px; margin-top: 22px; }
.social {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--dark); color: #fff;
  transition: transform .25s var(--anim-ease), background-color .2s;
}
.social:hover { transform: translateY(-3px); background: var(--accent); }

/* Hero fotoğraf (fotoğraf gelince kullanılacak) */
.hero__photo { position: relative; justify-self: center; width: min(100%, 420px); aspect-ratio: 1; }
.hero__photo::before { content: ""; position: absolute; inset: 6% -6% -2% 6%; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; background: var(--blob); }
.hero__photo img { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; }

/* Yetenekler */
.skill-groups { display: grid; gap: 14px; cursor: default; user-select: none; -webkit-user-select: none; }
.skill-group { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.skill-group__label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-top: 6px; }

/* Proje */
#projects h2 { margin-bottom: 14px; }
.project {
  display: grid; grid-template-columns: 1fr 1fr; margin-top: 48px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .4s var(--anim-ease), box-shadow .4s;
}
.project:hover { transform: translateY(var(--anim-hover-lift)); box-shadow: var(--shadow-hover); }
.project__art { display: grid; place-items: center; background: var(--green-soft); padding: 32px; }
.project__fallback { width: 100%; max-width: 420px; display: none; }

/* Ekran görüntüsü için tarayıcı çerçevesi */
.browser {
  width: 100%; border-radius: 12px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 20px 50px -20px rgba(30, 28, 58, .35);
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
  transition: transform .6s var(--anim-ease), box-shadow .6s;
}
.project:hover .browser { transform: none; box-shadow: 0 24px 60px -20px rgba(30, 28, 58, .45); }
.browser__bar {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  background: var(--blob); border-bottom: 1px solid var(--border);
}
.browser__bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff6b6b; }
.browser__bar i:nth-child(2) { background: #ffc048; }
.browser__bar i:nth-child(3) { background: #2ecc8f; }
.browser__bar span {
  margin-left: 10px; flex: 1; max-width: 220px; height: 18px; border-radius: 6px;
  background: var(--surface); color: var(--muted);
  font: 500 .68rem/18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 0 8px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.browser img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

/* Temaya göre ekran görüntüsü (gizli olan lazy olduğu için indirilmez) */
.shot-dark { display: none; }
:root[data-theme="dark"] .shot-light { display: none; }
:root[data-theme="dark"] .shot-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot-light { display: none; }
  :root:not([data-theme="light"]) .shot-dark { display: block; }
}

/* Görsel yoksa çizime geri dön */
.no-shot .browser { display: none; }
.no-shot .project__fallback { display: block; }
.project__body { padding: 36px 40px; }
.project__meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; margin-bottom: 10px; }
.url { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-weight: 700; }
.project h3 { margin-bottom: 12px; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 6px 0 22px; font-size: .86rem; font-weight: 600; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps b {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: .72rem;
}
.project__actions { display: flex; gap: 10px; }
.project__actions .btn { flex: 1; }

/* Özgeçmiş */
.timeline { list-style: none; padding: 0; margin: 8px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 26px 36px; display: grid; gap: 2px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2.5px solid var(--accent); box-sizing: border-box;
}
.timeline li:first-child::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline .date { font-size: .78rem; color: var(--muted); font-weight: 600; }
.timeline strong { font-size: 1.05rem; }
.timeline .sub { color: var(--muted); font-size: .88rem; }
.langs { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.link-arrow { display: inline-block; color: var(--accent); font-weight: 700; font-size: .92rem; transition: transform .25s var(--anim-ease); }
.link-arrow:hover { transform: translateX(4px); }

/* İletişim */
.location { color: var(--muted); font-size: .88rem; margin-top: 22px; }

/* Footer */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--border); margin-top: 40px; padding-top: 24px; padding-bottom: 32px;
  color: var(--muted); font-size: .82rem;
}

/* ---------- 6) Animasyonlar ---------- */

/* Scroll ile belirme: data-anim + style="--d:N" (sıralı gecikme) */
.js [data-anim] {
  opacity: 0;
  transition:
    opacity var(--anim-reveal-duration) var(--anim-ease),
    transform var(--anim-reveal-duration) var(--anim-ease);
  transition-delay: calc(var(--d, 0) * var(--anim-stagger));
}
.js [data-anim="fade-up"] { transform: translateY(var(--anim-reveal-distance)); }
.js [data-anim="fade-in"] { transform: scale(.97); }
.js [data-anim].is-in { opacity: 1; transform: none; }
/* Belirme bittikten sonra hover transform'ları gecikmesiz çalışsın */
.js .project.is-done { transition: transform .4s var(--anim-ease), box-shadow .4s; transition-delay: 0s; }
.js .project.is-in:hover { transform: translateY(var(--anim-hover-lift)); }

/* İllüstrasyon süzülmesi */
.float { animation: float var(--anim-float-duration) ease-in-out infinite; animation-delay: var(--fd, 0s); transform-box: fill-box; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(var(--anim-float-distance) * -1)); } }

/* Kod satırları "yazılıyor" */
.type { transform-box: fill-box; transform-origin: left; transform: scaleX(0); }
.is-in .type { animation: type .7s var(--anim-ease) forwards; animation-delay: var(--td, 0s); }
@keyframes type { to { transform: scaleX(1); } }

/* Grafik çubukları büyür */
.grow { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); }
.is-in .grow { animation: grow .7s var(--anim-ease) forwards; animation-delay: var(--td, 0s); }
@keyframes grow { to { transform: scaleY(1); } }

/* Bitki salınır, el sallanır, püskül sallanır */
.sway { transform-box: fill-box; transform-origin: bottom center; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.wave { transform-box: view-box; transform-origin: 140px 174px; animation: wave 3.2s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } 90% { transform: rotate(-4deg); } }
.tassel { transform-box: view-box; transform-origin: 240px 130px; animation: tassel 4s ease-in-out infinite; }
@keyframes tassel { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(2.5deg); } }

/* Proje kartı: ilanlar sırayla gelir, büyüteç tarar */
.job { opacity: 0; transform: translateX(-12px); transform-box: fill-box; }
.is-in .job { animation: job-in .6s var(--anim-ease) forwards; animation-delay: calc(.4s + var(--jd, 0s)); }
@keyframes job-in { to { opacity: 1; transform: none; } }
.scan { transform: translate(280px, 110px); animation: scan 7s ease-in-out infinite; }
@keyframes scan {
  0%, 100% { transform: translate(280px, 110px); }
  33% { transform: translate(250px, 150px); }
  66% { transform: translate(275px, 185px); }
}

/* Kâğıt uçak + yıldızlar */
.plane { animation: plane 5s ease-in-out infinite; transform-box: fill-box; }
@keyframes plane { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(6px, -10px) rotate(-4deg); } }
.trail { animation: dash 2.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 3s ease-in-out infinite; animation-delay: var(--fd, 0s); }
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.6); opacity: .5; } }

@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

/* Hareket azaltma tercihi: tüm animasyonlar kapanır */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js [data-anim] { opacity: 1; transform: none; }
  .type, .grow, .job { transform: none; opacity: 1; }
}

/* ---------- 7) Responsive ---------- */
@media (max-width: 900px) {
  :root { --section-gap: 96px; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split--rev > :first-child { order: 2; }
  .hero__art, .split > [aria-hidden="true"] { max-width: 460px; margin: 0 auto; width: 100%; }
  .project { grid-template-columns: 1fr; }
  .project__body { padding: 28px 24px; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .menu-btn { display: grid; }
  .nav__links {
    position: absolute; top: 72px; left: 16px; right: 16px;
    flex-direction: column; gap: 4px; padding: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .2s, transform .25s var(--anim-ease);
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 10px 12px; border-radius: 8px; }
  .nav__links a::after { display: none; }
  .nav__links a.is-active { background: var(--accent-soft); }
  .hero { padding-top: 24px; }
  .skill-group { grid-template-columns: 1fr; gap: 6px; }
  .skill-group__label { padding-top: 0; }
  .actions .btn { flex: 1 1 auto; }
  #emailLink { font-size: .85rem; padding: 0 14px; }
}
