/* Ortak stiller: sıfırlama, header, düğmeler, sayfa sonu gezinmesi, giriş animasyonu */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

a { color: var(--text); }
a:hover { color: #fff; }

.mono { font-family: var(--font-mono); }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
main:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--text); color: var(--bg); text-decoration: none;
  font-size: 14px; font-weight: 500;
}
.skip:focus { top: 12px; color: var(--bg); }

/* ── Lenis ── */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ── Header ── */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 32px;
  padding: 28px var(--gutter) 0;
  view-transition-name: site-header;
}
.logo {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 15px; text-decoration: none; color: var(--text);
}
.header-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.menu { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; }
.navl {
  color: var(--text-3); text-decoration: none; transition: color .2s;
  display: inline-flex; align-items: center; min-height: 44px;
}
.navl:hover { color: var(--text); }
.navl.on {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-4);
  text-underline-offset: 7px;
}
.langs { display: flex; align-items: center; }
.langs-sep { color: var(--border-3); font-size: 13px; }
.lbtn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-4); text-decoration: none; transition: color .2s;
}
.lbtn:hover { color: var(--text); }
.lbtn[aria-current="true"] { color: var(--text); }

/* ── Sayfa kabuğu ── */
.page-shell {
  flex: 1;
  display: flex; flex-direction: column;
  padding: 0 var(--gutter) 28px;
}

/* ── Ortak metin stilleri ── */
.eyebrow {
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-4);
}
.label { font-family: var(--font-mono); font-size: 13px; font-weight: 400; color: var(--text-4); }
.page-title {
  font-size: clamp(44px, 5.5vw, 72px); line-height: 1; letter-spacing: -.035em; font-weight: 600;
}
.page-lead { font-size: 19px; line-height: 1.55; color: var(--text-3); }

.swatch { display: inline-block; width: 24px; height: 2px; background: var(--text); flex: none; }
.swatch.sys { background: var(--sys); }
.swatch.dev { background: var(--dev); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px;
}

/* ── Düğmeler ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 8px;
  font-size: 15px; font-weight: 500; text-decoration: none;
  transition: border-color .2s, background .2s;
}
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: #fff; color: var(--bg); }
.btn.ghost { border: 1px solid var(--border-2); color: var(--text); }
.btn.ghost:hover { border-color: var(--border-4); }

/* ── Sayfa sonu gezinmesi ── */
.page-end {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  margin-top: 96px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--text-4);
}
.page-end-next {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--text-2); text-decoration: none;
}
.page-end-next:hover { color: var(--text); }

/* ── Giriş animasyonu ── */
.rise { opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease-in) forwards; }
.d1 { animation-delay: .15s; }
.d2 { animation-delay: .3s; }
.d3 { animation-delay: .5s; }
.d4 { animation-delay: .7s; }
.d5 { animation-delay: .9s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ── Sayfa geçişleri (View Transitions API; desteklemeyen tarayıcıda normal geçiş) ── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  ::view-transition-old(root) { animation: vt-out .28s var(--ease-move) both; }
  ::view-transition-new(root) { animation: vt-in .5s var(--ease-in) both; }
  ::view-transition-group(site-header) { animation-duration: 0s; }

  @keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
}

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

@media (max-width: 768px) {
  .page-end { margin-top: 64px; }
  .site-header { gap: 0 32px; }
  .header-right, .menu { gap: 0 22px; }
}
