/* ───── Font ─────
   Mac/iPhone gerçek Helvetica Neue'yu kullanır (bu dosya hiç indirilmez).
   Windows/Android/Linux'ta Helvetica'nın ücretsiz kopyası TeX Gyre Heros devreye girer. */
@font-face {
  font-family: "Heros";
  src: url("fonts/heros-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
}

/* ───── Tokens ───── */
:root {
  --bg: #000000;
  --fg: #ECE8E0;                         /* kırık beyaz */
  --fg-dim: rgba(236, 232, 224, 0.56);   /* soluk yazı: siyah üstünde 5,5:1 kontrast (en az 4,5 gerekir) */
  --fg-faint: rgba(236, 232, 224, 0.16); /* yalnızca süs çizgileri */
  --line: rgba(236, 232, 224, 0.42);     /* form kutusu / düğme çizgisi: 3,4:1 (en az 3 gerekir) */
  --font: "Helvetica Neue", "Heros", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --gutter: clamp(16px, 2.6vw, 36px);
  --size-small: 13px;
  --size-nav: clamp(1.0625rem, 1.35vw, 1.3125rem);
  --size-title: clamp(1.875rem, 3.8vw, 3.25rem);
}

/* ───── Base ───── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.js body { animation: page-in 0.7s var(--ease) backwards; }
.js body.is-leaving { opacity: 0; transition: opacity 0.32s var(--ease); }
.via-vt body { animation: none; }
@keyframes page-in { from { opacity: 0; } }

/* ───── Sayfa geçişi: kelimeler yerinden kayarak menüye oturur ─────
   Chrome, Edge ve Safari 18.2+; diğerlerinde yumuşak solma kalır. */
@view-transition { navigation: auto; }

.site-header [data-site-name] { view-transition-name: site-name; }
.vt-clients { view-transition-name: nav-clients; }
.vt-archive { view-transition-name: nav-archive; }
.vt-contact { view-transition-name: nav-contact; }

::view-transition-group(*) {
  animation-duration: 0.85s;
  animation-timing-function: cubic-bezier(0.5, 0, 0.1, 1);
}
::view-transition-old(root) { animation: vt-out 0.35s ease both; }
::view-transition-new(root) { animation: vt-in 0.8s 0.55s cubic-bezier(0.2, 0.7, 0.1, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in  { from { opacity: 0; } }

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }

:focus { outline: none; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 6px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ───── Header (iç sayfalar) ───── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: var(--gutter);
  font-size: var(--size-small);
  letter-spacing: 0.01em;
  pointer-events: none;
}
.site-header a { pointer-events: auto; }
/* Logo: sol üstteki isim yazısının yerine assets/logo.svg gösterilir.
   Yazı sayfada durur (ekran okuyucular ve arama motorları için), yalnızca görünmez.
   Eski yazılı hale dönmek için bu bloğu sil. */
.site-header [data-site-name] {
  display: block;
  align-self: center;
  width: 1.82rem;
  height: 1.9rem;
  background: url("logo.svg") left center / contain no-repeat;
  font-size: 0;
  color: transparent;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: auto;
}
.site-header nav { display: flex; align-items: baseline; gap: 1.5em; }
/* Dokunma alanı: yazı küçük kalır ama tıklanabilir alan en az ~44px olur */
.site-header nav a { color: var(--fg-dim); transition: color 0.35s var(--ease); padding: 1.2em 0.55em; margin: -1.2em -0.55em; }
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--fg); }

/* Dil düğmeleri (TR / EN) — main.js ekler */
.lang-switch { display: flex; gap: 0.55em; pointer-events: auto; }
.lang-switch button {
  padding: 1.2em 0.35em;
  margin: -1.2em -0.25em;
  border: 0;
  background: none;
  color: var(--fg-dim);
  font: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.35s var(--ease);
}
.lang-switch button:hover,
.lang-switch button[aria-pressed="true"] { color: var(--fg); }
.lang-switch button[aria-pressed="true"] { cursor: default; }
.site-header nav .lang-switch { margin-left: 0.4em; }

