:root {
  --frame-margin: 14px;
  --wine-950: #4e0602;
  --wine-900: #650800;
  --wine-800: #7f0c03;
  --wine-700: #9b1508;
  --source-burgundy: #700b06;
  --gold-500: #ffcc3d;
  --gold-300: #ffe08a;
  --cream-100: #fff6d8;
  --cream-200: #fff1c5;
  --cream-300: #edcf80;
  --paper: #fffaf0;
  --ink: #24100c;
  --muted: #704834;
  --line: #d4a84e;
  --blue: #517fa8;
  --green: #7b9d45;
  --rose: #bb6d6b;
  --shadow: 0 18px 44px rgba(89, 43, 8, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream-100);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
}

h2,
h3,
h4,
p,
li,
dd {
  overflow-wrap: anywhere;
}

.page-header {
  margin: 8px var(--frame-margin) 0;
  min-height: 302px;
  padding: 8px;
  background: var(--source-burgundy);
  border-radius: 14px;
  overflow: hidden;
}

.image-banner {
  display: grid;
  place-items: center start;
  min-height: 286px;
  background: var(--source-burgundy);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
}

.image-banner img {
  display: block;
  width: min(1120px, 100%);
  height: auto;
  max-width: 1120px;
}

.app-layout {
  min-height: calc(100vh - 390px);
  margin: 18px var(--frame-margin) 24px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--cream-100);
  box-shadow: var(--shadow);
}

.side-panel {
  padding: 22px;
  color: var(--cream-100);
  background: linear-gradient(180deg, var(--wine-900), var(--wine-950));
  box-shadow: inset -1px 0 0 rgba(255, 231, 163, 0.18);
}

.side-title {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 224, 138, 0.25);
}

.side-title span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: var(--gold-500);
  border-radius: 6px;
  font-weight: 900;
}

.section-tabs {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.tab-button {
  padding: 12px 10px;
  color: var(--cream-100);
  text-align: left;
  background: transparent;
  border-left: 3px solid transparent;
  border-radius: 4px;
}

.tab-button:hover,
.tab-button.is-active {
  color: var(--gold-500);
  background: rgba(255, 204, 61, 0.09);
  border-left-color: var(--gold-500);
}

.content-stage {
  min-width: 0;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(112, 11, 6, 0.06), rgba(112, 11, 6, 0) 96px),
    var(--cream-100);
}

.stage-top {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--wine-800);
  font-size: 0.77rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stage-top h2 {
  margin: 0;
  color: var(--wine-950);
  font-size: clamp(1.7rem, 3vw, 2.55rem);
}

.article-subtitle {
  max-width: 980px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.35;
}

.article-authors {
  display: block;
  margin-top: 3px;
  color: var(--wine-800);
}

.article-authors strong {
  font-weight: 900;
}

.content-panel {
  display: none;
}

.content-panel.is-visible {
  display: block;
}

.paper-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  min-height: 330px;
  overflow: hidden;
  color: #fff8dc;
  background:
    linear-gradient(120deg, rgba(255, 204, 61, 0.18), transparent 42%),
    linear-gradient(135deg, var(--wine-900), var(--wine-950));
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(91, 19, 6, 0.14);
}

.hero-copy {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: stretch;
  gap: 16px;
  padding: 30px;
}

