:root {
  /* Default Dark Theme */
  --color-bg: #050505;
  --color-text: #ffffff;
  --color-primary: #ffffff;
  --color-secondary: #a1a1a6;
  --color-accent: #ffffff;
  --glass-bg: rgba(30, 30, 30, 0.65);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.05);
  --glass-blur: 20px;
  --glass-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);

  --header-bg: rgba(10, 10, 10, 0.85);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Roboto Mono', monospace;

  --spacing-lg: 40px;
  --spacing-xl: 40px;

  /* Rotating Text Variables (Auto-Inverted for Dark Mode) */
  --rotating-bg: #ffffff;
  --rotating-text: #000000;
}

[data-theme="white"] {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-primary: #000000;
  --color-secondary: #424245;
  --color-accent: #333333;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-highlight: rgba(0, 0, 0, 0.03);
  --glass-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.1);
  --header-bg: rgba(255, 255, 255, 0.85);

  --rotating-bg: #000000;
  --rotating-text: #ffffff;
}

[data-theme="colorful"] {
  --color-bg: #0f172a;
  --grad-bg: linear-gradient(135deg, #0f172a 0%, #312e81 25%, #581c87 50%, #701a75 75%, #0f172a 100%);
  --color-text: #ffffff;
  --color-primary: #fcd34d;
  /* Amber/Gold */
  --color-secondary: #e2e8f0;
  --color-accent: #22d3ee;
  /* Cyan */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-highlight: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --header-bg: rgba(15, 23, 42, 0.85);

  --rotating-bg: #fcd34d;
  --rotating-text: #581c87;
  /* Explicit Purple */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: var(--font-main);
  background: var(--color-bg);
  background-image: var(--grad-bg, none);
  color: var(--color-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s ease, color 0.5s ease, background-image 0.5s ease;
}

/* Typography Overhaul */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  /* Tighter tracking for headlines */
}

p {
  line-height: 1.6;
  color: var(--color-secondary);
  font-size: 1.05rem;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.3s ease;
}

a:hover {
  opacity: 0.7;
}

/* Layout */
.site-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Premium Header */
/* Site Header - Awwwards Style */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background 0.5s ease, border-color 0.5s ease;
}

.header-container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo,
.logo-link,
.logo-text {
  font-family: var(--font-main);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-primary) !important;
  text-decoration: none;
  letter-spacing: -0.03em;
  text-shadow: 0 0 20px var(--glass-highlight);
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
  /* Prevent excessive gap by removing flex: 2 */
}

.nav-links a {
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}

.nav-links {
  align-items: center;
}

/* --- Dropdown Menu Styles --- */
.nav-item-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(30, 30, 30, 0.95);
  /* High opacity for darker background */
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 12px;
  padding: 10px 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

[data-theme="white"] .dropdown-menu {
  background: rgba(255, 255, 255, 0.95);
  /* High opacity for white theme */
}

.nav-item-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dropdown-trigger::after {
  content: 'expand_more';
  font-family: 'Material Icons';
  font-size: 16px;
  opacity: 0.7;
  text-transform: none !important;
  /* Prevent 'E' issue */
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--color-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  transition: all 0.2s ease;
  width: 100%;
}

.dropdown-menu a:hover {
  background: var(--glass-highlight);
  color: var(--color-primary);
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.contact-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.contact-link:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.nav-links .contact-mobile-only {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  cursor: pointer;
  margin-right: 15px;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  width: 18px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}



/* Search Bar Styles (Awwwards Style) */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--glass-highlight);
  border-radius: 100px;
  padding: 6px 14px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 220px;
  cursor: text;
}

.search-wrapper:focus-within {
  background: var(--glass-bg);
  width: 260px;
  box-shadow: 0 0 0 1px var(--color-accent);
}

.search-icon {
  font-size: 0.95rem !important;
  color: var(--color-secondary);
  margin-right: 8px;
  pointer-events: none;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 0.85rem;
  font-family: var(--font-main);
  outline: none;
  width: 100%;
}

.search-input::placeholder {
  color: var(--color-secondary);
  opacity: 0.6;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--color-secondary);
  font-style: italic;
}

/* --- NEW MATERIAL ICONS CHECKBOX HACK --- */

