/* ---------- Tokens ---------- */
:root {
  --bg: #0c0b0a;
  --bg-raised: #161412;
  --text: #ede8df;
  --text-dim: #9a948a;
  --line: rgba(237, 232, 223, 0.14);
  --red: #e3201b;

  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --ease-wheel: cubic-bezier(0.65, 0, 0.25, 1);
  --dur-wheel: 720ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

::selection { background: var(--red); color: #fff; }

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

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--text); color: var(--bg);
  padding: .5rem .875rem; text-decoration: none; z-index: 10;
}
.skip:focus { top: 1rem; }

/* ---------- Intro ---------- */
.intro {
  padding: clamp(1.5rem, 5vh, 4rem) var(--gutter) 0;
  display: grid;
  gap: .75rem 3rem;
  align-items: end;
}
.intro__name {
  margin: 0;
  font: 400 clamp(3rem, min(11vw, 13vh), 7.5rem)/0.88 var(--font-display);
  letter-spacing: -0.01em;
}
.intro__lede {
  margin: 0;
  max-width: 34ch;
  color: var(--text-dim);
  font-size: clamp(.95rem, 1.2vw, 1.0625rem);
}
@media (min-width: 900px) {
  .intro { grid-template-columns: auto 1fr; }
  .intro__lede { justify-self: end; text-align: right; padding-bottom: .6rem; }
}

/* ---------- Showcase: geometry ---------- */
.showcase {
  /* Dikey ekran yüksekliği ve yatay ekran genişliği */
  --ph: min(46svh, 410px);
  --lw: 88vw;
  /* Çarkın merkezi seçici çizginin --R kadar altında */
  --R: 125vw;
  --step: 30deg;
  --tilt: 0.55;          /* ekranın yayda ne kadar dik kalacağı (1 = tamamen dik) */
  --line-y: 1.25rem;     /* seçici çizginin sahne altına uzaklığı */

  position: relative;
  padding-top: clamp(1rem, 3vh, 2.5rem);
}
@media (min-width: 720px) {
  .showcase {
    --ph: min(50svh, 540px);
    --lw: min(60vw, 820px);
    --R: clamp(700px, 80vw, 1150px);
    --step: 34deg;
  }
}

.showcase__stage {
  position: relative;
  height: calc(var(--ph) + var(--line-y) + 1.5rem);
  overflow: hidden;
  touch-action: pan-y;           /* dikey kaydırma tarayıcıda, yatay jest bizde */
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.showcase__stage.is-dragging { cursor: grabbing; }
.showcase__stage:focus-visible { outline: 1px solid var(--line); outline-offset: -1px; }

.showcase__wheel { position: absolute; inset: 0; }

/* ---------- Slides on the wheel ---------- */
.slide {
  --o: 0;                                   /* aktif slayta göre konum (JS) */
  --a: calc(var(--o) * var(--step));
  position: absolute;
  left: 50%;
  bottom: var(--line-y);
  transform-origin: 50% 100%;
  transform:
    translateX(-50%)
    translateY(var(--R))
    rotate(var(--a))
    translateY(calc(var(--R) * -1))
    rotate(calc(var(--a) * var(--tilt) * -1))
    scale(var(--s, 1));
  transition:
    transform var(--dur-wheel) var(--ease-wheel),
    opacity var(--dur-wheel) var(--ease-wheel),
    filter var(--dur-wheel) var(--ease-wheel);
  will-change: transform;
}
.slide:not(.is-active) {
  --s: .86;
  opacity: .32;
  filter: grayscale(.7) brightness(.75);
  cursor: pointer;
}
.slide:not(.is-active):hover { opacity: .5; }
.slide.is-active { z-index: 2; }
.is-dragging .slide { transition: none; }

.screen {
  position: relative;
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow:
    0 0 0 1px rgba(237, 232, 223, .1),
    0 30px 60px -20px rgba(0, 0, 0, .8);
}
.screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; pointer-events: none; }

/* Dikey ekran: yükseklik sabit, genişliği içindeki görsel belirler.
   Çerçevenin kendi oranı yok; böylece hiçbir ekran görüntüsü kenarlarından kırpılmaz. */
.screen--portrait {
  height: var(--ph);
  width: max-content;
  border-radius: calc(var(--ph) * .07);
  border: calc(var(--ph) * .018) solid #1f1d1a;
}
.screen--portrait > img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
}
/* Görsel yokken yer tutucu telefon oranında yer kaplar */
.screen--portrait > .screen__placeholder {
  position: static;
  height: 100%;
  aspect-ratio: 9 / 19.5;
}
.screen--landscape {
  width: var(--lw);
  aspect-ratio: 1900 / 862;
  border-radius: 6px;
}

