/* ============================================================
   CVK Marble & Stone — Taşın İçinden
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --ink: #e8e4dd;
  --ink-dim: rgba(232, 228, 221, 0.55);
  --ink-faint: rgba(232, 228, 221, 0.28);
  --hair: rgba(232, 228, 221, 0.16);
  --serif: "Cormorant Garamond", Georgia, serif;
  --grot: "Space Grotesk", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--grot);
  -webkit-font-smoothing: antialiased;
}

body { cursor: none; }
@media (pointer: coarse) { body { cursor: auto; } #cursor { display: none; } }

a { color: inherit; text-decoration: none; cursor: none; }
@media (pointer: coarse) { a { cursor: pointer; } }

/* ---------- Canvas ---------- */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Özel imleç ---------- */
#cursor {
  position: fixed;
  top: 0; left: 0;
  width: 88px; height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  border: 1px solid rgba(232, 228, 221, 0.35);
  pointer-events: none;
  z-index: 90;
  transition: transform 0.45s var(--ease), opacity 0.45s ease, border-color 0.3s ease;
  transform: scale(0.35);
}
#cursor::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 3px; height: 3px;
  margin: -1.5px;
  border-radius: 50%;
  background: var(--ink);
}
#cursor.is-down { transform: scale(0.22); }
#cursor.is-link { transform: scale(0.6); border-color: rgba(232, 228, 221, 0.8); }

/* ---------- Yükleme perdesi ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 1.1s ease 0.15s, visibility 0s linear 1.3s;
}
#loader.done { opacity: 0; visibility: hidden; }

.loader-mark {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(44px, 6vw, 76px);
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.55; } }

.loader-line {
  width: min(320px, 60vw);
  height: 1px;
  background: var(--hair);
  overflow: hidden;
}
#loader-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.loader-meta {
  display: flex;
  width: min(320px, 60vw);
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- Perdeler (giriş / final) ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}
.veil.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s ease;
}
#finale.on { pointer-events: auto; }

/* ---------- Giriş ---------- */
#intro { background: radial-gradient(ellipse at center, rgba(10,10,10,0.18) 0%, rgba(10,10,10,0.62) 100%); }

.intro-mark {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(96px, 19vw, 300px);
  line-height: 0.9;
  letter-spacing: 0.14em;
  margin-right: -0.14em;
  text-shadow: 0 2px 60px rgba(0,0,0,0.55);
}
.intro-tag {
  margin-top: 18px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 3vw, 34px);
  letter-spacing: 0.08em;
  color: var(--ink);
}
.intro-tag span { display: inline-block; }
.intro-sub {
  margin-top: 26px;
  font-size: 10px;
  letter-spacing: 0.44em;
  margin-right: -0.44em;
  color: var(--ink-dim);
}

/* Giriş harf animasyonu */
#intro .intro-mark, #intro .intro-tag, #intro .intro-sub {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease), filter 1.4s var(--ease);
}
#intro.on .intro-mark { opacity: 1; transform: none; filter: none; transition-delay: 0.1s; }
#intro.on .intro-tag  { opacity: 1; transform: none; filter: none; transition-delay: 0.42s; }
#intro.on .intro-sub  { opacity: 1; transform: none; filter: none; transition-delay: 0.72s; }
#intro.off .intro-mark, #intro.off .intro-tag, #intro.off .intro-sub {
  opacity: 0;
  transform: translateY(-20px);
  filter: blur(8px);
  transition-duration: 0.7s;
}

/* ---------- Sabit arayüz ---------- */
#chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(20px, 3.4vh, 34px) clamp(22px, 3.6vw, 48px);
  opacity: 0;
  transition: opacity 1s ease;
}
#chrome.on { opacity: 1; }
#chrome:not(.on) { pointer-events: none; }

.brand {
  font-size: 13px;
  letter-spacing: 0.34em;
  font-weight: 500;
}
.brand em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  margin-left: 6px;
}

.index {
  font-size: 11px;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
}
.index i { font-style: normal; margin: 0 6px; color: var(--ink-faint); }
.index #idx-cur { color: var(--ink); }

/* ---------- Taş etiketi ---------- */
#stone-label {
  position: fixed;
  left: clamp(22px, 3.6vw, 48px);
  bottom: clamp(26px, 5vh, 56px);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}
#stone-label.on { opacity: 1; }

#stone-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 6.4vw, 92px);
  line-height: 1;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}
#stone-name .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) rotate(2.5deg);
  filter: blur(4px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease);
}
#stone-name.in .ch { opacity: 1; transform: none; filter: none; }
#stone-name .ch.sp { width: 0.28em; }

#stone-sub {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease 0.25s, transform 0.7s var(--ease) 0.25s;
}
#stone-name.in + #stone-sub { opacity: 1; transform: none; }

/* ---------- Sağ ray ---------- */
#rail {
  position: fixed;
  right: clamp(20px, 3vw, 42px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transition: opacity 1s ease;
}
#rail.on { opacity: 1; }
#rail b {
  display: block;
  width: 14px;
  height: 1px;
  background: var(--ink-faint);
  transform-origin: right;
  transition: transform 0.6s var(--ease), background 0.6s ease;
}
#rail b.act {
  background: var(--ink);
  transform: scaleX(1.9);
}

