/* ==========================================
   HONGDAO TCM CLINIC - STYLE SHEET
   Exclusive Color Palette:
   - Beige / Cream (Min 60%): Background, peace & minimalism
   - Terracotta: Accent, buttons, highlights, warmth
   - Jadegrün: Medical, natural spirituality
   - Hellblau: Calmness, retreats, sound healing
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  /* Color Variables */
  --bg-cream-light: #FBF9F6;
  --bg-cream-dark: #F3EFE9;
  --text-dark: #2C2C2C;
  --text-muted: #5C5C5C;
  
  --terracotta: #E65A28; /* Vibrant Cinnabar Orange */
  --terracotta-hover: #C54316; /* Deep Vermilion/Orange-red */
  --terracotta-light: #FCEDE7; /* Soft Cinnabar tint */
  
  --jade-green: #2D5A46;
  --jade-hover: #224334;
  --jade-light: #EBF2EE;
  
  --hellblau: #A3C1AD; /* Soft teal-blue */
  --hellblau-sky: #D5E5F2; /* Light blue accent */
  --hellblau-dark: #5B8296;
  
  /* Typography */
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Outfit', sans-serif;
  
  /* Shared values */
  --border-radius: 12px;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-medium: 0 10px 30px rgba(185, 92, 56, 0.08);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-cream-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

h1, h2, h3, h4, .title-large, .title-medium, .title-small, .card h3, .card h4 {
  overflow-wrap: normal;
  word-wrap: normal;
  word-break: normal;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  transition: var(--transition-smooth);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-cream-light);
}
::-webkit-scrollbar-thumb {
  background: var(--hellblau);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--terracotta);
}

/* Typography Helpers */
.title-large {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}
.title-medium {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}
.title-small {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.text-italic {
  font-family: var(--font-serif);
  font-style: italic;
}
.subtitle-serif {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--terracotta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

/* Sections Structure */
section {
  padding: 8rem 10%;
  position: relative;
}

.cream-bg {
  background-color: var(--bg-cream-light);
}

.cream-dark-bg {
  background-color: var(--bg-cream-dark);
}

.jade-bg {
  background-color: var(--jade-light);
}

.blue-bg {
  background-color: var(--hellblau-sky);
}

/* Philosophy Visual & Bodhisattva Image */
.philosophy-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.bodhisattva-wrapper {
  position: relative;
  width: 320px;
  height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bodhisattva-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 15px 35px rgba(230, 90, 40, 0.12));
  transition: var(--transition-smooth);
}

.bodhisattva-img:hover {
  transform: translateY(-5px) scale(1.02);
  filter: drop-shadow(0 20px 40px rgba(230, 90, 40, 0.18));
}

.halo-effect {
  position: absolute;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(230, 90, 40, 0.1) 0%, rgba(230, 90, 40, 0) 70%);
  border-radius: 50%;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(230, 90, 40, 0.15);
  animation: rotateHalo 40s linear infinite;
}

@keyframes rotateHalo {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* =========================================
   App Layout & Sidebar (Site Bar)
   ========================================= */

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  width: 100%;
}

/* Mobile Header (Fixed Top) */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background-color: rgba(251, 249, 246, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 1000;
}

.logo-mobile .logo-img {
  height: 32px;
  width: auto;
  mix-blend-mode: multiply;
}

/* Sidebar / Fullscreen Menu */
.sidebar {
  position: fixed;
  top: 64px; /* below mobile header */
  left: 0;
  width: 100%;
  height: calc(100vh - 64px);
  background-color: var(--bg-cream-light);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  gap: 2rem;
  height: 100%;
}

.sidebar .logo {
  display: none; /* Hidden on mobile */
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-dark);
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.sidebar .logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: var(--transition-smooth);
}

.sidebar .logo:hover .logo-img {
  transform: scale(1.05);
}

.sidebar .logo-text {
  display: block;
}

.sidebar .logo-sub {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--terracotta);
  display: block;
}

.sidebar .nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .nav-links a {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.02em;
  text-decoration: none;
  display: block;
  transition: color 0.2s ease;
}

.sidebar .nav-links a:hover {
  color: var(--terracotta);
}

.sidebar .nav-controls {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}

.nav-tech-pill {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--jade-light);
  color: var(--jade-green);
  border: 1px solid rgba(45, 90, 70, 0.15);
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.nav-tech-pill:hover {
  background: var(--jade-green);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(45, 90, 70, 0.2);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  background: var(--bg-cream-dark);
  border-radius: 20px;
  padding: 3px;
  border: 1px solid rgba(0,0,0,0.05);
}

