/* ==========================================================================
   BASE — font yüklemesi, reset, temel tipografi, erişilebilirlik yardımcıları
   ========================================================================== */

/* ---------- Font: Figtree (variable, self-host) ---------- */
/* latin-ext: ş ğ İ ve diğer Türkçe'ye özgü harfler */
@font-face {
  font-family: "figtreeFont";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../assets/fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin: temel harfler, ü ö ç ı, noktalama, tire, tırnak */
@font-face {
  font-family: "figtreeFont";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../assets/fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Fallback: Arial, Figtree metriklerine yaklaştırıldı → font yüklenirken layout kaymaz.
   Değerler ölçüldü: Figtree upm 1000, ascent 950, descent 250, lineGap 0.
   Ortalama genişlik oranı (Türkçe örnek metin): 400 ağırlıkta ≈ %99, 800 ağırlıkta ≈ %96.5.
   ascent/descent-override = metrik / size-adjust. Kalın başlıklar için ayrı (Arial Bold) yüz. */
@font-face {
  font-family: "figtreeFont Fallback";
  font-weight: 300 599;
  src: local("Arial"), local("ArialMT"), local("Helvetica");
  size-adjust: 99%;
  ascent-override: 95.9%;
  descent-override: 25.3%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "figtreeFont Fallback";
  font-weight: 600 900;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Arial");
  size-adjust: 96.5%;
  ascent-override: 98.4%;
  descent-override: 25.9%;
  line-gap-override: 0%;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;                 /* yumuşak kaydırmayı Lenis yönetir */
  background: var(--black);
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped,
.is-menu-locked {
  overflow: hidden;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  color: var(--fg);
  background: var(--bg);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg,
picture,
video {
  display: block;
  max-width: 100%;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

address {
  font-style: normal;
}

h1,
h2,
h3,
h4 {
  font-weight: var(--fw-bold);
  text-wrap: balance;
  line-height: var(--lh-snug);
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ---------- Odak (klavye) ---------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: var(--pad-x);
  z-index: var(--z-skip);
  padding: 0.85rem 1.25rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--black);
  transform: translateY(-120%);
  transition: transform var(--dur-fast) var(--ease-out-3);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: 2px;
}

/* ---------- Yardımcılar ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Küçük, büyük harfli etiket */
.label {
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
}

.label--muted {
  color: var(--muted);
}

/* Dev başlık */
.display {
  font-size: var(--fs-display);
  font-weight: var(--fw-heavy);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
}

.h-xl {
  font-size: var(--fs-xl);
  font-weight: var(--fw-heavy);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
}

.h-lg {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-snug);
}

/* ---------- Satır maskesi (başlık reveal) ----------
   Her satır: .line (maske) > .line__inner (hareket eden).
   Aksan işaretleri (Ü, İ, Ş, ç alt kuyruğu) kesilmesin diye maske dikey pay taşır,
   negatif margin ile satır aralığı bozulmaz. */
.line {
  display: block;
  overflow: hidden;
  padding-block: 0.14em 0.12em;
  margin-block: -0.14em -0.12em;
}

.line__inner {
  display: block;
  will-change: transform;
}

/* ---------- JS yüklenmeden önce başlangıç durumları (yalnızca hareket açıkken) ----------
   .has-motion <head> içinde eklenir; animations.js hazır olunca .is-armed ekleyip
   durumu GSAP'a devreder. JS hiç gelmezse güvenlik zamanlayıcısı .has-motion'ı kaldırır. */
.has-motion:not(.is-armed) [data-reveal] .line__inner,
.has-motion:not(.is-armed) .hero__title .line__inner,
.has-motion:not(.is-armed) .page-hero__title .line__inner {
  transform: translateY(112%);
}

.has-motion:not(.is-armed) [data-fade] {
  opacity: 0;
  transform: translateY(1.5rem);
}

.has-motion:not(.is-armed) [data-photo-frame] {
  clip-path: inset(100% 0% 0% 0%);
}

/* ---------- Hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