/* ---------- Kaydırma ipucu ---------- */
#hint {
  position: fixed;
  bottom: calc(clamp(26px, 5vh, 56px) + env(safe-area-inset-bottom, 0px));
  right: max(clamp(22px, 3.6vw, 48px), env(safe-area-inset-right, 0px));
  z-index: 50;
  display: grid;
  justify-items: end;
  gap: 10px;
  width: 184px;
  color: rgba(232, 228, 221, 0.9);
  text-shadow: 0 1px 8px #0a0a0a, 0 0 20px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}
#hint.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease;
}
#hint-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.025em;
}
.hint-action {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.22em;
  white-space: nowrap;
}
.hint-mouse {
  display: none;
  position: relative;
  width: 14px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 8px;
}
.hint-mouse::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 5px;
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  animation: scroll-wheel 1.8s ease-in-out infinite;
}
.hint-arrow { display: block; transition: transform 0.5s var(--ease); }
#hint.is-end .hint-arrow { transform: rotate(180deg); }
#hint.is-end .hint-mouse::after { animation-direction: reverse; }
.hint-track {
  width: 100%;
  height: 1px;
  margin-top: 3px;
  background: rgba(232, 228, 221, 0.25);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
#hint-progress {
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
}
@keyframes scroll-wheel {
  0%, 15% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  80%, 100% { transform: translateY(7px); opacity: 0; }
}
@media (hover: hover) and (pointer: fine) {
  .hint-mouse { display: block; }
}

/* ---------- Galeri çıkışı: Explore more ---------- */
#explore {
  position: fixed;
  top: 50%;
  left: 49%;
  transform: translate(-50%, -46%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 44px 56px;
  background: radial-gradient(ellipse at center, rgba(6, 6, 6, 0.78) 0%, rgba(6, 6, 6, 0.45) 55%, transparent 78%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, transform 0.9s var(--ease), visibility 0s linear 0.9s;
}
#explore.on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
  transition: opacity 0.9s ease, transform 0.9s var(--ease);
}
#explore em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(24px, 2.6vw, 38px);
  color: var(--ink);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
#explore span {
  font-size: 11px;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  padding: 14px 30px;
  border: 1px solid rgba(232, 228, 221, 0.55);
  background: rgba(6, 6, 6, 0.55);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  transition: border-color 0.3s ease, background 0.3s ease;
}
#explore:hover span {
  border-color: var(--ink);
  background: rgba(232, 228, 221, 0.06);
}

/* ---------- Final: video + navigasyon ---------- */
#finale { justify-content: flex-end; }

#finvid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fin-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.30) 0%, rgba(10,10,10,0.10) 40%, rgba(10,10,10,0.86) 88%);
}
.fin-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-bottom: calc(clamp(26px, 5vh, 56px) + 110px + env(safe-area-inset-bottom, 0px));
}

.fin-kicker {
  font-size: 10px;
  letter-spacing: 0.46em;
  margin-right: -0.46em;
  color: var(--ink-dim);
  margin-bottom: clamp(20px, 3.5vh, 34px);
}

.fin-nav {
  display: flex;
  gap: clamp(30px, 5.5vw, 84px);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 4.5vh, 48px);
}
.fin-nav a {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(30px, 4vw, 54px);
  letter-spacing: 0.04em;
  line-height: 1.1;
  position: relative;
  transition: opacity 0.35s ease;
}
.fin-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -6px;
  height: 1px;
  background: var(--ink);
  transition: right 0.5s var(--ease);
}
.fin-nav a:hover::after { right: 0; }
.fin-nav a:hover { opacity: 0.85; }

.fin-contact {
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  flex-wrap: wrap;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  border-top: 1px solid var(--hair);
  padding-top: clamp(18px, 2.8vh, 28px);
}
.fin-contact a { color: var(--ink); transition: opacity 0.3s ease; }
.fin-contact a:hover { opacity: 0.6; }

/* Final kademeli giris */
#finale .fin-kicker, #finale .fin-nav a, #finale .fin-contact {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
#finale.on .fin-kicker { opacity: 1; transform: none; transition-delay: 0.15s; }
#finale.on .fin-nav a:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.32s; }
#finale.on .fin-nav a:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.44s; }
#finale.on .fin-nav a:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.56s; }
#finale.on .fin-contact { opacity: 1; transform: none; transition-delay: 0.8s; }

/* ---------- Ust nav ---------- */
.top-nav {
  display: flex;
  gap: clamp(18px, 2.6vw, 36px);
  pointer-events: auto;
}
.top-nav a {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.3s ease;
}
.top-nav a:hover { color: var(--ink); }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  #hint {
    left: max(22px, env(safe-area-inset-left, 0px));
    right: max(22px, env(safe-area-inset-right, 0px));
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 16px;
  }
  #hint-title { justify-self: start; font-size: 17px; }
  .hint-track { grid-column: 1 / -1; margin-top: 0; }
  .hint-action { font-size: 8px; gap: 10px; letter-spacing: 0.18em; }
  #stone-label { bottom: calc(98px + env(safe-area-inset-bottom, 0px)); }
  .fin-content { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  #stone-name { font-size: clamp(26px, 7vw, 44px); }
  #stone-sub { max-width: calc(100vw - 44px); font-size: 8px; letter-spacing: 0.2em; line-height: 1.6; }
  #rail { display: none; }
  .fin-stats { gap: 22px 34px; }
  .brand em { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.2s !important; }
  .hint-mouse::after { animation: none; }
}