/* İki dilli uzun metinler (privacy): HTML'de iki dil de yazılı, yalnızca seçili olan görünür */
[data-lang="tr"] { display: none; }
html[lang="tr"] [data-lang="tr"] { display: block; }
html[lang="tr"] [data-lang="en"] { display: none; }

/* ───── Ana sayfa ───── */
.home {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
}

.home-nav {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5.5vw, 5rem);
  font-size: var(--size-nav);
  letter-spacing: -0.005em;
}
.home-nav a {
  display: block;
  padding: 0.75em 0.15em;
  transition: opacity 0.6s var(--ease);
  animation: settle 1.6s var(--ease) backwards;
}
.home-nav a:nth-child(2) { animation-delay: 0.14s; }
.home-nav a:nth-child(3) { animation-delay: 0.28s; }
.via-vt .home-nav a { animation: none; }

.home-nav .word { display: inline-block; }

/* Clients / Archive yanındaki küçük sayı */
.count {
  margin-left: 0.28em;
  font-size: 0.62em;
  line-height: 0;
  vertical-align: 0.72em;
  opacity: 0.58;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

@keyframes settle {
  from { opacity: 0; filter: blur(10px); letter-spacing: 0.14em; }
  to   { opacity: 1; filter: blur(0);    letter-spacing: -0.005em; }
}

/* Üzerine gelince diğerleri kısılır */
.dim-group.is-hovering > :not(.is-active) { opacity: 0.22; }

/* Ana sayfada kısma renkle yapılır ki kayma geçişinde kelimeler kısık haliyle uçsun */
.home-nav a { transition: color 0.6s var(--ease); }
.home-nav.dim-group.is-hovering > :not(.is-active) { opacity: 1; color: rgba(236, 232, 224, 0.22); }

/* ───── Liste sayfaları (Clients / Archive) ───── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--gutter) * 2 + 3rem) var(--gutter);
  text-align: center;
}

.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 3.6vw, 3rem);
  width: 100%;
  max-width: 44rem;
}

.item { transition: opacity 0.6s var(--ease); }

.item-title {
  display: inline-block;
  font-size: var(--size-title);
  font-weight: 400;
  letter-spacing: -0.028em;
  line-height: 1.04;
  padding: 0.04em 0.1em;
}

.item-text {
  max-width: 34ch;
  margin: 0.7rem auto 0;
  font-size: var(--size-small);
  color: var(--fg-dim);
  letter-spacing: 0.005em;
}

/* Arkada beliren kapak görseli */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.9s var(--ease), transform 1.8s var(--ease);
}
.backdrop img.is-visible { opacity: 0.4; transform: scale(1); }

/* ───── Hareketli ışık arka planı ─────
   Home ve Contact'ta hep açık; Clients ve Archive'da isim üzerine gelince açılır.
   Işıklar main.js'te küçük bir tuvale (canvas) çizilip ekrana büyütülür:
   büyük ekranlarda bile ekran kartını yormaz. */
.ambient {
  --amb-opacity: 0.62;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  view-transition-name: ambient;
}

.ambient-inner {
  position: absolute;
  inset: 0;
  background: #000; /* gren siyahın üstünde hesaplansın */
  opacity: 0;
  transition: opacity 1.1s var(--ease);
}
.ambient.is-on .ambient-inner { opacity: var(--amb-opacity); }

.ambient-inner canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Film greni: sadece ışığın olduğu yerde görünür, siyah siyah kalır */
.ambient-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

/* Kenarları karart */
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(110% 90% at 50% 50%, transparent 28%, rgba(0,0,0,.7) 68%, #000 96%);
}

/* Dokunmatik cihazlarda "üzerine gelme" olmadığı için listelerde de hep açık */
@media not all and (hover: hover) and (pointer: fine) {
  .ambient .ambient-inner { opacity: var(--amb-opacity); }
}

/* ───── Contact ───── */
.contact { width: 100%; max-width: 25rem; }

.contact-name {
  font-size: var(--size-title);
  font-weight: 400;
  letter-spacing: -0.028em;
  line-height: 1.04;
}

