/* Kern shell — global tea-green backdrop, aurora, minimal nav, drawer, SOS */

:root {
  --cream: #EAF2EC;
  --cream-mid: #E0EBE3;
  --cream-deep: #D0DDD4;
  --site-bg: #EAF2EC;
  --sage: #B8C9B0;
  --sage-light: #E4EDE1;
  --sage-mid: #8AA882;
  --sage-deep: #4A6B44;
  --accent: #059669;
  --accent-hover: #047857;
  --text-dark: #1A1916;
  --text-mid: #5C574E;
  --text-light: #8C8880;
  --white: #FFFFFF;
  --line: #D0DDD4;
  --node-calm: #E2DCED;
  --node-focus: #D4E2E6;
  --node-energy: #F5E3D8;
  --node-sounds: #EAE3D9;
  --node-favourites: #EED8D8;
  --node-recommended: #F3ECE0;
  --aurora-a: #E2DCED;
  --aurora-b: #D4E2E6;
  --aurora-c: #F5E3D8;
  --aurora-d: #F3ECE0;
}

html {
  scroll-behavior: smooth;
  background: var(--site-bg);
}
body.kern-shell {
  font-family: 'Jost', sans-serif;
  background: transparent;
  color: var(--text-dark);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

/* Pure CSS ambient aura blobs — reliable on every page */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background-color: #EAF2EC;
  pointer-events: none;
}
.aura-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.55;
  mix-blend-mode: normal;
  will-change: transform;
}
.aura-blob.blob-1 {
  width: 580px;
  height: 580px;
  background: var(--aurora-b, #D4E2E6);
  top: -10%;
  left: -8%;
  animation: floatFluid1 12s ease-in-out infinite;
}
.aura-blob.blob-2 {
  width: 680px;
  height: 680px;
  background: var(--aurora-a, #E2DCED);
  top: 12%;
  right: -14%;
  animation: floatFluid2 14s ease-in-out infinite;
}
.aura-blob.blob-3 {
  width: 540px;
  height: 540px;
  background: var(--aurora-c, #F5E3D8);
  bottom: -12%;
  left: 18%;
  animation: floatFluid3 13s ease-in-out infinite;
}

@keyframes floatFluid1 {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(150px, -100px) scale(1.2); }
  66% { transform: translate(-100px, 150px) scale(0.9); }
  100% { transform: translate(0px, 0px) scale(1); }
}
@keyframes floatFluid2 {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(-120px, 120px) scale(1.1); }
  66% { transform: translate(180px, -80px) scale(0.85); }
  100% { transform: translate(0px, 0px) scale(1); }
}
@keyframes floatFluid3 {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(90px, 110px) scale(1.15); }
  66% { transform: translate(-140px, -70px) scale(0.88); }
  100% { transform: translate(0px, 0px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .aura-blob { animation: none !important; }
}

/* Hide legacy aurora / canvas if still present in DOM */
.kern-aurora,
.fluid-canvas,
#fluid-canvas {
  display: none !important;
}

body.kern-shell > main,
body.kern-shell > footer {
  position: relative;
  z-index: 1;
}

/* ── Floating pill / island navbar ── */
nav.kern-topnav {
  position: fixed !important;
  top: 0.85rem !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: min(720px, calc(100vw - 1.5rem)) !important;
  max-width: calc(100vw - 1.5rem);
  z-index: 5000 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem 0.55rem 1.25rem !important;
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  border-radius: 9999px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55) !important;
  box-shadow:
    0 10px 32px rgba(44, 42, 36, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  gap: 0.85rem;
  overflow: visible;
  isolation: isolate;
}
.nav-logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-dark);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo span {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--sage-mid);
  border-radius: 50%;
  margin-left: 3px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}
/* Center links hidden on all breakpoints — drawer only */
.nav-links.kern-nav-hidden {
  display: none !important;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
  z-index: 5001;
  overflow: visible;
}
.nav-cta {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--white);
  background: var(--sage-deep);
  border: 1px solid var(--sage-deep);
  border-radius: 100px;
  padding: 0.6rem 1.25rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.nav-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.nav-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  transition: background 0.15s;
}
.nav-burger:hover { background: rgba(74, 107, 68, 0.1); }
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
}

