:root {
  --bg: #f5efe4;
  --surface: rgba(255, 251, 245, 0.68);
  --surface-strong: rgba(255, 250, 242, 0.9);
  --text: #1d1b17;
  --muted: #635b52;
  --line: rgba(29, 27, 23, 0.12);
  --accent: #c96a3d;
  --accent-deep: #8a3f1d;
  --shadow: 0 18px 48px rgba(45, 29, 20, 0.08);
  --heading-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body-font: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(245, 197, 133, 0.24), transparent 26%),
    radial-gradient(circle at 85% 18%, rgba(201, 106, 61, 0.1), transparent 18%),
    linear-gradient(180deg, #faf5ed 0%, #f2eadf 100%);
  color: var(--text);
  font-family: var(--body-font);
}

a {
  color: inherit;
}

.page-aura {
  position: fixed;
  z-index: 0;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.42;
  pointer-events: none;
}

.page-aura-left {
  top: -6rem;
  left: -6rem;
  background: rgba(226, 156, 105, 0.18);
}

.page-aura-right {
  right: -8rem;
  bottom: -6rem;
  background: rgba(124, 152, 106, 0.1);
}

.portal-shell,
.demo-shell {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

.portal-shell {
  padding: 28px 0 48px;
}

.hero,
.portal-section,
.demo-panel {
  backdrop-filter: blur(14px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(24px, 4vw, 40px);
  border-radius: 24px;
}

.eyebrow,
.section-kicker,
.demo-id,
.empty-kicker {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--accent-deep);
}

.hero h1,
.section-heading h2,
.demo-card h3,
.demo-panel h1,
.empty-state h3 {
  margin: 0;
  font-family: var(--heading-font);
  font-weight: 600;
  line-height: 1.02;
}

.hero h1 {
  display: inline-flex;
  flex-direction: column;
  gap: 0.04em;
  max-width: none;
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
}

.hero h1 span {
  display: block;
}

.hero-copy,
.section-copy,
.demo-card p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.hero-copy {
  margin-top: 14px;
  max-width: 30rem;
  font-size: 0.96rem;
}

.portal-section {
  margin-top: 18px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 22px;
}

.section-heading {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: end;
}

.section-heading h2 {
  margin-top: 8px;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.section-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.archive-bar {
  display: flex;
  justify-content: flex-end;
}

.filter-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.72);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  border-color: rgba(201, 106, 61, 0.4);
  color: var(--accent-deep);
  transform: translateY(-1px);
}

.filter-chip.is-active {
  background: rgba(201, 106, 61, 0.12);
  color: var(--accent-deep);
  border-color: rgba(201, 106, 61, 0.26);
}

.archive-switch {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.archive-switch.is-active {
  color: var(--text);
}

.demo-card,
.empty-state {
  display: flex;
  flex-direction: column;
  min-height: 188px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.demo-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.demo-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.demo-id {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-type,
.demo-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(201, 106, 61, 0.12);
  color: var(--accent-deep);
  font-size: 0.76rem;
}

.demo-type {
  background: rgba(29, 27, 23, 0.06);
  color: var(--text);
}

.demo-type-other {
  background: rgba(86, 116, 190, 0.1);
  color: #3654a4;
}

.demo-type-personal {
  background: rgba(47, 120, 91, 0.12);
  color: #2d7a5b;
}

.demo-card-body {
  margin-top: 18px;
  flex: 1;
}

.demo-card h3 {
  font-size: 1.42rem;
}

.demo-card p {
  margin-top: 8px;
}

.demo-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.demo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fffaf4;
  text-decoration: none;
  font-size: 0.9rem;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.demo-link:hover,
.demo-link:focus-visible {
  background: var(--accent-deep);
  box-shadow: 0 12px 20px rgba(138, 63, 29, 0.12);
  transform: translateY(-1px);
}

.archive-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.archive-action:hover,
.archive-action:focus-visible {
  color: var(--accent-deep);
}

.demo-card.is-archived {
  border-style: dashed;
}

.empty-state {
  justify-content: center;
}

.empty-state h3 {
  margin-top: 10px;
  font-size: 1.5rem;
}

.empty-state p {
  margin-top: 8px;
  max-width: 28rem;
}

.demo-page {
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.demo-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 48px);
}

.demo-panel {
  width: min(520px, 100%);
  padding: clamp(28px, 6vw, 44px);
  border-radius: 24px;
  text-align: center;
}

.demo-panel h1 {
  font-size: clamp(2.8rem, 10vw, 4.4rem);
}

@media (max-width: 720px) {
  .portal-shell,
  .demo-shell {
    width: min(100% - 24px, 920px);
  }

  .portal-shell {
    padding: 20px 0 36px;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .archive-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .hero,
  .portal-section,
  .demo-panel {
    border-radius: 20px;
  }

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

  .demo-card-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
