:root {
  --bg: #f4debf;
  --bg-deep: #ecd2af;
  --surface: rgba(255, 250, 243, 0.82);
  --surface-line: rgba(115, 86, 52, 0.11);
  --text: #161412;
  --muted: #615a54;
  --accent: #f76c37;
  --accent-soft: rgba(247, 108, 55, 0.14);
  --shadow: 0 28px 80px rgba(96, 65, 31, 0.14);
  --radius-xl: 34px;
  --radius-md: 18px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.68), transparent 0 22%),
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.42), transparent 0 16%),
    linear-gradient(180deg, #f7e7cf 0%, var(--bg) 52%, var(--bg-deep) 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 1px, transparent 1px);
  background-size: 14px 14px;
  mix-blend-mode: soft-light;
}

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

.page-shell {
  width: min(1220px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 26px 0 90px;
}

.browser-frame {
  position: sticky;
  top: 14px;
  z-index: 10;
}

.browser-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--radius-pill);
  background: rgba(255, 249, 242, 0.78);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.traffic {
  display: inline-flex;
  gap: 8px;
}

.traffic span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(109, 86, 57, 0.28);
}

.address-bar {
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.56);
  padding: 12px 18px;
  color: var(--muted);
  font-size: 0.93rem;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-nav {
  display: inline-flex;
  gap: 18px;
  font-size: 0.95rem;
  color: var(--muted);
}

.layout {
  padding-top: 30px;
}

.hero {
  padding: 26px 0 16px;
}

.eyebrow,
.panel-label {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.78fr);
  gap: 24px;
  align-items: end;
}

.hero h1,
.section h2,
.hero-panel h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(3.7rem, 9vw, 7.2rem);
  max-width: 11ch;
}

.hero-text,
.section-copy,
.hero-panel p,
.trail-card p,
.link-card p,
.resource-card p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-chips,
.topic-rail,
.mention-row,
.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  background: rgba(255, 248, 240, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 30px rgba(111, 77, 39, 0.08);
}

.hero-panel,
.stat-card,
.trail-card,
.link-card,
.resource-card {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel,
.trail-card,
.link-card,
.resource-card,
.stat-card {
  padding: 22px;
}

.hero-panel h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-top: 14px;
}

.stats-grid,
.trail-grid,
.link-grid,
.resource-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0 34px;
}

.stat-card strong {
  display: block;
  margin: 14px 0 6px;
  font-size: 2rem;
}

.stat-card span {
  color: var(--muted);
}

.section {
  margin-top: 28px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.section h2 {
  margin-top: 10px;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.search-box {
  display: grid;
  gap: 8px;
}

.pretext-panel {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

.pretext-form,
.pretext-result {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 22px;
}

.pretext-form {
  display: grid;
  gap: 12px;
}

.pretext-form label {
  color: var(--muted);
  font-size: 0.92rem;
}

.pretext-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-box label {
  color: var(--muted);
  font-size: 0.92rem;
}

.search-box input,
.pretext-row input {
  width: 100%;
  border: 1px solid rgba(103, 71, 41, 0.12);
  background: rgba(255, 248, 240, 0.78);
  border-radius: var(--radius-pill);
  padding: 15px 18px;
  font: inherit;
  color: var(--text);
}

.pretext-row button {
  border: none;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #fff8f0;
  font: inherit;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

.pretext-row button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.pretext-result h3 {
  margin: 12px 0 10px;
  font-family: "Fraunces", serif;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

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

.trail-card h3,
.link-card h3,
.resource-card h3 {
  margin: 12px 0 10px;
  font-family: "Fraunces", serif;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.trail-steps {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.trail-step {
  display: grid;
  gap: 5px;
  padding: 14px 15px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(110, 81, 49, 0.08);
}

.trail-stage {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.topic-rail {
  margin-top: 14px;
}

.topic-chip {
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.topic-chip.active,
.topic-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 252, 247, 0.92);
  border-color: rgba(247, 108, 55, 0.24);
}

.link-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-card-head,
.resource-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.relation-pill,
.type-pill {
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resource-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.resource-card {
  display: grid;
  gap: 14px;
}

.resource-card p {
  margin: 0;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-pill {
  padding: 8px 11px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
  font-size: 0.82rem;
}

.active-filter {
  min-height: 26px;
  margin-bottom: 4px;
  color: var(--muted);
}

.empty-state {
  padding: 26px;
  border-radius: var(--radius-xl);
  background: rgba(255, 249, 240, 0.54);
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: fadeUp 700ms cubic-bezier(0.2, 1, 0.25, 1) forwards;
}

.reveal:nth-child(2) { animation-delay: 100ms; }
.reveal:nth-child(3) { animation-delay: 180ms; }
.reveal:nth-child(4) { animation-delay: 260ms; }
.reveal:nth-child(5) { animation-delay: 340ms; }
.reveal:nth-child(6) { animation-delay: 420ms; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .hero-grid,
  .section-head,
  .pretext-panel,
  .trail-grid,
  .resource-grid,
  .link-grid,
  .stats-grid,
  .browser-top {
    grid-template-columns: 1fr;
  }

  .top-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 14px;
  }

  .browser-top {
    padding: 14px;
  }

  .pretext-row {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.9rem, 18vw, 4.8rem);
  }

  .section h2,
  .trail-card h3,
  .link-card h3,
  .resource-card h3 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }
}
