:root {
  color-scheme: light dark;
  --paper: #efe0bc;
  --paper-shadow: rgba(84, 54, 20, 0.18);
  --ink: #271808;
  --muted: rgba(39, 24, 8, 0.72);
  --button-bg: rgba(255, 248, 226, 0.78);
  --button-border: rgba(65, 39, 11, 0.28);
  --focus: #8e3c15;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 250, 225, 0.72), transparent 26rem),
    radial-gradient(circle at 80% 90%, rgba(173, 117, 54, 0.20), transparent 34rem),
    linear-gradient(135deg, #f6e8c7, var(--paper) 48%, #dfc794);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(82, 52, 18, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 52, 18, 0.025) 1px, transparent 1px);
  background-size: 5rem 5rem, 4rem 4rem;
  mix-blend-mode: multiply;
}

body[data-mode="dark"] {
  --paper: #08090b;
  --paper-shadow: rgba(0, 0, 0, 0.55);
  --ink: #f5ead0;
  --muted: rgba(245, 234, 208, 0.72);
  --button-bg: rgba(20, 21, 24, 0.82);
  --button-border: rgba(245, 234, 208, 0.26);
  --focus: #e2b65b;
  background:
    radial-gradient(circle at 28% 16%, rgba(106, 71, 30, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 78%, rgba(203, 172, 103, 0.10), transparent 32rem),
    linear-gradient(140deg, #040506, #101015 52%, #070707);
}

.work-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100svh;
}

.topbar {
  position: fixed;
  z-index: 8;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.8rem, 2vw, 1.25rem);
  pointer-events: none;
}

.persistent-title {
  pointer-events: none;
  max-width: min(42vw, 28rem);
  color: var(--muted);
  font-size: clamp(0.78rem, 1.2vw, 0.95rem);
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0.18rem 0.7rem var(--paper-shadow);
}

.persistent-title span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72em;
  letter-spacing: 0.16em;
}

.controls button {
  pointer-events: auto;
  border: 1px solid var(--button-border);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--ink);
  box-shadow: 0 0.75rem 2rem var(--paper-shadow);
  font: 700 0.78rem/1.1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.controls button {
  min-height: 2.65rem;
  padding: 0.72rem 0.95rem;
  cursor: pointer;
}

.controls button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.stage {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  align-items: flex-end;
  padding: clamp(6.5rem, 12vh, 9rem) clamp(1.2rem, 6vw, 7rem) clamp(2rem, 7vh, 5rem);
}

.lines {
  width: min(100%, 74rem);
  font-size: clamp(1.45rem, 2.15vw, 2.35rem);
  line-height: 1.36;
  letter-spacing: 0;
}

.line {
  max-width: 100%;
  margin: 0.78em 0 0;
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(0.3em);
  animation: revealLine 520ms ease-out forwards;
}

.line.blank {
  min-height: 1.15em;
}

.splash {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  align-items: end;
  padding: clamp(1.2rem, 4vw, 4rem);
  color: #fff7e2;
  isolation: isolate;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.splash[hidden] {
  display: none;
}

.splash.is-closing {
  opacity: 0;
  visibility: hidden;
}

.splash-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(10, 7, 4, 0.88), rgba(10, 7, 4, 0.48) 48%, rgba(10, 7, 4, 0.28)),
    linear-gradient(0deg, rgba(10, 7, 4, 0.84), rgba(10, 7, 4, 0.10) 58%),
    url("parthenope_splash.png") center / cover no-repeat;
}

.splash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(23, 13, 4, 0.18);
  backdrop-filter: blur(1.5px);
}

.splash-panel {
  width: min(100%, 47rem);
  padding: 0 0 clamp(0.8rem, 3vw, 2.5rem);
  text-shadow: 0 0.18rem 1rem rgba(0, 0, 0, 0.7);
}

.kicker,
.author {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.splash h1 {
  max-width: 12ch;
  margin: 0.12em 0 0;
  font-size: clamp(3.5rem, 12vw, 9.2rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.author {
  margin: 1rem 0 clamp(1.2rem, 3vw, 2rem);
  color: rgba(255, 247, 226, 0.78);
}

.splash-panel p:not(.kicker):not(.author) {
  max-width: 42rem;
  margin: 0.85rem 0 0;
  font-size: clamp(1.04rem, 1.65vw, 1.35rem);
  line-height: 1.42;
}

.enter-button {
  margin-top: clamp(1.4rem, 3vw, 2.4rem);
  border: 1px solid rgba(255, 247, 226, 0.5);
  border-radius: 999px;
  background: rgba(255, 247, 226, 0.12);
  color: #fff7e2;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.38);
  cursor: pointer;
  font: 800 0.88rem/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.16em;
  padding: 1rem 1.35rem;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.enter-button:focus-visible {
  outline: 3px solid #f4c76b;
  outline-offset: 4px;
}

@keyframes revealLine {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
  }

  .persistent-title {
    max-width: 9rem;
  }

  .controls {
    max-width: 13.5rem;
  }

  .controls button {
    font-size: 0.72rem;
  }

  .stage {
    padding-top: 8rem;
  }

  .splash {
    align-items: end;
    padding-top: 7rem;
  }

  .splash h1 {
    font-size: clamp(3.3rem, 17vw, 5.8rem);
  }
}