/* Tanıtım metni (panelden: İçerik → Tanıtım metni) */
.contact-about {
  margin-top: 1.1rem;
  color: var(--fg-dim);
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-line;
  text-wrap: balance;
}

/* "Proje başlat" satırı (brief formuna götürür) */
.contact-cta {
  margin-top: 1.1rem;
  font-size: var(--size-small);
  color: var(--fg-dim);
}
.contact-cta a { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--fg-dim); white-space: nowrap; }
.contact-cta a::after { content: " →"; }

.form {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  text-align: left;
}

.form input,
.form textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* iOS zoom yapmasın */
  transition: border-color 0.35s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.form textarea { min-height: 7rem; resize: none; line-height: 1.5; }
.form input:focus,
.form textarea:focus { border-bottom-color: var(--fg); }
.form input:focus-visible,
.form textarea:focus-visible { outline: none; }
.form ::placeholder { color: var(--fg-dim); opacity: 1; }

.form input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--bg) inset;
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
}

.form .trap { display: none; }

/* Gizlilik onay kutusu (contact formu) */
.form .consent {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: var(--size-small);
  color: var(--fg-dim);
  cursor: pointer;
}
.form .consent input {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 0.1rem;
  padding: 0;
  border: 1px solid var(--fg-dim);
  border-radius: 3px;
  cursor: pointer;
}
.form .consent input:checked { background: var(--fg); box-shadow: inset 0 0 0 3px var(--bg); border-color: var(--fg); }
.form .consent input:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }
.form .consent a, .prose a { text-decoration: underline; text-underline-offset: 3px; }

/* Düz yazı sayfası (privacy) */
.prose { width: 100%; max-width: 34rem; text-align: left; }
.prose h1 { font-size: var(--size-title); font-weight: 400; letter-spacing: -0.028em; line-height: 1.04; margin-bottom: 2rem; }
.prose h2 { font-size: 1rem; font-weight: 400; margin: 1.75rem 0 0.4rem; }
.prose p, .prose li { color: var(--fg-dim); }
.prose p + p { margin-top: 0.7rem; }
.prose ul { padding-left: 1.1rem; }

.send {
  justify-self: center;
  margin-top: 1.25rem;
  padding: 0.85rem 2.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease), border-color 0.45s var(--ease);
}
.send:hover,
.send:focus-visible { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.send[disabled] { opacity: 0.4; pointer-events: none; }

.status {
  min-height: 1.45em;
  font-size: var(--size-small);
  color: var(--fg-dim);
  text-align: center;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.6rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  font-size: var(--size-small);
}
.links a { color: var(--fg-dim); transition: color 0.35s var(--ease); padding: 1em 0.4em; margin: -1em -0.4em; }
.links a:hover { color: var(--fg); }

/* ───── Archive klasör sayfası (yer tutucu) / 404 ───── */
.solo-title {
  font-size: var(--size-title);
  font-weight: 400;
  letter-spacing: -0.028em;
  line-height: 1.04;
}

.solo-back { margin-top: 1.6rem; font-size: var(--size-small); }
.solo-back a { color: var(--fg-dim); text-decoration: underline; text-underline-offset: 4px; padding: 1em 0.5em; margin: -1em -0.5em; transition: color 0.35s var(--ease); }
.solo-back a:hover { color: var(--fg); }

/* ───── "İçeriğe geç" bağlantısı: yalnızca klavyeyle (Tab) gezenlere görünür ───── */
.skip {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-size: var(--size-small);
  transform: translateY(-300%);
}
.skip:focus { transform: none; outline: none; }
main:focus { outline: none; }

/* ───── Mobil ───── */
@media (max-width: 560px) {
  .home-nav { gap: 1.9rem; }
  .site-header nav { gap: 1.1em; }
  .site-header nav .lang-switch { margin-left: 0; }
}

@media (max-width: 340px) {
  .home-nav { flex-direction: column; gap: 0.25rem; }
}

/* ───── Hareket azaltma tercihi ───── */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
