/* ---------------------------------------------------
   storyworlds.ink — under construction
   Palette: ink night + gilded parchment
--------------------------------------------------- */

:root {
  --ink-black: #0e1016;
  --ink-navy: #171e2e;
  --ink-navy-2: #232d44;
  --parchment: #f1e8d3;
  --parchment-shadow: #ded1ae;
  --gold: #b8912f;
  --gold-bright: #d4ac4a;
  --wax: #7a2e28;
  --ink-text: #2a251c;
  --muted: #6d6656;

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Literata", Georgia, serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 120% 90% at 50% -10%, var(--ink-navy-2) 0%, var(--ink-navy) 45%, var(--ink-black) 100%);
  font-family: var(--font-body);
  color: var(--ink-text);
  overflow-x: hidden;
  position: relative;
}

/* -----------------------------
   Background constellation
----------------------------- */

#constellation {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
}

/* -----------------------------
   Ink reveal (load animation)
----------------------------- */

.ink-reveal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--ink-black);
  pointer-events: none;
  clip-path: circle(150% at 50% 50%);
  animation: ink-recede 1.4s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}

@keyframes ink-recede {
  0% {
    clip-path: circle(150% at 50% 45%);
  }
  100% {
    clip-path: circle(0% at 50% 45%);
  }
}

/* -----------------------------
   Stage & manuscript card
----------------------------- */

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 5vw;
}

.manuscript {
  position: relative;
  width: min(640px, 100%);
  background: var(--parchment);
  color: var(--ink-text);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 6vw, 4rem);
  transform: rotate(-0.6deg);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(184, 145, 47, 0.15);
  opacity: 0;
  animation: card-in 0.9s ease-out 0.9s forwards;
}

.manuscript::before {
  /* deckle-edge illusion via layered shadow strip at top */
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(122, 46, 40, 0.18);
  pointer-events: none;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: rotate(-0.6deg) translateY(14px);
  }
  to {
    opacity: 1;
    transform: rotate(-0.6deg) translateY(0);
  }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wax);
  margin: 0 0 1.4rem;
}

.eyebrow-dot {
  color: var(--gold);
}

h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 1.2rem;
  color: var(--ink-text);
}

.lede {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #4a4335;
  max-width: 46ch;
  margin: 0 0 2rem;
}

.rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 2rem;
  color: var(--gold);
}

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(122, 46, 40, 0.35), transparent);
}

.rule::after {
  background: linear-gradient(to left, transparent, rgba(122, 46, 40, 0.35), transparent);
}

.quill {
  width: 20px;
  height: 20px;
  flex: none;
}

/* -----------------------------
   Notify form
----------------------------- */

.notify {
  margin: 0 0 2.2rem;
}

.notify-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.notify-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.notify-row input {
  flex: 1 1 220px;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 0.75rem 0.9rem;
  background: #fbf6ea;
  border: 1px solid var(--parchment-shadow);
  color: var(--ink-text);
  border-radius: 2px;
}

.notify-row input::placeholder {
  color: #9c9377;
}

.notify-row input:focus-visible {
  outline: 2px solid var(--wax);
  outline-offset: 2px;
}

.notify-row button {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 0.75rem 1.3rem;
  background: var(--wax);
  color: var(--parchment);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.notify-row button:hover {
  background: #8f3630;
}

.notify-row button:active {
  transform: translateY(1px);
}

.notify-row button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.notify-status {
  min-height: 1.2em;
  margin: 0.7rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--wax);
}

.notify-status.is-success {
  color: #4b6b3f;
}

/* -----------------------------
   Colophon / footer
----------------------------- */

.colophon {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-top: 1px solid rgba(122, 46, 40, 0.18);
  padding-top: 1.1rem;
}

.colophon a {
  color: var(--wax);
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 46, 40, 0.35);
}

.colophon a:hover {
  color: var(--ink-text);
}

/* -----------------------------
   Responsive
----------------------------- */

@media (max-width: 480px) {
  .manuscript {
    transform: rotate(0deg);
    padding: 2.2rem 1.5rem;
  }
  .colophon {
    flex-direction: column;
  }
}

/* -----------------------------
   Reduced motion
----------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ink-reveal {
    animation: none;
    clip-path: circle(0% at 50% 45%);
  }
  .manuscript {
    animation: none;
    opacity: 1;
    transform: rotate(-0.6deg);
  }
  #constellation {
    display: none;
  }
}
