:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Visual Hierarchy */
h1,
.h1,
.text-3xl,
.text-4xl,
.text-5xl,
.text-6xl {
  font-weight: 700 !important;
}

h2,
h3,
.text-xl,
.text-2xl,
.font-semibold {
  font-weight: 600 !important;
}

/* Readability for long content */
.prose p,
.video-description,
#videoDescription,
#postContent p,
article p {
  line-height: 1.75;
  margin-bottom: 1.5rem;
  max-width: 75ch;
  /* Standard optimal readability width */
}

/* Text Container Constraint */
.content-container {
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

/* Helpers used across pages */
.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  vertical-align: middle;
}

.logo-img {
  max-height: 40px;
  width: auto;
  object-fit: contain;
  padding: 4px 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  transition: transform 0.2s ease;
}

.site-logo:hover .logo-img {
  transform: scale(1.02);
}

.site-logo span {
  line-height: 1;
  display: flex;
  align-items: center;
}

.nav-link {
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Card hover effects */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.08);
}

/* Gradient button */
.btn-primary {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
}

/* Nav underline animation */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: #0f766e;
  transition: width .3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Navbar optimizations */
nav {
  will-change: transform, padding, background-color;
  transform: translateZ(0);
  /* Hardware acceleration */
  backface-visibility: hidden;
  perspective: 1000px;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav>div,
nav .flex {
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fix dropdown gap flickering - bridge the 0.25rem (mt-1) gap */
.group>div[class*="absolute"] {
  margin-top: 0.5rem;
  /* Standardize gap */
}

.group>div[class*="absolute"]::before {
  content: "";
  position: absolute;
  top: -0.6rem;
  /* Extends above the dropdown to bridge the gap to the parent */
  left: 0;
  right: 0;
  height: 0.6rem;
  background: transparent;
}

/* Navbar shadow on scroll */
.nav-scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Enhanced button hover */
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Simple mobile menu behavior; Tailwind handles most styling */
/* Simple mobile menu behavior; Tailwind handles most styling */
/* [data-mobile-menu] display rules removed to avoid conflict with mobile.css transform */

/* Visual Polish & Consistency */
.card,
.blog-card,
.video-card,
/* Target common Tailwind card patterns if generic class not used */
article.bg-white,
div.bg-white.rounded-lg,
div.bg-white.rounded-xl {
  border-radius: 12px;
}

/* Clean Text Glow */
.text-glow {
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}

/* Ensure sharp images */
img {
  image-rendering: -webkit-optimize-contrast;
}

/* Global Button Styling */
button,
.btn,
[role="button"] {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}