:root {
  --bg: #fff9fc;
  --paper: rgba(255, 255, 255, 0.78);
  --paper-strong: rgba(255, 255, 255, 0.93);
  --ink: #6a6170;
  --ink-strong: #34303a;
  --muted: #aaa1ad;
  --pink: #f7c8d9;
  --pink-2: #ffeaf2;
  --pink-3: #fff5f9;
  --line: rgba(210, 178, 194, 0.5);
  --shadow: 0 20px 55px rgba(175, 138, 160, 0.18);
  --mono: "Courier New", ui-monospace, monospace;
  --round: 30px;
  --reader-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 219, 234, .8), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(255, 239, 246, .9), transparent 25%),
    linear-gradient(180deg, #ffffff, var(--bg));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.night {
  --bg: #fbf7fa;
  --paper: rgba(255, 255, 255, 0.68);
  --paper-strong: rgba(255, 255, 255, 0.88);
  --ink: #817985;
  --ink-strong: #47404c;
  --pink: #e9d7e1;
  --pink-2: #f7eef3;
  --line: rgba(185, 172, 182, 0.45);
}

.soft-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: .9;
}

.soft-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(235, 174, 201, .35) 1.4px, transparent 1.4px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}

.blob {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  filter: blur(34px);
  opacity: .35;
}

.b1 {
  left: -70px;
  top: 10%;
  background: #ffd4e4;
}

.b2 {
  right: -60px;
  bottom: 15%;
  background: #efe7ff;
}

.tiny-heart {
  position: absolute;
  color: rgba(214, 171, 192, .45);
  font-size: 44px;
  font-family: var(--mono);
}

.h1 { top: 9%; right: 12%; }
.h2 { bottom: 22%; left: 8%; }
.h3 { bottom: 9%; right: 16%; }

.phone-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(36px + env(safe-area-inset-bottom));
  position: relative;
}

.browser-card,
.note-card,
.story-window,
.profile-card,
.about-card {
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.browser-card {
  border-radius: 32px;
  overflow: hidden;
  margin: 12px 0 18px;
}

.browser-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 150px;
  padding: 10px 18px 8px;
  background: #f3edf1;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-bottom-right-radius: 18px;
  font-family: var(--mono);
  color: var(--ink-strong);
  transform: translateX(16px);
}

.tab-title {
  font-style: italic;
  font-weight: 700;
}

.tab-close {
  color: #2d2b30;
  font-weight: 900;
}

.browser-bar {
  display: grid;
  grid-template-columns: 42px 42px 42px 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, #fff7fb, #ffeaf2);
  border-bottom: 1px solid var(--line);
}

.round-btn {
  border: 0;
  height: 38px;
  border-radius: 14px;
  background: rgba(255,255,255,.8);
  color: #2f2a31;
  font-size: 26px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(225, 188, 206, .55);
}

.address {
  min-width: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: #8c7f8b;
  padding: 0 14px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero {
  padding: 30px 20px 26px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: #caa1b5;
  font-family: var(--mono);
  font-size: 13px;
}

h1 {
  margin: 0;
  color: var(--ink-strong);
  font-family: "Georgia", serif;
  font-size: clamp(48px, 18vw, 72px);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: .88;
  text-shadow: 0 10px 26px rgba(214, 165, 191, .22);
}

.subtitle {
  color: #c49aae;
  font-family: var(--mono);
  font-size: 14px;
  margin: 16px auto 10px;
  max-width: 300px;
}

.tagline {
  font-size: 14px;
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}

.tag-row span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  color: #b68ba0;
  font-size: 11px;
  font-family: var(--mono);
}

.quick-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 18px;
}

.quick-nav a,
.reader-tools button,
.footer a {
  min-height: 42px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fff1f6);
  color: #947487;
  text-decoration: none;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(184, 138, 160, .12);
}

.reader-tools {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 54px 54px 1fr 1fr;
  gap: 8px;
  padding: 8px 0;
  backdrop-filter: blur(16px);
}

.reader-tools button {
  cursor: pointer;
  font: 700 12px/1 var(--mono);
}

.progress-wrap {
  position: sticky;
  top: 58px;
  z-index: 11;
  height: 5px;
  border-radius: 999px;
  background: rgba(244, 218, 231, .8);
  overflow: hidden;
  margin-bottom: 14px;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e7a8c0, #d8c7ee);
  border-radius: inherit;
  transition: width .08s linear;
}

.note-card {
  border-radius: var(--round);
  padding: 22px;
  margin: 16px 0;
}

.card-label {
  font-family: var(--mono);
  color: #b8aeba;
  font-size: 12px;
  margin-bottom: 10px;
}

.note-card h2,
.character-zone h2,
.about-card h2 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-family: "Georgia", serif;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -.04em;
}

.note-card p,
.about-card p {
  margin: 0;
  line-height: 1.8;
  font-size: var(--reader-size);
}

.story-window {
  border-radius: 26px;
  margin: 18px 0;
  overflow: hidden;
}

.window-top {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: linear-gradient(180deg, #fff7fb, #f8eef3);
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e8d3de;
}

.window-title {
  margin-left: auto;
  font-family: var(--mono);
  color: #9b909b;
  font-size: 12px;
}

.story-body {
  padding: 22px 20px 26px;
  background:
    linear-gradient(rgba(255,255,255,.52), rgba(255,255,255,.52)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(246, 213, 228, .35) 32px);
}

.story-body p {
  margin: 0 0 18px;
  color: #5f5863;
  font-size: var(--reader-size);
  line-height: 1.95;
  text-align: justify;
  text-wrap: pretty;
}

.story-body p:first-of-type::first-letter {
  font-family: "Georgia", serif;
  font-size: 3.4em;
  float: left;
  line-height: .8;
  padding-right: 8px;
  color: #d3a4ba;
}

.character-zone {
  margin-top: 26px;
}

.character-grid {
  display: grid;
  gap: 14px;
}

.profile-card {
  border-radius: 26px;
  padding: 20px;
  background:
    radial-gradient(circle at 94% 8%, rgba(251, 218, 231, .8), transparent 26%),
    var(--paper-strong);
}

.profile-card h3 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-family: var(--mono);
  font-size: 20px;
}

.profile-card ul {
  margin: 0;
  padding-left: 20px;
}

.profile-card li {
  margin: 9px 0;
  line-height: 1.65;
}

.about-card {
  border-radius: 28px;
  padding: 22px;
  margin-top: 18px;
}

.mini-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.mini-grid div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,.55);
}

.mini-grid b,
.mini-grid span {
  display: block;
}

.mini-grid b {
  color: var(--ink-strong);
  font-family: var(--mono);
  font-size: 12px;
}

.mini-grid span {
  margin-top: 4px;
  line-height: 1.5;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 24px 0 0;
  color: #b8aeba;
  font-family: var(--mono);
  font-size: 12px;
}

.footer a {
  min-height: 38px;
  padding: 0 12px;
}

@media (min-width: 760px) {
  .phone-shell {
    width: min(100%, 780px);
  }

  .character-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mini-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 390px) {
  .phone-shell {
    padding-left: 11px;
    padding-right: 11px;
  }

  .browser-bar {
    grid-template-columns: 34px 34px 34px 1fr;
    gap: 6px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .round-btn {
    height: 34px;
  }

  .quick-nav {
    grid-template-columns: 1fr;
  }

  .reader-tools {
    grid-template-columns: 44px 44px 1fr 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .browser-card,
  .note-card,
  .story-window,
  .profile-card,
  .about-card {
    animation: rise .5s ease both;
  }

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