.lang-btn {
  background: none;
  padding: 6px 12px;
  border-radius: 17px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.lang-btn.active {
  background-color: white;
  color: var(--terracotta);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  border-radius: 30px;
  text-transform: uppercase;
  transition: var(--transition-smooth);
}

.btn-terracotta {
  background-color: var(--terracotta);
  color: white;
}

.btn-terracotta:hover {
  background-color: var(--terracotta-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(185, 92, 56, 0.2);
}

.btn-outline {
  border: 1px solid var(--terracotta);
  color: var(--terracotta);
  background-color: transparent;
}

.btn-outline:hover {
  background-color: var(--terracotta-light);
  transform: translateY(-2px);
}

.btn-jade {
  background-color: var(--jade-green);
  color: white;
}

.btn-jade:hover {
  background-color: var(--jade-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(45, 90, 70, 0.2);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  position: relative;
  padding-top: 64px; /* for mobile header */
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(251, 249, 246, 0.92) 30%, rgba(251, 249, 246, 0.6) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-tag {
  display: inline-block;
  background: var(--terracotta-light);
  color: var(--terracotta);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero h1 {
  line-height: 1.1;
  color: var(--text-dark);
}

.hero-buttons {
  margin-top: 2.5rem;
  display: flex;
  gap: 1.2rem;
}

/* Cards & Hover Effects */
.card {
  background-color: white;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(251,249,246,0.9)), url('images/hero_bg.png');
  background-size: cover;
  background-position: center;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
  border: 1px solid rgba(0,0,0,0.02);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-medium);
}

.card-img-wrapper {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.card:hover .card-img {
  transform: scale(1.08);
}

.card-content {
  padding: 2rem;
}

/* Doctors & Masters */
.master-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 3rem;
  box-shadow: var(--shadow-subtle);
  border-left: 4px solid var(--terracotta);
}

.avatar-wrapper {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 3px solid var(--bg-cream-dark);
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Specialized Treatments */
.treatment-badge {
  display: inline-block;
  background-color: var(--jade-light);
  color: var(--jade-green);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 15px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

#treatments .card {
  position: relative;
  background-size: cover;
  background-position: center;
  z-index: 1;
  overflow: hidden;
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}

#treatments .card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: -1;
  transition: background-color 0.3s ease;
}

#treatments .card:hover::after {
  background: rgba(0, 0, 0, 0.35);
}

#treatments .card > * {
  position: relative;
  z-index: 2;
}

/* Devices Section */
.device-card {
  text-align: center;
  padding: 2.5rem 2rem;
}

.device-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--jade-light);
  color: var(--jade-green);
  margin: 0 auto 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

/* Programs & Endometriosis Simulator */
.endo-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 3rem;
  box-shadow: var(--shadow-subtle);
}

