@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Literata:opsz,wght@7..72,400;500;600;700&display=swap");

/* Visual direction v1: modern interface + warm illustrated book. */

:root {
  --bg: #F5F0E7;
  --bg-card: #FFFDF8;
  --text: #282633;
  --text-muted: #77717A;
  --accent: #48405F;
  --accent-2: #D7AD5A;
  --accent-soft: #EEE9F2;
  --warm: #F2D89D;
  --shadow: 0 14px 34px rgba(45, 39, 58, 0.08);
  --shadow-soft: 0 7px 20px rgba(45, 39, 58, 0.055);
}

html,
body { background: var(--bg); }

body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 500px at 50% -160px, rgba(216, 178, 105, 0.12), transparent 70%),
    radial-gradient(500px 400px at -120px 38%, rgba(122, 105, 151, 0.08), transparent 70%),
    radial-gradient(500px 420px at 110% 78%, rgba(216, 178, 105, 0.07), transparent 70%),
    var(--bg);
}

h1,h2,h3 {
  font-family: "Literata", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.035em;
}
h1 { line-height: 1.04; }
h2 { line-height: 1.08; }
h3 { font-weight: 600; letter-spacing: -0.02em; }

.eyebrow,
.memory-kicker,
.scene-kicker,
.story-chapter-label,
button,
input,
select,
textarea,
.nav-item,
.hero-profile-meta,
.hero-role,
.chapter-number,
.chapter-row small {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.eyebrow,
.memory-kicker,
.scene-kicker {
  letter-spacing: 0.16em;
  font-weight: 700;
}

.app-shell { padding-top: calc(24px + env(safe-area-inset-top)); }

.form-card {
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(72, 64, 95, 0.07);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

input,
select,
textarea {
  background: rgba(255, 253, 248, 0.88);
  border-color: rgba(72, 64, 95, 0.10);
}

.primary-button {
  min-height: 54px;
  border-radius: 16px;
  background: #48405F;
  box-shadow: 0 10px 22px rgba(72, 64, 95, 0.17);
  font-weight: 700;
}

.secondary-button {
  background: rgba(238, 233, 242, 0.72);
  color: var(--accent);
  font-weight: 700;
}

/* Illustrated world scene: this background is intentionally the single visible scene layer. */
.world-hero-scene {
  min-height: 286px;
  border-radius: 30px 30px 22px 22px;
  padding: 26px 22px;
  isolation: isolate;
  background: transparent url("./assets/world-night.svg") center / cover no-repeat !important;
  box-shadow: 0 18px 38px rgba(22, 27, 43, 0.17);
}

.world-hero-scene::before,
.world-hero-scene::after,
.scene-glow,
.scene-stars {
  display: none !important;
}

.scene-copy {
  max-width: 315px;
  z-index: 2;
}

.scene-kicker { color: rgba(255, 249, 236, 0.66); }

.world-hero-scene h1 {
  max-width: 300px;
  font-size: clamp(30px, 7.8vw, 36px);
  font-weight: 600;
}

.world-hero-scene p {
  max-width: 290px;
  color: rgba(255, 249, 236, 0.76);
  font-size: 14px;
}

.scene-chapter {
  z-index: 2;
  border: 1px solid rgba(255, 249, 236, 0.14);
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(8px);
}

/* Action hierarchy. */
.world-action-card {
  min-height: 68px;
  border: 1px solid rgba(72, 64, 95, 0.055);
  background: rgba(255, 253, 248, 0.68);
  box-shadow: none;
  border-radius: 17px;
}
.world-action-card .action-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(238, 233, 242, 0.72);
}
.world-action-primary {
  background: rgba(255, 253, 248, 0.94);
  border-color: rgba(72, 64, 95, 0.10);
  box-shadow: var(--shadow-soft);
}
.world-action-card strong { font-size: 14px; font-weight: 700; }
.world-separate-action {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  opacity: 0.82;
}

/* Memory. */
.world-memory {
  border: 1px solid rgba(72, 64, 95, 0.055);
  background: rgba(238, 233, 242, 0.48);
  box-shadow: none;
}
.chapter-row { border-bottom-color: rgba(72, 64, 95, 0.08); }

/* Hero. */
.hero-profile-card {
  border: 1px solid rgba(255, 249, 236, 0.08);
  box-shadow: 0 18px 34px rgba(20, 25, 40, 0.15);
}
.hero-section { margin-bottom: 25px; }
.hero-description {
  font-family: "Literata", Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  color: #494352;
}
.tag {
  font-family: "Manrope", sans-serif;
  background: rgba(238, 233, 242, 0.72);
  border-color: rgba(72, 64, 95, 0.05);
  color: var(--accent);
  font-weight: 600;
}
.character-card {
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(72, 64, 95, 0.06);
  box-shadow: none;
}
.add-card {
  background: transparent;
  border: 1px dashed rgba(72, 64, 95, 0.18);
  color: var(--accent);
}

/* Creation screen. */
.create-header { padding-top: 8px; }
.create-header h2 { font-size: clamp(30px, 7.8vw, 36px); }
.create-header p {
  max-width: 330px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}
.create-story-form {
  padding: 20px;
  margin-top: 18px;
}

/* Reading surface: illustrated night scene is the single visible background layer. */
.story-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 28px;
  background: transparent url("./assets/story-night.svg") center / cover no-repeat !important;
  box-shadow: 0 18px 38px rgba(18, 23, 38, 0.18);
}

.story-card::before,
.story-card::after {
  display: none !important;
  content: none !important;
}

.story-card #story-text,
.story-card .story-moon {
  position: relative;
  z-index: 1;
}

.story-header h2 { font-size: clamp(30px, 7.8vw, 36px); }

#story-text {
  font-family: "Literata", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 1.78;
  letter-spacing: 0;
}

.story-save-note { font-family: "Manrope", sans-serif; }

/* Navigation. */
.bottom-nav {
  background: rgba(255, 253, 248, 0.92);
  border-top-color: rgba(72, 64, 95, 0.07);
  box-shadow: 0 -8px 24px rgba(45, 39, 58, 0.045);
  backdrop-filter: blur(16px);
}
.nav-item { font-weight: 600; }
.nav-item.active { background: rgba(238, 233, 242, 0.72); }

/* Quiet icon treatment. */
.spark-icon {
  font-size: 0;
  width: 13px;
  height: 13px;
  position: relative;
}
.spark-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.hero-edit-note { border-top-color: rgba(72, 64, 95, 0.07); }
.hero-edit-note > span { color: var(--accent-2); }

.character-name {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500 !important;
  letter-spacing: -0.01em;
}
.character-meta { font-weight: 500; }

@media (max-width: 390px) {
  .world-hero-scene { min-height: 268px; }
  .hero-description,
  #story-text { font-size: 17px; }
}
