/* ==========================================================================
   Rising Tide Technologies CSS Design System
   ========================================================================== */

/* --- CSS custom properties (Variables) --- */
:root {
  /* Colors */
  --bg-dark: hsl(222, 47%, 4%);
  --bg-card: hsl(223, 47%, 7%);
  --bg-card-hover: hsl(223, 47%, 10%);
  --border-color: hsla(220, 30%, 20%, 0.5);
  --border-glow: hsla(160, 80%, 40%, 0.15);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 25%, 72%);
  --text-muted: hsl(215, 16%, 53%);
  --text-dim: hsl(215, 15%, 40%);
  
  --accent-emerald: hsl(160, 84%, 39%);
  --accent-emerald-glow: hsla(160, 84%, 39%, 0.15);
  --accent-indigo: hsl(239, 84%, 67%);
  --accent-indigo-glow: hsla(239, 84%, 67%, 0.15);
  --accent-gradient: linear-gradient(135deg, var(--accent-emerald), var(--accent-indigo));
  
  /* Fonts */
  --font-family-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-family-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-family-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset & Base Styles --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

main {
  display: block;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: hsl(223, 30%, 15%);
  border-radius: 5px;
  border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(223, 30%, 25%);
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-padding {
  padding: 120px 0;
}

.grid {
  display: grid;
  gap: 32px;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent {
  color: var(--accent-emerald);
}

.font-mono {
  font-family: var(--font-family-mono);
}

.font-serif {
  font-family: 'Georgia', serif;
  font-style: italic;
}

.font-semibold {
  font-weight: 600;
}

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

.text-green {
  color: var(--accent-emerald);
}

.text-indigo {
  color: var(--accent-indigo);
}

.hidden {
  display: none !important;
}

/* --- Scroll Progress Bar --- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent-gradient);
  z-index: 2000;
  transform-origin: left;
}



/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-gradient);
  color: hsl(222, 47%, 4%);
  box-shadow: 0 4px 20px var(--accent-emerald-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px hsla(160, 84%, 39%, 0.3);
}

.btn-secondary {
  border: 1px solid var(--border-color);
  background: hsla(223, 47%, 10%, 0.3);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: var(--accent-emerald);
  background: var(--bg-card);
  box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

.btn-tertiary {
  color: var(--text-secondary);
}

.btn-tertiary:hover {
  color: var(--text-primary);
  transform: translateX(4px);
}

.btn-block {
  width: 100%;
}

/* --- Glassmorphism Cards --- */
.glass {
  background: hsla(223, 47%, 6%, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), hsla(160, 84%, 39%, 0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-4px);
  border-color: hsla(160, 84%, 39%, 0.3);
  box-shadow: 0 8px 30px hsla(222, 47%, 2%, 0.5), 0 0 20px var(--accent-emerald-glow);
}

/* --- Header & Navigation --- */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  z-index: 1000;
  transition: all var(--transition-normal);
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
}

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

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-svg {
  height: 32px;
  width: auto;
}

.logo-text {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-link:hover {
  color: var(--text-primary);
}

/* Mobile Menu Toggle button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
}

.hamburger-bar {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all var(--transition-fast);
}

/* Shrink header animation on scroll */
@keyframes shrink-header {
  to {
    height: 64px;
    background: hsla(222, 47%, 4%, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
  }
}

/* Hero Animations */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }

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

/* --- Hero Section --- */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  overflow: hidden;
}

.hero-container {
  position: relative;
  z-index: 10;
}

.hero-content {
  max-width: 780px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 99px;
  background: hsla(160, 84%, 39%, 0.1);
  border: 1px solid hsla(160, 84%, 39%, 0.2);
  color: var(--accent-emerald);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 4rem;
  }
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 540px) {
  .hero-actions {
    flex-direction: row;
    align-items: center;
  }
}

/* Glowing background orbs */
.glow-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  mix-blend-mode: screen;
  animation: float-orbs 12s infinite alternate ease-in-out;
}

.orb-primary {
  width: 400px;
  height: 400px;
  background-color: var(--accent-emerald);
  top: -100px;
  right: -50px;
  animation-delay: 0s;
}

.orb-secondary {
  width: 300px;
  height: 300px;
  background-color: var(--accent-indigo);
  bottom: 10%;
  left: -50px;
  animation-delay: 4s;
}

@keyframes float-orbs {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(30px) scale(1.1); }
}

