/* ============================================
   AFS - Asaba Farm System
   Design: Organic/Earthy with Modern Edge
   Palette: Deep Forest Green + Terracotta + Warm Cream
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Core palette */
  --green-deep: #1a3a2a;
  --green-mid: #2d6a4f;
  --green-light: #52b788;
  --green-pale: #d8f3dc;
  --terracotta: #c45d3e;
  --terracotta-light: #e07a5f;
  --cream: #faf3e8;
  --cream-dark: #f0e6d3;
  --earth: #8b6f47;
  --charcoal: #2b2b2b;
  --white: #ffffff;
  
  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --nav-height: 72px;
  --section-pad: clamp(3rem, 8vw, 7rem);
  --content-max: 1200px;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { 
  scroll-behavior: smooth; 
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }
p { max-width: 65ch; }

.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
}

/* ---- LAYOUT ---- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.section {
  padding: var(--section-pad) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ---- NAVIGATION ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(26, 58, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: all 0.4s var(--ease-out);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.nav__logo-icon {
  width: 40px;
  height: 40px;
  background: var(--terracotta);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--white);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav__links a {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.25s var(--ease-out);
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.nav__cta {
  background: var(--terracotta) !important;
  color: var(--white) !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
}

.nav__cta:hover {
  background: var(--terracotta-light) !important;
}

/* Mobile menu */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 8px;
}

.nav__burger span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
}

@media (max-width: 768px) {
  .nav__burger { display: flex; }
  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--green-deep);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    transform: translateY(-110%);
    transition: transform 0.4s var(--ease-out);
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { width: 100%; padding: 0.75rem 1rem; }
}

/* ---- HERO ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: var(--green-deep);
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 80%, rgba(45, 106, 79, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(196, 93, 62, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(26, 58, 42, 1) 0%, rgba(26, 58, 42, 0.95) 100%);
}

.hero__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='white' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(82, 183, 136, 0.15);
  border: 1px solid rgba(82, 183, 136, 0.3);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  margin-bottom: 2rem;
  color: var(--green-light);
  font-size: 0.85rem;
  font-weight: 500;
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.hero__badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--green-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s var(--ease-out) 0.1s both;
}

.hero h1 em {
  color: var(--green-light);
  font-style: italic;
}

.hero__sub {
  color: rgba(255,255,255,0.7);
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.hero__stats {
  display: flex;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

.hero__stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--white);
}

.hero__stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.25rem;
}

/* ---- DECORATIVE ELEMENT ---- */
.hero__visual {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  opacity: 0.12;
}

.hero__visual svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .hero__visual { display: none; }
  .hero__stats { gap: 2rem; }
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--terracotta);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--terracotta-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(196, 93, 62, 0.3);
}

.btn--secondary {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
}

.btn--secondary:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

.btn--outline {
  background: transparent;
  color: var(--green-deep);
  border: 2px solid var(--green-deep);
}

.btn--outline:hover {
  background: var(--green-deep);
  color: var(--white);
}

.btn--green {
  background: var(--green-mid);
  color: var(--white);
}

.btn--green:hover {
  background: var(--green-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(45, 106, 79, 0.3);
}

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(0,0,0,0.06);
  transition: all 0.4s var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.card__icon--green { background: var(--green-pale); }
.card__icon--terra { background: #fde8e0; }
.card__icon--earth { background: #f5edd8; }

.card h3 {
  margin-bottom: 0.75rem;
}

.card p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  color: var(--terracotta);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.3s var(--ease-out);
}

.card__link:hover { gap: 0.75rem; }

/* ---- PILLAR CARDS (special) ---- */
.pillar-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  transition: all 0.4s var(--ease-out);
}

.pillar-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.1);
}

