:root {
  --home-background-color: #ffffff;
  --home-background-image: none;
  --castle-red: #db0000;
  --castle-purple: #3f1174;
  --castle-gold: #b88d24;
  --castle-ink: #17151b;
}

@font-face {
  font-family: 'BlackCastle';
  src: url('../Fonts/Blackcastlemf-BG5n.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--castle-ink);
  background-color: var(--home-background-color);
  background-image: var(--home-background-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: Georgia, 'Times New Roman', serif;
}

.home-main {
  width: min(1120px, 100%);
  flex: 1;
  margin: 0 auto;
  padding: 38px 28px 44px;
}

.home-header {
  margin: 0 auto 34px;
  text-align: center;
}

.home-title {
  margin: 0;
  color: var(--castle-red);
  font-family: BlackCastle, Georgia, serif;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.12;
}

.home-former-name {
  margin: 9px 0 0;
  color: #514a57;
  font-size: 17px;
  line-height: 1.4;
}

.home-origin {
  margin: 6px 0 0;
  color: var(--castle-purple);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: 1040px;
  margin: 0 auto;
}

.home-shortcut {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 245px;
  padding: 2px;
  border: 4px solid #3d2817;
  border-radius: 15px 15px 50% 50%;
  color: #111;
  background: linear-gradient(135deg, #c0a080 0%, #8b7355 50%, #5a4a3a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 5px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.4);
  font-family: 'BlackCastle', serif;
  text-decoration: none;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.35);
  overflow: hidden;
  transition: all 0.3s ease;
}

.home-shortcut::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30%;
  border-radius: 15px 15px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
  pointer-events: none;
}

.home-shortcut:hover {
  border-color: #ffd700;
  background: linear-gradient(135deg, #d4b896 0%, #a8956a 50%, #6b5a45 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 215, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translateY(-3px) scale(1.05);
}

.home-shortcut-face {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 14px 28px;
  text-align: center;
}

.home-shortcut-number {
  max-width: 100%;
  color: #111;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.home-shortcut-title {
  max-width: 100%;
  color: #111;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.home-shortcut-action {
  color: #251b13;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.home-shortcut:focus-visible,
.home-footer-links a:focus-visible {
  outline: 3px solid var(--castle-gold);
  outline-offset: 4px;
}

.home-category-index a:focus-visible {
  outline: 3px solid var(--castle-gold);
  outline-offset: 3px;
}

.home-category-index {
  max-width: 1040px;
  margin: 38px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(63, 17, 116, 0.24);
  text-align: center;
}

.home-category-index h2 {
  margin: 0;
  color: var(--castle-purple);
  font-size: 22px;
}

.home-category-index p {
  margin: 8px 0 14px;
  color: #514a57;
  line-height: 1.5;
}

.home-category-index nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.home-category-index a {
  color: var(--castle-purple);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.home-category-index a:hover {
  color: var(--castle-red);
}

.home-footer {
  padding: 18px 24px 12px;
  color: #ffffff;
  background: var(--castle-purple);
  text-align: center;
}

.home-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 980px;
  margin: 0 auto;
}

.home-footer-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid rgba(255, 215, 0, 0.75);
  border-radius: 4px;
  color: #ffe486;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.home-footer-links a:hover {
  color: #ffffff;
  background: #511c8a;
}

.home-copyright {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 12px;
}

@media (max-width: 800px) {
  .home-main {
    padding: 30px 20px 36px;
  }

  .home-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-width: 560px;
  }

  .home-shortcut {
    min-height: 220px;
  }
}

@media (max-width: 480px) {
  .home-main {
    padding: 24px 14px 28px;
  }

  .home-header {
    margin-bottom: 24px;
  }

  .home-category-index {
    margin-top: 28px;
  }

  .home-title {
    font-size: 32px;
  }

  .home-former-name {
    font-size: 14px;
  }

  .home-origin {
    font-size: 17px;
  }

  .home-shortcuts {
    gap: 10px;
  }

  .home-shortcut {
    min-height: 190px;
  }

  .home-shortcut-face {
    gap: 9px;
    padding: 16px 8px 24px;
  }

  .home-shortcut-number {
    font-size: 0.95rem;
  }

  .home-shortcut-title {
    font-size: 16px;
  }

  .home-shortcut-action {
    font-size: 12px;
  }

  .home-footer {
    padding: 14px 12px 10px;
  }

  .home-footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .home-footer-links a {
    padding: 9px 6px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-shortcut {
    transition: none;
  }
}