/* İşaretli yer tutucu: gerçek görsel gelene kadar */
.screen__placeholder {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: .5rem;
  padding: 1rem;
  text-align: center;
  font-size: .75rem; line-height: 1.4;
  color: var(--text-dim);
  background:
    repeating-linear-gradient(-45deg, transparent 0 10px, rgba(237,232,223,.035) 10px 20px),
    var(--bg-raised);
}
.screen__placeholder strong {
  color: var(--red);
  font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-size: .6875rem;
}
.screen__placeholder code { font-size: .6875rem; word-break: break-all; color: var(--text); }

/* ---------- Selector line ---------- */
.showcase__selector {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--line-y) - 2px);
  height: 2px;
  background: var(--line);
  pointer-events: none;
  z-index: 3;
}
.showcase__selector::after {
  content: "";
  position: absolute; left: 50%; top: -1px;
  height: 4px;
  width: var(--sel-w, 0px);
  transform: translateX(-50%);
  background: var(--red);
  transition: width var(--dur-wheel) var(--ease-wheel);
}

/* ---------- Caption + controls ---------- */
.showcase__bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: .25rem var(--gutter) 3rem;
}
.showcase__controls {
  display: flex; align-items: center; gap: .5rem;
  order: -1; /* mobilde bağlantı ve oklar sahnenin hemen altında */
}
.showcase__link {
  margin-right: auto;
  padding: .55rem 0;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}
.showcase__link:hover span { display: inline-block; transform: translateX(3px); }
.showcase__count {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: .875rem;
  margin-right: .5rem;
}
.arrow {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  background: none; color: var(--text);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color .2s, opacity .2s;
}
.arrow svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.arrow:hover:not(:disabled) { border-color: var(--text); }
.arrow:disabled { opacity: .25; cursor: default; }

.caption { max-width: 60ch; }
.caption__meta { margin: 0 0 .35rem; color: var(--text-dim); font-size: .8125rem; }
.caption__title { margin: 0; font: 400 clamp(1.75rem, 3.4vw, 2.75rem)/1.05 var(--font-display); }
.caption__title span { color: var(--text-dim); }
.caption__summary { margin: .6rem 0 0; color: var(--text-dim); }
.caption.is-entering { animation: caption-in .5s var(--ease-wheel) both; }
@keyframes caption-in { from { opacity: 0; transform: translateY(6px); } }

@media (min-width: 720px) {
  .showcase__bar { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 3rem; }
  .showcase__controls { order: 0; flex-shrink: 0; }
  .showcase__link { margin-right: 1.5rem; }
}

.showcase__noscript { padding: 0 var(--gutter); color: var(--text-dim); }

