/* ==========================================================================
   kasımpatı — bir kasım gecesi bahçesi
   Palet
     --gece    #0e0914  gece mürdümü (zemin)
     --sis     #2a2338  ay sisi
     --bordo   #7e1f33  bordo kasımpatı
     --bakir   #c8672c  bakır
     --altin   #e7b04a  altın
     --inci    #f2e8d5  inci (metin)
   ========================================================================== */

/* Cormorant Garamond italic — latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cormorant Garamond italic — latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cormorant Garamond normal — latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cormorant Garamond normal — latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Jost normal — latin-ext */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url('../fonts/jost-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Jost normal — latin */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url('../fonts/jost-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --gece: #0e0914;
  --sis: #2a2338;
  --bordo: #7e1f33;
  --bakir: #c8672c;
  --altin: #e7b04a;
  --inci: #f2e8d5;

  --serif: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --sans: 'Jost', 'Futura', 'Avenir Next', system-ui, sans-serif;

  /* şiir ölçeği: genişliğe ve yüksekliğe birlikte bağlı */
  --verse-size: clamp(1.9rem, min(10.2vw, 7.2vh), 5.4rem);
}

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

html,
body {
  height: 100%;
}

body {
  background:
    radial-gradient(120% 70% at 50% 110%, #2a1b36 0%, transparent 60%),
    linear-gradient(180deg, #07050c 0%, #120b1d 45%, #1f1429 75%, #0b0710 100%);
  background-color: var(--gece);
  color: var(--inci);
  font-family: var(--serif);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='9' fill='none' stroke='%23f2e8d5' stroke-opacity='.55' stroke-width='1'/%3E%3Ccircle cx='14' cy='14' r='1.6' fill='%23e7b04a'/%3E%3C/svg%3E") 14 14, crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.is-day .scene {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='9' fill='none' stroke='%2324162c' stroke-opacity='.55' stroke-width='1'/%3E%3Ccircle cx='14' cy='14' r='1.6' fill='%239a4c12'/%3E%3C/svg%3E") 14 14, crosshair;
}

/* ---------- katmanlar ---------- */

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.layer--sky {
  opacity: 0;
  transition: opacity 2.4s ease;
}

.is-awake .layer--sky {
  opacity: 1;
}

/* kenar kararması + çok hafif film greni */
.veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(130% 95% at 50% 40%, transparent 55%, rgba(5, 3, 8, 0.72) 100%);
  transition: opacity 3s ease;
}

.is-day .veil {
  opacity: 0.32;
}

.veil::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.045;
}

/* ---------- şiir ---------- */

.verse {
  --ink: var(--inci);
  --ink-soft: rgba(242, 232, 213, 0.58);
  --accent: var(--altin);
  --accent-soft: #f0cf86;
  --ink-glow: rgba(242, 232, 213, 0.14);
  --accent-glow: rgba(231, 176, 74, 0.28);
  position: absolute;
  left: 0;
  right: 0;
  top: max(8vh, calc(env(safe-area-inset-top) + 3.5rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  padding: 0 1.25rem;
}

/* okunabilirlik: gece şiirin ardında yumuşak bir karanlık, gündüz yumuşak bir aydınlık */
.verse::before,
.verse::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(118vw, 60rem);
  height: 165%;
  transform: translate(-50%, -50%);
  z-index: -1;
  transition: opacity 3s ease;
}

.verse::before {
  background: radial-gradient(closest-side, rgba(10, 6, 15, 0.62), rgba(10, 6, 15, 0.28) 55%, transparent);
}

.verse::after {
  background: radial-gradient(closest-side, rgba(252, 249, 244, 0.42), rgba(252, 249, 244, 0.16) 55%, transparent);
  opacity: 0;
}

.is-day .verse {
  --ink: #24162c;
  --ink-soft: rgba(36, 22, 44, 0.64);
  --accent: #9a4c12;
  --accent-soft: #b8661f;
  --ink-glow: rgba(255, 252, 246, 0.55);
  --accent-glow: rgba(255, 244, 222, 0.6);
}

.is-day .verse::before {
  opacity: 0;
}

.is-day .verse::after {
  opacity: 1;
}

.verse__mark {
  width: calc(var(--verse-size) * 0.62);
  height: auto;
  margin-bottom: calc(var(--verse-size) * 0.32);
  overflow: visible;
  opacity: 0;
  transform: scale(0.6) rotate(-40deg);
  transition: opacity 1.8s ease, transform 2.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.verse__mark use,
.verse__mark ellipse {
  fill: none;
  stroke: var(--accent);
  transition: stroke 3s ease;
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.verse__mark-inner use {
  stroke: var(--accent-soft);
}

.verse__mark-core {
  fill: var(--accent);
  transition: fill 3s ease;
}

.is-awake .verse__mark {
  opacity: 0.85;
  transform: none;
}

/*
  "kasım" kökü dört satırda aynı dikey eksene hizalanır:
  sol sütun (ön ek) sağa, sağ sütun (kök + ek) sola yaslı.
*/
.verse__poem {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  column-gap: 0.26em;
  row-gap: 0.02em;
  font-size: var(--verse-size);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: 0.005em;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

.verse__pre {
  justify-self: end;
  color: var(--ink-soft);
  transition: color 3s ease;
  font-weight: 300;
  white-space: nowrap;
}

.verse__word {
  justify-self: start;
  color: var(--ink);
  font-weight: 400;
  white-space: nowrap;
  text-shadow: 0 0 0.6em var(--ink-glow);
  transition: color 3s ease, text-shadow 3s ease;
}

.verse__word i {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
  text-shadow: 0 0 0.5em var(--accent-glow);
  transition: color 3s ease, text-shadow 3s ease;
  padding-left: 0.015em;
}

/* harf harf açılış (JS böldükten sonra) */
.ch {
  display: inline-block;
  opacity: 0;
  filter: blur(0.18em);
  transform: translateY(0.32em);
  animation: ch-in 1.5s cubic-bezier(0.2, 0.7, 0.15, 1) forwards;
  animation-delay: calc(var(--d, 0s) + var(--i, 0) * 52ms);
  animation-play-state: paused;
}

.verse__word i .ch {
  font-style: italic;
}

.is-awake .ch {
  animation-play-state: running;
}

.is-instant .ch {
  animation: none;
  opacity: 1;
  filter: none;
  transform: none;
}

@keyframes ch-in {
  60% {
    filter: blur(0);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

/* ---------- ipucu ---------- */

.hint {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + clamp(1rem, 3.2vh, 1.8rem));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 2rem);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(0.62rem, 0.55rem + 0.25vw, 0.76rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(242, 232, 213, 0.62);
  text-shadow: 0 0 12px rgba(8, 5, 12, 0.95), 0 0 2px rgba(8, 5, 12, 0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hint.is-shown {
  opacity: 1;
}

/* ---------- erişilebilirlik ---------- */

@media (prefers-reduced-motion: reduce) {
  .ch {
    filter: none;
    transform: none;
    animation-name: ch-fade;
    animation-duration: 0.9s;
    animation-delay: calc(var(--d, 0s) * 0.3);
  }

  .verse__mark {
    transform: none;
    transition: opacity 0.9s ease;
  }

  @keyframes ch-fade {
    to {
      opacity: 1;
    }
  }
}

@media (orientation: portrait) and (max-width: 820px) {
  .verse {
    top: max(11vh, calc(env(safe-area-inset-top) + 3.5rem));
  }
}

@media (max-width: 520px) {
  .verse__poem {
    column-gap: 0.22em;
  }

  .hint {
    letter-spacing: 0.18em;
  }
}
