:root {
  --bg: #f4efe5;
  --paper: #fbf7f0;
  --ink: #16324a;
  --ink-soft: #536b7d;
  --accent: #c8a46e;
  --accent-soft: #ead9ba;
  --accent-cream: #f7ecda;
  --accent-line: rgba(200, 164, 110, 0.34);
  --ink-soft-2: #35546d;
  --panel: #102a40;
  --panel-soft: #173954;
  --success: #3d6f5b;
  --warning: #996228;
  --danger: #9a493f;
  --border: rgba(22, 50, 74, 0.12);
  --shadow: 0 22px 50px rgba(14, 34, 53, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(200, 164, 110, 0.24), transparent 24%),
    linear-gradient(180deg, #f8f3eb 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(22, 50, 74, 0.08);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar-brand {
  color: var(--ink-soft);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.page-shell {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 42px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-soft) 100%);
  color: #f7f1e8;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -110px;
  top: -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(200, 164, 110, 0.22);
}

.hero h1,
.hero h2 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.hero p {
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #d8e3ed;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 26px;
  z-index: 1;
}

.hero-sidecard {
  align-self: start;
  padding: 22px;
  border-radius: 22px;
  background: rgba(247, 241, 232, 0.09);
  border: 1px solid rgba(247, 241, 232, 0.16);
  backdrop-filter: blur(10px);
}

.hero-sidecard h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-family: Georgia, "Times New Roman", serif;
}

.sidecard-label {
  color: #f0c98b;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidecard-divider {
  height: 1px;
  margin: 18px 0;
  background: rgba(247, 241, 232, 0.14);
}

.rank-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #d8e3ed;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.button-primary {
  background: var(--accent);
  color: var(--ink);
}

.button-ghost {
  border: 1px solid rgba(22, 50, 74, 0.12);
  color: var(--ink);
  background: rgba(255, 253, 250, 0.72);
}

.button-secondary {
  border: 1px solid rgba(247, 241, 232, 0.24);
  color: #f7f1e8;
}

body[data-page="item"] .topbar {
  margin-bottom: 14px;
}

body[data-page="item"] .topbar-brand {
  color: #5d7384;
}

body[data-page="item"] .hero {
  padding: 38px;
  background: linear-gradient(140deg, #14324a 0%, #1d3e59 62%, #2a536f 100%);
}

body[data-page="item"] .hero-sidecard {
  background: rgba(255, 250, 242, 0.12);
  border-color: rgba(247, 241, 232, 0.18);
}

body[data-page="item"] .section {
  background: linear-gradient(180deg, #fffefc 0%, #fbf8f2 100%);
}

.section {
  margin-top: 28px;
  padding: 30px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.section h3 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
}

.eyebrow {
  margin-bottom: 10px;
  color: #f0c98b;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: var(--warning);
}

.muted {
  color: var(--ink-soft);
  line-height: 1.6;
}

.pill-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(22, 50, 74, 0.08);
  background: linear-gradient(180deg, #fffdfa 0%, var(--accent-cream) 100%);
  color: var(--panel);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.pill-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.pill-link:hover {
  background: linear-gradient(180deg, #fff6ea 0%, #f1debe 100%);
  border-color: var(--accent-line);
  color: var(--ink);
  box-shadow: 0 10px 18px rgba(14, 34, 53, 0.08);
  transform: translateY(-1px);
}

.pill-dark {
  background: rgba(247, 241, 232, 0.12);
  color: #f7f1e8;
  border: 1px solid rgba(247, 241, 232, 0.12);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.metric-card,
.flagship-card,
.mini-panel {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fffdfa 0%, #fcf6ee 100%);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.metric-card:hover,
.flagship-card:hover,
.mini-panel:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 164, 110, 0.38);
  box-shadow: 0 18px 34px rgba(14, 34, 53, 0.1);
}

.metric-value {
  margin: 10px 0 4px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
}

.metric-label {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.flagship-card img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
}

.flagship-media-link {
  display: block;
  border-radius: 18px;
}

.flagship-title-link {
  text-decoration: none;
}

.flagship-title-link:hover {
  color: var(--ink-soft-2);
}

.flagship-card h4,
.mini-panel h4 {
  margin: 16px 0 10px;
  font-size: 1.15rem;
}

.flagship-card p,
.mini-panel p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.card-actions {
  margin-top: 16px;
}

.output-link-line {
  margin-top: 10px;
}

.output-file-link,
.review-file-link {
  color: #1d425c;
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 164, 110, 0.34);
}

.output-file-link:hover,
.review-file-link:hover {
  color: #14324a;
  border-bottom-color: rgba(29, 66, 92, 0.35);
}

.catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.catalog-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-color: rgba(16, 42, 64, 0.1);
  background:
    radial-gradient(circle at top right, rgba(200, 164, 110, 0.05), transparent 28%),
    linear-gradient(180deg, #fffefc 0%, #fcfaf5 100%);
  box-shadow: 0 14px 28px rgba(14, 34, 53, 0.055);
}

.catalog-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #173954 0%, #35546d 72%, #c8a46e 100%);
}

.catalog-label {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(20, 50, 74, 0.08);
  background: linear-gradient(180deg, #f9f4ea 0%, #efe3cf 100%);
  color: #173954;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog-card h4 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  letter-spacing: 0.01em;
}

.catalog-category {
  color: #5f7484;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-card p {
  margin: 0;
  color: #5c6f7d;
  font-size: 0.96rem;
  line-height: 1.65;
}

.catalog-card .pill-link {
  border-width: 1px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(22, 50, 74, 0.08);
  color: #4f6475;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: none;
}

.catalog-card .pill-link:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(200, 164, 110, 0.3);
  color: #14324a;
  box-shadow: 0 10px 18px rgba(14, 34, 53, 0.05);
  transform: translateY(-1px);
}

.catalog-card .button-ghost {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(22, 50, 74, 0.09);
  color: #1b3a50;
  min-height: 42px;
}

.catalog-card .button-ghost:hover {
  background: #ffffff;
  border-color: rgba(22, 50, 74, 0.14);
}

.catalog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(53, 84, 109, 0.18);
  box-shadow: 0 20px 36px rgba(14, 34, 53, 0.075);
}

.table-shell {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.market-grid,
.review-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.market-card {
  background:
    linear-gradient(180deg, #fffdf9 0%, #faf4e8 100%);
}

.cta-section {
  background: linear-gradient(180deg, #fbf7f0 0%, #f4ebdc 100%);
}

.cta-shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdfa;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(22, 50, 74, 0.08);
  font-size: 0.96rem;
}

th {
  background: #f4ebdc;
  color: var(--ink);
}

.severity-high {
  color: var(--danger);
  font-weight: 700;
}

.severity-medium {
  color: var(--warning);
  font-weight: 700;
}

.risk-high {
  color: var(--danger);
  font-weight: 700;
}

.risk-low {
  color: var(--success);
  font-weight: 700;
}

ul.clean-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.two-column {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  .section {
    animation: rise 360ms ease both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .topbar,
  .cta-shell,
  .hero-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .hero,
  .section {
    padding: 22px;
    border-radius: 22px;
  }
}
