/* ============================================================
   Organic / Natural Design System
   Huang Lab website style
   ============================================================ */

/* ---------- Noise Texture Overlay ---------- */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ---------- Soft Shadows ---------- */
.shadow-soft {
  box-shadow: 0 4px 20px -2px rgba(93, 112, 82, 0.15);
}
.shadow-float {
  box-shadow: 0 10px 40px -10px rgba(193, 140, 93, 0.2);
}
.shadow-card {
  box-shadow: 0 4px 20px -2px rgba(93, 112, 82, 0.10);
}
.hover\:shadow-lift:hover {
  box-shadow: 0 20px 40px -10px rgba(93, 112, 82, 0.15);
}

/* ---------- Organic Blob Shapes ---------- */
.blob-1 {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}
.blob-2 {
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}
.blob-3 {
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}
.blob-mask {
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

/* ---------- Asymmetric Card Radii ---------- */
.card-radius-0 { border-radius: 2rem; }
.card-radius-1 { border-radius: 4rem 2rem 4rem 2rem; }
.card-radius-2 { border-radius: 2rem 4rem 2rem 4rem; }
.card-radius-3 { border-radius: 3rem 2rem 5rem 2rem; }
.card-radius-4 { border-radius: 2rem 5rem 2rem 3rem; }
.card-radius-5 { border-radius: 5rem 3rem 2rem 4rem; }

/* ---------- Hover Animations ---------- */
.hover-lift {
  transition: all 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
}
.hover-rotate:hover {
  transform: rotate(1deg);
}

/* ---------- Section Background Alternation ---------- */
.bg-stone-tint {
  background-color: rgba(240, 235, 229, 0.3);
}
.bg-sand-tint {
  background-color: rgba(230, 220, 205, 0.3);
}
.bg-moss-tint {
  background-color: rgba(93, 112, 82, 0.08);
}
.bg-clay-tint {
  background-color: rgba(193, 140, 93, 0.08);
}

/* ---------- Blob backgrounds for sections ---------- */
.blob-decor {
  position: absolute;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  filter: blur(64px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Glassmorphism ---------- */
.glass-pill {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.glass-card {
  background: rgba(254, 254, 250, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---------- Typography ---------- */
.heading-display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.heading-section {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
}
.text-organic {
  font-family: 'Nunito', 'Inter', sans-serif;
}

/* ---------- Focus states ---------- */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(93, 112, 82, 0.3);
  ring-offset: 2px;
}

/* ---------- Transition utilities ---------- */
.transition-soft {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.transition-slow {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Mobile navigation ---------- */
.mobile-nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: #5D7052;
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.28rem;
  box-shadow: 0 10px 24px -14px rgba(93, 112, 82, 0.8);
}

.mobile-nav-toggle span {
  width: 1.1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-nav-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: none;
  background: rgba(44, 44, 36, 0.26);
}

.mobile-nav-panel {
  position: fixed;
  top: 4.75rem;
  left: 0.875rem;
  right: 0.875rem;
  z-index: 9998;
  display: none;
  max-height: calc(100dvh - 5.75rem);
  overflow-y: auto;
  padding: 0.65rem;
  border: 1px solid rgba(222, 216, 207, 0.9);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 60px -24px rgba(44, 44, 36, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mobile-nav-backdrop.open,
.mobile-nav-panel.open {
  display: block;
}

.mobile-nav-link,
.mobile-nav-sublink {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  color: #2C2C24;
  text-decoration: none;
  border-radius: 0.9rem;
  line-height: 1.25;
}

.mobile-nav-link {
  padding: 0.7rem 0.9rem;
  font-size: 0.98rem;
  font-weight: 800;
}

.mobile-nav-sublinks {
  display: grid;
  gap: 0.2rem;
  margin: 0.15rem 0 0.5rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(93, 112, 82, 0.16);
}

.mobile-nav-sublink {
  padding: 0.55rem 0.8rem;
  color: #5D7052;
  font-size: 0.92rem;
  font-weight: 700;
}

.mobile-nav-link:active,
.mobile-nav-link:hover,
.mobile-nav-sublink:active,
.mobile-nav-sublink:hover {
  background: rgba(93, 112, 82, 0.08);
}

.mobile-nav-login {
  justify-content: center;
  margin-top: 0.35rem;
  background: #5D7052;
  color: #fff;
}

.mobile-nav-panel [data-auth-nav] {
  margin-left: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding-top: 0.35rem;
}

.mobile-nav-panel [data-auth-nav] span,
.mobile-nav-panel [data-auth-nav] a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  text-align: center;
}

/* ---------- Mobile layout fixes ---------- */
img,
svg,
video,
canvas {
  max-width: 100%;
}

@media (min-width: 768px) {
  .mobile-nav-backdrop,
  .mobile-nav-panel,
  .mobile-nav-toggle {
    display: none !important;
  }
}

@media (max-width: 767px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  body {
    font-size: 15px;
  }

  nav > div {
    gap: 0.75rem !important;
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
  }

  nav > div > a:first-child {
    min-width: 0;
  }

  nav > div > a:first-child img {
    height: 3.25rem !important;
    border-radius: 0.75rem !important;
  }

  nav > div > div:last-child {
    height: 3.25rem !important;
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .heading-display {
    letter-spacing: 0;
  }

  .max-w-\[1920px\] {
    width: 100% !important;
  }

  .px-8,
  .md\:px-8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .p-10,
  .md\:p-10 {
    padding: 1.25rem !important;
  }

  .p-8,
  .md\:p-8,
  .p-7,
  .md\:p-7,
  .p-6,
  .md\:p-6 {
    padding: 1rem !important;
  }

  .py-12,
  [class*="py-12"] {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .rounded-\[2rem\],
  [class*="rounded-[2rem]"] {
    border-radius: 1.25rem !important;
  }

  .grid,
  .flex {
    min-width: 0;
  }

  .grid.grid-cols-2,
  .grid.grid-cols-3,
  [class*="grid-cols-2"],
  [class*="grid-cols-3"],
  [class*="grid-cols-[160px_1fr]"],
  [class*="grid-cols-[200px_1fr]"],
  [class*="grid-cols-[60px_1fr]"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  [class*="grid-cols-[160px_1fr]"],
  [class*="grid-cols-[200px_1fr]"],
  [class*="grid-cols-[60px_1fr]"] {
    text-align: left;
  }

  .grid[class*="gap-8"],
  .grid[class*="gap-6"],
  .grid[class*="gap-5"] {
    gap: 1rem !important;
  }

  .team-member-card,
  .tab-panel,
  .tab-content,
  main,
  section,
  article {
    min-width: 0;
  }

  img[class*="w-[300px]"][class*="h-[400px]"],
  div[class*="w-[300px]"][class*="h-[400px]"] {
    width: min(100%, 17rem) !important;
    height: auto !important;
    aspect-ratio: 3 / 4;
  }

  img[class*="w-[200px]"],
  img[class*="w-[190px]"],
  img[class*="w-[160px]"],
  img[class*="w-[150px]"],
  div[class*="w-[150px]"][class*="h-[180px]"] {
    width: min(100%, 10rem) !important;
    height: auto !important;
    justify-self: center;
  }

  [class*="grid-cols-[160px_1fr]"] > img,
  [class*="grid-cols-[200px_1fr]"] > img,
  [class*="grid-cols-[160px_1fr]"] > div[class*="w-[150px]"],
  [class*="grid-cols-[200px_1fr]"] > div[class*="w-[150px]"] {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .flex.gap-1.mb-9.border-b-2,
  .flex.gap-1.mb-6.border-b-2 {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .flex.gap-1.mb-9.border-b-2 > *,
  .flex.gap-1.mb-6.border-b-2 > * {
    flex: 0 0 auto;
  }

  .tab-btn,
  .tcid-tab-btn {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .tab-btn img.h-10 {
    height: 2rem !important;
  }

  .tool-section-title {
    width: 100%;
    justify-content: flex-start;
    border-radius: 1rem;
  }

  .tool-section-title::after {
    display: none;
  }

  table,
  pre,
  code {
    max-width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }

  footer .max-w-\[1920px\].flex {
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
  }

  footer span {
    justify-content: center;
  }
}
