/* Wish World — Aşama 0 landing
 *
 * Görsel yön: docs/design-direction.md
 *   "Soğuk ve uçsuz bir gökyüzü, içinde tek bir sıcak ışık."
 *
 * Kart/gölge/kenarlık yığını yok — yüzeyler renkle ayrılır (§4).
 * Aksan cimri kullanılır: balon, birincil buton, odak halkası (§2).
 */

/* ------------------------------------------------------------------ */
/* Font                                                                */
/* ------------------------------------------------------------------ */

/* Gövde sistem yığını (0 KB). Serif yalnızca başlıklarda.
 * Newsreader, opsz=30 sabit + wght 500-600, Latin+Türkçe alt kümesi.
 * Üretimi ve Türkçe glif doğrulaması: src/assets/fonts/README.md
 * Google Fonts CDN kullanılmaz — ek DNS/TLS ve üçüncü tarafa IP sızıntısı. */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/Newsreader-tr.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ */
/* Tokenler — docs/design-direction.md §2                              */
/* ------------------------------------------------------------------ */

:root {
  --sky-900: #0a0e1c; /* taban — gökyüzü */
  --sky-800: #131829; /* yükseltilmiş yüzey */
  --sky-700: #1e2438; /* kenarlık, ayırıcı */

  --text-1: #e8e6e1; /* birincil metin — sıcak kırık beyaz */
  --text-2: #9aa0b0; /* ikincil metin */

  --lantern: #f5c77e; /* aksan — fener ışığı */
  --lantern-soft: #ffd9a0; /* hover, parıltı */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;

  --step-pad: clamp(1.25rem, 5vw, 2rem);
  --measure: 34rem; /* uzun satır bu üründe okumayı bozar (§3) */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 200ms;
  --t-base: 300ms;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--sky-900);
  color: var(--text-1);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------------ */
/* Gökyüzü — hero'nun kendisi (§5)                                     */
/* ------------------------------------------------------------------ */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  /* Saf siyah kullanılmaz: derinliği öldürür (§2) */
  background:
    radial-gradient(140% 100% at 50% 108%, rgba(245, 199, 126, 0.07) 0%, transparent 55%),
    linear-gradient(178deg, #070a15 0%, var(--sky-900) 42%, #0d1425 100%);
}

/* Yıldızlar: tekrarlayan radial-gradient. Görsel indirilmiyor, JS yok. */
.sky__stars,
.sky__stars--far {
  position: absolute;
  inset: -10%;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, rgba(232, 230, 225, 0.55), transparent),
    radial-gradient(1.2px 1.2px at 68% 14%, rgba(232, 230, 225, 0.42), transparent),
    radial-gradient(1.6px 1.6px at 84% 46%, rgba(232, 230, 225, 0.5), transparent),
    radial-gradient(1.1px 1.1px at 32% 62%, rgba(232, 230, 225, 0.34), transparent),
    radial-gradient(1.3px 1.3px at 52% 34%, rgba(232, 230, 225, 0.38), transparent),
    radial-gradient(1px 1px at 8% 78%, rgba(232, 230, 225, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 92% 82%, rgba(232, 230, 225, 0.44), transparent);
  background-size: 620px 620px;
  animation: drift 300s linear infinite;
}

.sky__stars--far {
  opacity: 0.4;
  background-size: 340px 340px;
  animation-duration: 480s;
  animation-direction: reverse;
}

@keyframes drift {
  to {
    transform: translate3d(-620px, 0, 0);
  }
}

/* --- Balon silüetleri (§5) ---
 * Konumlar scripts/gen-balloons.mjs tarafından sabit bir seed'den
 * üretilir. "Balonlar dikkat çekmez, sadece derinlik verir." */

.sky__balloons {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky__def {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.balloon-ghost {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * 44px);
  height: auto;
  color: var(--lantern);
  fill: currentColor;
  opacity: var(--o);
  /* 150-260 sn ve alternate: yön değişimi bile fark edilmez.
   * Göz takip etmeye başlıyorsa fazla hızlıdır (§5). */
  animation: balloon-drift var(--d) ease-in-out var(--delay) infinite alternate;
  will-change: transform;
}

@keyframes balloon-drift {
  to {
    transform: translate3d(var(--sway), calc(var(--rise) * -1), 0);
  }
}

/* ------------------------------------------------------------------ */
/* Adımlar ve tipografi (§3, §4)                                       */
/* ------------------------------------------------------------------ */

main {
  display: flex;
  flex-direction: column;
}

.step {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: calc(var(--step-pad) * 2) var(--step-pad);
}

.step[hidden] {
  display: none;
}

.step__inner {
  width: 100%;
  max-width: var(--measure);
  animation: rise var(--t-base) var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.hero__title,
.step__title {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-1);
}

.hero__title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.5rem, 8vw, 4rem);
  line-height: 1.1;
}

