/* Clarendon Regular (B&P Graphics, 1991) — the actual typeface Sony's
   logo is based on. Full alphabet, real glyph data for every letter. */
@font-face {
  font-family: "Clarendon";
  font-style: normal;
  font-weight: 400;
  src: url("./fonts/clarendon-regular.otf?v=3") format("opentype");
  font-display: block;
}
/* Bebas Neue — narrow display caps with near-uniform letter widths.
   Lets MISCHIEF / DIVISION sit visually balanced without manual hacks. */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #000;
  overflow: hidden;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { transition: opacity 600ms cubic-bezier(0.32, 0.72, 0, 1); }
body.fade-out { opacity: 0; }

/* ---------- shared slide ---------- */
.slide {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 1;
  transition: opacity 400ms cubic-bezier(0.32, 0.72, 0, 1);
}
.slide.show { display: block; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vh, 56px);
  padding: clamp(24px, 4vh, 60px);
}

/* ============================================================
   SLIDE 1 — original PS1-startup look, romparty copy
   ============================================================ */
.screen-1 {
  background: #fff;
  color: #2C459B;
  text-align: center;
  animation: slideIn 1s linear backwards;
}

.screen-1 .title {
  /* Real Clarendon — Sony's wordmark is a customized cut of this. */
  font-family: "Clarendon", "Clarendon BT", Rockwell, "Times New Roman", serif;
  font-size: clamp(48px, 7vw, 96px);
  color: #2C459B;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.02em;
  animation: slideIn 0.5s linear backwards;
  animation-delay: 2.5s;
}
/* Small-caps stylization: uppercase letters rendered at x-height,
   so "TEEHEE" reads with lowercase rhythm (T-ee-H-ee). */
.screen-1 .title .sc {
  font-size: 0.74em;
  vertical-align: baseline;
  letter-spacing: 0.01em;
}

.screen-1 .subtitle {
  margin: 0;
  /* Bebas Neue — narrow display caps; uniform widths balance MISCHIEF/DIVISION. */
  font-family: "Bebas Neue", "Oswald", "Helvetica Neue Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(26px, 4.4vw, 48px);
  line-height: 1;
  font-weight: 400;
  color: #0C349B;
  text-align: center;
  letter-spacing: 0.12em;
  animation: slideIn 0.5s linear backwards;
  animation-delay: 2.5s;
}
.screen-1 .subtitle .line {
  display: block;
}
.screen-1 .subtitle .line > span {
  display: inline;
}

/* ---- original red/yellow diamond (vh-based so it scales with viewport
   height and never overlaps the title or subtitle) ---- */
