/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
  --color-primary: #816a83;
  --color-primary-dark: #28262c;
  --color-accent: #e1dde4;
  --color-accent-bright: #f5d0ff;
  --color-text: #f5f5f5;
  --color-text-muted: #aaa;
  --color-bg-overlay: rgba(255, 255, 255, 0.05);
  --color-bg-overlay-hover: rgba(255, 255, 255, 0.1);
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
  --border-radius: 15px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===========================
   Header
   =========================== */
header {
  background: #322e34;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* One flexbox: logo left, inline actions (lang + menu + burger) right */
.header-flex {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo left, never shrinks */
.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  flex: 0 0 auto;
}
.logo {
  height: 60px;
  width: auto;
  transition: transform 0.3s ease;
}
.logo:hover {
  transform: scale(1.05);
}
.logo-text {
  display: flex;
  flex-direction: column;
}
.logo-text h1 {
  color: var(--color-accent-bright);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}
.logo-text span {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 300;
}

/* Inline actions area: sits at the far right */
.inline-actions {
  margin-left: auto; /* push to the far right */
  display: flex;
  align-items: center;
  gap: 3rem; /* small space between lang and menu */
  min-width: 0; /* allow inner flex to shrink gracefully */
}

/* Language selector (inline) */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-inline {
  flex: 0 0 auto;
}
.lang-link {
  color: var(--color-text);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: var(--transition);
  border: 1px solid transparent;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: transparent;
  white-space: nowrap;
}
.lang-link:hover {
  background: var(--color-bg-overlay);
  color: var(--color-accent-bright);
  border-color: var(--color-bg-overlay-hover);
}
.lang-active {
  background: var(--color-bg-overlay-hover);
  color: var(--color-accent-bright);
  border-color: var(--color-accent);
}
.lang-sep {
  color: var(--color-text-muted);
}

/* Desktop/Tablet nav lives inline to the right of lang */
.nav-inline {
  flex: 0 1 auto;
  min-width: 0;
}
.nav-inline ul {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  align-items: center;
  white-space: nowrap;
}
.nav-inline a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
}
.nav-inline a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}
.nav-inline a:hover {
  background: var(--color-bg-overlay);
  color: var(--color-accent-bright);
}
.nav-inline a:hover::after {
  width: 80%;
}
.nav-inline a.active {
  background: var(--color-bg-overlay-hover);
  color: var(--color-accent-bright);
}

/* ===========================
   Animated Burger Button
   =========================== */
.menu-toggle {
  display: none; /* shown at the responsive breakpoint */
  flex: 0 0 auto;
  position: relative;
  width: 32px;
  height: 28px;
  padding: 0;
  margin-left: 0.25rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  border-radius: 3px;
  transition: transform 0.35s ease, opacity 0.25s ease, top 0.35s ease, bottom 0.35s ease;
}
/* 3 lines default positions */
.menu-toggle span:nth-child(1) {
  top: 4px;
}
.menu-toggle span:nth-child(2) {
  top: 12.5px;
}
.menu-toggle span:nth-child(3) {
  bottom: 4px;
}
/* Morph into an "X" when open */
.menu-toggle.is-open span:nth-child(1) {
  top: 12.5px;
  transform: rotate(45deg);
}
.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.is-open span:nth-child(3) {
  bottom: auto;
  top: 12.5px;
  transform: rotate(-45deg);
}

/* ===========================
   Drawer (mobile/tablet) with animation
   =========================== */
/* Hidden by default on ALL widths */
.drawer {
  display: none;
}

/* Only participate at/below breakpoint; animated collapse/expand */
@media (max-width: 1100px) {
  .drawer {
    display: grid; /* used only at/below breakpoint */
    grid-template-rows: 0fr; /* collapsed by default */
    transition: grid-template-rows 0.35s ease;
    background: #322e34;
    border-top: 1px solid var(--color-bg-overlay-hover);
    overflow: hidden;
  }
  .drawer > .drawer-inner {
    min-height: 0;
  } /* for animation */
  .drawer.active {
    grid-template-rows: 1fr;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) inset;
  }
}

