/* ==========================================================================
   THE CASTLE FLOOR LLC — Official Design System & Stylesheet
   Domain: thecastlefloor.com
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --bg-dark: #0D1017;
  --bg-secondary: #151A24;
  --bg-card: #1B2230;
  --bg-card-hover: #222B3D;
  
  --text-primary: #F4F2EA;
  --text-secondary: #A8AFBC;
  --text-muted: #6C768A;
  
  --accent-gold: #D5A94E;
  --accent-gold-light: #F0C86A;
  --accent-gold-glow: rgba(213, 169, 78, 0.15);
  --accent-gold-border: rgba(213, 169, 78, 0.3);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(213, 169, 78, 0.4);

  /* Typography — System & Local High-Quality Fallbacks (No External Requests) */
  --font-heading: 'Cinzel', 'Trajan Pro', 'Baskerville', 'Georgia', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  /* Layout & Spacing */
  --container-max: 1140px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  /* Transitions & Shadows */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(213, 169, 78, 0.15);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: dark;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Skip link for keyboard accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent-gold);
  color: var(--bg-dark);
  padding: 10px 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 20px;
}

/* Focus styles for keyboard users */
:focus-visible {
  outline: 2px solid var(--accent-gold-light);
  outline-offset: 4px;
}

/* Base Typography Elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

p.lead {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--text-secondary);
  max-width: 720px;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-gold-light);
}

/* Standard Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1 0 auto;
  padding-top: var(--header-height);
}

/* --------------------------------------------------------------------------
   3. HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: rgba(13, 16, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.site-header.scrolled {
  background-color: rgba(13, 16, 23, 0.95);
  border-bottom-color: rgba(213, 169, 78, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
}

.brand-link:hover .brand-logo {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.65rem;
  font-family: var(--font-body);
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav Menu Desktop */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  position: relative;
  padding: 0.4rem 0;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-gold);
  transition: width var(--transition-normal);
  border-radius: 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--accent-gold-light);
  font-weight: 600;
}

/* Mobile Menu Toggle Button */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.nav-toggle:hover {
  border-color: var(--accent-gold);
  background-color: var(--accent-gold-glow);
}

.hamburger-icon {
  width: 22px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-fast);
}

/* Mobile Open State */
.nav-toggle[aria-expanded="true"] .line-1 {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .line-2 {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .line-3 {
  transform: translateY(-8px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   4. HERO SECTION
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  padding: 6rem 0 5rem 0;
  overflow: hidden;
  background-color: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
}

/* Hero Background Lighting & Overlay */
.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/hero-bg-pattern.svg');
  background-repeat: repeat;
  opacity: 0.6;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(213, 169, 78, 0.12) 0%, rgba(21, 26, 36, 0) 70%);
  pointer-events: none;
  filter: blur(40px);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 840px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(213, 169, 78, 0.08);
  border: 1px solid var(--accent-gold-border);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-gold-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-gold);
}

.hero-title {
  color: var(--text-primary);
  letter-spacing: 0.03em;
  margin-bottom: 1.5rem;
}

.hero-title span {
  background: linear-gradient(135deg, #F4F2EA 30%, #D5A94E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  margin: 0 auto 2.5rem auto;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   5. BUTTONS & INTERACTIVE ELEMENTS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #D5A94E 0%, #B88B35 100%);
  color: #0D1017;
  border: 1px solid var(--accent-gold-light);
  box-shadow: 0 4px 15px rgba(213, 169, 78, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #F0C86A 0%, #D5A94E 100%);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(213, 169, 78, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.btn-icon {
  transition: transform var(--transition-fast);
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   6. SECTIONS & CARDS
   -------------------------------------------------------------------------- */
.section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5rem auto;
}

.section-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

/* Cards Grid Layout */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  position: relative;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold-border);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card-icon-wrapper {
  width: 52px;
  height: 52px;
  background: rgba(213, 169, 78, 0.08);
  border: 1px solid var(--accent-gold-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold-light);
  margin-bottom: 1.5rem;
}

.card-title {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.card-text {
  font-size: 0.98rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. GAMES PAGE / SHOWCASE
   -------------------------------------------------------------------------- */
.games-teaser-box {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px dashed var(--accent-gold-border);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.teaser-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem auto;
  color: var(--accent-gold);
  opacity: 0.85;
}

.game-card-template {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-cover-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.game-card-body {
  padding: 1.75rem;
  flex: 1;
}

.game-meta-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.tag-gold {
  color: var(--accent-gold-light);
  border-color: var(--accent-gold-border);
  background: rgba(213, 169, 78, 0.08);
}

/* --------------------------------------------------------------------------
   8. ABOUT PAGE & LEGAL INFORMATION
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 860px) {
  .about-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.legal-notice-box {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-gold);
  padding: 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 2rem;
}

.legal-notice-box p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.legal-notice-box p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. CONTACT PAGE
   -------------------------------------------------------------------------- */
.contact-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
}

.email-box {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg-dark);
  border: 1px solid var(--accent-gold-border);
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-gold-light);
  margin: 1.5rem 0 2rem 0;
}

.email-box svg {
  color: var(--accent-gold);
}

.config-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   10. PRIVACY POLICY PAGE
   -------------------------------------------------------------------------- */
.policy-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3rem;
}

.policy-content h2 {
  font-size: 1.5rem;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.policy-content h2:first-of-type {
  margin-top: 0;
}

.policy-content ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.policy-content li {
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   11. 404 PAGE
   -------------------------------------------------------------------------- */
.error-page {
  text-align: center;
  padding: 6rem 1.5rem;
  max-width: 640px;
  margin: 0 auto;
}

.error-code {
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent-gold);
  line-height: 1;
  margin-bottom: 1rem;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   12. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem 0;
  margin-top: auto;
  font-size: 0.9rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.footer-nav {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-nav a:hover {
  color: var(--accent-gold);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
}

.footer-copy {
  font-size: 0.85rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   13. RESPONSIVE BREAKPOINTS & ACCESSIBILITY
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: rgba(13, 16, 23, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 0;
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    border-left: 3px solid transparent;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.active,
  .nav-link:hover {
    background: rgba(213, 169, 78, 0.08);
    border-left-color: var(--accent-gold);
  }

  .nav-toggle {
    display: flex;
  }

  .hero-section {
    padding: 4rem 0 3rem 0;
  }

  .policy-content {
    padding: 1.75rem;
  }
}

/* Reduced Motion Override for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
