:root {
  color-scheme: dark;
  --bg: #17100f;
  --bg-soft: #241715;
  --ink: #fff8ee;
  --muted: #c7b8aa;
  --dim: #927f72;
  --line: rgba(255, 248, 238, 0.16);
  --panel: rgba(42, 27, 24, 0.78);
  --panel-strong: rgba(61, 35, 31, 0.92);
  --paper: #fff4e7;
  --paper-ink: #261614;
  --rose: #c94f5f;
  --rose-dark: #8e2632;
  --amber: #d7a767;
  --sage: #7b9a84;
  --blue: #7d93b8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(201, 79, 95, 0.26), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(215, 167, 103, 0.18), transparent 28%),
    linear-gradient(135deg, #120d0d 0%, #211513 52%, #2a1717 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 248, 238, 0.28);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--rose), var(--rose-dark));
  color: white;
  font-size: 0.72rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.top-nav a:hover,
.site-footer a:hover {
  color: var(--ink);
}

.language-control select {
  height: 40px;
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 238, 0.08);
  color: var(--ink);
  padding: 0 10px;
}

.language-control option {
  color: #17100f;
}

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

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 42px;
  padding: 34px 0 56px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 7vw, 6.7rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.card-count {
  margin: 14px 0 0;
  color: var(--amber);
  font-weight: 850;
}

.primary-link,
.secondary-link,
.primary-button,
.secondary-button,
.mode-button,
.deck-card,
.icon-button {
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-link,
.secondary-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-weight: 820;
}

.primary-link,
.primary-button {
  border: 1px solid rgba(255, 248, 238, 0.18);
  background: linear-gradient(145deg, var(--rose), var(--rose-dark));
  color: white;
}

.secondary-link,
.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 248, 238, 0.08);
  color: var(--ink);
}

.showcase {
  position: relative;
  min-height: 560px;
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 248, 238, 0.08), transparent 40%),
    linear-gradient(130deg, rgba(201, 79, 95, 0.18), rgba(215, 167, 103, 0.08));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.showcase::before {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(255, 248, 238, 0.1);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 248, 238, 0.06) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(255, 248, 238, 0.04) 0 1px, transparent 1px 22px);
}

.floating-card {
  position: absolute;
  width: min(280px, 42%);
  min-height: 360px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 248, 238, 0.26);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.floating-card span {
  color: rgba(255, 248, 238, 0.72);
  font-size: 0.8rem;
  font-weight: 850;
}

.floating-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.card-a {
  top: 58px;
  left: 48px;
  background: linear-gradient(150deg, #b73749, #7d202b);
  transform: rotate(-9deg);
}

.card-b {
  right: 70px;
  top: 120px;
  background: var(--paper);
  color: var(--paper-ink);
  transform: rotate(8deg);
}

.card-b span {
  color: rgba(38, 22, 20, 0.58);
}

.card-c {
  left: 180px;
  bottom: 40px;
  background: linear-gradient(150deg, #3d2724, #241512);
  transform: rotate(-2deg);
}

.tool-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  margin: 20px 0;
}

.control-panel,
.card-stage,
.night-list-section,
.content-band,
.site-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 18px;
}

.panel-title {
  margin-bottom: 16px;
}

.panel-title h2,
.night-list-section h2,
.content-band h2,
.site-page h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.deck-grid {
  display: grid;
  gap: 10px;
}

.deck-card {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 238, 0.07);
  color: var(--ink);
  text-align: left;
}

.deck-card.active {
  border-color: rgba(215, 167, 103, 0.72);
  background: rgba(215, 167, 103, 0.12);
}

.deck-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--deck-color);
  display: inline-grid;
  place-items: center;
  color: white;
  font-weight: 850;
}

.deck-card strong {
  display: block;
  margin-bottom: 4px;
}

.deck-card span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 238, 0.06);
}

.mode-button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 820;
}

.mode-button.active {
  background: var(--paper);
  color: var(--paper-ink);
}

.action-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 16px;
  font-weight: 850;
}

.primary-button:hover,
.secondary-button:hover,
.deck-card:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.card-stage {
  min-height: 620px;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 248, 238, 0.12), transparent 24%),
    var(--panel);
}

.drawn-card {
  width: min(480px, 100%);
  min-height: 570px;
  padding: 28px;
  border-radius: 8px;
  color: var(--paper-ink);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.76), rgba(255, 244, 231, 0.94)),
    var(--paper);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.drawn-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(38, 22, 20, 0.12);
  border-radius: 8px;
  pointer-events: none;
}

.drawn-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(38, 22, 20, 0.035) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(38, 22, 20, 0.028) 0 1px, transparent 1px 18px);
  pointer-events: none;
}

.card-topline,
.card-kicker,
.drawn-card h2,
.drawn-card p,
.card-actions {
  position: relative;
  z-index: 1;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(38, 22, 20, 0.58);
  font-size: 0.85rem;
  font-weight: 850;
  text-transform: uppercase;
}

.card-kicker {
  color: var(--rose-dark);
  font-weight: 850;
}

.drawn-card h2 {
  margin: auto 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.03;
  letter-spacing: 0;
}

.drawn-card p {
  color: rgba(38, 22, 20, 0.7);
  line-height: 1.55;
}

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

.icon-button {
  min-height: 42px;
  border: 1px solid rgba(38, 22, 20, 0.18);
  background: rgba(255, 255, 255, 0.42);
  color: var(--paper-ink);
  font-weight: 850;
}

.status-line {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--amber);
  font-weight: 760;
  text-align: center;
}

.night-list-section,
.content-band,
.site-page {
  padding: 24px;
  margin: 18px 0;
}

.night-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style-position: inside;
}

.night-list li {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 238, 0.07);
  color: var(--muted);
  line-height: 1.45;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.content-grid article,
.site-page article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 248, 238, 0.06);
}

.content-grid h3,
.site-page h2 {
  margin-bottom: 8px;
}

.content-grid p,
.site-page p,
.site-page li {
  color: var(--muted);
  line-height: 1.7;
}

.site-page {
  max-width: 920px;
  min-height: calc(100vh - 170px);
}

.site-page article {
  margin-top: 18px;
}

.site-page ul {
  padding-left: 20px;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--dim);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.site-footer div {
  display: flex;
  gap: 14px;
}

@media (max-width: 940px) {
  .site-header {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .top-nav {
    order: 3;
    width: 100%;
  }

  .hero,
  .tool-section,
  .night-list,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .showcase {
    min-height: 470px;
  }

  .floating-card {
    min-height: 300px;
  }

  .card-stage {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  main,
  .site-header,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  h1 {
    font-size: 3.15rem;
  }

  .hero-copy {
    padding-top: 16px;
  }

  .hero-actions,
  .site-footer,
  .site-footer div {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .showcase {
    min-height: 420px;
  }

  .floating-card {
    width: 64%;
    min-height: 250px;
    padding: 18px;
  }

  .floating-card strong {
    font-size: 1.25rem;
  }

  .card-a {
    left: 16px;
  }

  .card-b {
    right: 16px;
  }

  .card-c {
    left: 74px;
  }

  .drawn-card {
    min-height: 500px;
    padding: 22px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }
}