.step__title {
  margin: 0 0 0.875rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.25;
}

.hero__lead,
.step__lead {
  margin: 0 0 1.75rem;
  max-width: 28rem;
  color: var(--text-2);
}

.hero__lead {
  margin-bottom: 2.75rem;
  font-size: clamp(1.0625rem, 3.4vw, 1.1875rem);
}

/* ------------------------------------------------------------------ */
/* Form                                                                */
/* ------------------------------------------------------------------ */

.field {
  margin-bottom: 1.75rem;
}

.field--row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.field--row > * {
  flex: 1 1 12rem;
}

.wish-input,
.text-input,
.select {
  width: 100%;
  min-height: 3rem; /* dokunma hedefi ≥ 44px (§8) */
  padding: 0.875rem 1rem;
  font: inherit;
  color: var(--text-1);
  background: var(--sky-800);
  border: 1px solid var(--sky-700);
  border-radius: 0.75rem;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.wish-input {
  min-height: 8.5rem;
  font-family: var(--serif);
  font-size: clamp(1.125rem, 4vw, 1.3125rem);
  line-height: 1.5;
  resize: vertical;
}

.wish-input::placeholder,
.text-input::placeholder {
  color: var(--text-2);
  opacity: 0.55;
}

.wish-input:hover,
.text-input:hover,
.select:hover {
  border-color: #2a3149;
}

.wish-input:focus,
.text-input:focus,
.select:focus {
  border-color: var(--lantern);
}

.select {
  appearance: none;
  cursor: pointer;
}

.select option {
  background: var(--sky-800);
  color: var(--text-1);
}

.field__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.625rem;
  min-height: 1.5rem;
}

.counter,
.hint,
.fineprint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-2);
}

.hint {
  margin-top: 0.625rem;
}

.fineprint {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
}

.counter--over {
  color: var(--lantern);
}

/* Uyarı metni. Renk tek başına anlam taşımaz (§8): metin zaten ne
 * yapılacağını söylüyor, renk yalnızca onu destekliyor. */
.notice {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--lantern);
  min-height: 1.4em;
}

.notice:empty {
  min-height: 0;
}

/* ------------------------------------------------------------------ */
/* Butonlar ve seçimler                                                */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem; /* ≥ 44px */
  padding: 0 1.625rem;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--lantern);
  color: #1c1408; /* fener zemininde yüksek kontrast */
}

.btn--primary:hover:not(:disabled) {
  background: var(--lantern-soft);
}

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--sky-700);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text-1);
  border-color: #2a3149;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3.5rem;
  padding: 0 1.125rem;
  font: inherit;
  text-align: left;
  color: var(--text-1);
  background: var(--sky-800);
  border: 1px solid var(--sky-700);
  border-radius: 0.875rem;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.choice:hover {
  border-color: #2a3149;
}

/* Seçili durum renkle DEĞİL, kenarlık + zemin + aria-checked ile
 * anlatılır; ekran okuyucu da aynı bilgiyi alır (§8). */
.choice[aria-checked="true"] {
  background: rgba(245, 199, 126, 0.1);
  border-color: var(--lantern);
}

.choice__icon {
  font-size: 1.25rem;
  line-height: 1;
}

:where(a) {
  color: var(--text-2);
  text-underline-offset: 0.2em;
  transition: color var(--t-fast) var(--ease);
}

:where(a):hover {
  color: var(--lantern);
}

/* Odak halkası her zaman görünür, aksan renginde (§8) */
:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--lantern);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Bırakma animasyonu — ürünün tek anı (§6)                            */
/* ------------------------------------------------------------------ */

.step--release .step__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
}

.balloon {
  position: relative;
  width: 7rem;
  height: 13rem;
  animation: float 20s ease-in-out infinite alternate;
}

.balloon__body {
  width: 7rem;
  height: 8.25rem;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 34% 28%, #fff1d6 0%, var(--lantern) 44%, #c99248 100%);
  box-shadow: 0 0 70px rgba(245, 199, 126, 0.3);
}

