/* =========================================================
   RESET + BASE
========================================================= */

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

/* =========================================================
   ULTRA LIQUID GLASS THEME VARIABLES
========================================================= */

:root {
  /* Base Colors */
  --bg-color: #eaf0f6;
  --text-color: #0f1724;
  --muted-text: #475569;
  
  /* Enhanced Glass Properties */
  --glass-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 0.3) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-border-inner: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  --glass-shadow-hover: 0 20px 60px rgba(31, 38, 135, 0.25);
  
  /* Accent Colors */
  --accent-1: #4cc9f0;
  --accent-2: #8a4fff;
  --accent-3: #ffd166;
  
  /* Glass Effects */
  --glass-blur: 20px;
  --glass-noise-opacity: 0.03;
  --card-radius: 20px;
  --input-bg: rgba(255, 255, 255, 0.5);
}

/* Dark Mode */
html[data-theme="dark"] {
  --bg-color: #0a0e1a;
  --text-color: #e6eef8;
  --muted-text: #9fb1c9;
  
  --glass-bg: linear-gradient(
    135deg,
    rgba(20, 25, 40, 0.7) 0%,
    rgba(10, 15, 30, 0.4) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-inner: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glass-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.6);
  
  --input-bg: rgba(20, 25, 40, 0.5);
}

/* Color Palettes */
html[data-palette="arctic"] {
  --accent-1: #4cc9f0;
  --accent-2: #4361ee;
  --accent-3: #90e0ef;
}

html[data-palette="neon"] {
  --accent-1: #00f5d4;
  --accent-2: #ff00c8;
  --accent-3: #ffe066;
}

html[data-palette="sunset"] {
  --accent-1: #ff7b00;
  --accent-2: #ff006e;
  --accent-3: #ffbe0b;
}

html[data-palette="emerald"] {
  --accent-1: #2ec4b6;
  --accent-2: #2a9d8f;
  --accent-3: #80ed99;
}

html[data-palette="midnight"] {
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #c4b5fd;
}

html[data-palette="ocean"] {
  --accent-1: #0ea5e9;
  --accent-2: #0284c7;
  --accent-3: #7dd3fc;
}

html[data-palette="rose"] {
  --accent-1: #f43f5e;
  --accent-2: #fb7185;
  --accent-3: #fecdd3;
}

html[data-palette="gold"] {
  --accent-1: #f59e0b;
  --accent-2: #d97706;
  --accent-3: #fde68a;
}

html[data-palette="lavender"] {
  --accent-1: #a78bfa;
  --accent-2: #c084fc;
  --accent-3: #e9d5ff;
}

html[data-palette="crimson"] {
  --accent-1: #dc2626;
  --accent-2: #ef4444;
  --accent-3: #fecaca;
}

/* =========================================================
   BACKGROUND
========================================================= */

html {
  background:
    radial-gradient(circle at 15% 20%, rgba(76, 201, 240, 0.1), transparent 25%),
    radial-gradient(circle at 85% 80%, rgba(138, 79, 255, 0.08), transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(255, 209, 102, 0.05), transparent 30%),
    var(--bg-color);
  transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  transition: color 0.6s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  opacity: 0;
  animation: fadeInBody 0.5s ease forwards;
}

body.loaded {
  opacity: 1;
}

@keyframes fadeInBody {
  to { opacity: 1; }
}

::selection {
  background: var(--accent-1);
  color: white;
}

/* =========================================================
   ENHANCED GLASS CARD
========================================================= */

.glass-card {
  position: relative;
  padding: 2rem;
  border-radius: var(--card-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 
    var(--glass-shadow),
    inset 0 1px 0 var(--glass-border-inner),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Sweep Effect */
.glass-card::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 70%
  );
  transform: translateX(-100%) rotate(15deg);
  animation: glassSweep 8s infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes glassSweep {
  0%, 100% { transform: translateX(-100%) rotate(15deg); }
  50% { transform: translateX(100%) rotate(15deg); }
}

/* Noise Texture */
.glass-card::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: var(--glass-noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: overlay;
}

.glass-card > * {
  position: relative;
  z-index: 3;
}

.glass-card-hover {
  cursor: pointer;
}

.glass-card-hover:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 
    var(--glass-shadow-hover),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 0 40px rgba(var(--accent-1-rgb, 76, 201, 240), 0.1);
}

.glass-card-hover:active {
  transform: translateY(-2px) scale(0.99);
}

/* Feature Card Variant */
.glass-feature {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.2) 100%
  );
  border: 1.5px solid var(--glass-border);
}

html[data-theme="dark"] .glass-feature {
  background: linear-gradient(
    135deg,
    rgba(30, 35, 50, 0.6) 0%,
    rgba(15, 20, 35, 0.3) 100%
  );
}