.pricing-toggle-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0 3rem 0;
  background: var(--bg-cream-dark);
  border-radius: 30px;
  padding: 5px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-toggle-btn {
  flex: 1;
  background: none;
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 25px;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.pricing-toggle-btn.active {
  background-color: white;
  color: var(--terracotta);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.price-display {
  text-align: center;
  margin: 2rem 0;
}

.price-amount {
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--terracotta);
  font-weight: 600;
}

.price-period {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.feature-list {
  list-style: none;
  margin: 2rem 0;
  padding-left: 0;
}

.feature-list li {
  margin-bottom: 0.8rem;
  position: relative;
  padding-left: 1.6rem;
  line-height: 1.6;
}

.feature-list li::before {
  content: '✓';
  color: var(--jade-green);
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;
}

/* Yunnan Partner Hotel & Experience */
.yunnan-showcase {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  background-color: white;
}

.yunnan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.yunnan-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  background: var(--bg-cream-dark);
}

.yunnan-img {
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.yunnan-img:hover {
  transform: scale(1.03);
}

.yunnan-details {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Child Space */
.child-space-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.child-space-info {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Marketing Popup (Modal Alert) */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 44, 44, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%) scale(0.9);
  background-color: var(--bg-cream-light);
  width: 90%;
  max-width: 500px;
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  text-align: center;
  transition: var(--transition-smooth);
  border: 1px solid rgba(185, 92, 56, 0.1);
}

.popup-overlay.active .popup-window {
  transform: translate(-50%, -50%) scale(1);
}

.popup-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.popup-close:hover {
  color: var(--terracotta);
}

.popup-tag {
  font-family: var(--font-serif);
  color: var(--terracotta);
  font-style: italic;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}

.popup-code {
  display: inline-block;
  background-color: var(--terracotta-light);
  border: 1.5px dashed var(--terracotta);
  color: var(--terracotta);
  padding: 0.6rem 2rem;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  border-radius: 10px;
  margin: 1.5rem 0;
}

/* Interactive Booking Form & Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 44, 44, 0.5);
  backdrop-filter: blur(8px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%) scale(0.95);
  background-color: var(--bg-cream-light);
  width: 95%;
  max-width: 650px;
  border-radius: var(--border-radius);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.active .modal-window {
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  background-color: var(--jade-green);
  color: white;
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.6rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: white;
  opacity: 0.8;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 2.5rem;
  max-height: 80vh;
  overflow-y: auto;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(0,0,0,0.1);
  background-color: white;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(185, 92, 56, 0.1);
  outline: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Time Slot Selector */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.slot-btn {
  background: white;
  border: 1px solid rgba(0,0,0,0.1);
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  transition: var(--transition-smooth);
}

.slot-btn:hover {
  border-color: var(--terracotta);
  background-color: var(--terracotta-light);
}

.slot-btn.selected {
  background-color: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

.slot-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: var(--bg-cream-dark);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--jade-green);
  color: white;
  padding: 1rem 2rem;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transform: translateY(100px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.toast.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* FAQ Area */
.faq-grid {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.faq-icon {
  transition: var(--transition-smooth);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: var(--transition-smooth);
  color: var(--text-muted);
  margin-top: 0;
  font-size: 0.95rem;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-item.active .faq-answer {
  max-height: 500px;
  margin-top: 1rem;
}

/* Footer */
footer {
  background-color: #1E1E1E;
  color: #ECEAE5;
  padding: 5rem 10% 2rem 10%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: white;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a:hover {
  color: var(--terracotta);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(185, 92, 56, 0.08);
  color: var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

.social-btn:hover {
  background-color: var(--terracotta);
  color: white;
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: #8C8C8C;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Hamburger Menu Button */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-menu span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-only-cta {
  display: none;
}

/* Responsive Design */
@media (max-width: 1150px) {
  .hamburger-menu {
    display: flex;
  }
  
  .mobile-only-cta {
    display: block;
    width: 100%;
    margin-top: 1rem;
  }
  
  .mobile-only-cta .btn {
    display: block;
    width: 100%;
    text-align: center;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 80vw);
    height: 100vh;
    background: rgba(251, 249, 246, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: -5px 0 25px rgba(0,0,0,0.05);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    padding: 4rem 3rem;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }
  
  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    font-size: 1.1rem;
    display: block;
    width: 100%;
  }

  .nav-tech-pill {
    display: none;
  }
}

@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
  .yunnan-grid {
    grid-template-columns: 1fr;
  }
  .child-space-card {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  section {
    padding: 5rem 5%;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .nav-controls > .apply-trigger {
    display: none;
  }
  .nav-controls {
    gap: 1rem;
  }
  .hero-buttons {
    flex-direction: column;
    gap: 0.8rem;
  }
  .hero h1 {
    font-size: 1.9rem;
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
  }
  .bodhisattva-wrapper {
    width: 280px;
    height: 360px;
  }
  .halo-effect {
    width: 260px;
    height: 260px;
  }
}

/* Gallery Styles */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 90, 70, 0.4); /* soft jade overlay */
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-title {
  color: white;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
}

.gallery-item-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Staggered Fade-In for revealed gallery items */
@keyframes galleryFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item.hidden-item {
  opacity: 0;
}

.gallery-item.hidden-item.revealed {
  animation: galleryFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Lightbox Overlay */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(10px);
  z-index: 3000;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lightbox-overlay.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-caption {
  color: white;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lightbox-close:hover {
  color: var(--terracotta);
  transform: scale(1.1);
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.lightbox-prev:hover, .lightbox-next:hover {
  background: var(--terracotta);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}


/* Desktop Grid Override */
@media (min-width: 1024px) {
  .mobile-header {
    display: none;
  }
  
  .app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
  
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 280px;
    transform: translateX(0);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    background-color: rgba(251, 249, 246, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
  }
  
  .sidebar-inner {
    padding: 3rem 2rem;
    gap: 3rem;
  }
  
  .sidebar .logo {
    display: flex;
  }
  
  .sidebar .nav-links {
    gap: 1rem;
  }
  
  .sidebar .nav-links a {
    font-size: 1rem;
    padding: 0.5rem 0;
  }
  
  .hero {
    padding-top: 4rem; /* No fixed header to clear on desktop */
  }

  .nav-controls > .apply-trigger {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/* ==========================================
   ADDED RESPONSIVE CLASSES & LAYOUT FIXES
   ========================================== */

/* Responsive Tech Device row in tech-modal */
.tech-device-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding-bottom: 2rem;
  align-items: center;
}
.tech-device-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Nav tech link styling */
.nav-tech-link {
  color: var(--terracotta) !important;
  font-weight: 600 !important;
}

/* Modal layout stacking on smaller screens */
@media (max-width: 768px) {
  .tech-device-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-bottom: 1.5rem;
  }
  .modal-window {
    width: 95% !important;
    max-height: 90vh !important;
  }
  .modal-body {
    padding: 1.5rem !important;
  }
}

/* Dynamic Article Modal Content Stacking Fix */
#article-modal-body {
  display: block !important;
}

#article-modal-body ul.feature-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.2rem !important;
  list-style: none !important;
  margin: 1.5rem 0 !important;
  padding-left: 0 !important;
}

#article-modal-body ul.feature-list li {
  display: block !important;
  position: relative !important;
  padding-left: 1.8rem !important;
  margin-bottom: 0 !important;
}

#article-modal-body ul.feature-list li::before {
  content: '✓' !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  color: var(--jade-green) !important;
  font-weight: bold !important;
}

/* =========================================
   ARTICLE MODAL — Tech Detail Article Styles
   ========================================= */

/* Ensure article modal window is large enough for rich content */
#article-modal .modal-window {
  max-width: 820px !important;
  width: 95% !important;
  max-height: 90vh !important;
}

#article-modal .modal-body {
  max-height: calc(90vh - 80px) !important;
  overflow-y: auto !important;
  padding: 2rem 2.5rem !important;
  background-color: var(--bg-cream-light) !important;
}

/* Tech Detail Article Container */
.tech-detail-article {
  display: flex;
  flex-direction: column;
  gap: 0;
  color: var(--text-dark);
  line-height: 1.8;
  font-size: 1rem;
  max-width: 100%;
}

.tech-detail-article p {
  margin: 0 0 1rem 0;
  line-height: 1.8;
}

.tech-detail-article h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--terracotta);
  font-size: 1.1rem;
}

/* Intro lead paragraph — styled prominently */
.tech-detail-article .intro-lead,
.intro-lead {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-dark);
  background: rgba(74, 123, 90, 0.06);
  border-left: 4px solid var(--jade-green);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  margin: 0 0 1.5rem 0;
}

