/* ============================================
   Kemi - Global Styles
   Brand: The Warm Protector
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* ---------- Tokens ---------- */
:root {
  --teal: #1A6B5A;
  --teal-dark: #145A4B;
  --sage: #7FB5A6;
  --sage-light: #A8D0C5;
  --ivory: #F5F0E8;
  --ivory-dark: #EDE7DC;
  --charcoal: #3D3A36;
  --charcoal-light: #6B6357;
  --muted: #A89E90;

  --clear: #6AAF8D;
  --clear-bg: #E8F5EE;
  --clear-text: #1B4D33;
  --review: #D4A55A;
  --review-bg: #FDF3E2;
  --review-text: #5C3E12;
  --caution: #C47263;
  --caution-bg: #FAEAE8;
  --caution-text: #4A1B13;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-w: 1120px;
  --max-w-narrow: 720px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); color: var(--charcoal); background: var(--ivory); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; font-family: var(--font-body); }
img { max-width: 100%; display: block; }
input { font-family: var(--font-body); }

/* ---------- Utilities ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--max-w-narrow); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.anim-fade-up { animation: fadeUp 0.7s var(--ease) both; }
.anim-fade-in { animation: fadeIn 0.6s var(--ease) both; }
.anim-float { animation: float 5s ease-in-out infinite; }
.anim-scale-in { animation: scaleIn 0.5s var(--ease) both; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}

/* Transparent on dark hero (teal bg) - ivory text */
.nav--dark .nav-logo { color: var(--ivory); }
.nav--dark .nav-link { color: rgba(245, 240, 232, 0.7); }
.nav--dark .nav-link:hover { color: var(--ivory); }
.nav--dark .nav-cta { background: rgba(245, 240, 232, 0.15); border: 1px solid rgba(245, 240, 232, 0.25); color: var(--ivory); }
.nav--dark .nav-cta:hover { background: rgba(245, 240, 232, 0.25); }
.nav--dark .nav-hamburger span { background: var(--ivory); }

/* Transparent on light hero (ivory bg) - teal text */
.nav--light .nav-logo { color: var(--teal); }
.nav--light .nav-link { color: var(--charcoal-light); }
.nav--light .nav-link:hover { color: var(--charcoal); }
.nav--light .nav-cta { background: var(--teal); color: white; }
.nav--light .nav-cta:hover { background: var(--teal-dark); }
.nav--light .nav-hamburger span { background: var(--charcoal); }

/* Scrolled state - always solid ivory bg with teal text */
.nav.scrolled {
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(61, 58, 54, 0.08);
}
.nav.scrolled .nav-logo { color: var(--teal); }
.nav.scrolled .nav-link { color: var(--charcoal-light); }
.nav.scrolled .nav-link:hover { color: var(--charcoal); }
.nav.scrolled .nav-cta { background: var(--teal); color: white; border: none; }
.nav.scrolled .nav-cta:hover { background: var(--teal-dark); }
.nav.scrolled .nav-hamburger span { background: var(--charcoal); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.5px;
  transition: color 0.4s var(--ease), opacity 0.2s;
  position: relative;
  z-index: 1010;
}
.nav-logo:hover { opacity: 0.8; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-size: 14px;
  font-weight: 400;
  transition: color 0.4s var(--ease);
  white-space: nowrap;
}
.nav-cta {
  font-size: 13px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: var(--radius-xs);
  transition: all 0.4s var(--ease);
  white-space: nowrap;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
  z-index: 1010;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  transition: all 0.3s var(--ease);
  position: absolute;
  left: 5px;
}
.nav-hamburger span:nth-child(1) { top: 8px; }
.nav-hamburger span:nth-child(2) { top: 15px; }
.nav-hamburger span:nth-child(3) { top: 22px; }

/* Hamburger active state */
.nav-hamburger.active span:nth-child(1) { top: 15px; transform: rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { top: 15px; transform: rotate(-45deg); }

/* Mobile nav panel */
@media (max-width: 768px) {
  .nav-hamburger { display: block; }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ivory);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    z-index: 1005;
    padding: 80px 24px 48px;
  }
  .nav-links.open { display: flex; }

  .nav-links .nav-link {
    font-size: 18px;
    font-weight: 400;
    color: var(--charcoal);
  }
  .nav-links .nav-link:hover { color: var(--teal); }

  .nav-links .nav-cta {
    background: var(--teal);
    color: white;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
    border: none;
  }

  /* When mobile menu is open, nav bg must be solid */
  .nav.mobile-open {
    background: var(--ivory);
  }
  .nav.mobile-open .nav-logo { color: var(--teal); }
  .nav.mobile-open .nav-hamburger span { background: var(--charcoal); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--teal);
  color: white;
}
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26, 107, 90, 0.2); }
.btn-secondary {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.btn-secondary:hover { background: var(--teal); color: white; }
.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1.5px solid rgba(255,255,255,0.25);
}
.btn-ghost:hover { background: rgba(255,255,255,0.2); }
.btn-ivory {
  background: var(--ivory);
  color: var(--teal);
}
.btn-ivory:hover { background: white; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.btn-lg { padding: 16px 36px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 10px 20px; font-size: 13px; }

/* ---------- Section spacing ---------- */
.section {
  padding: 100px 0;
}
.section-sm {
  padding: 64px 0;
}
.section-teal {
  background: var(--teal);
  color: white;
}
.section-white {
  background: white;
}
.section-ivory {
  background: var(--ivory);
}

/* ---------- Typography ---------- */
.heading-xl {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}
.heading-lg {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.heading-md {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.25;
}
.heading-sm {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.3;
}
.subheading {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
}
.body-lg {
  font-size: 17px;
  line-height: 1.7;
  color: var(--charcoal-light);
}
.body-md {
  font-size: 15px;
  line-height: 1.7;
  color: var(--charcoal-light);
}
.body-sm {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Cards ---------- */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}
.card-flat {
  background: var(--ivory);
  border-radius: var(--radius);
  padding: 32px;
}
.card-outline {
  background: transparent;
  border: 1px solid rgba(61, 58, 54, 0.08);
  border-radius: var(--radius);
  padding: 32px;
}

/* ---------- Grid ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---------- Trust bar ---------- */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 16px 0;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.trust-item svg { flex-shrink: 0; }

/* ---------- Footer ---------- */
.footer {
  padding: 48px 0;
  border-top: 1px solid rgba(61, 58, 54, 0.06);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--teal);
}
.footer-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--muted);
}
.footer-links a:hover { color: var(--charcoal); }

/* ---------- Input ---------- */
.input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid rgba(61, 58, 54, 0.12);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: white;
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: var(--muted); }
.input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(127, 181, 166, 0.15);
}

/* ---------- Rating badges ---------- */
.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
}
.rating-clear { background: var(--clear-bg); color: var(--clear-text); }
.rating-review { background: var(--review-bg); color: var(--review-text); }
.rating-caution { background: var(--caution-bg); color: var(--caution-text); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .section-sm { padding: 48px 0; }
  .container { padding: 0 20px; }
  .container-narrow { padding: 0 20px; }

  .heading-xl { font-size: 32px; }
  .heading-lg { font-size: 26px; }
  .heading-md { font-size: 22px; }
  .body-lg { font-size: 15px; }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .trust-bar { gap: 12px; flex-direction: column; align-items: center; }

  .btn { padding: 12px 24px; font-size: 14px; }
  .btn-lg { padding: 14px 28px; font-size: 15px; }

  .card { padding: 24px; }
  .card-flat { padding: 24px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
