:root {
  --bg-1: #150d11;
  --bg-2: #2a1411;
  --bg-3: #082126;
  --paper: #f4ecd8;
  --paper-dim: rgba(244, 236, 216, 0.72);
  --gold: #efc36b;
  --gold-strong: #ffd98d;
  --rose: #c94b4b;
  --teal: #4cb8b3;
  --panel: rgba(26, 12, 14, 0.78);
  --panel-2: rgba(10, 25, 29, 0.72);
  --line: rgba(239, 195, 107, 0.28);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  background:
    radial-gradient(circle at 12% 12%, rgba(239, 195, 107, 0.12), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(76, 184, 179, 0.15), transparent 24%),
    linear-gradient(135deg, #1b0f13 0%, #2e1713 38%, #0c1f24 100%);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(transparent 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.34;
  pointer-events: none;
  z-index: -2;
}

.stage-lights {
  position: fixed;
  inset: 0;
  background:
    conic-gradient(from 180deg at 15% -8%, rgba(201, 75, 75, 0.22), transparent 24%),
    conic-gradient(from 180deg at 85% -8%, rgba(76, 184, 179, 0.18), transparent 24%);
  pointer-events: none;
  z-index: -1;
}

.page-shell,
.site-footer {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.page-shell {
  padding: 28px 0 72px;
}

.hero,
.analyzer,
.notes {
  display: grid;
  gap: 24px;
}

.hero {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.analyzer-copy,
.analyzer-panel,
.notes,
.portal-card {
  position: relative;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy,
.analyzer-copy {
  background:
    linear-gradient(180deg, rgba(58, 24, 19, 0.9), rgba(22, 12, 12, 0.94)),
    radial-gradient(circle at top left, rgba(239, 195, 107, 0.1), transparent 30%);
}

.hero-panel,
.analyzer-panel {
  background:
    linear-gradient(180deg, rgba(11, 30, 35, 0.9), rgba(12, 17, 23, 0.94)),
    radial-gradient(circle at top right, rgba(76, 184, 179, 0.12), transparent 26%);
}

.hero-copy,
.hero-panel,
.analyzer-copy,
.analyzer-panel,
.notes,
.portal-card {
  padding: 28px;
}

.hero-copy::before,
.hero-panel::before,
.analyzer-copy::before,
.analyzer-panel::before,
.notes::before,
.portal-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.eyebrow,
.panel-label,
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow::before,
.panel-label::before,
.card-tag::before {
  content: "";
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-strong));
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Noto Serif SC", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 {
  max-width: 8ch;
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 0.94;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.hero-text,
.panel-note,
.portal-card p,
.analyzer-copy p,
.notes p,
.status-copy,
.helper-text,
.site-footer,
textarea {
  color: var(--paper-dim);
  line-height: 1.72;
}

.hero-text {
  max-width: 56ch;
  margin-top: 18px;
  font-size: 1.03rem;
}

.hero-actions,
.form-actions,
.sample-list,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 28px;
}

.button,
.filter,
.sample-chip,
.mini-action {
  border: 1px solid var(--line);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button,
.filter,
.sample-chip,
.mini-action {
  font: inherit;
}

.button {
  padding: 12px 18px;
  letter-spacing: 0.04em;
}

.button-primary,
.filter.is-active,
.sample-chip:hover,
.mini-action:hover {
  background: linear-gradient(135deg, rgba(201, 75, 75, 0.34), rgba(239, 195, 107, 0.18));
}

.button-secondary {
  background: linear-gradient(135deg, rgba(76, 184, 179, 0.12), rgba(255, 255, 255, 0.02));
}

.button:hover,
.filter:hover,
.portal-card:hover,
.sample-chip:hover,
.mini-action:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 217, 141, 0.72);
}

.button:focus-visible,
.filter:focus-visible,
.sample-chip:focus-visible,
.mini-action:focus-visible,
textarea:focus-visible,
.portal-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.status-row {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.status-pill,
.model-pill {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill.is-live {
  background: rgba(76, 184, 179, 0.14);
  color: #aaf5f0;
}

.status-pill.is-warn {
  background: rgba(201, 75, 75, 0.16);
  color: #ffd3d3;
}

.panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 22px;
}

.panel-stats div {
  padding: 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.panel-stats strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.7rem;
}

.filters {
  margin: 22px 0 24px;
}

.filter,
.sample-chip,
.mini-action {
  padding: 10px 15px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.portal-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 228px;
  background:
    linear-gradient(180deg, rgba(45, 17, 16, 0.94), rgba(13, 25, 30, 0.92)),
    linear-gradient(135deg, rgba(239, 195, 107, 0.05), transparent 40%);
  color: inherit;
  text-decoration: none;
  opacity: 0;
  animation: rise-in 620ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--delay, 0s);
}

.portal-card.is-hidden {
  display: none;
}

.tilt-left {
  transform: rotate(-0.7deg);
}

.tilt-right {
  transform: rotate(0.7deg);
}

.portal-card:hover {
  transform: translateY(-3px) rotate(0deg);
}

.card-index {
  color: rgba(255, 217, 141, 0.5);
  font-size: 0.84rem;
  letter-spacing: 0.2em;
}

.portal-card h2 {
  font-size: 1.58rem;
}

.portal-card p {
  margin: 0;
}

.spotlight-card {
  justify-content: flex-start;
  background:
    linear-gradient(180deg, rgba(20, 33, 38, 0.95), rgba(45, 17, 16, 0.9)),
    radial-gradient(circle at top right, rgba(76, 184, 179, 0.12), transparent 28%);
}

.mini-action {
  margin-top: auto;
  width: fit-content;
}

.analyzer {
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  margin-top: 28px;
}

.sample-list {
  margin-top: 22px;
}

.analysis-form {
  display: grid;
  gap: 14px;
}

.field-label {
  color: var(--paper);
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 190px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  resize: vertical;
}

.form-actions {
  align-items: center;
  justify-content: space-between;
}

.helper-text {
  font-size: 0.92rem;
}

.analysis-output {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.output-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

#analysisOutput {
  margin: 0;
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  white-space: pre-wrap;
  color: var(--paper);
  line-height: 1.7;
  background: transparent;
}

.notes {
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  margin-top: 28px;
  background:
    linear-gradient(180deg, rgba(26, 12, 14, 0.88), rgba(14, 20, 24, 0.9)),
    radial-gradient(circle at 15% 20%, rgba(201, 75, 75, 0.12), transparent 26%);
}

.site-footer {
  margin-bottom: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 1080px) {
  .hero,
  .analyzer,
  .notes {
    grid-template-columns: 1fr;
  }

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

  .tilt-left,
  .tilt-right {
    transform: none;
  }
}

@media (max-width: 720px) {
  .page-shell,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .hero-copy,
  .hero-panel,
  .analyzer-copy,
  .analyzer-panel,
  .notes,
  .portal-card {
    padding: 22px;
  }

  .portal-grid,
  .panel-stats {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .form-actions,
  .filters,
  .sample-list {
    flex-direction: column;
  }

  .button,
  .filter,
  .sample-chip {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
