:root {
  color-scheme: light;
  --bg: #f3ecdf;
  --bg-deep: #ebe0ce;
  --panel: rgba(255, 251, 244, 0.88);
  --panel-strong: #fffaf2;
  --ink: #222722;
  --muted: #666259;
  --line: rgba(67, 55, 33, 0.1);
  --accent: #d35b2a;
  --accent-deep: #b7471d;
  --accent-soft: rgba(211, 91, 42, 0.12);
  --shadow: 0 24px 52px rgba(84, 67, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 28%),
    radial-gradient(circle at top right, rgba(211, 91, 42, 0.12), transparent 24%),
    linear-gradient(180deg, #f7f0e5 0%, var(--bg) 100%);
}

.home-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px 1fr;
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 22px 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 249, 240, 0.72);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  padding: 4px 6px 20px;
  border-bottom: 1px solid var(--line);
}

.brand-home-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, opacity 160ms ease;
}

.brand-home-link:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.brand-word,
.topbar-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.brand-word {
  display: block;
  font-size: 2.15rem;
}

.brand-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.rail-nav {
  display: grid;
  gap: 8px;
}

.rail-label,
.eyebrow,
.module-kicker {
  margin: 6px 0 4px;
  color: #896d58;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.rail-link {
  display: block;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 15px;
  text-align: left;
  font: inherit;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}

.rail-link-static {
  cursor: default;
  opacity: 0.72;
}

.rail-link-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 14px 24px rgba(211, 91, 42, 0.2);
}

.main-panel {
  padding: 24px 28px 32px;
}

.topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  padding: 8px 4px 18px;
  border-bottom: 1px solid var(--line);
}

.topbar-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-mark {
  font-size: 1.95rem;
}

.topbar-home {
  color: inherit;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  transition: opacity 160ms ease, transform 160ms ease;
}

.topbar-home:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}