/* Compact language: codes only */
.lang-wrap {
  position: relative;
  display: inline-flex;
  z-index: 5002;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(208, 221, 212, 0.9);
  border-radius: 100px;
  padding: 0.55rem 0.95rem;
  min-height: 40px;
  cursor: pointer;
  color: var(--text-mid);
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap;
  line-height: 1;
}
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--sage-mid);
  color: var(--text-dark);
}
.lang-btn .lang-name,
.lang-btn .lang-arr { display: none !important; }
.lang-flag {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--text-dark);
  padding: 0;
  min-width: 0;
}
.lang-dd {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(250, 250, 247, 0.97);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(208, 221, 212, 0.95);
  border-radius: 18px;
  padding: 6px;
  min-width: 76px;
  z-index: 6000;
  box-shadow: 0 12px 36px rgba(44, 42, 36, 0.18);
  pointer-events: auto;
}
.lang-dd.open { display: block; }
.lang-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-mid);
  transition: background 0.12s;
}
.lang-opt > span:not(.lf) { display: none !important; }
.lang-opt .lf {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: transparent;
  color: inherit;
  padding: 0;
  min-width: 0;
}
.lang-opt:hover { background: var(--sage-light); color: var(--text-dark); }
.lang-opt.active { background: var(--sage-deep); color: var(--white); }
.lang-opt.active .lf { background: transparent; color: var(--white); }

/* Slide-over drawer — soft frosted sage */
.kern-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5500;
  background: rgba(234, 242, 236, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.kern-drawer-backdrop.open { display: block; }
.kern-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 92vw);
  z-index: 5600;
  background: rgba(234, 242, 236, 0.78);
  backdrop-filter: blur(28px) saturate(1.15);
  -webkit-backdrop-filter: blur(28px) saturate(1.15);
  color: var(--text-dark, #2C2A24);
  padding: 1.75rem 1.5rem 2.25rem;
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -12px 0 40px rgba(44, 42, 36, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.55);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.kern-nav-drawer.open { transform: translateX(0); }
.kern-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(208, 221, 212, 0.7);
}
.kern-drawer-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(36px, 5.5vw, 48px);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dark, #2C2A24);
  line-height: 1.1;
}
.kern-drawer-close {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(208, 221, 212, 0.85);
  color: var(--text-dark, #2C2A24);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.kern-drawer-close:hover { background: rgba(255, 255, 255, 0.75); }
.kern-drawer-link {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.35;
  color: var(--text-dark, #2C2A24);
  text-decoration: none;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  transition: background 0.15s, color 0.15s;
}
.kern-drawer-link:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--sage-deep, #4A6B44);
}
.kern-drawer-sep {
  height: 1px;
  background: rgba(208, 221, 212, 0.75);
  margin: 0.55rem 0;
  border: none;
}

/* SOS nav pill */
.kern-sos-fab {
  position: static;
  z-index: 5002;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #5A2A2A;
  background: rgba(244, 194, 194, 0.95);
  border: 1px solid rgba(232, 170, 170, 0.95);
  border-radius: 100px;
  padding: 0.45rem 0.9rem;
  min-height: 40px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
  transition: background 0.18s, border-color 0.18s;
}
.kern-sos-fab:hover {
  background: rgba(236, 176, 176, 0.98);
  border-color: rgba(210, 140, 140, 0.95);
}
.kern-sos-fab svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

/* SOS 60s breathing overlay */
.kern-sos-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5700;
  background: rgba(234, 242, 236, 0.94);
  backdrop-filter: blur(18px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
}
.kern-sos-overlay.open { display: flex; }
.kern-sos-inner {
  text-align: center;
  max-width: 420px;
  width: 100%;
}
.kern-sos-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}
.kern-sos-action {
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-mid);
  margin: 0 0 0.85rem;
  line-height: 1.45;
}
.kern-sos-phase {
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 1.5rem;
  min-height: 1.4em;
}
.kern-sos-circle {
  width: min(220px, 55vw);
  height: min(220px, 55vw);
  margin: 0 auto 1.75rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #F4C2C2, #E6D5F5 70%);
  box-shadow: 0 0 60px rgba(230, 213, 245, 0.55);
  transform: scale(0.72);
  transition: transform 3.8s ease-in-out;
}
.kern-sos-circle.inhale { transform: scale(1.08); }
.kern-sos-circle.exhale { transform: scale(0.72); }
.kern-sos-timer {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 42px;
  color: var(--sage-deep);
  margin-bottom: 1.5rem;
}
.kern-sos-close {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
}
.kern-sos-close:hover {
  border-color: var(--sage-deep);
  color: var(--sage-deep);
}

body.kern-drawer-open { overflow: hidden; }

@media (max-width: 720px) {
  nav.kern-topnav {
    top: 0.6rem;
    width: calc(100vw - 1rem);
    padding: 0.45rem 0.65rem 0.45rem 1rem;
  }
  .kern-sos-fab { padding: 0.45rem 0.7rem; }
  .kern-sos-fab .kern-sos-label { display: none; }
}

footer.kern-footer {
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  position: relative;
  z-index: 1;
}
.footer-logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--text-mid);
}
.footer-copy { font-size: 12px; color: var(--text-light); }
.footer-links { display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.footer-links a {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--sage-deep); }
@media (max-width: 720px) {
  footer.kern-footer {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }
}
