:root {
  color-scheme: dark;
  --ink: #f4ead7;
  --muted: #c5b89d;
  --paper: #18130f;
  --paper-2: #231a14;
  --line: rgba(244, 234, 215, 0.22);
  --accent: #e1432f;
  --gold: #d8a83f;
  --shadow: rgba(0, 0, 0, 0.35);
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(225, 67, 47, 0.18), transparent 35rem),
    radial-gradient(circle at 80% 15%, rgba(216, 168, 63, 0.12), transparent 28rem),
    linear-gradient(135deg, #120e0b, #1a1410 45%, #0d0b0a);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent 75%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(18, 14, 11, 0.88);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}

.sigil {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 168, 63, 0.06);
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--ink);
}

.language-switcher {
  display: flex;
  border: 1px solid var(--line);
}

.lang-button {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
}

.lang-button:first-child {
  border-left: 0;
}

.lang-button.active {
  background: var(--ink);
  color: #17110d;
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 2rem;
  align-items: center;
  min-height: 72vh;
  padding: 5rem 0 3rem;
}

.hero-copy h1,
.section-heading h2,
.split-section h2,
.phases-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.hero-copy h1 {
  max-width: 780px;
  font-size: clamp(3.3rem, 10vw, 8.8rem);
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-text,
.section-heading p,
.split-section p {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  background: var(--ink);
  color: #17110d;
}

.button.ghost {
  background: transparent;
  color: var(--ink);
}

.hero-card,
.panel,
.submission-card,
.phase-grid article {
  border: 1px solid var(--line);
  background: rgba(35, 26, 20, 0.72);
  box-shadow: 0 26px 80px var(--shadow);
}

.hero-card {
  position: relative;
  padding: 1.5rem;
  transform: rotate(1.5deg);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0.75rem;
  border: 1px dashed rgba(244, 234, 215, 0.22);
  pointer-events: none;
}

.stamp {
  display: inline-block;
  margin: 0 0 1.5rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 0.35rem 0.65rem;
  font-weight: 900;
  transform: rotate(-3deg);
}

.hero-card li {
  margin: 0.85rem 0;
  color: var(--muted);
  line-height: 1.5;
}

.systems-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  padding-bottom: 3rem;
}

.systems-strip span,
.resource-card .tag,
.resource-card .score {
  border: 1px solid var(--line);
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.panel {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  margin: 2rem 0 4rem;
}

.section-heading {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-heading h2,
.split-section h2,
.phases-panel h2 {
  font-size: clamp(2.2rem, 6vw, 5.2rem);
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

label {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(10, 8, 7, 0.72);
  color: var(--ink);
  padding: 0.85rem;
  font: inherit;
}

textarea {
  resize: vertical;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.resource-card {
  display: grid;
  gap: 1rem;
  min-height: 100%;
  border: 1px solid var(--line);
  padding: 1rem;
  background: rgba(12, 9, 7, 0.52);
}

.resource-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.resource-card h3 {
  margin: 0.8rem 0 0.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  line-height: 1;
}

.resource-card h3 a {
  text-decoration: none;
}

.resource-card h3 a:hover {
  color: var(--gold);
}

.resource-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.seal {
  color: var(--gold);
  font-weight: 900;
}

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: start;
  margin: 5rem 0;
}

.submission-card {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.phase-grid article {
  padding: 1.25rem;
}

.phase-grid span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
}

.phase-grid h3 {
  margin: 0.75rem 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
}

.phase-grid p {
  color: var(--muted);
  line-height: 1.55;
}

.text-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.text-link.compact {
  margin-top: 0;
  font-size: 0.75rem;
}

.resource-detail {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.detail-card {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  background: rgba(35, 26, 20, 0.72);
  box-shadow: 0 26px 80px var(--shadow);
}

.detail-header {
  padding: clamp(1.25rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.detail-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.detail-header .hero-text {
  margin: 1.25rem auto 0;
}

.detail-meta {
  justify-content: center;
  margin-top: 1.5rem;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.fact-grid div {
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.fact-grid div:last-child {
  border-right: 0;
}

.fact-grid dt {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fact-grid dd {
  margin: 0.5rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.detail-body {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.25rem, 5vw, 3rem);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.78;
}

.detail-body p {
  margin: 0 0 1.35rem;
}

.translation-note,
.prototype-note {
  max-width: 760px;
  margin: 0 auto clamp(1.25rem, 4vw, 2rem);
  border: 1px dashed var(--line);
  padding: 1rem;
  color: var(--muted);
}

.translation-note strong {
  color: var(--gold);
}

.prototype-note {
  border-style: solid;
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-header,
  .hero,
  .split-section,
  .filters,
  .resource-grid,
  .phase-grid,
  .fact-grid {
    grid-template-columns: 1fr;
  }

  .fact-grid div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .fact-grid div:last-child {
    border-bottom: 0;
  }

  .site-header {
    position: static;
  }

  .main-nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
  }

  .hero-card {
    transform: none;
  }
}

@media (max-width: 560px) {
  main,
  .site-footer {
    width: min(100% - 1rem, 1180px);
  }

  .site-header {
    padding: 0.85rem;
  }

  .brand {
    letter-spacing: 0.08em;
  }

  .language-switcher {
    justify-self: start;
  }

  .site-footer {
    flex-direction: column;
  }
}
