/* ==========================================================================
   ROMIX STUDIO
   ========================================================================== */

/* --- Temel ---------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --size: 390;          /* tipografi ölçek referansı (mobil) */
  --pad-x: 4rem;
  --pad-y: 2.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 650px) {
  :root {
    --size: 1500;       /* masaüstü */
    --pad-x: 8rem;
    --pad-y: 4rem;
  }
}

html {
  /* 1rem = viewport genişliğine göre ~10px, 20px'te sabitlenir */
  font-size: clamp(5px, 20px, 10 * 100vw / var(--size));
  -webkit-text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
  width: 100%;
  position: fixed;
  overflow: hidden;
  touch-action: none;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

button {
  /* Tarayıcı varsayılanı butonlarda text-transform'u sıfırlıyor, geri alıyoruz */
  text-transform: inherit;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

::selection { background: rgba(255, 255, 255, 0.18); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Minik büyük harf etiket — arayüzün tamamı bu tipte */
.label {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}


/* --- Yükleme ekranı ------------------------------------------------------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity 0.8s var(--ease);
}

.loader-bars { display: flex; gap: 0.8rem; }

.loader-bars i {
  display: block;
  width: 5rem;
  height: 0.5rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
}

.loader-bars i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  animation: barFill 1.1s var(--ease) infinite;
}

.loader-bars i:nth-child(2)::after { animation-delay: 0.12s; }
.loader-bars i:nth-child(3)::after { animation-delay: 0.24s; }

@keyframes barFill {
  0%   { transform: scaleX(0);   transform-origin: left; }
  45%  { transform: scaleX(1);   transform-origin: left; }
  55%  { transform: scaleX(1);   transform-origin: right; }
  100% { transform: scaleX(0);   transform-origin: right; }
}

body:not(.is-loading) .loader {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.8s var(--ease), visibility 0s linear 0.8s;
}


/* --- Proje şeridi --------------------------------------------------------- */

/* Kartların görselleri bu canvas'a çiziliyor (bkz. js/gl.js) */
.gl {
  position: fixed;
  inset: 0;
  /* canvas yerleşik olarak 300x150; inset tek başına germiyor */
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

body.no-gl .gl { display: none; }

.gl { transition: opacity 0.9s var(--ease), filter 0.9s var(--ease); }

/* İletişim panelindeki doğrudan bağlantı satırı */
.panel-direct {
  margin: 2.2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: center;
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.5);
}

.panel-direct a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.panel-direct a:hover { color: #fff; border-color: #fff; }

/* Arka plan videosu — iki katman üst üste, dikişte çapraz geçiş yapıyor */
.bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: #000;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s linear;
}

.stage {
  z-index: 30;
  position: fixed;
  user-select: none;
  -webkit-user-select: none;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  transition: opacity 0.9s var(--ease), filter 0.9s var(--ease);
}

.stage.is-hot     { cursor: pointer; }
.stage.is-dragging,
.stage.is-dragging.is-hot { cursor: grabbing; }

/* Yerleşimin tek kaynağı: kartları CSS diziyor, app.js her karede
   getBoundingClientRect() ile okuyup mesh'leri üzerlerine oturtuyor. */
.track {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  will-change: transform;
}

.card {
  position: relative;
  flex: none;
  height: 43.5svh;
  max-height: 55rem;
  width: auto;
  aspect-ratio: var(--r, 16 / 10);
  border-radius: 2rem;
  overflow: hidden;
  background: transparent;
}

/* Telefonda ekran dar ve uzun; kartlar yatay oranlı olduğu için boyu genişlik
   belirliyor. Genişliği açmak kartı büyütmenin tek yolu. */
@media (max-width: 649px) {
  .card {
    height: auto;
    width: 86vw;
    max-height: none;
    border-radius: 1.5rem;
  }

  .track { gap: 1.6rem; }
}

/* Görselleri WebGL çiziyor; bu katman yalnızca yedek (bkz. body.no-gl) */
.card-media { display: none; }
body.no-gl .card-media { display: block; }

.card-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  transition: transform 0.9s var(--ease);
}

body.no-gl .card.is-hover .card-media { transform: scale(1.12); }

.card-foot {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}

@media (min-width: 650px) {
  .card-foot { left: 2rem; right: 2rem; }
}

.card-title {
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.05em;
  white-space: nowrap;
  text-shadow: 0 0.1rem 2rem rgba(0, 0, 0, 0.45);
}

@media (min-width: 650px) {
  .card-title { font-size: 1.8rem; }
}

.card-go {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #000;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.card-go svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card.is-hover .card-go { opacity: 1; transform: scale(1); }


/* --- "Tümü" metin listesi ------------------------------------------------- */

.index-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s var(--ease);
}

body.view-full .index-view { opacity: 1; pointer-events: auto; }
body.view-full .stage,
body.view-full .gl { opacity: 0; pointer-events: none; filter: blur(1.2rem); }

.index-list {
  width: 100%;
  max-width: 78rem;
  padding: 0 var(--pad-x);
  max-height: 70svh;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 4rem, #000 calc(100% - 4rem), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 4rem, #000 calc(100% - 4rem), transparent 100%);
}

.index-list::-webkit-scrollbar { display: none; }

.index-list li { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.index-list li:first-child { border-top: 1px solid rgba(255, 255, 255, 0.12); }

.index-list button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  padding: 1.6rem 0;
  text-align: left;
  opacity: 0.55;
  transition: opacity 0.4s var(--ease), padding 0.5s var(--ease);
}

.index-list button:hover { opacity: 1; padding-left: 1.2rem; }

.index-name {
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.04em;
}

@media (min-width: 650px) {
  .index-name { font-size: 3.2rem; }
}

.index-meta { flex: none; opacity: 0.6; }

.index-preview {
  position: fixed;
  top: 0; left: 0;
  width: 26rem;
  aspect-ratio: 4 / 3;
  border-radius: 1rem;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  translate: -50% -50%;
  scale: 0.9;
  transition: opacity 0.4s var(--ease), scale 0.6s var(--ease);
  z-index: 21;
}

.index-preview.is-on { opacity: 1; scale: 1; }

@media (max-width: 649px) { .index-preview { display: none; } }


/* --- Ortadaki paneller ---------------------------------------------------- */

.panel {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--pad-x);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}

.panel.is-open { opacity: 1; pointer-events: auto; }

.panel-inner {
  width: 100%;
  max-width: 45rem;
  text-align: center;
}

.panel-project .panel-inner { max-width: 52rem; }

/* İçerik kademeli beliriyor */
.panel-inner > * {
  opacity: 0;
  transform: translateY(1.2rem);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.panel.is-open .panel-inner > * { opacity: 1; transform: none; }
.panel.is-open .panel-inner > *:nth-child(1) { transition-delay: 0.06s; }
.panel.is-open .panel-inner > *:nth-child(2) { transition-delay: 0.12s; }
.panel.is-open .panel-inner > *:nth-child(3) { transition-delay: 0.18s; }
.panel.is-open .panel-inner > *:nth-child(4) { transition-delay: 0.24s; }

.panel-bio {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.panel-stats { margin: 3rem 0 0; opacity: 0.6; }

.panel-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.8rem 2rem;
  margin-top: 3rem;
}

.panel-links a {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: opacity 0.3s var(--ease);
}

.panel-links a:hover { opacity: 0.6; }

/* Proje paneli */
.project-meta { margin: 0 0 1.5rem; opacity: 0.6; }

.project-title {
  margin: 0 0 1.5rem;
  font-size: 3.4rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

@media (min-width: 650px) {
  .project-title { font-size: 4.6rem; }
}

.project-link {
  display: inline-block;
  margin-top: 3rem;
  padding: 1.1rem 2rem;
  border-radius: 4rem;
  background: #fff;
  color: #000;
  transition: opacity 0.3s var(--ease);
}

.project-link:hover { opacity: 0.75; }
.project-link[hidden] { display: none; }

/* İletişim formu */
.contact-form {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  max-width: 32rem;
  margin: 3rem auto 0;
}

.field {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 4.5rem;
  border-radius: 4rem;
  background: rgba(255, 255, 255, 0.1);
}

.field input {
  width: 100%;
  height: 100%;
  padding: 0 2rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: max(1.4rem, 16px);
  letter-spacing: inherit;
  outline: none;
}

.field input::placeholder { color: rgba(255, 255, 255, 0.4); }

.contact-form button {
  width: 4.5rem;
  height: 4.5rem;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #000;
  transition: opacity 0.3s var(--ease);
}

.contact-form button:hover { opacity: 0.75; }

.contact-form svg {
  width: 1.6rem;
  height: 1.6rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-status {
  margin: 1.5rem 0 0;
  min-height: 1.2em;
  opacity: 0.6;
}


/* --- Sabit arayüz --------------------------------------------------------- */

.ui {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--pad-y) var(--pad-x);
  pointer-events: none;
}

.ui-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.ui-bottom { align-items: flex-end; }

.ui-cluster { display: flex; align-items: center; gap: 2rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  pointer-events: auto;
  position: relative;
  transition: opacity 0.3s var(--ease);
}

.brand:hover { opacity: 0.6; }
.brand::before { content: ''; position: absolute; inset: -1.5rem; }

.brand-mark {
  height: 4.4rem;
  width: auto;
  display: block;
}

/* Dar ekranda logo zaten "ROMIXSTUDIO" yazıyor; yanındaki metin üst satırı
   taşırıyordu. Görünürden kaldırıp ekran okuyucular için yerinde bırakıyoruz. */
@media (max-width: 649px) {
  .brand-mark { height: 3.4rem; }
  #brandText {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Kapatma tuşu yalnızca bir panel açıkken görünür; dil ve profil
   düğmelerinin yerini alır ki köşe kalabalıklaşmasın. */
.ui-close {
  display: none;
  align-items: center;
  gap: 0.6rem;
}

.ui-close svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

body.has-panel .ui-close { display: inline-flex; }
body.has-panel #btnLang,
body.has-panel #navServices,
body.has-panel #btnProfile { display: none; }

.ui .link,
.nav button {
  pointer-events: auto;
  position: relative;
  transition: opacity 0.3s var(--ease);
}

/* Minik metinlerin tıklama alanını büyütür */
.ui .link::before,
.nav button::before {
  content: '';
  position: absolute;
  inset: -1.5rem;
}

.ui .link:hover { opacity: 0.6; }

#btnLang .sep { margin: 0 0.4rem; opacity: 0.4; }
#btnLang .dim { opacity: 0.4; transition: opacity 0.3s var(--ease); }
#btnLang:hover .dim { opacity: 1; }

.nav {
  display: flex;
  gap: 0.5rem;
  pointer-events: auto;
}

.nav button { opacity: 0.5; }
.nav button.is-active,
.nav button:hover { opacity: 1; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}

body.has-panel .scrim { opacity: 0.5; pointer-events: auto; }
body.has-panel .stage,
body.has-panel .gl { filter: blur(0.9rem); opacity: 0.5; }
body.view-full.has-panel .index-view { filter: blur(0.9rem); opacity: 0.45; }

body.is-loading .ui,
body.is-loading .gl,
body.is-loading .stage { opacity: 0; }


@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