.pillar-card__top {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.pillar-card__top--dairy { background: linear-gradient(135deg, #d8f3dc, #b7e4c7); }
.pillar-card__top--agro { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.pillar-card__top--skill { background: linear-gradient(135deg, #fde8e0, #fcd5ce); }
.pillar-card__top--ext { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }

.pillar-card__body {
  padding: 1.75rem;
}

.pillar-card__body h3 {
  margin-bottom: 0.5rem;
}

.pillar-card__body p {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ---- ABOUT SECTION ---- */
.about-section {
  background: var(--white);
}

.about__cycle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2.5rem;
  background: var(--green-pale);
  border-radius: 20px;
  margin: 2rem 0;
}

.about__cycle-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--green-deep);
}

.about__cycle-arrow {
  font-size: 1.5rem;
  color: var(--terracotta);
}

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

.section-header h2 {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: #666;
  font-size: 1.05rem;
  margin: 0 auto;
}

/* ---- COMMUNITY / CTA BAND ---- */
.cta-band {
  background: var(--green-deep);
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(82,183,136,0.15) 0%, transparent 60%);
}

.cta-band h2 { color: var(--white); position: relative; }
.cta-band p { color: rgba(255,255,255,0.7); margin: 1rem auto 2rem; position: relative; }

/* ---- CONTACT SECTION ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact__info {
  background: var(--green-deep);
  color: var(--white);
  border-radius: 20px;
  padding: 2.5rem;
}

.contact__info h3 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.contact__info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.contact__info-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact__info-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.8);
}

.contact__info-text strong {
  color: var(--white);
  display: block;
  margin-bottom: 0.25rem;
}

.contact__form {
  background: var(--white);
  border-radius: 20px;
  padding: 2.5rem;
  border: 1px solid rgba(0,0,0,0.06);
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s var(--ease-out);
  background: var(--cream);
  color: var(--charcoal);
}

.form-input:focus {
  outline: none;
  border-color: var(--green-mid);
  background: var(--white);
}

textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--terracotta);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s var(--ease-out);
  margin-top: 0.5rem;
}

.form-submit:hover {
  background: var(--terracotta-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(196, 93, 62, 0.25);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-success {
  display: none;
  text-align: center;
  padding: 2rem;
  color: var(--green-mid);
}

.form-success.show {
  display: block;
  animation: fadeInUp 0.5s var(--ease-out);
}

.form-success svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
}

/* ---- FOOTER ---- */
.footer {
  background: var(--green-deep);
  color: rgba(255,255,255,0.7);
  padding: 4rem 0 2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
}

.footer__brand p {
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 300px;
}

.footer h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.footer__links {
  list-style: none;
}

.footer__links li { margin-bottom: 0.6rem; }

.footer__links a {
  font-size: 0.9rem;
  transition: color 0.25s;
}

.footer__links a:hover { color: var(--green-light); }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__cert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.05);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* ---- CHATBOT WIDGET ---- */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.chat-fab__btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: all 0.3s var(--ease-spring);
  border: none;
}

.chat-fab__btn:hover {
  transform: scale(1.08);
}

.chat-fab__piripa {
  background: var(--green-mid);
  color: var(--white);
}

.chat-fab__bigeme {
  background: var(--terracotta);
  color: var(--white);
}

.chat-fab__label {
  position: absolute;
  right: 72px;
  background: var(--charcoal);
  color: var(--white);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.chat-fab__btn:hover + .chat-fab__label,
.chat-fab__btn:hover .chat-fab__label {
  opacity: 1;
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 400px;
  max-height: 560px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 12px 50px rgba(0,0,0,0.15);
  z-index: 901;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 0.4s var(--ease-spring);
}

.chat-window.open { display: flex; }

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 90px;
    max-height: 70vh;
  }
}

.chat-window__header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.chat-window__header--piripa { background: var(--green-mid); color: var(--white); }
.chat-window__header--bigeme { background: var(--terracotta); color: var(--white); }

.chat-window__header h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
}

.chat-window__header span {
  font-size: 0.8rem;
  opacity: 0.8;
}