.kicker,
.keyword-row span,
.evidence-copy span,
.finding-card > span {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  padding: 7px 10px;
  color: var(--wine-950);
  background: var(--gold-300);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy h3 {
  max-width: 820px;
  margin: 0;
  color: #fff8dc;
  font-size: clamp(1.8rem, 3.1vw, 2.75rem);
  line-height: 1.08;
}

.hero-copy p {
  max-width: 780px;
  margin: 0;
  color: #f5d9a0;
  font-size: 1.04rem;
  line-height: 1.48;
}

.article-source-button {
  display: inline-flex;
  min-height: 42px;
  justify-self: start;
  align-items: center;
  padding: 10px 14px;
  color: var(--wine-950);
  background: var(--gold-500);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 9px 20px rgba(91, 19, 6, 0.1);
}

.article-source-button:hover {
  background: var(--gold-300);
}

.hero-facts {
  padding: 22px;
  background: rgba(255, 246, 216, 0.09);
  border-left: 1px solid rgba(255, 224, 138, 0.22);
}

.hero-facts dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.hero-facts div {
  padding: 13px;
  background: rgba(255, 246, 216, 0.13);
  border: 1px solid rgba(255, 224, 138, 0.24);
  border-radius: 7px;
}

.hero-facts dt {
  color: var(--gold-300);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 5px 0 0;
  color: #fff8dc;
  line-height: 1.35;
}

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

.insight-strip article,
.lens-card,
.section-card,
.finding-card,
.evidence-card {
  background: var(--paper);
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 9px 20px rgba(91, 19, 6, 0.08);
}

.insight-strip article {
  min-height: 106px;
  padding: 14px;
}

.insight-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--wine-900);
  font-size: 1.5rem;
  line-height: 1;
}

.insight-strip p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.28;
}

.overview-section {
  margin-top: 22px;
}

.compact-section,
.visual-section {
  padding: 18px;
  background: rgba(255, 241, 197, 0.55);
  border: 1px solid rgba(212, 168, 78, 0.72);
  border-radius: 8px;
}

.section-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.section-heading span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--wine-950);
  background: var(--gold-500);
  border-radius: 6px;
  font-weight: 900;
}

.section-heading h3 {
  margin: 0;
  color: var(--wine-950);
  font-size: 1.35rem;
}

.small-heading {
  margin-bottom: 10px;
}

.small-heading span {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

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

.lens-card,
.section-card,
.finding-card {
  padding: 16px;
}

.lens-card h4,
.finding-card h4 {
  margin: 0 0 9px;
  color: var(--wine-900);
  font-size: 1.08rem;
}

.lens-card p,
.lens-card li,
.section-card li,
.finding-card p,
.evidence-copy p {
  color: var(--muted);
  line-height: 1.43;
}

.lens-card p,
.finding-card p {
  margin: 0;
}

.lens-card ul,
.section-card ul {
  margin: 0;
  padding-left: 18px;
}

.lens-card li + li,
.section-card li + li {
  margin-top: 7px;
}

.keyword-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.keyword-row span {
  background: #fff6d8;
}

.finding-card {
  position: relative;
  min-height: 205px;
  border-top: 6px solid var(--gold-500);
}

.finding-card.romania {
  border-top-color: var(--rose);
}

.finding-card.turkiye {
  border-top-color: var(--blue);
}

.finding-card > span {
  margin-bottom: 12px;
  background: #fff6d8;
}

.finding-card h4 {
  font-size: 1.22rem;
}

.evidence-stack {
  display: grid;
  gap: 16px;
}

.evidence-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  overflow: hidden;
}

.evidence-card.is-reversed {
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
}

.evidence-card.is-reversed .evidence-visual {
  grid-column: 2;
  grid-row: 1;
}

.evidence-card.is-reversed .evidence-copy {
  grid-column: 1;
  grid-row: 1;
  border-left: 0;
  border-right: 1px solid var(--cream-300);
}

.evidence-visual {
  min-width: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.evidence-copy {
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 22px;
  background: linear-gradient(180deg, #fff7df, #fff1c5);
  border-left: 1px solid var(--cream-300);
}

.evidence-copy h4 {
  margin: 0;
  color: var(--wine-950);
  font-size: 1.18rem;
  line-height: 1.22;
}

.article-figure {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 0;
}

.article-figure img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(212, 168, 78, 0.62);
  border-radius: 6px;
}

.study-map {
  display: grid;
  gap: 10px;
}

.study-lane {
  padding: 10px;
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid rgba(212, 168, 78, 0.72);
  border-radius: 8px;
}

.study-lane-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.study-lane-head h5 {
  margin: 0;
  color: var(--wine-900);
  font-size: 0.96rem;
}

.study-lane-head span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 7px;
  color: var(--wine-950);
  background: var(--gold-300);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.study-card {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 9px;
  background: var(--paper);
  border: 1px solid var(--cream-300);
  border-radius: 7px;
  box-shadow: 0 5px 11px rgba(91, 19, 6, 0.06);
}

.study-card-top {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}

.study-card-top strong {
  color: var(--wine-900);
  font-size: 0.98rem;
}

.study-card-top span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 6px;
  color: var(--wine-950);
  background: #fff6d8;
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 900;
}

