@font-face {
  font-family: 'Reisinger Yonatan';
  src: url('assets/fonts/Reisinger-Yonatan-Regular.woff2') format('woff2'),
       url('assets/fonts/Reisinger-Yonatan-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.55);
  --text-faint: rgba(255, 255, 255, 0.32);
}

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

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
}

/* ─── Background image ───────────────────────────────────── */

.bg {
  position: fixed;
  inset: -6%;
  background-image: url('assets/hero.webp');
  background-size: cover;
  background-position: center;
  filter: grayscale(1) brightness(0.55) contrast(1.05);
  z-index: -2;
  opacity: 0;
  --px: 0px;
  --py: 0px;
  animation: bg-in 2.4s ease forwards, ambient-bg 26s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes ambient-bg {
  0%   { transform: translate(calc(0px + var(--px)), calc(0px + var(--py))) scale(1.04); }
  50%  { transform: translate(calc(-12px + var(--px)), calc(8px + var(--py))) scale(1.07); }
  100% { transform: translate(calc(10px + var(--px)), calc(-10px + var(--py))) scale(1.04); }
}

main {
  --px: 0px;
  --py: 0px;
  will-change: transform;
  animation: ambient-content 32s ease-in-out infinite alternate;
}

@keyframes ambient-content {
  0%   { transform: translate(calc(0px + var(--px)), calc(0px + var(--py))); }
  50%  { transform: translate(calc(4px + var(--px)), calc(-3px + var(--py))); }
  100% { transform: translate(calc(-3px + var(--px)), calc(4px + var(--py))); }
}

.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.7) 100%);
}

@keyframes bg-in {
  to { opacity: 1; }
}

/* ─── Lyrics atmospheric layer (full-screen scrolling columns) ─ */

.lyrics-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 300;
  color: #fff;
  direction: rtl;
  opacity: 0;
}

.lyrics-layer.base {
  z-index: -1;
  animation: lyrics-fade-base 3.5s ease 1s forwards;
}

.lyrics-layer.highlight {
  z-index: 0;
  animation: lyrics-fade-highlight 3.5s ease 1.4s forwards;
  -webkit-mask-image: radial-gradient(circle 280px at var(--cx, -500px) var(--cy, -500px),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.45) 55%,
    transparent 100%);
  mask-image: radial-gradient(circle 280px at var(--cx, -500px) var(--cy, -500px),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.45) 55%,
    transparent 100%);
}

@keyframes lyrics-fade-base {
  to { opacity: 0.13; }
}

@keyframes lyrics-fade-highlight {
  to { opacity: 0.48; }
}

.lyric-column {
  position: absolute;
  top: 0;
  height: 100%;
  width: 12.5%;
  overflow: hidden;
}

.lyric-inner {
  position: absolute;
  top: 0;
  width: 100%;
  will-change: transform;
}

.lyric-column.up .lyric-inner {
  animation: lyric-scroll-up linear infinite;
}

.lyric-column.down .lyric-inner {
  animation: lyric-scroll-down linear infinite;
}

@keyframes lyric-scroll-up {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

@keyframes lyric-scroll-down {
  from { transform: translateY(-50%); }
  to   { transform: translateY(0); }
}

.lyric-line {
  display: block;
  padding: 4px 10px 4px 4px;
  text-align: right;
  line-height: 1.7;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transform-origin: right center;
}

@media (max-width: 800px) {
  .lyric-column { width: 25%; }
  .lyric-column:nth-child(n+5) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lyric-column.up .lyric-inner,
  .lyric-column.down .lyric-inner {
    animation: none !important;
  }
}

/* ─── Dense fine grain ───────────────────────────────────── */

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
  animation: grain 0.6s steps(8) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-3%, -2%); }
  20%  { transform: translate(2%, 3%); }
  30%  { transform: translate(-2%, 4%); }
  40%  { transform: translate(4%, -1%); }
  50%  { transform: translate(-4%, 2%); }
  60%  { transform: translate(1%, -3%); }
  70%  { transform: translate(-1%, 4%); }
  80%  { transform: translate(3%, -2%); }
  90%  { transform: translate(-2%, 1%); }
  100% { transform: translate(0, 0); }
}

/* ─── Content ────────────────────────────────────────────── */

main {
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.panel {
  padding: 40px 32px 32px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px) saturate(110%);
  -webkit-backdrop-filter: blur(14px) saturate(110%);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.name {
  font-family: 'Reisinger Yonatan', 'Frank Ruhl Libre', serif;
  font-weight: 400;
  font-size: clamp(52px, 11vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 48px;
  white-space: nowrap;
}

html[lang="en"] .name {
  font-size: clamp(40px, 9vw, 72px);
  letter-spacing: -0.045em;
}

.name span {
  display: inline-block;
  opacity: 0;
  color: #0a2540;
  animation: typewriter 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.name span.instant {
  animation: none;
  opacity: 1;
  color: #fff;
}

@keyframes typewriter {
  0%   { opacity: 0; color: #0a2540; }
  40%  { opacity: 1; color: #0a2540; }
  100% { opacity: 1; color: #ffffff; }
}

.signup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 1.4s cubic-bezier(0.19, 1, 0.22, 1) 1.6s forwards;
}

.signup input[type="email"] {
  width: 100%;
  padding: 13px 2px;
  font-family: inherit;
  font-size: 15px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text);
  text-align: right;
  outline: none;
  transition: border-color 0.4s ease;
}

html[lang="en"] .signup input[type="email"] {
  text-align: left;
}

.signup input[type="email"]::placeholder {
  color: var(--text-faint);
  font-weight: 300;
}

.signup input[type="email"]:focus {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.signup button {
  margin-top: 4px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.32);
  cursor: pointer;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.signup button:hover {
  background: #d4956c;
  color: #1a0e05;
  border-color: #d4956c;
}

.signup button:disabled {
  opacity: 0.4;
  cursor: default;
}

.hp {
  position: absolute;
  left: -9999px;
  visibility: hidden;
}

.success {
  font-size: 15px;
  margin-bottom: 40px;
  letter-spacing: 0.02em;
  line-height: 1.6;
  opacity: 0;
  color: #0a2540;
  animation: success-fade 3s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
}

/* ─── Language toggle ────────────────────────────────────── */

.lang-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Heebo', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.14em;
  padding: 6px 11px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
  opacity: 0;
  animation: fadeUp 1.4s cubic-bezier(0.19, 1, 0.22, 1) 2.6s forwards;
}

.lang-toggle:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

@keyframes success-fade {
  from { opacity: 0; color: #0a2540; }
  to   { opacity: 1; color: #ffffff; }
}

.links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  opacity: 0;
  animation: fadeUp 1.4s cubic-bezier(0.19, 1, 0.22, 1) 2.4s forwards;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-soft);
  transition: color 0.3s ease, transform 0.3s ease;
}

.links a:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.links svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 480px) {
  .panel {
    padding: 32px 24px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .name span,
  .signup,
  .links,
  .success,
  .bg {
    animation: none;
    opacity: 1;
    transform: none;
    color: #ffffff;
  }
  .grain {
    animation: none;
  }
}