.menu-toggle-input {
  display: none !important;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: auto;
}

.mobile-menu-label {
  display: none;
  /* Hidden on desktop */
  cursor: pointer;
  position: relative;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.mobile-menu-label::before {
  content: "menu";
  font-family: "Material Icons";
  font-size: 32px;
  color: var(--color-primary);
  transition: transform 0.3s ease;
}

@media (max-width: 1160px) {
  .site-header {
    height: 56px;
    background: var(--header-bg);
  }

  .header-container {
    padding: 0 16px;
  }

  .nav-links,
  .contact-link {
    display: none;
  }

  .nav-links .contact-mobile-only {
    display: flex;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .header-left {
    flex: 0 0 auto;
  }

  .logo {
    font-size: 1.1rem;
  }

  .header-right {
    flex: 1;
    justify-content: flex-end;
  }

  .search-wrapper {
    flex: 1;
    max-width: none;
    width: auto;
    height: 38px;
    background: var(--glass-highlight);
    border-radius: 8px;
    margin-left: 15px;
  }

  .search-wrapper:focus-within {
    width: auto;
    flex: 1;
    background: var(--glass-bg);
  }

  /* Mobile Nav Overlay */
  .nav-links {
    display: none;
    /* Hide completely when closed */
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--color-bg);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
    gap: 12px;
    /* Reduced gap between main items */
    overflow-y: auto;
    transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    pointer-events: none;
    /* Prevent interaction when closed */
  }

  body.menu-active .nav-links {
    display: flex;
    /* Show when menu is active */
    height: calc(100vh - 56px);
    pointer-events: auto;
    /* Allow interaction when open */
  }

  .nav-links a {
    font-size: 1.4rem;
    font-weight: 600;
    height: auto !important;
    padding: 4px 0 !important;
    line-height: 1.2;
  }

  /* Mobile Dropdown Fixes */
  .nav-item-dropdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    padding: 4px 0 !important;
    /* Tiny top/bottom padding */
    min-width: auto;
    align-items: center;
    gap: 2px;
    /* Closer sub-items */
    display: flex;
  }

  .dropdown-menu a {
    font-size: 0.95rem;
    padding: 2px 0 !important;
    text-align: center;
    color: var(--color-secondary);
    opacity: 0.8;
  }

  .dropdown-menu a:hover {
    background: transparent;
    color: var(--color-primary);
    opacity: 1;
  }

  /* Override desktop hover transform */
  .nav-item-dropdown:hover .dropdown-menu {
    transform: none;
  }
}

@media (max-width: 480px) {
  .logo {
    display: none;
    /* Hide logo text on very small screens, maybe keep 'W' style later */
  }

  .search-wrapper {
    margin-left: 0;
  }
}

/* Hero Section Styles */
.hero-section {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 64px;
  /* Offset for fixed header */
  overflow: hidden;
  text-align: center;
  z-index: 5;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  /* Increased to fit single line text */
  padding: 0 20px;
  width: 100%;
  /* Ensure it uses available space */
}

.hero-title {
  font-size: clamp(1.1rem, 5vw, 5rem);
  /* Responsive scaling */
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  color: var(--color-primary);
  text-shadow: 0 0 30px var(--glass-highlight);
  /* New Layout for Rotating Text */
  display: flex;
  flex-wrap: nowrap;
  /* Prevent wrapping */
  justify-content: center;
  align-items: center;
  gap: 0.15em;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .hero-title {
    flex-direction: column;
    gap: 8px;
    /* Ensure vertical separation */
  }
}

/* Rotating Wrapper - Boxed Style */
/* Rotating Wrapper - Boxed Style */
.rotating-text-wrapper {
  background-color: var(--rotating-bg);
  color: var(--rotating-text);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 1.1em;
  /* Tighter height for box */
  padding: 0 0.4em;
  /* Box padding */
  border-radius: 8px;
  overflow: hidden;
  margin-left: 0.2em;
  /* Spacing from main title */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: width 0.3s cubic-bezier(0.2, 0, 0.2, 1), background-color 0.5s ease;
  white-space: nowrap;
  position: relative;
}