.screen-1 .logo-wrap {
  position: relative;
  width: clamp(220px, 38vh, 380px);
  height: clamp(220px, 38vh, 380px);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen-1 .logo {
  position: relative;
  /* 70% ≈ 1/√2 — once rotated 45°, the diamond's tips
     land exactly at the .logo-wrap edges, no overflow into title/subtitle. */
  width: 70%;
  height: 70%;
  background: linear-gradient(45deg, #CA2820 0%, #EBF415 50%, #CA2820 100%);
  transform: rotate(45deg);
  animation: slideIn 0.25s linear backwards;
  animation-delay: 1s;
}
.screen-1 .logo::before,
.screen-1 .logo::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f00;
}
.screen-1 .logo::before {
  background: linear-gradient(45deg, #CA2820 0%, #EBF415 50%, transparent 51%, transparent 100%);
  animation: triangle-1 1s linear forwards;
  animation-delay: 1.25s;
}
.screen-1 .logo::after {
  background: linear-gradient(45deg, transparent 0%, transparent 50%, #EBF415 51%, #CA2820 100%);
  animation: triangle-2 1s linear forwards;
  animation-delay: 1.25s;
}

@keyframes slideIn { from { opacity: 0; } }
@keyframes triangle-1 { to { transform: translate(-17.5%, -17.5%) scale(0.35); } }
@keyframes triangle-2 { to { transform: translate(17.5%,  17.5%) scale(0.35); } }

/* ============================================================
   SLIDE 2 — original PS1 dark "wordmark + license" look
   ============================================================ */
.screen-2 {
  background: #000;
  color: #c8c8c8;
  text-align: center;
  font-family: Arial, sans-serif;
}
/* Romparty logo is the hero on slide 2 (mirrors the PS1 mark dominating
   the original SCEA boot). The wrapping frame uses an aspect-ratio
   shorter than the SVG's native 970:609 to crop ~12% off the bottom
   (which is dark background and not part of the mark). Slow 1.6s reveal
   intentionally crests with the audio's second swell at ~8s (= 1.5s into
   this slide's 6.5s window). */
.screen-2 .rp-logo-frame {
  width: clamp(420px, 56vw, 760px);
  aspect-ratio: 970 / 535;
  overflow: hidden;
  margin: 0 auto clamp(-8px, -1vh, -20px);
  animation: fadeInUp 1.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.screen-2 .rp-logo {
  width: 100%;
  height: auto;
  display: block;
}
.screen-2 .ps-title {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: clamp(28px, 4.2vw, 56px);
  letter-spacing: 0.005em;
  color: #fff;
  margin-bottom: clamp(20px, 3.5vh, 44px);
  animation: fadeInUp 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.6s backwards;
}
.screen-2 .ps-title span {
  font-size: 0.32em;
  vertical-align: super;
  margin-left: 4px;
  font-style: normal;
  font-weight: 600;
}
.screen-2 .ps-license {
  font-family: Arial, sans-serif;
  font-size: clamp(12px, 1.15vw, 18px);
  line-height: 1.6;
  color: #c8c8c8;
  letter-spacing: 0.04em;
  max-width: 60ch;
  animation: fadeInUp 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1.0s backwards;
}

/* Lead-in words ("Licensed by", "Made by") — muted/secondary */
.screen-2 .ps-license .prefix {
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78em;
  font-weight: 600;
}

/* Single chromatic highlight: MISCHIEF in the brand gradient */
.screen-2 .ps-license .accent {
  background: linear-gradient(135deg, #FF8C3A 0%, #00C9A7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* Brand words around it stay solid, white-bold */
.screen-2 .ps-license .brand-soft {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Maker name — turquoise accent, underlined (it's a link to sajarin.com) */
.screen-2 .ps-license .maker {
  color: #00C9A7;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 160ms;
}
.screen-2 .ps-license .maker:hover { color: #FF8C3A; }

/* Copyright line — neutral, low-key */
.screen-2 .ps-license .tm-mark {
  font-size: 0.6em;
  vertical-align: super;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
}
.screen-2 .ps-license .rights {
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.18em;
  font-size: 0.82em;
}
.screen-2 .ps-license .dim {
  color: rgba(255, 255, 255, 0.22);
  margin: 0 0.3em;
}

/* Keep the original ™ glyph styling on the romparty title (not licensed text) */
.screen-2 .ps-title span {
  font-size: 0.32em;
  vertical-align: super;
  margin-left: 4px;
  font-style: normal;
  font-weight: 600;
}

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

/* ============================================================
   romparty finale
   ============================================================ */
#finale {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #050608;
  z-index: 200;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 900ms cubic-bezier(0.32, 0.72, 0, 1),
    transform 900ms cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}
#finale.show { opacity: 1; transform: translateY(0); }
#finale::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(closest-side at 50% 50%, rgba(255,140,58,0.22), transparent 70%),
    radial-gradient(closest-side at 50% 50%, rgba(0,201,167,0.18), transparent 70%);
  filter: blur(20px);
  z-index: -1;
}
.brand-mark {
  font-size: clamp(56px, 8vw, 112px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  background: linear-gradient(135deg, #FF8C3A 0%, #00C9A7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255,140,58,0.25), 0 0 80px rgba(0,201,167,0.22);
}
.brand-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.45);
}

/* ---------- skip / audio controls ---------- */
#skip, #audio-toggle {
  position: absolute;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: color 160ms, background 160ms, opacity 160ms;
}
#skip { right: 20px; bottom: 20px; }
#audio-toggle { left: 20px; bottom: 20px; }
#skip:hover, #audio-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
#audio-toggle .audio-icon { font-size: 14px; line-height: 1; }
#audio-toggle[data-state="off"] { opacity: 0.7; }
#audio-toggle[data-state="off"] .audio-icon::after {
  content: "";
  display: inline-block;
  width: 14px;
  border-top: 1.5px solid currentColor;
  transform: translate(-14px, -2px) rotate(-20deg);
  position: relative;
}

/* On the white slide, dark-text affordance for both buttons */
.screen-1 ~ #skip,
.screen-1 ~ #audio-toggle {
  color: rgba(31, 36, 43, 0.6);
  background: rgba(255,255,255,0.6);
  border-color: rgba(0,0,0,0.08);
}

/* On the white slide, dark-text affordance */
.screen-1 ~ #skip { color: rgba(31, 36, 43, 0.6); background: rgba(255,255,255,0.6); border-color: rgba(0,0,0,0.08); }

.kbd {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.72);
}