.chat-window__close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-window__close:hover { background: rgba(255,255,255,0.3); }

.chat-window__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 300px;
  max-height: 380px;
}

.chat-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeInUp 0.3s var(--ease-out);
}

.chat-msg--bot {
  background: var(--cream);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg--user {
  background: var(--green-mid);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg--typing {
  background: var(--cream);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  padding: 0.75rem 1.25rem;
}

.chat-msg--typing span {
  width: 8px;
  height: 8px;
  background: #aaa;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.chat-msg--typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-msg--typing span:nth-child(3) { animation-delay: 0.4s; }

.chat-window__quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

.chat-quick-btn {
  padding: 0.4rem 0.85rem;
  background: var(--green-pale);
  color: var(--green-deep);
  border: 1px solid rgba(45,106,79,0.15);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.25s;
}

.chat-quick-btn:hover {
  background: var(--green-mid);
  color: var(--white);
}

.chat-window__input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: var(--cream);
}

.chat-window__input input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--white);
  font-size: 0.9rem;
  transition: border-color 0.3s;
}

.chat-window__input input:focus {
  outline: none;
  border-color: var(--green-mid);
}

.chat-window__input button {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--green-mid);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: none;
  transition: background 0.25s;
}

.chat-window__input button:hover {
  background: var(--green-deep);
}

/* ---- PAGE-SPECIFIC: Pillar detail pages ---- */
.page-hero {
  padding: calc(var(--nav-height) + 4rem) 0 4rem;
  background: var(--green-deep);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 70%, rgba(45,106,79,0.3) 0%, transparent 60%);
}

.page-hero__content {
  position: relative;
  z-index: 2;
}

.page-hero .label { color: var(--green-light); }
.page-hero h1 { color: var(--white); font-size: clamp(2rem, 4vw, 3.2rem); margin-top: 0.75rem; }
.page-hero p { color: rgba(255,255,255,0.7); font-size: 1.1rem; margin-top: 1rem; }

/* ---- TRAINEE PORTAL ---- */
.portal-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--cream-dark);
  padding: 0.35rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.portal-tab {
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  background: none;
  white-space: nowrap;
  transition: all 0.25s var(--ease-out);
}