.study-card h6 {
  margin: 0;
  color: var(--wine-900);
  font-size: 0.88rem;
}

.study-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.22;
}

.command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.55fr);
  gap: 14px;
  min-height: 245px;
  padding: 20px;
  color: #fff8dc;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 204, 61, 0.2), transparent 22%),
    linear-gradient(135deg, var(--wine-900), var(--wine-950));
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(91, 19, 6, 0.14);
}

.command-hero > div,
.command-status {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 20px;
  background: rgba(255, 246, 216, 0.09);
  border: 1px solid rgba(255, 224, 138, 0.24);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 246, 216, 0.12);
}

.command-hero h3 {
  max-width: 780px;
  margin: 0;
  color: #fff8dc;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.03;
}

.command-hero p,
.command-status p {
  margin: 0;
  color: #f5d9a0;
  line-height: 1.42;
}

.command-status span {
  color: var(--gold-300);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.command-status strong {
  color: #fff8dc;
  font-size: 2.35rem;
}

.command-shell {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 204, 61, 0.16), rgba(255, 250, 240, 0.82)),
    var(--paper);
  border: 1px solid var(--cream-300);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(91, 19, 6, 0.11);
}

.command-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 0.52fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.command-orbit {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 204, 61, 0.2), transparent 34%),
    linear-gradient(145deg, #8a1d0b 0%, #5c0d05 58%, #260604 100%);
  border: 1px solid rgba(255, 224, 138, 0.45);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 246, 216, 0.16), 0 18px 36px rgba(91, 19, 6, 0.18);
}

.command-orbit svg {
  width: min(100%, 380px);
  height: auto;
}

.orbit-ring {
  fill: none;
  stroke: rgba(255, 224, 138, 0.22);
  stroke-width: 2;
}

.orbit-ring-mid {
  stroke-dasharray: 8 10;
}

.orbit-core {
  fill: rgba(255, 204, 61, 0.24);
  stroke: var(--gold-500);
  stroke-width: 3;
}

.command-orbit text {
  fill: #fff8dc;
  font-weight: 900;
  text-anchor: middle;
}

.command-link {
  stroke: rgba(255, 246, 216, 0.18);
  stroke-width: 3;
  stroke-linecap: round;
}

.command-link.is-lit {
  stroke: rgba(255, 204, 61, 0.78);
}

.command-node circle {
  fill: rgba(255, 246, 216, 0.1);
  stroke: rgba(255, 224, 138, 0.46);
  stroke-width: 2;
}

.command-node.is-unlocked circle {
  fill: rgba(255, 246, 216, 0.2);
}

.command-node.is-active circle {
  fill: var(--gold-500);
  stroke: #fff8dc;
}

.command-node.is-complete circle {
  fill: #7b9d45;
  stroke: #eff9ec;
}

.command-node.is-active text {
  fill: var(--wine-950);
}

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

.module-card {
  display: grid;
  gap: 8px;
  min-height: 116px;
  align-content: center;
  padding: 13px;
  color: #fff8dc;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 204, 61, 0.1), rgba(255, 246, 216, 0.04)),
    var(--wine-900);
  border: 1px solid rgba(255, 224, 138, 0.3);
  border-radius: 8px;
  box-shadow: 0 9px 20px rgba(91, 19, 6, 0.1);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.module-card:not(:disabled):hover,
.module-card.is-active {
  transform: translateY(-2px);
  color: var(--ink);
  background: var(--gold-500);
  border-color: var(--gold-500);
}

.module-card:disabled {
  cursor: default;
  opacity: 0.45;
}

.module-card.is-complete {
  background:
    linear-gradient(135deg, rgba(255, 246, 216, 0.16), rgba(255, 204, 61, 0.12)),
    #4d7025;
  border-color: rgba(255, 224, 138, 0.42);
}

.module-card span,
.module-card small {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.module-card strong {
  font-size: 1.05rem;
}

.workspace-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--cream-300);
  border-radius: 10px;
}

