@font-face { font-family: "Cinzel"; src: url("/assets/cinzel-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/assets/alegreya-sans-medium.woff") format("woff"); font-weight: 500; font-display: swap; }

:root {
  --ink: #030b18;
  --gold: #d4ad62;
  --gold-2: #f3dfae;
  --gold-3: #9c7a3e;
  --foam: #dbe9f2;
  --mist: #9db4c6;
  --flash: 0;
  --px: 0;
  --py: 0;
  --serif: "Cinzel", "Times New Roman", serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --emblem: min(45svh, 78vw, 520px);
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100svh;
  overflow-x: clip;
  color: var(--foam);
  font: 500 16px/1.4 var(--sans);
  background: var(--ink) url("/assets/hero.webp") center / cover no-repeat fixed;
}
html.gl body { background: var(--ink); }

canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#sea { z-index: 0; }
#sky-fx { z-index: 1; pointer-events: none; }
#rain { z-index: 4; pointer-events: none; }
html:not(.gl) #sea { display: none; }

.shade {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(120% 85% at 50% 42%, transparent 45%, rgba(1, 5, 12, .72) 100%),
    linear-gradient(to top, rgba(1, 6, 14, .82) 0, rgba(1, 6, 14, .35) 26%, transparent 46%);
  animation: lift 1.6s ease-out both;
}
@keyframes lift { from { background-color: #000; } to { background-color: transparent; } }

.stage {
  position: relative; z-index: 3;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 64px;
  text-align: center;
  pointer-events: none;
  overflow-x: clip;
}
.stage a { pointer-events: auto; }

/* Amblem */
.emblem {
  position: relative; width: var(--emblem); aspect-ratio: 1;
  transform: translate3d(calc(var(--px) * -10px), calc(var(--py) * -7px), 0);
  animation: emblem-in 1.5s .55s cubic-bezier(.16, .84, .3, 1) both;
}
@keyframes emblem-in {
  0% { opacity: 0; scale: .9; }
  12% { opacity: 1; }
  100% { opacity: 1; scale: 1; }
}
.emblem-glow {
  position: absolute; inset: -14%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(150, 195, 240, .62), rgba(90, 140, 200, .2) 52%, transparent 74%);
  opacity: calc(.3 + var(--flash) * .7);
}
.emblem-sway {
  position: absolute; inset: 0;
  transform-origin: 50% 62%;
  animation: sway 9s ease-in-out 2s infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-1.6deg) translateY(-3px); }
  50% { transform: rotate(1.6deg) translateY(5px); }
}
.emblem-img, .emblem-lit { position: absolute; inset: 0; width: 100%; height: 100%; }
.emblem-lit {
  filter: brightness(1.75) saturate(.55) contrast(1.05);
  opacity: var(--flash);
  will-change: opacity;
}