/* Tech spec table */
.tech-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tech-table tr {
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: background 0.15s ease;
}

.tech-table tr:last-child {
  border-bottom: none;
}

.tech-table tr:hover {
  background: rgba(74, 123, 90, 0.04);
}

.tech-table td {
  padding: 0.65rem 1rem;
  vertical-align: top;
}

.tech-table td:first-child {
  font-weight: 600;
  color: var(--text-dark);
  width: 38%;
  background: rgba(0,0,0,0.02);
}

.tech-table td:last-child {
  color: var(--text-muted);
}

/* Nested lists inside feature-list */
#article-modal-body ul.feature-list li ul {
  list-style: none !important;
  padding-left: 1.5rem !important;
  margin-top: 0.5rem !important;
}

#article-modal-body ul.feature-list li ul li {
  padding-left: 1.5rem !important;
}

#article-modal-body ul.feature-list li ul li::before {
  content: '→' !important;
  color: var(--terracotta) !important;
}

/* Mobile: article modal */
@media (max-width: 600px) {
  #article-modal .modal-window {
    width: 100% !important;
    max-height: 95vh !important;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    transform: none !important;
  }

  #article-modal .modal-body {
    padding: 1.2rem 1rem !important;
    max-height: calc(95vh - 70px) !important;
  }

  .tech-detail-article .intro-lead,
  .intro-lead {
    font-size: 0.95rem;
  }

  .tech-table td:first-child {
    width: 45%;
  }
}
