/* ═══════════════════════════════════════════════════════════
   YiYo — Ortak tasarım sistemi
   Tüm sayfalar (landing, yasal, 404) bu token'ları tüketir.
   Koyu tema varsayılan; :root[data-theme] ile değişir.
   ═══════════════════════════════════════════════════════════ */

:root,
:root[data-theme="dark"] {
  --bg:         #08080A;
  --surface:    #101013;
  --surface-2:  #17171B;
  --fg:         #F4EFE7;
  --fg-muted:   #8A857D;  /* #7C7770 zeminde 4,51, surface-2 üstünde 4,03 idi */
  --fg-soft:    #B7B1A8;
  --accent:     #FF8A1E;  /* dolgu / kenar / vurgu */
  --accent-ink: #FF8A1E;  /* accent renkli METİN */
  --accent-deep:#E04A08;
  --edge:       rgba(244, 239, 231, .16);
  --edge-soft:  rgba(244, 239, 231, .08);
  --shadow:     rgba(0, 0, 0, .5);
  --focus:      #FF8A1E;

  /* Yeşil, maskotun yaprağından geliyor (#6ABE6E) — markaya sonradan
     eklenmiş bir renk değil. "Bedava / dahil / engel yok" anlamındaki
     her vurgu bunu kullanır; turuncu ürünün kendisini işaret etmeye
     devam eder. İkisinin işi karışmasın. */
  --go:         #6ABE6E;
  --go-ink:     #7FCF84;  /* koyu zeminde okunan yeşil METİN */
  --go-soft:    rgba(106, 190, 110, .14);
  --go-edge:    rgba(106, 190, 110, .34);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:         #FCF9F3;
  --surface:    #FFFFFF;
  --surface-2:  #F6F1E8;
  --fg:         #1E3A5F;
  --fg-muted:   #4F6D90;  /* #5C7A9D krem üstünde 4,23:1 idi (AA altı) */
  --fg-soft:    #3B5779;  /* muted koyulaşınca hiyerarşi kaybolmasın */
  --accent:     #F28F3E;
  --accent-ink: #B4560A;  /* krem üstünde AA kontrast için koyultuldu */
  --accent-deep:#C25A05;
  --edge:       rgba(30, 58, 95, .16);
  --edge-soft:  rgba(30, 58, 95, .08);
  --shadow:     rgba(30, 58, 95, .14);
  --focus:      #A34E09;  /* accent #F28F3E krem üstünde 2,3:1 — odak halkası için 3:1 şart */

  --go:         #4A9E52;  /* maskotun yaprak gölgesi */
  --go-ink:     #2E7D46;  /* krem üstünde AA kontrast için koyultuldu */
  --go-soft:    rgba(74, 158, 82, .12);
  --go-edge:    rgba(74, 158, 82, .32);
  color-scheme: light;
}

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

/* overflow-x:hidden, overflow-y'yi auto'ya zorlar ve bir kaydırma konteyneri
   yaratır; bu da içerideki position:sticky'yi (landing'deki sabit hero)
   çalışmaz hale getirir. clip aynı kırpmayı konteyner yaratmadan yapar. */
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Instrument Sans","Instrument Sans Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}

/* ── Tipografi rolleri ─────────────────────────────────── */

.display {
  font-family: "Bricolage Grotesque","Bricolage Grotesque Fallback", "Instrument Sans","Instrument Sans Fallback", sans-serif;
  font-weight: 700;
  line-height: .96;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.mono {
  font-family: "Martian Mono","Martian Mono Fallback", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--fg-muted);
}

/* lang="tr" altında uppercase "YiYo"yu "YİYO" yapar — marka adı
   her zaman olduğu gibi yazılır. */
.brandname { text-transform: none; }

a { color: inherit; }

/* ── Odak halkası ──────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--focus, var(--accent));
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── Tema anahtarı ─────────────────────────────────────── */

.theme-toggle,
.motion-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: none;
  color: var(--fg);
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.motion-toggle:hover,
.motion-toggle:focus-visible {
  border-color: var(--fg);
  background: var(--edge-soft);
}

.theme-toggle svg,
.motion-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Aktif temaya göre tek bir ikon görünür. */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Hareket anahtarı: basılıyken (hareket durdurulmuş) oynat ikonu görünür. */
.motion-toggle .icon-play { display: none; }
.motion-toggle[aria-pressed="true"] .icon-pause { display: none; }
.motion-toggle[aria-pressed="true"] .icon-play  { display: block; }

/* Landing dışındaki sayfalarda sağ üstte sabit durur. */
.theme-toggle--fixed {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  background: var(--surface);
  box-shadow: 0 2px 10px var(--shadow);
}