.topbar-subtitle {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.hero-panel {
  border-radius: 30px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-panel {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1fr);
  gap: 16px;
  padding: 26px;
  align-items: center;
}

.hero-copy {
  padding: 6px 8px 6px 10px;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

h1 {
  margin-top: 0;
  max-width: 12ch;
  font-size: clamp(1.85rem, 3.2vw, 2.95rem);
}

h2 {
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
}

.hero-text,
.module-copy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.68;
}

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

.primary-link,
button {
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.primary-link,
button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-link:hover,
button:hover {
  transform: translateY(-1px);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 16px 30px rgba(211, 91, 42, 0.22);
}

.primary-link {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 16px 30px rgba(211, 91, 42, 0.22);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border: 1px solid var(--line);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual-link {
  position: relative;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease;
}

.hero-visual-link:hover {
  transform: translateY(-2px);
}

.hero-visual-link::after {
  content: "Open 2 Umpire Mechanics";
  position: absolute;
  left: 26px;
  bottom: 26px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(34, 39, 34, 0.9);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.visual-frame {
  width: 100%;
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(67, 55, 33, 0.08);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.hero-visual-link:hover .visual-frame {
  border-color: rgba(211, 91, 42, 0.18);
  box-shadow: 0 18px 30px rgba(84, 67, 34, 0.12);
}

.hero-visual-link:hover::after,
.hero-visual-link:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.hero-visual-link:focus-visible {
  outline: none;
}

.hero-visual-link:focus-visible .visual-frame {
  border-color: rgba(211, 91, 42, 0.28);
  box-shadow: 0 0 0 4px rgba(211, 91, 42, 0.12);
}

.field-image {
  width: 100%;
  display: block;
  object-fit: contain;
  border-radius: 20px;
}

.module-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
}

.module-card {
  padding: 20px 20px 22px;
  border-radius: 24px;
  background: rgba(255, 251, 244, 0.82);
  border: 1px solid rgba(67, 55, 33, 0.08);
  box-shadow: 0 12px 26px rgba(84, 67, 34, 0.08);
}

.module-card-featured {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(250, 243, 232, 0.96));
}

.situations-panel {
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.8fr);
}

.situations-page .home-shell {
  grid-template-columns: 1fr;
}

.situations-page .main-panel {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.situations-stats {
  display: grid;
  gap: 14px;
}

.library-panel {
  margin-top: 18px;
  padding: 24px;
  border-radius: 30px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.library-count {
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.scenario-link {
  display: block;
  padding: 18px;
  border-radius: 22px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(67, 55, 33, 0.08);
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.scenario-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(84, 67, 34, 0.1);
}

.scenario-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.92rem;
  font-weight: 800;
}

.scenario-title {
  margin: 16px 0 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.scenario-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .home-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    gap: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: start;
  }

  .rail-label {
    grid-column: 1 / -1;
    margin-top: 2px;
  }

  .module-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .main-panel {
    padding: 18px 14px 24px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .situations-panel {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 2px 2px 0;
  }

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

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

  .library-header {
    flex-direction: column;
    align-items: start;
  }

  .hero-visual {
    order: -1;
  }

  .visual-frame {
    padding: 12px;
    border-radius: 22px;
  }

  .field-image {
    border-radius: 16px;
  }

  .hero-visual-link::after {
    left: 18px;
    bottom: 18px;
    font-size: 0.8rem;
  }

  .home-page .side-rail {
    gap: 12px;
    padding: 18px 14px 8px;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .home-page .brand-lockup {
    padding: 0;
    border-bottom: 0;
    text-align: center;
  }

  .home-page .rail-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .home-page .rail-label {
    display: block;
    margin: 8px 0 2px;
    text-align: center;
  }

  .home-page .rail-link,
  .home-page .rail-link-static {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(67, 55, 33, 0.08);
    box-shadow: 0 10px 22px rgba(84, 67, 34, 0.06);
  }

  .home-page .rail-link-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border-color: transparent;
  }

  .home-page .topbar {
    display: none;
  }

  .home-page .main-panel {
    padding-top: 4px;
  }

  .home-page .hero-panel {
    margin-top: 6px;
    gap: 14px;
    padding: 14px;
    border-radius: 24px;
  }

  .home-page .hero-visual {
    order: 0;
  }

  .home-page .hero-copy {
    text-align: center;
    padding: 2px 4px 4px;
  }

  .home-page .eyebrow {
    margin-top: 0;
  }

  .home-page h1 {
    margin-left: auto;
    margin-right: auto;
    max-width: 30rem;
  }

  .home-page .hero-text {
    max-width: 30rem;
    margin-left: auto;
    margin-right: auto;
  }

  .home-page .hero-actions {
    justify-content: center;
    margin-top: 18px;
  }

  .home-page .primary-link {
    width: min(100%, 320px);
  }

  .home-page .visual-frame {
    padding: 10px;
    border-radius: 20px;
  }

  .home-page .module-strip {
    margin-top: 14px;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .side-rail {
    gap: 14px;
    padding: 16px 14px;
    background: rgba(255, 249, 240, 0.92);
  }

  .brand-word,
  .topbar-mark {
    font-size: 1.8rem;
  }

  .topbar {
    flex-direction: column;
    align-items: start;
  }

  .topbar-copy {
    align-items: start;
  }

  .topbar-divider {
    display: none;
  }

  .topbar-home {
    font-size: 1.8rem;
  }

  .topbar-subtitle {
    font-size: 0.92rem;
  }

  h1 {
    max-width: none;
    font-size: clamp(2rem, 11vw, 3rem);
    line-height: 0.98;
  }

  .hero-text,
  .module-copy {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .rail-nav {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rail-link {
    padding: 11px 12px;
    font-size: 0.96rem;
  }

  .hero-panel,
  .library-panel,
  .module-card {
    border-radius: 22px;
  }

  .module-card {
    padding: 18px;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual-link::after {
    left: 14px;
    right: 14px;
    bottom: 14px;
    text-align: center;
  }

  .home-page .side-rail {
    padding: 14px 12px 6px;
  }

  .home-page .brand-word {
    font-size: 2.35rem;
  }

  .home-page .brand-note {
    font-size: 0.98rem;
  }

  .home-page .rail-nav {
    gap: 8px;
  }

  .home-page .rail-link,
  .home-page .rail-link-static {
    width: 100%;
    text-align: center;
    font-size: 0.96rem;
  }

  .home-page .hero-panel {
    padding: 12px;
    border-radius: 20px;
  }

  .home-page h1 {
    font-size: clamp(1.55rem, 7vw, 2.05rem);
    max-width: 30rem;
  }

  .home-page .hero-text {
    font-size: 1rem;
    line-height: 1.55;
  }

  .home-page .visual-frame {
    padding: 8px;
    border-radius: 18px;
  }

  .home-page .field-image {
    border-radius: 14px;
  }

  .home-page .module-card {
    padding: 16px;
  }

  .home-page .module-card h2 {
    font-size: 1.5rem;
  }
}