/* ---------- Üst menü ---------- */
html { scroll-behavior: smooth; }
.site-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem var(--gutter) 0;
  font-size: .9375rem;
}
.site-nav__links { display: flex; align-items: center; gap: clamp(.85rem, 3vw, 2rem); }
@media (max-width: 420px) {
  .site-nav { font-size: .875rem; }
  .site-nav__links { gap: .8rem; }
}
.site-nav__links a {
  color: var(--text-dim); text-decoration: none;
  padding: .4rem 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.site-nav__links a:hover { color: var(--text); border-bottom-color: var(--red); }
.site-nav__links a[aria-current="page"],
.site-nav__links a[aria-current="location"] { color: var(--text); border-bottom-color: var(--red); }

/* Dil seçici: menünün sonunda, diğer bağlantılardan ince bir çizgiyle ayrılır */
.lang-switch {
  margin-left: .25rem;
  padding: .3rem .55rem !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px;
  font-size: .8125rem;
  letter-spacing: .04em;
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.lang-switch:hover { color: var(--text); border-color: var(--red) !important; }

/* ---------- İmza (NBD) ----------
   Kapalıyken D harfi N ve B'yi çevreler; üzerine gelince açılır ve üç harf ayrı okunur.
   (CSS "d" özelliğini desteklemeyen tarayıcılarda imza kapalı hâliyle durur.) */
.brand { display: inline-flex; color: var(--text); text-decoration: none; line-height: 0; }
.nbd-mark { width: 3.4rem; height: auto; overflow: visible; }
.nbd-mark .nbd-outline { transition: d .19s ease-out, stroke .19s ease-out; }
.brand:focus-visible .nbd-outline { d: path("M52 3 H58 C67.39 3 75 10.61 75 20 C75 29.39 67.39 37 58 37 H52"); stroke: var(--red); }
@media (hover: hover) {
  .brand:hover .nbd-outline { d: path("M52 3 H58 C67.39 3 75 10.61 75 20 C75 29.39 67.39 37 58 37 H52"); stroke: var(--red); }
}
@media (max-width: 420px) { .site-nav .nbd-mark { width: 2.9rem; } }

/* ---------- Ortak bölüm başlıkları ---------- */
.kicker { margin: 0 0 .5rem; color: var(--text-dim); font-size: .8125rem; letter-spacing: .02em; }
.section-title { margin: 0; font: 400 clamp(2rem, 4.5vw, 3.5rem)/1.02 var(--font-display); }
.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;
}
#about, #contact, #projects { scroll-margin-top: 1rem; }

/* ---------- Hakkımda ---------- */
.about {
  display: grid; gap: 2.5rem;
  padding: clamp(4rem, 10vw, 8rem) var(--gutter) 0;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
.about__portrait {
  margin: 0;
  position: relative;
  width: min(100%, 22rem);
  padding-bottom: .75rem;
}
.about__portrait img {
  width: 100%; height: auto;
  border-radius: 4px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
}
/* Vitrindeki kırmızı seçici çizgi, burada portrenin altında */
.about__portrait::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 4px; background: var(--red);
}
.about__text p:not(.kicker) {
  margin: 1.25rem 0 0;
  max-width: 54ch;
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  color: var(--text);
}
.about__text p + p { color: var(--text-dim) !important; }
@media (min-width: 900px) {
  .about { grid-template-columns: minmax(16rem, 22rem) 1fr; gap: clamp(3rem, 7vw, 7rem); align-items: end; }
  .about__text { padding-bottom: 2rem; }
}

/* ---------- İletişim ---------- */
.contact {
  margin-top: clamp(4rem, 10vw, 8rem);
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) 0;
  border-top: 1px solid var(--line);
}
.contact__head {
  display: grid; gap: 2rem;
  align-items: end;
}
.contact__title {
  margin: 0;
  font: 400 clamp(3.25rem, 9vw, 7.5rem)/.9 var(--font-display);
  letter-spacing: -0.015em;
}
.contact__sub {
  margin: 1.25rem 0 0;
  color: var(--text-dim);
  font-size: clamp(.95rem, 1.2vw, 1.0625rem);
  line-height: 1.6;
}
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.contact__status { flex-basis: 100%; min-height: 1.25rem; color: var(--text-dim); font-size: .8125rem; }

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  font: 500 .9375rem/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn span[aria-hidden] { display: inline-block; transition: transform .2s; }
.btn:hover span[aria-hidden] { transform: translateX(3px); }
.btn--primary { background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn--primary:hover { background: #c71a15; border-color: #c71a15; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--text); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.contact__grid {
  position: relative;
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 0;
  display: grid;
  border-top: 1px solid var(--line);
}
/* Vitrindeki kırmızı seçici, burada ızgaranın başında */
.contact__grid::before {
  content: ""; position: absolute; left: 0; top: -2px;
  width: 4rem; height: 3px; background: var(--red);
}
.contact__item { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.contact__item dt { color: var(--text-dim); font-size: .8125rem; margin-bottom: .5rem; }
.contact__item dd { margin: 0; font-size: clamp(1rem, 1.3vw, 1.125rem); overflow-wrap: anywhere; }
.contact__item a {
  text-decoration: none;
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0 1px;
  transition: background-size .3s var(--ease-wheel);
  padding-bottom: 2px;
}
.contact__item a:hover, .contact__item a:focus-visible { background-size: 100% 1px; }
.contact__item a span[aria-hidden] { color: var(--text-dim); font-size: .9em; }

@media (max-width: 899px) {
  .contact__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
  .contact__actions .btn { white-space: nowrap; }
  .contact__actions .btn { justify-content: center; padding-inline: .75rem; font-size: .875rem; }
  .contact__status { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .contact__head { grid-template-columns: 1fr auto; gap: 4rem; }
  .contact__actions { justify-content: flex-end; padding-bottom: .5rem; }
  .contact__status { text-align: right; }
  .contact__grid { grid-template-columns: repeat(3, 1fr); }
  .contact__item { border-bottom: 0; padding: 1.75rem 2rem 0 0; }
  .contact__item + .contact__item { padding-left: 2rem; border-left: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .contact__item a { transition: none; } }

.site-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin: clamp(4rem, 9vw, 7rem) var(--gutter) 0;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-dim); font-size: .875rem;
}
.site-footer p { margin: 0; }
.site-footer__sign { display: flex; align-items: center; gap: .9rem; }
.site-footer__sign .nbd-mark { width: 2.4rem; color: var(--text-dim); }
.site-footer__top { color: var(--text-dim); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.site-footer__top:hover { color: var(--text); }

/* ---------- Sayfalar arası geçiş ----------
   Vitrindeki aktif ekran, proje sayfasındaki ekrana dönüşür (aynı view-transition-name). */
@view-transition { navigation: auto; }
::view-transition-group(*) {
  animation-duration: 560ms;
  animation-timing-function: var(--ease-wheel);
}

/* ---------- Reduced motion: doğrudan geçiş ---------- */
@media (prefers-reduced-motion: reduce) {
  .slide, .showcase__selector::after { transition: none; }
  .caption.is-entering { animation: none; }
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  .nbd-mark .nbd-outline { transition: none; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 100svh; display: grid; place-items: center; }
.notfound__main { padding: 3rem var(--gutter); width: min(100%, 44rem); }
.notfound__title { margin: 0; font: 400 clamp(3rem, 9vw, 6rem)/.95 var(--font-display); }
.notfound__text { margin: 1rem 0 0; color: var(--text-dim); font-size: 1.125rem; }
.notfound__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
