:root {
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --surface-soft: #e8eee8;
  --ink: #18262b;
  --muted: #687275;
  --accent: #24505a;
  --accent-strong: #173740;
  --accent-soft: #d7e7e6;
  --clay: #b95f45;
  --gold: #dfad55;
  --line: rgba(24, 38, 43, 0.13);
  --shadow: 0 22px 50px rgba(40, 52, 55, 0.15);
  --content-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", Arial, sans-serif;
  background: linear-gradient(180deg, #eef5f3 0%, var(--bg) 48%, #f5eadf 100%);
}

body,
button,
input {
  font: inherit;
}

button,
input {
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-shell {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 18px 16px 96px;
}

.topbar,
.brand,
.hero-actions,
.drawer-actions,
.guide-meta,
.guide-actions,
.detail-actions,
.status-strip,
.filter-row {
  display: flex;
  align-items: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  padding: 10px 0;
  background: rgba(247, 243, 234, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  gap: 10px;
}

.brand strong {
  display: block;
  font-size: 1.15rem;
}

.brand-mark {
  display: block;
  width: 92px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(40, 52, 55, 0.08);
}

.brand-mark img {
  object-fit: contain;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(40, 52, 55, 0.08);
}

.main-content {
  display: grid;
  gap: 18px;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(620px, calc(100vh - 120px));
  overflow: hidden;
  border-radius: 8px;
  background: var(--accent-strong);
  box-shadow: var(--shadow);
}

.hero-media {
  position: absolute;
  inset: 0;
  opacity: 0.72;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(23, 55, 64, 0.94), rgba(23, 55, 64, 0.34));
}

.hero-placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #7a6b47);
  font-size: 4rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: end;
  max-width: 720px;
  padding: clamp(28px, 7vw, 72px);
  color: #fffdf8;
}

.badge {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(2.8rem, 8vw, 6.2rem);
  line-height: 0.96;
}

.hero p {
  max-width: 60ch;
  margin-top: 18px;
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  padding: 0 18px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
}

.secondary-button,
.ghost-button,
.mini-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.hero .secondary-button {
  color: #fffdf8;
  background: rgba(255, 253, 248, 0.14);
  border-color: rgba(255, 253, 248, 0.38);
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
}

.filter-row {
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 800;
}

.filter-button.is-active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.status-strip {
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.76);
  border: 1px solid var(--line);
}

.content-panel {
  display: grid;
  gap: 18px;
  scroll-margin-top: 92px;
}

.section-head {
  display: grid;
  gap: 8px;
}

.section-head h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.section-head p {
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.55;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.guide-card,
.detail-panel,
.trip-panel,
.empty-state {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 12px 28px rgba(40, 52, 55, 0.08);
}

.guide-card {
  display: grid;
  grid-template-rows: 210px 1fr;
}

.guide-media {
  display: block;
  background: var(--accent-soft);
}

.guide-media img {
  transition: transform 0.25s ease;
}

.guide-card:hover .guide-media img {
  transform: scale(1.03);
}

.guide-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.guide-meta {
  flex-wrap: wrap;
  gap: 6px;
}

.meta-pill {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.guide-title {
  font-size: 1.35rem;
  line-height: 1.14;
}

.guide-excerpt {
  color: var(--muted);
  line-height: 1.5;
}

.guide-actions,
.detail-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.access-gate {
  text-align: left;
}

.access-gate > h2,
.access-gate > p {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.access-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "login purchase"
    "login restore";
  gap: 14px;
  width: min(100%, 860px);
  margin: 22px auto 0;
}

.access-message {
  width: min(100%, 760px);
  margin: 18px auto 0;
  padding: 14px 16px;
  border: 1px solid rgba(36, 80, 90, 0.24);
  border-radius: 8px;
  background: rgba(240, 247, 245, 0.92);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.access-option {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 100%;
  padding: clamp(18px, 4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
}

.access-option-login {
  grid-area: login;
}

.access-option-purchase {
  grid-area: purchase;
}

.access-option-restore {
  grid-area: restore;
}

.access-option h3 {
  font-size: 1.28rem;
  line-height: 1.18;
}

.access-option p {
  color: var(--muted);
  line-height: 1.58;
}

.checkout-form {
  display: grid;
  gap: 10px;
  width: 100%;
}

.checkout-form label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.checkout-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

@media (max-width: 720px) {
  .access-options {
    grid-template-columns: 1fr;
    grid-template-areas:
      "login"
      "purchase"
      "restore";
  }
}

.mini-button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 0.84rem;
}

.mini-button.is-active {
  color: #fff;
  border-color: var(--clay);
  background: var(--clay);
}

.detail-panel {
  display: grid;
  grid-template-columns: 1fr;
}

.detail-media {
  min-height: 360px;
  aspect-ratio: 16 / 7;
  background: var(--accent-soft);
}

.detail-body {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: clamp(22px, 4vw, 42px);
}

.detail-body h2 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
}

.detail-body p,
.trip-panel p,
.empty-state p {
  color: var(--muted);
  line-height: 1.65;
}

.article-text {
  display: grid;
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.article-text p {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.72;
}

.article-text strong,
.article-text .article-subhead {
  font-weight: 800;
}

.article-text .article-subhead {
  margin-top: 8px;
}

.draft-separator {
  width: 100%;
  height: 1px;
  margin: 18px 0 0;
  border: 0;
  background: var(--line);
}

.draft-notice {
  padding: 14px 16px;
  border-left: 4px solid var(--clay);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
}

.detail-list {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0 0 12px;
  list-style: none;
}

.detail-list li {
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  background: var(--surface-soft);
}

.trip-panel,
.empty-state {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.generation-state {
  scroll-margin-block: 96px;
}

.countdown-text {
  font-weight: 800;
}

.progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 80, 90, 0.14);
}

.progress-bar {
  position: absolute;
  inset-block: 0;
  left: -40%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--clay));
  animation: progress-slide 1.35s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(335%);
  }
}

.trip-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.trip-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trip-item strong {
  display: block;
}

.trip-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.drawer.is-open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(17, 25, 28, 0.38);
}

.drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(88vw, 360px);
  padding: 20px;
  overflow: auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-nav {
  display: grid;
  gap: 8px;
}

.drawer-nav a,
.drawer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.drawer-nav a {
  padding: 13px 14px;
  font-weight: 800;
}

.drawer-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.drawer-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.muted,
.install-hint {
  color: var(--muted);
  line-height: 1.5;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px max(10px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(18px);
}

.bottom-link {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.bottom-link.is-active {
  color: #fff;
  background: var(--accent);
}

@media (max-width: 900px) {
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-media {
    min-height: 300px;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 10px 10px 92px;
  }

  .brand-mark {
    width: 68px;
    height: 34px;
  }

  .hero {
    min-height: 540px;
  }

  .hero-media::after {
    background: linear-gradient(0deg, rgba(23, 55, 64, 0.96), rgba(23, 55, 64, 0.3));
  }

  .hero-copy {
    padding: 24px;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 14vw, 4rem);
  }

  .control-strip {
    grid-template-columns: 1fr;
  }

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

  .guide-card {
    grid-template-rows: 220px 1fr;
  }

  .bottom-nav {
    display: grid;
  }
}