/* YAKINDA */
.title {
  margin-top: 4px;
  font: 700 min(13.5vw, 11svh, 104px)/1.05 var(--serif);
  letter-spacing: .15em;
  padding-left: .15em;
}
.letters { display: inline-flex; }
.letters span {
  position: relative; display: inline-block;
  background: linear-gradient(176deg, #fff4d2 8%, var(--gold-2) 32%, var(--gold) 58%, var(--gold-3) 92%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .85)) drop-shadow(0 0 22px rgba(0, 0, 0, .6));
  animation: letter-in .9s cubic-bezier(.2, .9, .25, 1.15) both;
}
.letters span:nth-child(1) { animation-delay: 1.15s; }
.letters span:nth-child(2) { animation-delay: 1.23s; }
.letters span:nth-child(3) { animation-delay: 1.31s; }
.letters span:nth-child(4) { animation-delay: 1.39s; }
.letters span:nth-child(5) { animation-delay: 1.47s; }
.letters span:nth-child(6) { animation-delay: 1.55s; }
.letters span:nth-child(7) { animation-delay: 1.63s; }
@keyframes letter-in {
  from { opacity: 0; transform: translateY(.45em) rotate(4deg) scale(1.15); }
  to { opacity: 1; transform: none; }
}

.subtitle {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 6px;
  font: 700 clamp(12px, 1.7svh, 15px)/1.2 var(--serif);
  letter-spacing: .42em; text-transform: uppercase; white-space: nowrap;
  color: var(--gold-2);
  animation: fade-up .9s 2s ease-out both;
}
.subtitle > span:not(.rule) { padding-left: .42em; }
.rule { width: clamp(28px, 11vw, 120px); height: 1px; background: linear-gradient(to left, var(--gold), transparent); position: relative; }
.rule.flip { background: linear-gradient(to right, var(--gold), transparent); }
.rule::after {
  content: ""; position: absolute; right: -3px; top: -3px; width: 7px; height: 7px;
  background: var(--gold); transform: rotate(45deg);
}
.rule.flip::after { right: auto; left: -3px; }

.tagline {
  margin-top: clamp(8px, 1.5svh, 14px);
  font-size: clamp(16px, 2.2svh, 20px);
  color: var(--foam);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .9);
  animation: fade-up .9s 2.2s ease-out both;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Bağlantılar */
.social {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: clamp(14px, 2.6svh, 26px);
  animation: fade-up .9s 2.45s ease-out both;
}
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid rgba(212, 173, 98, .55);
  border-radius: 3px;
  background: rgba(4, 16, 32, .62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--gold-2);
  font: 700 13px/1 var(--serif); letter-spacing: .08em;
  text-decoration: none;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn:hover, .btn:focus-visible {
  border-color: var(--gold-2); color: #fff6dd;
  background: rgba(20, 44, 72, .8);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5), 0 0 18px rgba(212, 173, 98, .28);
}
.btn.discord {
  background: linear-gradient(176deg, #f3dfae, #d4ad62 55%, #a9843f);
  border-color: #f3dfae; color: #241604;
}
.btn.discord:hover, .btn.discord:focus-visible {
  background: linear-gradient(176deg, #fff0c9, #e3bf76 55%, #b8924b); color: #1a0f02;
}
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }

/* Ses ve alt bilgi */
.sound {
  position: fixed; z-index: 5;
  top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 12px;
  border: 1px solid rgba(219, 233, 242, .24); border-radius: 3px;
  background: rgba(3, 11, 24, .5);
  color: var(--foam);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.sound:hover { border-color: var(--gold); background: rgba(14, 32, 54, .7); }
.sound svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.sound .wave { display: none; }
.sound[aria-pressed="true"] .wave { display: block; }
.sound[aria-pressed="true"] .mute { display: none; }

.foot {
  position: fixed; z-index: 3; left: 0; right: 0;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 18px;
  padding: 0 16px;
  font-size: 13px; color: var(--mist);
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
  animation: fade-up .9s 2.8s ease-out both;
}

/* Kısa ekranlar: yatay telefon vb. sayfa kaydırılabilir kalır */
@media (max-height: 560px) {
  :root { --emblem: min(58svh, 60vw); }
  .stage { justify-content: flex-start; padding-top: 8px; padding-bottom: 12px; }
  .foot { position: static; padding: 0 16px 10px; }
  .foot { z-index: 3; }
  body { display: flex; flex-direction: column; }
  .hint { display: none; }
}
@media (max-width: 420px) {
  .btn { padding: 0 14px; }
  .btn.discord { flex-basis: 100%; justify-content: center; }
  .sound #sound-label { display: none; }
  .sound { padding: 0 10px; }
}

.motion {
  border: 0; background: none; padding: 8px 4px; margin: -8px 0;
  color: var(--gold-2); font: inherit; text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; pointer-events: auto;
}

html.still *, html.still *::before, html.still *::after { animation: none !important; transition: none !important; }
html.still .emblem-lit { display: none; }