.workspace-head {
  display: grid;
  gap: 7px;
}

.workspace-head span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.workspace-head h3 {
  margin: 0;
  color: var(--wine-950);
  font-size: 1.62rem;
}

.workspace-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

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

.workflow-step {
  min-height: 96px;
  padding: 12px;
  color: #fff8dc;
  background: linear-gradient(145deg, var(--wine-950), var(--wine-800));
  border: 1px solid rgba(255, 224, 138, 0.26);
  border-radius: 8px;
}

.workflow-step.is-on {
  background:
    linear-gradient(135deg, rgba(255, 204, 61, 0.22), rgba(255, 246, 216, 0.06)),
    linear-gradient(145deg, var(--wine-900), var(--wine-700));
  border-color: rgba(255, 224, 138, 0.56);
}

.workflow-step span,
.workflow-step strong {
  display: block;
}

.workflow-step span {
  color: var(--gold-300);
  font-size: 0.74rem;
  font-weight: 900;
}

.workflow-step strong {
  margin-top: 9px;
  font-size: 0.96rem;
}

.evidence-brief {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.evidence-brief article {
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 9px 20px rgba(91, 19, 6, 0.08);
}

.evidence-brief h4 {
  margin: 0 0 8px;
  color: var(--wine-900);
}

.evidence-brief p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

#workspaceEvidence {
  display: grid;
  gap: 7px;
}

.command-evidence-card {
  padding: 9px 10px;
  color: rgba(112, 72, 52, 0.58);
  background: rgba(255, 246, 216, 0.58);
  border: 1px solid rgba(237, 207, 128, 0.64);
  border-radius: 6px;
  line-height: 1.32;
}

.command-evidence-card.is-visible {
  color: var(--muted);
  background: #fffaf0;
  border-color: var(--cream-300);
}

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

.game-reset-button {
  min-height: 40px;
  padding: 9px 11px;
  color: var(--wine-900);
  background: #fff6d8;
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-weight: 900;
}

.game-reset-button:not(:disabled):hover {
  background: var(--gold-500);
}

.game-reset-button:disabled {
  cursor: default;
  opacity: 0.48;
}

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

.conclusion-card {
  background: linear-gradient(180deg, #fffaf0, #fff1c5);
}

.site-footer {
  margin: 0 var(--frame-margin) 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--wine-900), var(--wine-950));
  color: #fff8dc;
  text-align: center;
  padding: 14px 18px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1120px) {
  .paper-hero,
  .command-hero,
  .command-dashboard,
  .lens-grid,
  .finding-grid,
  .evidence-card,
  .evidence-card.is-reversed,
  .bottom-grid,
  .evidence-brief {
    grid-template-columns: 1fr;
  }

  .evidence-card.is-reversed .evidence-visual,
  .evidence-card.is-reversed .evidence-copy {
    grid-column: auto;
    grid-row: auto;
  }

  .evidence-card.is-reversed .evidence-copy,
  .evidence-copy {
    border: 0;
    border-top: 1px solid var(--cream-300);
  }
}

@media (max-width: 980px) {
  .app-layout,
  .insight-strip,
  .module-grid,
  .workflow-strip {
    grid-template-columns: 1fr;
  }

  .side-panel {
    border-radius: 12px 12px 0 0;
  }
}

@media (max-width: 620px) {
  :root {
    --frame-margin: 8px;
  }

  .content-stage,
  .side-panel {
    padding: 16px;
  }

  .page-header {
    min-height: 0;
    padding: 4px;
    border-radius: 12px;
  }

  .image-banner {
    min-height: 0;
    border-radius: 12px;
  }

  .hero-copy,
  .hero-facts,
  .command-hero,
  .command-hero > div,
  .command-status,
  .command-shell,
  .workspace-panel,
  .compact-section,
  .visual-section,
  .evidence-visual,
  .evidence-copy,
  .section-card,
  .finding-card {
    padding: 14px;
  }

  .hero-copy h3 {
    font-size: 1.78rem;
  }
}