.portal-tab.active {
  background: var(--white);
  color: var(--green-deep);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.portal-tab:hover:not(.active) {
  color: var(--charcoal);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.4s var(--ease-out);
}

/* ---- AI BOOKING ---- */
.booking-urgency {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 600px) {
  .booking-urgency { grid-template-columns: 1fr; }
}

.urgency-card {
  padding: 1.25rem;
  border: 2px solid #e5e5e5;
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.urgency-card:hover { border-color: var(--green-mid); }
.urgency-card.selected { border-color: var(--terracotta); background: #fef8f6; }

.urgency-card__icon { font-size: 2rem; margin-bottom: 0.5rem; }
.urgency-card__title { font-weight: 600; font-size: 0.95rem; }
.urgency-card__desc { font-size: 0.8rem; color: #888; margin-top: 0.25rem; }

/* ---- ANIMATIONS ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ---- SCROLL REVEAL ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- UTILITY ---- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

/* Status indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge--active { background: #dcfce7; color: #166534; }
.status-badge--pending { background: #fef3c7; color: #92400e; }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--green-deep);
  color: var(--white);
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  transition: transform 0.4s var(--ease-spring);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   PHASE 3: COMPREHENSIVE MOBILE & POLISH
   ============================================ */

/* ---- Mobile-first font scaling ---- */
@media (max-width: 480px) {
  :root {
    --nav-height: 60px;
    --section-pad: clamp(2rem, 6vw, 4rem);
  }
  body { font-size: 0.95rem; }
  h1 { font-size: 2rem !important; }
  h2 { font-size: 1.6rem !important; }
  h3 { font-size: 1.2rem !important; }
  
  .hero__sub { font-size: 1rem; }
  .hero__badge { font-size: 0.75rem; padding: 0.3rem 0.75rem; }
  .hero__stats { 
    flex-direction: column; 
    gap: 1.25rem; 
    margin-top: 2.5rem; 
    padding-top: 1.5rem;
  }
  .hero__stat-value { font-size: 1.8rem; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  
  .section-header { margin-bottom: 2rem; }
  .section-header p { font-size: 0.95rem; }
  
  .card { padding: 1.5rem; border-radius: 14px; }
  .pillar-card__top { height: 140px; font-size: 3rem; }
  .pillar-card__body { padding: 1.25rem; }
  
  .contact-grid { gap: 1.5rem; }
  .contact__info { padding: 1.75rem; border-radius: 16px; }
  .contact__form { padding: 1.75rem; border-radius: 16px; }
  
  .page-hero { padding: calc(var(--nav-height) + 2rem) 0 2rem; }
  .page-hero h1 { font-size: 1.8rem !important; }

  .cta-band { padding: 3rem 0; }
  .cta-band h2 { font-size: 1.6rem !important; }
  
  .footer__grid { gap: 1.5rem; }
  .footer__bottom { flex-direction: column; text-align: center; gap: 0.75rem; }
  
  .portal-tabs { 
    gap: 0.15rem; 
    padding: 0.25rem; 
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .portal-tab { padding: 0.55rem 0.85rem; font-size: 0.8rem; }
  
  .booking-urgency { grid-template-columns: 1fr !important; }
  
  .btn { padding: 0.75rem 1.25rem; font-size: 0.9rem; }
}

/* ---- Tablet (481-768px) ---- */
@media (min-width: 481px) and (max-width: 768px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero__stats { gap: 2rem; flex-wrap: wrap; }
}

/* ---- Touch-friendly tap targets ---- */
@media (hover: none) and (pointer: coarse) {
  .nav__links a { padding: 0.75rem 1rem; min-height: 44px; display: flex; align-items: center; }
  .form-input { padding: 0.85rem 1rem; min-height: 48px; font-size: 16px; /* prevents iOS zoom */ }
  .form-submit { min-height: 48px; }
  .btn { min-height: 44px; }
  .portal-tab { min-height: 44px; display: flex; align-items: center; }
  .chat-quick-btn { min-height: 40px; padding: 0.5rem 1rem; }
  .chat-fab__btn { width: 56px; height: 56px; }
}

/* ---- Safe area insets (notch phones) ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-fab { bottom: calc(24px + env(safe-area-inset-bottom)); }
  .chat-window { bottom: calc(100px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
}

/* ---- Print styles ---- */
@media print {
  .nav, .chat-fab, .chat-window, .toast, .cta-band { display: none !important; }
  body { background: white; color: black; }
  .hero { min-height: auto; padding: 2rem 0; }
  .hero__bg, .hero__pattern, .hero__visual { display: none; }
  .hero h1, .hero__sub { color: black; }
  .section { padding: 1.5rem 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---- Dark mode support (optional, respects system) ---- */
@media (prefers-color-scheme: dark) {
  /* Only activate if user hasn't explicitly set light mode */
  /* Currently keeping light theme - uncomment below to enable:
  :root {
    --cream: #1a1a1a;
    --cream-dark: #222;
    --white: #2a2a2a;
    --charcoal: #e5e5e5;
  }
  .card { background: #2a2a2a; border-color: rgba(255,255,255,0.06); }
  .about-section { background: #222; }
  */
}

/* ---- Landscape phone fix ---- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: calc(var(--nav-height) + 2rem) 0 2rem; }
  .hero__stats { display: none; }
}

/* ---- Skip to content (accessibility) ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--green-deep);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ---- Focus visible (keyboard nav) ---- */
:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Loading skeleton (for async content) ---- */
.skeleton {
  background: linear-gradient(90deg, var(--cream-dark) 25%, var(--cream) 50%, var(--cream-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
