/* CSS Custom Properties for easy theming */
:root {
  --primary-color: #6D9185;
  --primary-dark: #5a7a6f;
  --primary-light: #8fb3a7;
  --secondary-color: #ff9800;
  --secondary-dark: #e68900;
  --text-color: #2c3e50;
  --text-light: #6c757d;
  --bg-color: #fff;
  --bg-light: #f8f9fa;
  --bg-lighter: #fcfcfc;
  --border-color: #e1e8ed;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-hover: 0 12px 32px rgba(0,0,0,0.15);
  --max-width: 1200px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base Styles - Mobile First */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-lighter);
  font-weight: 400;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
}

a:hover {
  color: var(--primary-dark);
}

a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
  border-radius: 2px;
}

a:focus:not(:focus-visible) {
  outline: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--spacing-sm);
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo-mark {
  height: 40px;
  width: 40px;
  display: block;
  border-radius: 6px;
}

.logo-text {
  white-space: nowrap;
}

@media (min-width: 768px) {
  .logo {
    font-size: 1.6rem;
  }

  .logo-mark {
    height: 46px;
    width: 46px;
  }
}

/* Mobile Navigation */
.nav-toggle {
  display: block;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

.nav-toggle:active {
  transform: scale(0.95);
}

.nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--bg-color);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-lg);
  transition: right var(--transition);
  overflow-y: auto;
  z-index: 1001;
}

.nav.active {
  right: 0;
}

/* Mobile menu backdrop */
.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 1000;
}

.nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.nav-close {
  display: block;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  margin-left: auto;
  margin-bottom: var(--spacing-md);
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: var(--spacing-sm);
}

.nav-link {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 1.05rem;
  color: var(--text-color);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  font-weight: 500;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary-color);
  border-radius: 0 3px 3px 0;
  transition: height var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--bg-light);
  color: var(--primary-color);
  padding-left: calc(var(--spacing-md) + 8px);
}

.nav-link:hover::before,
.nav-link.active::before {
  height: 60%;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: var(--spacing-xl) var(--spacing-sm);
  text-align: center;
}

.hero-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 800px;
  margin: 0 auto var(--spacing-md);
}

.cta-button {
  display: inline-block;
  background: var(--secondary-color);
  color: white;
  padding: 14px 32px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1.05rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 152, 0, 0.4);
  background: var(--secondary-dark);
  color: white;
}

.cta-button:hover::before {
  left: 100%;
}

.cta-button:active {
  transform: translateY(-1px);
}

/* Main Content */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-sm);
}

.section {
  margin-bottom: var(--spacing-xl);
}

.section-title {
  color: var(--primary-color);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  border-bottom: 3px solid var(--primary-color);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--secondary-color);
}

/* Cards */
.card-grid {
  display: grid;
  gap: var(--spacing-md);
  grid-template-columns: 1fr;
}

.card {
  background: var(--bg-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: var(--spacing-lg);
  transition: all var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  font-size: 1.35rem;
}

/* Stretched link: makes the whole card clickable via its single anchor */
.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* Subjects List */
.subjects-section {
  margin-bottom: var(--spacing-lg);
}

.subjects-section h3 {
  background: var(--primary-color);
  color: white;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-sm);
}

.subjects-list {
  list-style: none;
  padding-left: var(--spacing-sm);
}

.subjects-list li {
  padding: var(--spacing-xs) 0;
  padding-left: var(--spacing-md);
  position: relative;
}

.subjects-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2em;
  line-height: 1.4;
}

.subjects-list li:hover {
  padding-left: calc(var(--spacing-md) + 4px);
  color: var(--primary-color);
}

/* Contact Section */
.contact-grid {
  display: grid;
  gap: var(--spacing-md);
  grid-template-columns: 1fr;
}

.contact-card {
  background: var(--bg-color);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.contact-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
  border-left-width: 6px;
}

.contact-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.contact-link {
  display: inline-block;
  margin-top: var(--spacing-xs);
  word-break: break-word;
  color: var(--text-color);
  font-weight: 500;
  padding: var(--spacing-xs) 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.contact-link:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  padding-left: var(--spacing-xs);
}

/* Footer */
.footer {
  background: var(--text-color);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--spacing-xl) var(--spacing-sm) var(--spacing-md);
  margin-top: var(--spacing-xl);
  font-size: 0.95rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

.footer-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--spacing-xs);
}

.footer-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light);
  margin-bottom: var(--spacing-sm);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--spacing-xs);
}

.footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Utility Classes */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