/* Drawer content spacing */
.lang-drawer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0.75rem 2rem 0.35rem;
}
.nav-drawer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem 2rem 1rem;
}
.nav-drawer a {
  display: block;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.9rem 0.75rem;
  border-radius: 8px;
  transition: var(--transition);
}
.nav-drawer a:hover {
  background: var(--color-bg-overlay);
  color: var(--color-accent-bright);
}
.nav-drawer a.active {
  background: var(--color-bg-overlay-hover);
  color: var(--color-accent-bright);
}

/* ===========================
   Main Content
   =========================== */
main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
}
.hero {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}
.hero h1 {
  font-size: 3.5rem;
  color: var(--color-accent-bright);
  margin-bottom: var(--spacing-sm);
  font-weight: 700;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}
.hero h2 {
  font-size: 1.8rem;
  color: var(--color-accent);
  margin-bottom: var(--spacing-md);
  font-weight: 400;
}
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 800px;
  margin: 0 auto;
}

.content-section {
  background: var(--color-bg-overlay);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}
.content-section:hover {
  background: var(--color-bg-overlay-hover);
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.content-section h2 {
  color: var(--color-accent-bright);
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: var(--spacing-sm);
}
.content-section h3 {
  color: var(--color-accent);
  font-size: 1.5rem;
  margin: var(--spacing-md) 0 var(--spacing-sm);
}
.content-section p {
  margin-bottom: var(--spacing-sm);
  line-height: 1.8;
}
.content-section strong,
.content-section em {
  color: var(--color-accent);
}
.content-section ul {
  margin-left: 2rem;
  margin-bottom: var(--spacing-sm);
}
.content-section ul li {
  margin-bottom: 0.5rem;
}

/* Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}
.card {
  background: var(--color-bg-overlay);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: 1px solid rgba(224, 176, 255, 0.1);
}
.card:hover {
  background: var(--color-bg-overlay-hover);
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--color-accent);
}
.card h3 {
  color: var(--color-accent-bright);
  margin-bottom: var(--spacing-sm);
}

/* ===========================
   Footer
   =========================== */
footer {
  background: #322e34;
  backdrop-filter: blur(10px);
  margin-top: auto;
  padding: var(--spacing-lg) var(--spacing-md);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}
.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}
.footer-section h3 {
  color: var(--color-accent-bright);
  font-size: 1.3rem;
  margin-bottom: var(--spacing-sm);
}
.footer-section p,
.footer-section a {
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.8;
  display: block;
  margin-bottom: 0.5rem;
}
.footer-section a:hover {
  color: var(--color-accent-bright);
  padding-left: 5px;
  transition: var(--transition);
}
.footer-links {
  display: flex;
  flex-direction: column;
}
.social-links {
  display: flex;
  gap: 1rem;
  margin-top: var(--spacing-sm);
}
.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-overlay);
  border-radius: 50%;
  transition: var(--transition);
}
.social-links a:hover {
  background: var(--color-accent);
  transform: scale(1.1);
}
.footer-bottom {
  border-top: 1px solid var(--color-bg-overlay-hover);
  padding-top: var(--spacing-md);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.footer-bottom-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: var(--spacing-sm);
  flex-wrap: wrap;
}
.footer-bottom-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: var(--transition);
}
.footer-bottom-links a:hover {
  color: var(--color-accent-bright);
}

/* ===========================
   Responsive behavior
   =========================== */
/* Collapse nav + lang into burger when space is tight (adjust 1100px as needed) */
@media (max-width: 1100px) {
  .nav-inline {
    display: none;
  } /* hide inline menu */
  .lang-inline {
    display: none;
  } /* hide inline language */
  .menu-toggle {
    display: block;
  } /* show animated burger */
}