/* ── Butonlar ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Martian Mono","Martian Mono Fallback", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: none;
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.btn:hover,
.btn:focus-visible { border-color: var(--fg); }

.btn--fill {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn--fill:hover,
.btn--fill:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #08080A;
}

.btn[aria-disabled="true"] {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

/* ── Mağaza rozeti ─────────────────────────────────────────
   Apple'ın pazarlama kuralları yalnız resmi "App Store'dan İndirin"
   rozetine izin veriyor (dile göre yerelleştirilmiş SVG'ler
   assets/badges/ altında, siyah sürüm). Rozetin kendisi değiştirilmez:
   renk, oran ve kenarlık olduğu gibi kalır; ekranda en az 40px yükseklik.
   Google Play rozeti ancak uygulama Play'e çıkınca eklenebilir; o zamana
   kadar yalnız düz metin. */

.store-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.store-badge {
  display: inline-block;
  flex: none;
  line-height: 0;
  border-radius: 10px;
  transition: opacity .2s ease;
}

.store-badge img { display: block; height: 48px; width: auto; }
.store-badge:hover { opacity: .88; }

.soon {
  font-family: "Martian Mono","Martian Mono Fallback", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* ── Yalnız ekran okuyucuya ────────────────────────────── */

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

/* ── İçeriğe geç ───────────────────────────────────────────
   Klavyeyle ilk Tab'da görünür; header'daki bağlantıları atlar. */

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  font-family: "Instrument Sans","Instrument Sans Fallback", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

/* ── Dil önerisi ───────────────────────────────────────────
   Tarayıcının dili (ya da menüden daha önce seçilen dil) sayfanınkinden
   farklıysa altta küçük bir hap. Otomatik yönlendirme yok: arama
   motorları her dili kendi adresinde görmeli. Sabit konumlu: sayfayı
   itmiyor, sahne pistinin ölçüsünü bozmuyor. js/i18n.js çiziyor. */

.lang-hint {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 32px);
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: 0 16px 40px -18px var(--shadow);
  font-family: "Instrument Sans","Instrument Sans Fallback", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.3;
  color: var(--fg-soft);
}

.lang-hint a { color: var(--fg); font-weight: 500; text-underline-offset: 3px; }
.lang-hint a:hover { color: var(--accent-ink); }

.lang-hint button {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fg-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.lang-hint button:hover { color: var(--fg); background: var(--edge-soft); }

/* ── Ücretsiz rozeti ───────────────────────────────────── */

.badge-free {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Martian Mono","Martian Mono Fallback", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--go-ink);
  background: var(--go-soft);
  border: 1px solid var(--go-edge);
  border-radius: 999px;
  padding: 7px 13px;
  white-space: nowrap;
}

.badge-free::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--go);
  flex: none;
}

/* accent yerine yeşille vurgulanan METİN */
.go { color: var(--go-ink); }

/* ── Bölüm illüstrasyonları ────────────────────────────────
   assets/illustration/*.svg vektör çizimleri (js/illustration.js
   basıyor). İmleç üstüne gelince maskottaki gibi bir konuşma
   balonu açılıyor.

   Üç katman üst üste biniyor: dıştaki span'ın transform'u .reveal
   animasyonunun, ortadaki .illus-frame'inki imleç tepkisinin,
   içteki görselinki de sürekli nefes almanın. Hepsi tek elemanda
   olsaydı biri diğerini eziyordu. */

.illus {
  position: relative;
  display: inline-block;
  line-height: 0;
  width: min(var(--illus-w, 280px), 74vw);
}

.illus-frame {
  display: block;
  transform-origin: 50% 90%;
  transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}

.illus.is-awake .illus-frame { transform: translateY(-6px) scale(1.04); }

.illus-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 50% 90%;
  animation: illus-bob 5.4s ease-in-out infinite;
}

/* Üç çizim aynı anda inip kalkmasın */
.illus[data-illus="kilolu"] .illus-img { animation-duration: 6.2s; animation-delay: -1.8s; }
.illus[data-illus="zayif"]  .illus-img { animation-duration: 4.8s; animation-delay: -3.1s; }

@keyframes illus-bob {
  0%, 100% { transform: translateY(0)    rotate(0deg); }
  50%      { transform: translateY(-7px) rotate(1deg); }
}

/* ── Pixel maskot ──────────────────────────────────────── */

.mascot {
  position: relative;
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
}

.mascot.is-awake { transform: scale(1.06); }

.mascot-canvas {
  display: block;
  image-rendering: pixelated;
  /* Nefes alma bütün elemanı taşıyan tek bir transform — kare başına
     yeniden çizim gerektirmiyor. Piksel piksel dalga yalnız imleç
     üstüne gelince, Canvas içinde çalışıyor. */
  animation: mascot-bob 3.6s ease-in-out infinite;
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-5px) rotate(-1.4deg); }
}

/* Konuşma balonu — maskot ve illüstrasyonlarda ortak */
.mascot-bubble,
.illus-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 16px);
  width: max-content;
  max-width: min(64vw, 250px);
  transform: translate(-50%, 8px) scale(.94);
  opacity: 0;
  pointer-events: none;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 11px 15px;
  font-family: "Instrument Sans","Instrument Sans Fallback", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 14px 34px -16px var(--shadow);
  transition: opacity .22s ease, transform .3s cubic-bezier(.22, .61, .36, 1);
  z-index: 6;
}