/* Grid mesh background */
.mesh-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(to right, hsla(220, 30%, 20%, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, hsla(220, 30%, 20%, 0.1) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 70%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

/* --- Section Formatting --- */
.section-header {
  max-width: 680px;
  margin-bottom: 64px;
}

.section-title {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.8px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.5rem;
  }
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* --- Pillars Cards --- */
.pillar-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: hsla(220, 30%, 20%, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.card-icon {
  width: 24px;
  height: 24px;
}

.card-title {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Solutions Section --- */
.solutions-showcase {
  display: flex;
  flex-direction: column;
  gap: 120px;
}

.showcase-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 992px) {
  .showcase-item {
    grid-template-columns: 1fr 1fr;
  }
  .showcase-item.reverse .showcase-content {
    grid-column: 2;
  }
  .showcase-item.reverse .showcase-visual {
    grid-column: 1;
    grid-row: 1;
  }
}

.solution-num {
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 16px;
  display: block;
}

.showcase-title {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 16px;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .showcase-title {
    font-size: 1.8rem;
  }
}

.showcase-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.solution-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.solution-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.bullet {
  color: var(--accent-emerald);
  font-weight: bold;
}

/* Interactive Visual mockups */
.showcase-visual {
  width: 100%;
}

.visual-box {
  width: 100%;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 40px hsla(0, 0%, 0%, 0.4);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background-color: #EF4444; }
.terminal-dot.yellow { background-color: #F59E0B; }
.terminal-dot.green { background-color: #10B981; }

.terminal-title {
  font-family: var(--font-family-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.terminal-body {
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from, to { color: transparent }
  50% { color: var(--text-primary) }
}

/* Data Flow diagram style */
.data-flow-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  background: hsla(220, 30%, 12%, 0.6);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.flow-step {
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.flow-step.active {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald-glow);
}

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

.code-preview {
  font-size: 0.85rem;
  background: hsl(223, 47%, 3%);
  padding: 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  border: 1px solid var(--border-color);
}

/* Stats grid mockup */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  background: hsla(220, 30%, 12%, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

/* --- Comparison Section (Table) --- */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 16px 32px hsla(222, 47%, 2%, 0.4);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 700px;
}

.comparison-table th, .comparison-table td {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody tr {
  transition: background var(--transition-fast);
}

.comparison-table tbody tr:hover {
  background: hsla(223, 47%, 10%, 0.2);
}

.table-lbl {
  font-family: var(--font-family-display);
  font-weight: 600;
  color: var(--text-primary);
}

.highlight-column {
  background: hsla(160, 84%, 39%, 0.03);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

th.highlight-column {
  color: var(--accent-emerald) !important;
  font-weight: 700 !important;
  background: hsla(160, 84%, 39%, 0.05);
}

/* --- Sustainability Section --- */
.sustainability-section {
  background: radial-gradient(ellipse 60% 40% at 50% 50%, hsla(160, 84%, 39%, 0.05) 0%, transparent 100%);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.sustainability-content {
  max-width: 800px;
  margin: 0 auto;
}

.icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: hsla(160, 84%, 39%, 0.1);
  border: 1px solid hsla(160, 84%, 39%, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.large-icon {
  width: 36px;
  height: 36px;
}

.sustainability-text {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.sustainability-subtext {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* --- Contact & Form Section --- */
.contact-section {
  position: relative;
}

.contact-lead-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-icon {
  font-size: 1.2rem;
  font-weight: 700;
}

.info-lbl {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.manifesto-box {
  padding: 24px;
  border-radius: 8px;
}

.manifesto-title {
  font-size: 0.8rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.manifesto-text {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Contact Form */
.contact-form-wrapper {
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 24px 48px hsla(222, 47%, 2%, 0.5);
}

.form-heading {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: hsla(220, 30%, 10%, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-family-sans);
  transition: all var(--transition-fast);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='none' stroke='hsl(215, 25%, 72%)' stroke-width='1.5' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'></path></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
  padding-right: 48px;
}

.form-group select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.form-group input::placeholder, .form-group textarea::placeholder {
  color: var(--text-dim);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald-glow);
  background: hsla(220, 30%, 12%, 1);
}

/* User-valid styles */
.form-group input:user-valid, .form-group textarea:user-valid, .form-group select:user-valid {
  border-color: hsla(160, 84%, 39%, 0.4);
}

/* Form Message */
.form-message {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.form-message.success {
  background: hsla(160, 84%, 39%, 0.1);
  border: 1px solid hsla(160, 84%, 39%, 0.3);
  color: var(--accent-emerald);
}

.form-message.error {
  background: hsla(0, 84%, 60%, 0.1);
  border: 1px solid hsla(0, 84%, 60%, 0.3);
  color: #F87171;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid hsla(222, 47%, 4%, 0.3);
  border-radius: 50%;
  border-top-color: hsl(222, 47%, 4%);
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Footer --- */
.main-footer {
  border-top: 1px solid var(--border-color);
  padding: 64px 0;
  background: hsl(223, 47%, 2%);
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-branding {
  max-width: 400px;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.footer-meta {
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .footer-meta {
    text-align: right;
  }
}

.footer-meta p {
  margin-bottom: 6px;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

/* --- Viewport Scroll Reveal (Progressive Enhancement) --- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}



/* Respect user prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .glow-orb {
    animation: none !important;
  }
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .main-header {
    animation: none !important;
  }
}

/* --- Mobile Navigation Show/Hide --- */
@media (max-width: 991px) {
  .mobile-menu-toggle {
    display: flex;
    z-index: 1001;
  }
  
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: hsla(222, 47%, 4%, 0.98);
    border-left: 1px solid var(--border-color);
    padding: 120px 40px 40px;
    transition: right var(--transition-normal);
    z-index: 1000;
    backdrop-filter: blur(20px);
  }
  
  .main-nav.open {
    right: 0;
  }
  
  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  
  .main-nav .btn {
    width: 100%;
  }

  /* Hamburger transform when menu is open */
  .mobile-menu-toggle.open .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .mobile-menu-toggle.open .hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-toggle.open .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* ==========================================================================
   Scroll-Driven Animations & Progress Indicators (At bottom to avoid parsing issues)
   ========================================================================== */

/* Scroll Progress Bar Animation */
@supports (animation-timeline: scroll()) {
  .scroll-progress-bar {
    width: 100%;
    animation: scroll-progress-animation auto linear both;
    animation-timeline: scroll(block root);
  }
  @keyframes scroll-progress-animation {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

/* Shrink Header Animation */
@supports (animation-timeline: scroll()) {
  .main-header {
    animation: shrink-header auto linear both;
    animation-timeline: scroll(block root);
    animation-range: 0px 100px;
  }
}

/* View Timeline Scroll Reveal */
@supports (animation-timeline: view()) {
  @keyframes fade-reveal {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .scroll-reveal {
    opacity: 1;
    transform: none;
    animation: fade-reveal linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 30%;
  }
}