.feature-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  pointer-events: none;
  z-index: 1;
}

.feature-content {
  position: relative;
  z-index: 2;
}

/* =========================================================
   LAYOUT
========================================================= */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  padding: 3rem 1.5rem;
  min-height: 60vh;
}

.section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

/* =========================================================
   HEADER / NAVIGATION
========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  position: relative;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-color);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

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

.nav-links a.active::after,
.nav-links a:hover::after {
  width: 100%;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-btn:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.theme-btn svg {
  position: absolute;
  width: 20px;
  height: 20px;
  color: var(--text-color);
  transition: all 0.3s ease;
}

.sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.moon-icon {
  opacity: 0;
  transform: rotate(-180deg);
}

html[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: rotate(180deg);
}

html[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

/* =========================================================
   HERO
========================================================= */

.hero {
  text-align: center;
  padding-bottom: 1rem 0;
  max-height: 400px;
  opacity: 1;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.hero.collapsed {
  max-height: 0;
  padding: 0;
  opacity: 0;
  transform: translateY(-30px);
}

.gradient-text {
  font-size: 2.75rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0rem;
  animation: gradientShift 8s ease infinite;
  background-size: 200% auto;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--muted-text);
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  margin-bottom: 0rem;
}

.hero-note {
  color: var(--muted-text);
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
  margin-bottom: 0.5rem;
}

/* =========================================================
   FLOATING BLOBS
========================================================= */

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}

.blob-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, var(--accent-1), transparent 70%);
  animation: floatBlob 25s infinite ease-in-out;
}

.blob-2 {
  width: 550px;
  height: 550px;
  bottom: -180px;
  right: -180px;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
  animation: floatBlob 30s infinite ease-in-out reverse;
}

.blob-3 {
  width: 450px;
  height: 450px;
  top: 40%;
  left: 60%;
  background: radial-gradient(circle, var(--accent-3), transparent 70%);
  animation: floatBlob 35s infinite ease-in-out;
  animation-delay: -10s;
}

@keyframes floatBlob {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  33% {
    transform: translate(50px, -80px) scale(1.1) rotate(120deg);
  }
  66% {
    transform: translate(-40px, 60px) scale(0.95) rotate(240deg);
  }
}

/* =========================================================
   PROGRESS BAR
========================================================= */

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px var(--accent-1);
}

/* =========================================================
   BUTTONS & LINKS
========================================================= */

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.btn-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-link svg {
  transition: transform 0.3s ease;
}

.btn-link:hover svg {
  transform: translateX(4px);
}

/* =========================================================
   PALETTE SWITCHER
========================================================= */

.palette-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
}

.palette-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.palette-toggle:hover {
  transform: scale(1.1) rotate(45deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.palette-toggle svg {
  color: var(--text-color);
}

.palette-panel {
  position: absolute;
  bottom: 65px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.palette-panel.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.palette-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.palette-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid white;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.palette-btn.active::before {
  opacity: 1;
}

.palette-btn:hover {
  transform: scale(1.3);
  box-shadow: 0 0 20px currentColor;
}

.palette-btn[data-palette="arctic"] { background: linear-gradient(135deg, #4cc9f0, #4361ee); }
.palette-btn[data-palette="neon"] { background: linear-gradient(135deg, #00f5d4, #ff00c8); }
.palette-btn[data-palette="sunset"] { background: linear-gradient(135deg, #ff7b00, #ff006e); }
.palette-btn[data-palette="emerald"] { background: linear-gradient(135deg, #2ec4b6, #2a9d8f); }
.palette-btn[data-palette="midnight"] { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.palette-btn[data-palette="ocean"] { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.palette-btn[data-palette="rose"] { background: linear-gradient(135deg, #f43f5e, #fb7185); }
.palette-btn[data-palette="gold"] { background: linear-gradient(135deg, #f59e0b, #d97706); }
.palette-btn[data-palette="lavender"] { background: linear-gradient(135deg, #a78bfa, #c084fc); }
.palette-btn[data-palette="crimson"] { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* =========================================================
   FOOTER
========================================================= */

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  color: var(--muted-text);
  opacity: 0.7;
}

/* =========================================================
   UTILITIES
========================================================= */

.text-muted {
  color: var(--muted-text);
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 768px) {
  .nav-links {
    gap: 1rem;
    font-size: 0.95rem;
  }
  
  .nav-links a {
    font-size: 0.95rem;
  }
  
  .gradient-text {
    font-size: 2rem;
  }
  
  .glass-card {
    padding: 1.5rem;
  }
  
  .palette-container {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

@media (max-width: 640px) {
  .nav-links {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .main-content {
    padding: 2rem 1rem;
  }
}

/** TYPEWRITER EFFECT **/
.cursor {
  display: inline-block;
  margin-left: 5px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}