.balloon__string {
  width: 1px;
  height: 2.25rem;
  margin: 0 auto;
  background: linear-gradient(var(--lantern), rgba(245, 199, 126, 0.12));
}

.balloon__card {
  width: 3.25rem;
  height: 2.25rem;
  margin: 0 auto;
  border-radius: 0.3rem;
  background: var(--text-1);
}

@keyframes float {
  to {
    transform: translateY(-10px);
  }
}

.balloon--releasing {
  animation: release 2.6s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
}

@keyframes release {
  to {
    transform: translateY(-80vh) scale(0.3);
    opacity: 0;
  }
}

.release__caption {
  margin: 0;
  color: var(--text-2);
}

/* ------------------------------------------------------------------ */
/* Kriz ekranı (§7)                                                    */
/* ------------------------------------------------------------------ */

/* Uyarı gibi GÖRÜNMEZ: kırmızı yok, ünlem yok, ikon yok, titreşim yok.
 * Zemin yükseltilmiş yüzey, aksan yine fener tonu — alarm değil, ışık.
 * "Bu ekranı gören kişi hata yaptığını değil, görüldüğünü hissetmelidir." */
.step--support {
  background: var(--sky-800);
}

.step--support .step__inner {
  max-width: 36rem;
}

/* Normalden bir tık büyük ve daha geniş satır aralığı — acele ettirmez */
.step--support .step__title {
  margin-bottom: 1.25rem;
  font-size: clamp(1.625rem, 4.4vw, 2.125rem);
  line-height: 1.3;
}

.step--support .step__lead {
  max-width: 32rem;
  font-size: 1.09375rem;
  line-height: 1.75;
  color: var(--text-1);
}

.support__heading {
  margin: 2.25rem 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

.resources {
  margin: 0 0 2.25rem;
  display: grid;
  gap: 1.5rem;
}

.resource__name {
  margin: 0 0 0.2rem;
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--lantern);
}

.resource__desc,
.resource__avail {
  margin: 0;
  color: var(--text-2);
  font-size: 0.96875rem;
  line-height: 1.65;
}

.resource__avail {
  margin-top: 0.15rem;
  font-size: 0.875rem;
}

.resource__closing {
  margin: 0;
  color: var(--text-1);
  line-height: 1.75;
}

.resources__error {
  margin: 0;
  color: var(--text-2);
}

/* Tek başına duran bağlantılar dokunma hedefi sayılır: 44px yüksekliğe
 * çıkarılır (§8). Cümle içine gömülü bağlantılar bu kuralın dışındadır
 * (WCAG 2.5.5 "inline" istisnası) — satır yüksekliğini bozmadan
 * büyütülemezler ve etraflarındaki metin zaten hedefi genişletir. */
.link-target {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.125rem;
}

/* ------------------------------------------------------------------ */
/* Geliştirme şeridi                                                   */
/* ------------------------------------------------------------------ */

/* Yalnızca uzman onayı tamamlanmadan yapılan build'lerde basılır.
   Koşulu strict build'i durduran koşulun aynısıdır (scripts/build.mjs). */
.devbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.5rem var(--step-pad);
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #1c1408;
  background: var(--lantern);
}

.devbar strong {
  font-weight: 600;
}

/* Şerit sticky olduğu için adımların tam ekran yüksekliğinden düşülür */
body:has(.devbar) .step {
  min-height: calc(100dvh - 2.2rem);
}

/* ------------------------------------------------------------------ */
/* Yardımcılar                                                         */
/* ------------------------------------------------------------------ */

.footer {
  padding: 2rem var(--step-pad) 3rem;
  text-align: center;
  font-size: 0.875rem;
}

.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;
}

/* Aydınlatma metni sayfası */
.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: calc(var(--step-pad) * 2) var(--step-pad) 4rem;
}

.prose h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.875rem, 6vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}

.prose h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 2.25rem 0 0.5rem;
}

.prose p,
.prose li {
  color: var(--text-2);
}

.prose strong {
  color: var(--text-1);
}

/* ------------------------------------------------------------------ */
/* Hareket tercihi — zorunlu (§6)                                      */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* Arka plan balonları ve yıldızlar durur */
  .sky__stars,
  .sky__stars--far,
  .balloon-ghost,
  .balloon,
  .step__inner {
    animation: none;
  }

  /* Bırakma animasyonu sade bir geçişe düşer */
  .balloon--releasing {
    animation: release-reduced 600ms linear forwards;
  }

  @keyframes release-reduced {
    to {
      opacity: 0;
    }
  }

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
  }
}