/* Balonun kuyruğu: kenarlık için dış, dolgu için iç üçgen */
.mascot-bubble::before,
.mascot-bubble::after,
.illus-bubble::before,
.illus-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 7px solid transparent;
}
.mascot-bubble::before,
.illus-bubble::before {
  margin-left: -7px;
  border-top-color: var(--edge);
}
.mascot-bubble::after,
.illus-bubble::after {
  margin-left: -6px;
  border-width: 6px;
  border-top-color: var(--surface-2);
}

.mascot.is-awake .mascot-bubble,
.illus.is-awake .illus-bubble {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  /* Açıkken imleç balonun üstüne geçebilsin (WCAG 1.4.13) */
  pointer-events: auto;
}

/* İllüstrasyonlar maskottan geniş: balon biraz daha uzun cümle
   taşıyabiliyor, kuyruğu da çizimin tepesine değmiyor. */
.illus-bubble {
  bottom: calc(100% + 10px);
  max-width: min(72vw, 280px);
}

/* ── Ortak footer ──────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--edge-soft);
  padding: 48px clamp(20px, 4vw, 54px) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  align-items: flex-start;
  justify-content: space-between;
}

.site-footer .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-footer .brand img { width: 30px; height: 30px; border-radius: 8px; }

.site-footer .wordmark {
  font-family: "Bricolage Grotesque","Bricolage Grotesque Fallback", sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .18em;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

/* Dikey dolgu dokunma hedefini ~25px'e çıkarıyor: dar ekranda alt alta
   dizilen bağlantılar 24px hedef boyutunun altında kalıyordu (2.5.8). */
.site-footer nav a {
  display: inline-block;
  padding-block: 5px;
  text-decoration: none;
  transition: color .25s ease;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible { color: var(--fg); }

.site-footer .colophon { text-align: right; }
.site-footer .colophon a { color: var(--accent-ink); text-decoration: none; }
.site-footer .colophon a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .site-footer { flex-direction: column; align-items: flex-start; }
  .site-footer .colophon { text-align: left; }
}

/* ── Dil seçici ────────────────────────────────────────────
   Tetikleyici tema anahtarıyla aynı kutu ölçüsünde: ikisi yan
   yana durduğunda ortak bir çift gibi okunsun. Menü js/i18n.js
   tarafından çiziliyor, bu yüzden burada yalnız görünüm var. */

/* inline-flex şart: taşıyıcı <span> satır içi kalırsa menünün
   right:0 hizası satır kutusuna göre hesaplanıyor ve açılır liste
   ekranın sağından taşıyor. */
/* min ölçü: seçici JS ile sonradan çiziliyor; yer baştan ayrılmazsa
   header'daki komşular kayıyordu (CLS). */
.lang { position: relative; display: inline-flex; min-width: 62px; min-height: 34px; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-soft);
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.lang-btn:hover,
.lang-btn:focus-visible,
.lang-btn[aria-expanded="true"] {
  border-color: var(--fg);
  background: var(--edge-soft);
  color: var(--fg);
}

.lang-btn svg { width: 15px; height: 15px; display: block; flex: none; }

.lang-code {
  font-family: "Martian Mono","Martian Mono Fallback", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .1em;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 168px;
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid var(--edge);
  border-radius: 12px;
  /* Hero'da menü videonun üstüne düşüyor: yarı saydam bir yüzey
     orada okunmaz. Tam opak surface + gölge her iki bağlamda çalışır. */
  background: var(--surface);
  box-shadow: 0 18px 44px -20px var(--shadow);
}

.lang-menu[hidden] { display: none; }

.lang-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: "Instrument Sans","Instrument Sans Fallback", system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}

.lang-menu a:hover,
.lang-menu a:focus-visible {
  background: var(--edge-soft);
  color: var(--fg);
}

/* Seçili dil: onay işareti metnin ARDINDA ve mutlak konumlu değil,
   böylece uzun dil adları (Português (BR)) işaretin altına kaymıyor. */
.lang-menu a[aria-current] {
  color: var(--accent-ink);
  font-weight: 500;
}

.lang-menu a[aria-current]::after {
  content: "✓";
  margin-left: 8px;
}

/* Sayfadaki "Hareketi durdur" anahtarı (bkz. js/theme.js): sonsuz
   animasyonlar durur, balonlar yine açılır. */
.motion-off .mascot-canvas,
.motion-off .illus-img { animation: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion-toggle { display: none; }
  body, .btn, .theme-toggle, .lang-btn, .lang-menu a { transition: none; }
  /* Maskot durur ama balon hâlâ açılır — bilgi kaybı olmasın. */
  .mascot-canvas { animation: none; }
  .mascot, .mascot-bubble { transition: none; }
  .mascot.is-awake { transform: none; }
  /* İllüstrasyonlarda da aynısı: çizim sabit kalır, balon çıkar. */
  .illus-img { animation: none; }
  .illus-frame, .illus-bubble { transition: none; }
  .illus.is-awake .illus-frame { transform: none; }
}
