/* Meikai — animasyon katmanı (anim.js ile birlikte). Başlangıçta gizlenen her şey html.anim'e bağlı: JS çalışmazsa içerik görünür kalır. */

/* =====================================================================
   AÇILIŞ — İAİ: kanji yanar → katana kınından çekilir → tek kesik (一閃) → ekran ikiye bölünüp açılır
   ===================================================================== */
.intro { --kh: min(6.45vw, 48px); z-index: 1000 !important; background: transparent !important; overflow: hidden; animation: ki-shake .32s linear 1.88s, intro-gone 0s linear 3s forwards !important; }
@keyframes intro-gone { to { visibility: hidden; } }
@keyframes ki-shake { 0%, 100% { translate: 0 0; } 20% { translate: -7px 4px; } 40% { translate: 6px -5px; } 60% { translate: -4px 3px; } 80% { translate: 3px -2px; } }

/* İki yarım: aynı sahne, kesik çizgisiyle kırpılmış */
.ki-half { position: absolute; inset: 0; will-change: transform; }
.ki-a { clip-path: polygon(0 0, 100% 0, 100% 37.27%, 0 62.73%); animation: ki-split-a .85s cubic-bezier(.7,0,.2,1) 2.1s forwards; }
.ki-b { clip-path: polygon(0 62.1%, 100% 36.6%, 100% 100%, 0 100%); /* üstteki yarımla hafif örtüşür: kesik çizgisinde ince ışık sızıntısı (yırtık) olmasın */ animation: ki-split-b .85s cubic-bezier(.7,0,.2,1) 2.1s forwards; }
@keyframes ki-split-a { 0% { transform: none; } 22% { transform: translate(-2.5%, .6%); } 100% { transform: translate(-9%, -108%) rotate(-3deg); } }
@keyframes ki-split-b { 0% { transform: none; } 22% { transform: translate(2.5%, -.6%); } 100% { transform: translate(9%, 108%) rotate(3deg); } }
.ki-scene { position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 50%, #1d0b0c, #050404 72%); }
.ki-moon { position: absolute; left: 50%; top: 50%; width: min(78vmin, 34rem); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, rgb(179 33 43 / .22), rgb(179 33 43 / .06) 55%, transparent 70%); opacity: 0; animation: ki-fade 1.2s ease-out .1s forwards; }
.ki-kanji { position: absolute; left: 50%; bottom: calc(50% + var(--kh) / 2 + .7rem); translate: -50% 0; display: flex; gap: .04em; margin: 0; font-family: var(--jp); font-weight: 800; font-size: min(22vmin, 8rem); line-height: 1; color: #ece6dc; white-space: nowrap; }
.ki-kanji span { opacity: 0; animation: kanji-burn 1s cubic-bezier(.16,1,.3,1) forwards; }
.ki-kanji span:nth-child(1) { animation-delay: .3s; }
.ki-kanji span:nth-child(2) { animation-delay: .5s; }
@keyframes kanji-burn {
  0% { opacity: 0; transform: scale(1.5); filter: blur(16px); color: #fff; }
  35% { opacity: 1; color: #fff; text-shadow: 0 0 30px #e2323e, 0 0 60px #b3212b; }
  60% { color: #e2323e; text-shadow: 0 0 24px #b3212b; }
  100% { opacity: 1; transform: none; filter: none; color: #ece6dc; text-shadow: 0 0 40px rgb(179 33 43 / .6); }
}
.ki-name { position: absolute; left: 50%; top: calc(50% + var(--kh) / 2 + 1rem); translate: -50% 0; display: flex; gap: .2em; margin: 0; padding-left: .2em; font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 7vmin, 3.4rem); line-height: 1; color: #ece6dc; }
.ki-name span { opacity: 0; animation: glitch-in .6s steps(1, end) forwards; animation-delay: calc(.9s + var(--i, 0) * .06s); }
@keyframes glitch-in {
  0% { opacity: 1; transform: translate(-6px, 0); clip-path: inset(0 0 62% 0); color: #e2323e; }
  20% { transform: translate(5px, 0); clip-path: inset(48% 0 0 0); color: #6ff; }
  40% { transform: translate(-3px, 0); clip-path: inset(20% 0 30% 0); color: #e2323e; }
  60% { transform: translate(2px, 0); clip-path: none; color: #fff; }
  100% { opacity: 1; transform: none; clip-path: none; color: #ece6dc; }
}
.ki-vert { position: absolute; left: max(1rem, 4vw); top: 50%; translate: 0 -50%; margin: 0; writing-mode: vertical-rl; font-family: var(--jp); font-weight: 800; font-size: .95rem; letter-spacing: .5em; color: #e2323e; opacity: 0; animation: ki-fade .8s ease-out .6s forwards; }
.ki-vert::after { content: ''; display: block; width: 1px; height: 4.5rem; margin: .6rem auto 0; background: linear-gradient(#e2323e, transparent); }
@keyframes ki-fade { to { opacity: 1; } }

/* Katana: kın sağa kayar (çekiş), çelikte parıltı akar, sonra savrulup kaybolur */
.ki-draw { position: absolute; left: 50%; top: 50%; z-index: 2; width: min(86vw, 640px); translate: -50% -50%; opacity: 0; animation: ki-draw-in .45s cubic-bezier(.16,1,.3,1) .15s forwards, ki-swing .14s cubic-bezier(.7,0,.84,0) 1.72s forwards; }
.ki-katana { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 10px rgb(226 50 62 / .35)); }
@keyframes ki-draw-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ki-swing { from { opacity: 1; transform: none; filter: none; } to { opacity: 0; transform: rotate(-16deg) scaleX(1.35); filter: blur(6px) brightness(2); } }
.ki-saya { animation: ki-unsheathe .55s cubic-bezier(.65,0,.25,1) .75s forwards; }
@keyframes ki-unsheathe { 60% { opacity: 1; } to { transform: translateX(62%); opacity: 0; } }
.ki-sword { animation: ki-pull .55s cubic-bezier(.65,0,.25,1) .75s; }
@keyframes ki-pull { 50% { transform: translateX(-10px); } }
.ki-gleam { transform: translateX(0); animation: ki-gleam .5s ease-in-out 1.15s forwards; }
@keyframes ki-gleam { to { transform: translateX(560px); } }

/* Kesik: çizgi çekilir, flaş, kıvılcımlar, yarımların kenarında kor */
.ki-slash { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; clip-path: inset(0 100% 0 0); filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 18px #e2323e); animation: ki-cut .13s cubic-bezier(.5,0,.2,1) 1.8s forwards, ki-fade-out .4s ease-out 2.2s forwards; }
.ki-slash line { stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; }
@keyframes ki-cut { to { clip-path: inset(0 0 0 0); } }
@keyframes ki-fade-out { to { opacity: 0; } }
.ki-edge { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; filter: drop-shadow(0 0 8px #e2323e); animation: ki-fade .15s linear 1.95s forwards; }
.ki-edge line { stroke: #e2323e; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.ki-flash { position: absolute; inset: 0; z-index: 4; background: #fff; opacity: 0; pointer-events: none; animation: ki-flash .5s ease-out 1.86s; }
@keyframes ki-flash { 0% { opacity: 0; } 12% { opacity: .55; } 30% { opacity: .2; background: #e2323e; } 100% { opacity: 0; background: #e2323e; } }
.ki-sparks i { position: absolute; z-index: 3; left: var(--x); top: var(--y); width: 2px; height: 16px; margin: -8px 0 0 -1px; border-radius: 2px; background: linear-gradient(#fff, #e2323e); box-shadow: 0 0 8px #e2323e; opacity: 0; rotate: var(--a); animation: ki-spark .6s cubic-bezier(.16,1,.3,1) calc(1.88s + var(--d)) forwards; }
@keyframes ki-spark { 0% { opacity: 1; transform: translateY(0) scaleY(.4); } 100% { opacity: 0; transform: translateY(-70px) scaleY(1.4); } }
@media (prefers-reduced-motion: reduce) { .intro { display: none !important; } }
/* Sayfa çizilene kadar her şey ilk karesinde bekler (bkz. sayfa başındaki intro-wait betiği) */
html.intro-wait *, html.intro-wait *::before, html.intro-wait *::after { animation-play-state: paused !important; }
.intro-out .intro { opacity: 0; transition: opacity .35s ease-out; }

/* Ana sayfa hero girişi intro perdesi açılırken başlar */
html:not(.skip-intro) .pg-home .hero-word span, html:not(.skip-intro) .pg-home .hero-kanji span { animation-delay: calc(var(--d, 0s) + 2.35s) !important; }
html:not(.skip-intro) .pg-home .hero-moon { animation-delay: 2.2s !important; }

/* =====================================================================
   HERO: paralaks, ay nabzı, harf glitch
   ===================================================================== */
.hero-moon { translate: var(--mx2, 0px) calc(var(--my2, 0px) + var(--sy, 0px)); }
.hero-moon::before { content: ''; position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(circle, transparent 58%, rgb(226 50 62 / .25) 66%, transparent 72%); animation: moon-pulse 4.5s ease-in-out infinite; pointer-events: none; }
@keyframes moon-pulse { 0%, 100% { opacity: .35; transform: scale(.98); } 50% { opacity: 1; transform: scale(1.04); } }
.hero-kanji { translate: var(--mx3, 0px) calc(var(--my3, 0px) + var(--sy2, 0px)); }
.hero-word { translate: var(--mx1, 0px) var(--my1, 0px); }
.hero-word span { position: relative; cursor: default; }
.hero-word.ready span { animation: none !important; opacity: 1; transform: none; }
.hero-word.ready span.glitch, .hero-word.ready span:hover { animation: letter-glitch .45s steps(1, end) !important; }
@keyframes letter-glitch {
  0% { text-shadow: -4px 0 #e2323e, 4px 0 #6ff; transform: translate(2px, -2px) skewX(-6deg); clip-path: inset(0 0 55% 0); }
  25% { text-shadow: 5px 0 #e2323e, -5px 0 #6ff; transform: translate(-3px, 1px); clip-path: inset(40% 0 0 0); }
  50% { text-shadow: -2px 0 #e2323e, 2px 0 #6ff; transform: translate(1px, 0) skewX(4deg); clip-path: inset(15% 0 35% 0); }
  75% { text-shadow: none; transform: none; clip-path: none; }
  100% { text-shadow: none; transform: none; clip-path: none; }
}
.hero-stats b { font-variant-numeric: tabular-nums; }

/* =====================================================================
   BAŞLIKLAR: kırmızı perde silme
   ===================================================================== */
.anim .section h2.reveal, .anim .cta-band h2.reveal, .anim .info h2.reveal, .anim .s-hero h1.reveal { position: relative; }
.anim .section h2.reveal.in, .anim .cta-band h2.reveal.in, .anim .info h2.reveal.in, .anim .s-hero h1.reveal.in { animation: wipe-text 1.1s linear forwards !important; }
.anim .section h2.reveal::before, .anim .cta-band h2.reveal::before, .anim .info h2.reveal::before, .anim .s-hero h1.reveal::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, #8e1820, #e2323e); clip-path: inset(0 100% 0 0);
}
.anim .section h2.reveal { padding-bottom: 1rem; width: fit-content; max-width: 100%; }
.anim .section h2.reveal::before { bottom: 1rem; }
.anim .section h2.reveal.in::before, .anim .cta-band h2.reveal.in::before, .anim .info h2.reveal.in::before, .anim .s-hero h1.reveal.in::before { animation: wipe-block 1.1s cubic-bezier(.77,0,.18,1) forwards; animation-delay: inherit; }
@keyframes wipe-block { 0% { clip-path: inset(0 100% 0 0); } 48% { clip-path: inset(0 0 0 0); } 52% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
@keyframes wipe-text { 0%, 49% { opacity: 1; -webkit-text-fill-color: transparent; } 50%, 100% { opacity: 1; -webkit-text-fill-color: currentColor; } }

/* Bölüm kanjileri: görünürken neon titremesi */
.sec-kanji, .page-kanji { translate: 0 var(--ky, 0px); transition: -webkit-text-stroke-color .6s, text-shadow .6s; }
.sec-kanji.lit { animation: kanji-flicker 1.8s linear forwards; }
@keyframes kanji-flicker {
  0% { -webkit-text-stroke-color: rgb(179 33 43 / .15); text-shadow: none; }
  8% { -webkit-text-stroke-color: rgb(226 50 62 / .95); text-shadow: 0 0 30px rgb(226 50 62 / .6); }
  12% { -webkit-text-stroke-color: rgb(179 33 43 / .2); text-shadow: none; }
  20% { -webkit-text-stroke-color: rgb(226 50 62 / .9); text-shadow: 0 0 40px rgb(226 50 62 / .5); }
  26% { -webkit-text-stroke-color: rgb(179 33 43 / .25); text-shadow: none; }
  40%, 100% { -webkit-text-stroke-color: rgb(226 50 62 / .6); text-shadow: 0 0 50px rgb(179 33 43 / .35); }
}

/* Proje görselleri: aşağıdan kırmızı perdeyle açılır */
.anim .project-media { clip-path: inset(100% 0 0 0); }
.anim .project-media.lit { animation: media-in 1.2s cubic-bezier(.77,0,.18,1) forwards; }
.anim .project-media::before { content: ''; position: absolute; inset: 0; z-index: 3; background: #b3212b; transform: translateY(0); pointer-events: none; }
.anim .project-media.lit::before { animation: media-cover 1.2s cubic-bezier(.77,0,.18,1) forwards; }
@keyframes media-in { to { clip-path: inset(0 0 0 0); } }
@keyframes media-cover { 0%, 45% { transform: translateY(0); } 100% { transform: translateY(-101%); } }

/* Torii: görünürken yükselir ve parlar */
.anim .torii { opacity: 0; translate: 0 60px; scale: .92; transition: opacity 1.4s, translate 1.6s cubic-bezier(.16,1,.3,1), scale 1.6s cubic-bezier(.16,1,.3,1); }
.anim .torii.lit { opacity: .18; translate: 0 0; scale: 1; animation: torii-breathe 5s ease-in-out 1.6s infinite; }
@keyframes torii-breathe { 50% { opacity: .26; filter: drop-shadow(0 0 70px rgb(226 50 62 / 1)); } }

/* Kayan bant: kaydırma hızına göre eğilir */
.fx-track span { transform: skewX(var(--sk, 0deg)); }

/* =====================================================================
   BUTONLAR & KARTLAR
   ===================================================================== */
.cta, .btn, .buy { position: relative; overflow: hidden; }
.cta::after, .btn::after, .buy::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / .35) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
.cta:hover::after, .btn:hover::after, .buy:hover:not(:disabled)::after { transform: translateX(120%); transition: transform .75s cubic-bezier(.16,1,.3,1); }
.cta > *, .btn > *, .buy > * { position: relative; z-index: 1; }
.stage::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(115deg, transparent 38%, rgb(255 255 255 / .14) 50%, transparent 62%); transform: translateX(-110%); }
.card:hover .stage::after { transform: translateX(110%); transition: transform 1s cubic-bezier(.16,1,.3,1); }
.shot:hover img { animation: shot-glitch .5s steps(1, end); }
@keyframes shot-glitch {
  0% { clip-path: inset(10% 0 70% 0); transform: translateX(-6px) scale(1.04); filter: hue-rotate(-20deg) saturate(1.6); }
  20% { clip-path: inset(60% 0 15% 0); transform: translateX(6px) scale(1.04); }
  40% { clip-path: inset(30% 0 40% 0); transform: translateX(-3px) scale(1.04); filter: none; }
  60%, 100% { clip-path: none; transform: scale(1.04); }
}
.lb.open img { animation: lb-in .55s cubic-bezier(.16,1,.3,1); }
@keyframes lb-in { from { opacity: 0; transform: scale(.92); filter: blur(8px) brightness(2); } }
.disc li:hover h3 { text-shadow: 3px 0 rgb(10 9 8 / .5); }
.crafts li:hover .num { animation: num-pop .5s cubic-bezier(.16,1,.3,1); color: #e2323e; }
@keyframes num-pop { 40% { transform: scale(1.25) rotate(-6deg); } }

/* Menü: açılırken kırmızı panel süpürür */
.drawer:has(.drawer-links)::before {
  content: ''; position: absolute; inset: 0; top: 0; right: 0; width: auto; height: auto; z-index: 3; border-radius: 0; filter: none;
  background: linear-gradient(180deg, #c5242f, #7a141b); pointer-events: none; transform: translateX(0);
}
html.drawer-open .drawer:has(.drawer-links)::before { animation: drawer-sweep .75s cubic-bezier(.77,0,.18,1) .12s forwards; }
@keyframes drawer-sweep { to { transform: translateX(-101%); } }
html.drawer-open .drawer-links a { transition-duration: .2s, .3s, .2s, .7s, .5s; }
html.drawer-open .drawer-links li:nth-child(1) a { transition-delay: .45s; }
html.drawer-open .drawer-links li:nth-child(2) a { transition-delay: .52s; }
html.drawer-open .drawer-links li:nth-child(3) a { transition-delay: .59s; }
html.drawer-open .drawer-links li:nth-child(4) a { transition-delay: .66s; }
html.drawer-open .drawer-links li:nth-child(5) a { transition-delay: .73s; }

/* =====================================================================
   İMLEÇ: "AÇ" etiketi, kıvılcım izi, tıklama patlaması, sayfa perdesi
   ===================================================================== */
#fx-ring::after { content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: .62rem; letter-spacing: .25em; text-indent: .25em; color: #fff; opacity: 0; transition: opacity .2s; }
#fx-ring.label { width: 86px; height: 86px; margin: -43px 0 0 -43px; background: rgb(179 33 43 / .85); border-color: #e2323e; backdrop-filter: blur(2px); }
#fx-ring.label::after { opacity: 1; }
#fx-trail { position: fixed; inset: 0; z-index: 9990; width: 100%; height: 100%; pointer-events: none; }
.fx-burst { position: fixed; z-index: 9995; width: 0; height: 0; pointer-events: none; }
.fx-burst i { position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; background: #e2323e; box-shadow: 0 0 8px #e2323e; animation: shard .65s cubic-bezier(.16,1,.3,1) forwards; }
.fx-burst b { position: absolute; left: -30px; top: -30px; width: 60px; height: 60px; border: 1.5px solid #e2323e; border-radius: 50%; animation: ring-out .6s cubic-bezier(.16,1,.3,1) forwards; }
.fx-burst s { position: absolute; left: -.6em; top: -.6em; font: 800 1.2rem/1 var(--jp); color: #e2323e; text-decoration: none; animation: kanji-pop .7s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes shard { to { transform: rotate(var(--a)) translateX(var(--r)) scale(.2); opacity: 0; } }
@keyframes ring-out { from { transform: scale(.1); opacity: 1; } to { transform: scale(1.6); opacity: 0; border-width: .5px; } }
@keyframes kanji-pop { 0% { transform: scale(.3); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-34px) scale(1.2); opacity: 0; } }
#fx-curtain { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; pointer-events: none; background: linear-gradient(180deg, #b3212b, #5e0e14); transform: translateY(101%); }
#fx-curtain span { font-family: var(--jp); font-weight: 800; font-size: min(30vmin, 12rem); color: #0a0908; opacity: .9; }
html.fx-leave body { opacity: 1 !important; }
html.fx-leave #fx-curtain { transform: none; transition: transform .22s cubic-bezier(.77,0,.18,1); }
#fx-curtain.out { transform: translateY(-101%); transition: transform .7s cubic-bezier(.77,0,.18,1) .05s; }
#fx-curtain.hold { transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  .anim .project-media, .anim .torii { clip-path: none !important; opacity: .16; translate: none; scale: none; }
  .anim .project-media { opacity: 1; }
  .anim .project-media::before, .anim .section h2.reveal::before, .anim .cta-band h2.reveal::before, .anim .info h2.reveal::before, .anim .s-hero h1.reveal::before, .drawer:has(.drawer-links)::before { display: none; }
  .hero-moon::before, .sec-kanji.lit, .shot:hover img, .hero-word span:hover { animation: none !important; }
  #fx-curtain, #fx-trail { display: none; }
}