[data-theme="colorful"] .rotating-word {
  color: #581c87 !important;
  /* Force purple color for colorful theme */
}

/* Rotating Words Animation */
.rotating-word {
  color: var(--rotating-text);
  /* Ensure good contrast */
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(50%) skewY(10deg);
  transition: all 0.5s cubic-bezier(0.2, 0, 0.2, 1);
  filter: blur(4px);
  pointer-events: none;
  white-space: nowrap;
}

.rotating-word.active {
  opacity: 1;
  transform: translateY(0) skewY(0);
  filter: blur(0);
  pointer-events: auto;
}

/* Outgoing state (optional for smoother exit) */
.rotating-word.exit {
  opacity: 0;
  transform: translateY(-50%) skewY(-10deg);
  filter: blur(4px);
}

/* Blog Grid & Cards */
.blog-section {
  padding: var(--spacing-xl) var(--spacing-lg);
  padding-top: 10px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.blog-section+.blog-section {
  padding-top: 10px;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 48px;
  /* More breathing room */
  font-weight: 600;
  letter-spacing: -0.03em;
  border: none;
  /* Removed border */
  text-align: center;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.blog-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  /* The Premium Glass Effect */
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);

  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--glass-shadow);
}

.blog-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.25);
}

.card-image-wrapper {
  overflow: hidden;
  height: 220px;
  width: 100%;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.blog-card:hover .card-image {
  transform: scale(1.1);
}

.card-content {
  padding: 30px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.card-excerpt {
  font-size: 0.95rem;
  color: var(--color-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.article-inner-image,
.article-content img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  margin: 40px auto;
  display: block;
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
}

/* Mobile-specific image handling for article content */
@media (max-width: 768px) {

  .article-inner-image,
  .article-content img {
    max-height: none;
    object-fit: contain;
  }
}

.read-more {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text);
  padding: 8px 16px;
  background: var(--glass-bg);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.read-more:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.read-more::after {
  content: '→';
  transition: transform 0.3s ease;
}

.read-more:hover::after {
  transform: translateX(3px);
}

/* Footer */
.site-footer {
  padding: 20px 20px;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--color-secondary);
  background: var(--color-bg);
  transition: background 0.5s ease;
}

.site-footer a {
  color: var(--color-secondary);
}

.site-footer a:hover {
  color: var(--color-text);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    /* Prevent wrapping by default, let font size shrink */
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    justify-content: center;
  }






  .blog-section {
    padding: 10px 20px 45px;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    /* Stack on mobile */
    gap: 24px;
  }
}

/* Small Mobile Adjustments */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  /* .hero-subtitle removed */

  .card-image-wrapper {
    height: 180px;
  }
}

/* Article Navigation & PDF Button */
.article-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.article-navigation .back-link {
  margin-bottom: 0;
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--color-secondary);
  font-size: 0.9rem;
  padding: 8px 16px;
  background: var(--glass-highlight);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: var(--font-main);
}

.pdf-download-btn:hover {
  color: var(--color-primary);
  background: var(--glass-bg);
  border-color: var(--color-accent);
}

.pdf-download-btn .material-icons-outlined {
  font-size: 1.1rem;
}

@media (max-width: 600px) {
  .article-navigation {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* Print Styles for PDF Generation */
@media print {

  /* Hide everything by default */
  body * {
    visibility: hidden;
  }

  /* content reset */
  html,
  body,
  .site-wrapper,
  .article-container {
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    max-height: none !important;
    width: 100% !important;
    background: #fff !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Show only article content */
  .article-container,
  .article-container * {
    visibility: visible;
  }

  .article-container {
    position: absolute;
    left: 0;
    top: 0;
    padding: 2cm !important;
    /* Proper print padding */
    max-width: none;
  }

  .article-content {
    color: #000 !important;
    opacity: 1 !important;
    font-size: 12pt !important;
  }

  .article-image,
  .article-content img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  p,
  h2,
  h3,
  h4 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3,
  h4 {
    page-break-after: avoid;
  }

  /* Hide navigation buttons and header/footer within article container if they are there */
  .article-navigation,
  .site-header,
  .site-footer,
  #header-placeholder,
  .target-cursor-wrapper,
  .read-more {
    display: none !important;
  }
}
