* {
  box-sizing: border-box;
}

:root {
  --page-bg: #f5efe3;
  --ink: #273044;
  --muted: #7c7368;
  --gold: #b59663;
  --cream: rgba(255, 250, 241, 0.86);
  --line: rgba(124, 115, 104, 0.18);
  --shadow: 0 18px 48px rgba(70, 56, 36, 0.16);
  --radius-large: 34px;
  --outer-margin: 14px;
  --gap: 10px;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.8), transparent 28rem),
    linear-gradient(180deg, #fbf7ee 0%, var(--page-bg) 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

body {
  overflow: hidden;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100vw, 480px);
  height: 100dvh;
  margin: 0 auto;
  padding:
    max(var(--outer-margin), env(safe-area-inset-top))
    var(--outer-margin)
    max(var(--outer-margin), env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: 25fr 75fr;
  gap: var(--gap);
}

.title-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(245,239,227,0.55));
  isolation: isolate;
}

.brand {
  position: absolute;
  top: 16px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.brand span {
  color: rgba(38, 47, 70, 0.92);
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1rem, 3.7vw, 1.38rem);
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  text-shadow: 0 1px 8px rgba(255,255,255,0.5);
}

.brand strong {
  color: rgba(181, 150, 99, 0.98);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(0.95rem, 3.8vw, 1.34rem);
  line-height: 1.05;
  letter-spacing: 0.03em;
  font-weight: 600;
  font-style: italic;
  text-transform: none;
  text-align: right;
  text-shadow: 0 1px 8px rgba(255,255,255,0.42);
}

.title-track {
  height: 100%;
  display: flex;
  transition: transform 380ms ease;
  touch-action: pan-y;
}

.title-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-size: cover;
  background-position: center center;
}

.title-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.08));
  z-index: -1;
}

.title-card-inner {
  position: relative;
  z-index: 1;
}

.title-card.tone-light::before {
  background: linear-gradient(180deg, rgba(18, 18, 32, 0.16), rgba(12, 12, 24, 0.22));
}

.title-card.tone-light h1 {
  color: rgba(244, 242, 249, 0.96);
  text-shadow: 0 3px 18px rgba(0,0,0,0.38);
}

.title-card.tone-light .subtitle {
  color: rgba(242, 240, 246, 0.88);
}

.title-card {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  padding: 54px 28px 42px;
  text-align: center;
}

.title-card h1 {
  margin: 0;
  font-size: clamp(3.25rem, 18vw, 6.35rem);
  line-height: 0.9;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
  color: rgba(35, 47, 73, 0.92);
  text-shadow: 0 2px 12px rgba(255,255,255,0.56);
}

.title-card .subtitle {
  margin: 18px auto 0;
  max-width: 20rem;
  color: rgba(67, 73, 88, 0.82);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
}

.title-actions {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.nav-btn {
  width: 42px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.58);
  border-radius: 999px;
  color: rgba(39, 48, 68, 0.78);
  background: rgba(255,255,255,0.42);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.counter {
  min-width: 70px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(10px);
  color: rgba(39, 48, 68, 0.72);
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
}

.content-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-large);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  background:
    var(--content-overlay, linear-gradient(180deg, rgba(255,250,243,0.24), rgba(255,247,236,0.08))),
    var(--content-bg-image, url("assets/content-gold-wind.png")),
    var(--cream);
  background-size: cover;
  background-position: center center;
  scroll-behavior: smooth;
}

.content-panel.tone-light {
  --content-overlay: linear-gradient(180deg, rgba(255,250,243,0.24), rgba(255,247,236,0.08));
}

.content-panel.tone-mist {
  --content-overlay: linear-gradient(180deg, rgba(246, 240, 231, 0.68), rgba(239, 233, 224, 0.52));
}

.content-article {
  padding: 44px 28px 68px;
  color: #3e3226;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
}

.content-article p {
  max-width: 31rem;
  margin: 0 auto 24px;
  font-size: clamp(1.42rem, 4.8vw, 1.82rem);
  line-height: 1.64;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.22);
}

.content-article blockquote {
  max-width: 30rem;
  margin: 26px auto;
  padding: 18px 22px;
  border-left: none;
  border-radius: 22px;
  background: rgba(255,255,255,0.44);
  color: #5a4f45;
  font-size: clamp(1.28rem, 4.5vw, 1.56rem);
  line-height: 1.58;
  font-style: italic;
}

.content-article ul {
  max-width: 30rem;
  margin: 0 auto 24px;
  padding-left: 0;
  list-style: none;
}

.content-article li {
  margin: 0 0 12px;
  line-height: 1.6;
  font-size: clamp(1.28rem, 4.4vw, 1.52rem);
}

@media (min-width: 620px) {
  body {
    background:
      radial-gradient(circle at top, rgba(255,255,255,0.9), transparent 30rem),
      #efe7d8;
  }

  .app-shell {
    margin-top: 24px;
    margin-bottom: 24px;
    height: calc(100dvh - 48px);
    border-radius: 42px;
  }
}