/* Tablet Styles */
@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }

  .hero h1 {
    font-size: 3rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main {
    padding: var(--spacing-xl) var(--spacing-md);
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }

  .nav {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }

  .nav-close {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: var(--spacing-sm);
  }

  .nav-item {
    margin-bottom: 0;
  }

  .nav-link {
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr;
    gap: var(--spacing-xl);
  }

  .hero {
    padding: 5rem var(--spacing-md);
  }

  .hero h1 {
    font-size: 3.5rem;
  }
}

/* Print Styles */
@media print {
  .header,
  .nav,
  .nav-toggle,
  .footer,
  .whatsapp-float {
    display: none;
  }
}

/* Page load animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: fadeIn 0.5s ease-in;
}

/* Responsive images */
img {
  transition: transform var(--transition), filter var(--transition);
}

img:hover {
  transform: scale(1.02);
}

/* Selection styling */
::selection {
  background: var(--primary-color);
  color: white;
}

::-moz-selection {
  background: var(--primary-color);
  color: white;
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

/* Skip to main content link for accessibility */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: var(--spacing-sm);
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* Card Icons */
.card-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
  transition: all var(--transition);
  box-shadow: 0 3px 8px rgba(109, 145, 133, 0.2);
}

.card-icon svg {
  width: 22px;
  height: 22px;
  color: white;
  stroke-width: 2.5;
}

.card:hover .card-icon {
  transform: translateY(-3px) rotate(5deg);
  box-shadow: 0 6px 16px rgba(109, 145, 133, 0.35);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.card:hover .card-icon svg {
  animation: iconPulse 0.6s ease;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Maps */
.footer-map {
  display: block;
  width: 100%;
  height: 160px;
  border: 0;
  border-radius: var(--border-radius-sm);
}

.map-embed {
  display: block;
  width: 100%;
  height: 400px;
  border: 0;
  border-radius: var(--border-radius-sm);
  margin-top: var(--spacing-md);
}

/* Contact form */
.contact-form {
  max-width: 560px;
}

.form-row {
  margin-bottom: var(--spacing-sm);
}

.form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius-sm);
  font: inherit;
  background: #fff;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 1px;
}

.form-privacy {
  font-size: 0.85rem;
  color: #666;
}

.footer-credit {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

/* Floating WhatsApp CTA */
.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
}

.whatsapp-float:hover,
.whatsapp-float:focus {
  transform: scale(1.08);
  color: #fff;
  box-shadow: var(--shadow-hover);
}

/* Lighthouse hero scene (staging experiment) */
.hero-lh {
  position: relative;
  overflow: hidden;
}

.hero-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lh-svg {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  height: 100%;
  width: auto;
  opacity: 0.55;
}

/* Keep the lantern and beam clear of the headline on wide screens */
@media (min-width: 900px) {
  .lh-svg {
    left: auto;
    right: 3%;
    transform: none;
  }
}

.hero-lh .hero-container {
  position: relative;
}

/* A rotating lamp seen side-on: the visible beam is the horizontal projection
   of the rotation (cosine of the phase). It sweeps out to one side, shortens
   into a lantern flash as the light turns to face the viewer, then re-emerges
   mirrored on the other side. */
.lh-beam {
  transform-origin: 300px 55px;
  transform-box: view-box;
  animation: lh-rotate 9s infinite;
  will-change: transform;
}

.lh-glow {
  transform-origin: 300px 55px;
  transform-box: view-box;
  animation: lh-flash 9s infinite;
}

@keyframes lh-rotate {
  0% {
    transform: scaleX(1);
    animation-timing-function: ease-in;
  }
  25% {
    transform: scaleX(0.04);
    animation-timing-function: ease-out;
  }
  50% {
    transform: scaleX(-1);
    animation-timing-function: ease-in;
  }
  75% {
    transform: scaleX(-0.04);
    animation-timing-function: ease-out;
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes lh-flash {
  0%, 20% {
    opacity: 0.35;
    transform: scale(1);
  }
  25% {
    opacity: 1;
    transform: scale(1.6);
  }
  30%, 70% {
    opacity: 0.35;
    transform: scale(1);
  }
  75% {
    opacity: 1;
    transform: scale(1.6);
  }
  80%, 100% {
    opacity: 0.35;
    transform: scale(1);
  }
}

.hero-lh.lh-manual .lh-beam {
  animation: none;
  transform: rotate(var(--lh-tilt, 0deg)) scaleX(var(--lh-reach, 1));
  transition: transform 0.3s ease-out;
}

.hero-lh.lh-manual .lh-glow {
  animation: none;
  opacity: var(--lh-flash, 0.35);
  transition: opacity 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .lh-beam,
  .lh-glow {
    animation: none;
  }
}
