/* ================================================================
   frontend/css/main.css
   NeuroFit AI — complete stylesheet
   ================================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
   --bg: #000000;
   --bg2: #0f0f0f;
   --bg3: #212728;
   --accent: #00BFFF;
   --accent2: #4cf0b0;
   --text: #f0f0f0;
   --muted: #888899;
   --border: rgba(255, 255, 255, 0.08);
   --card: rgba(255, 255, 255, 0.04);
   --font-display: 'Bebas Neue', 'Arial Black', 'Impact', sans-serif;
   --font-body: 'DM Sans', 'Segoe UI', Arial, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

html {
   scroll-behavior: smooth;
}

body {
   background: var(--bg);
   color: var(--text);
   font-family: var(--font-body);
   font-size: 16px;
   line-height: 1.6;
   overflow-x: hidden;
}

/* ================================================================
   NAVBAR
   ================================================================ */
nav {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   z-index: 100;
   padding: 1rem 2rem;
   display: flex;
   align-items: center;
   justify-content: space-between;
   background: rgba(0, 0, 0, 0.85);
   backdrop-filter: blur(16px);
   border-bottom: 1px solid var(--border);
}

.logo {
   font-family: var(--font-display);
   font-size: 1.8rem;
   letter-spacing: 2px;
   color: var(--accent);
}

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

.nav-links a {
   color: var(--muted);
   text-decoration: none;
   font-size: 0.9rem;
   letter-spacing: 0.05em;
   transition: color 0.2s;
}

.nav-links a:hover {
   color: var(--text);
}

.nav-right {
   display: flex;
   align-items: center;
   gap: 1.5rem;
}

.burger {
   display: none;
   flex-direction: column;
   justify-content: space-between;
   width: 24px;
   height: 18px;
   background: transparent;
   border: none;
   cursor: pointer;
   padding: 0;
   z-index: 110;
}

.burger span {
   width: 100%;
   height: 2px;
   background-color: var(--accent);
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger.active span:nth-child(1) {
   transform: translateY(8px) rotate(45deg);
}

.burger.active span:nth-child(2) {
   opacity: 0;
}

.burger.active span:nth-child(3) {
   transform: translateY(-8px) rotate(-45deg);
}

.nav-cta {
   background: var(--accent);
   color: #000000;
   font-weight: 500;
   padding: 0.5rem 1.25rem;
   border-radius: 100px;
   text-decoration: none;
   font-size: 0.85rem;
   letter-spacing: 0.04em;
   transition: all 0.2s;
}

.nav-cta:hover {
   opacity: 0.85;
   transform: translateY(-1px);
}

/* ================================================================
   MOBILE RESPONSIVE NAVBAR
   ================================================================ */
@media (max-width: 900px) {
   nav {
      padding: 1rem 1.5rem;
   }

   .burger {
      display: flex;
   }

   .nav-links {
      position: fixed;
      top: 0;
      right: -100%;
      height: 100vh;
      width: 100%;
      background: rgba(0, 0, 0, 0.95);
      backdrop-filter: blur(25px);
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3rem;
      transition: right 0.6s cubic-bezier(0.8, 0, 0.2, 1);
      z-index: 105;
   }

   .nav-links.active {
      right: 0;
   }

   .nav-links li {
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
   }

   /* BUG 3 FIX: Stagger-out transition for closing */
   .nav-links li:nth-child(1) {
      transition-delay: 0.0s;
   }

   .nav-links li:nth-child(2) {
      transition-delay: 0.1s;
   }

   .nav-links li:nth-child(3) {
      transition-delay: 0.2s;
   }

   .nav-links.active li {
      opacity: 1;
      transform: translateY(0);
   }

   .nav-links.active li:nth-child(1) {
      transition-delay: 0.2s;
   }

   .nav-links.active li:nth-child(2) {
      transition-delay: 0.3s;
   }

   .nav-links.active li:nth-child(3) {
      transition-delay: 0.4s;
   }

   .nav-links a {
      font-size: 2rem;
      font-family: var(--font-display);
      color: var(--text);
      letter-spacing: 2px;
   }

   .nav-cta {
      padding: 0.5rem 1rem;
      font-size: 0.8rem;
   }
}


/* ================================================================
   HERO
   ================================================================ */
#hero {
   min-height: 100vh;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   text-align: center;
   padding: 6rem 2rem 4rem;
   position: relative;
   overflow: hidden;
}

.hero-grid {
   position: absolute;
   inset: 0;
   background-image: linear-gradient(rgba(0, 191, 255, 0.08) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 191, 255, 0.08) 1px, transparent 1px);
   background-size: 60px 60px;
   pointer-events: none;
}

.hero-glow {
   position: absolute;
   width: 600px;
   height: 600px;
   border-radius: 50%;
   background: radial-gradient(circle, rgba(0, 191, 255, 0.08) 0%, transparent 70%);
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   pointer-events: none;
}

.hero-eyebrow {
   font-size: 0.8rem;
   letter-spacing: 0.3em;
   color: var(--accent);
   text-transform: uppercase;
   margin-bottom: 1.5rem;
   animation: fade-in-up 0.6s ease both;
}

.hero-title {
   font-family: var(--font-display);
   font-size: clamp(3rem, 10vw, 7.5rem);
   line-height: 0.95;
   letter-spacing: 2px;
   margin-bottom: 1.5rem;
   animation: fade-in-up 0.7s 0.1s ease both;
}

.hero-title span {
   color: var(--accent);
}

.hero-sub {
   font-size: 1.1rem;
   color: var(--muted);
   max-width: 540px;
   margin-bottom: 2.5rem;
   font-weight: 300;
   animation: fade-in-up 0.7s 0.2s ease both;
}

.hero-btn {
   display: inline-flex;
   align-items: center;
   gap: 0.5rem;
   background: var(--accent);
   color: #000000;
   font-weight: 500;
   padding: 0.9rem 2rem;
   border-radius: 100px;
   text-decoration: none;
   font-size: 0.95rem;
   letter-spacing: 0.03em;
   transition: transform 0.2s, opacity 0.2s;
   animation: fade-in-up 0.7s 0.3s ease both;
}

.hero-btn:hover {
   transform: translateY(-2px);
   opacity: 0.9;
}

.hero-stats {
   display: flex;
   gap: 3rem;
   margin-top: 4rem;
   animation: fade-in-up 0.7s 0.4s ease both;
}

.hero-stat .num {
   font-family: var(--font-display);
   font-size: 2.5rem;
   color: var(--accent);
}

.hero-stat .lbl {
   font-size: 0.8rem;
   color: var(--muted);
   letter-spacing: 0.1em;
}

/* ================================================================
   SHARED SECTION STYLES
   ================================================================ */
section {
   padding: 6rem 2rem;
}

.section-inner {
   max-width: 1100px;
   margin: 0 auto;
}

.section-tag {
   font-size: 0.75rem;
   letter-spacing: 0.3em;
   color: var(--accent);
   text-transform: uppercase;
   margin-bottom: 0.75rem;
}

.section-title {
   font-family: var(--font-display);
   font-size: clamp(2rem, 5vw, 3.5rem);
   line-height: 1;
   margin-bottom: 1rem;
}

.section-sub {
   color: var(--muted);
   max-width: 500px;
   font-weight: 300;
   font-size: 0.95rem;
}

/* ================================================================
   HOW IT WORKS
   ================================================================ */
#how {
   background: var(--bg2);
}

.steps {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
   gap: 1.5rem;
   margin-top: 3rem;
}

.step {
   background: var(--card);
   border: 1px solid var(--border);
   border-radius: 16px;
   padding: 1.75rem;
   position: relative;
   overflow: hidden;
   transition: border-color 0.3s;
}

.step:hover {
   border-color: rgba(0, 191, 255, 0.3);
}

.step-num {
   font-family: var(--font-display);
   font-size: 4rem;
   color: rgba(0, 191, 255, 0.08);
   position: absolute;
   top: 0.5rem;
   right: 1rem;
   line-height: 1;
}

.step-icon {
   font-size: 1.5rem;
   margin-bottom: 1rem;
}

.step h3 {
   font-size: 1rem;
   font-weight: 500;
   margin-bottom: 0.5rem;
}

.step p {
   font-size: 0.85rem;
   color: var(--muted);
}

/* ================================================================
   SCANNER SECTION
   ================================================================ */
#scanner {
   background: var(--bg);
}

.scanner-layout {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 2rem;
   margin-top: 3rem;
   align-items: start;
}

@media(max-width:800px) {
   .scanner-layout {
      grid-template-columns: 1fr;
   }
}

/* Camera box */
.cam-box {
   background: var(--bg3);
   border: 1px solid var(--border);
   border-radius: 20px;
   overflow: hidden;
   position: relative;
}

.cam-inner {
   position: relative;
   aspect-ratio: 3/4;
   background: #000;
}

#webcam {
   width: 100%;
   height: 100%;
   object-fit: cover;
   display: block;
   transform: scaleX(-1);
   /* Mirror just the feed */
}

#overlay {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   transform: scaleX(-1);
   /* Mirror skeleton overlay to match feed */
}

.cam-hud {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   pointer-events: none;
}

/* In-frame guide box */
.guide-box {
   position: absolute;
   top: 8%;
   left: 20%;
   width: 60%;
   height: 84%;
   border: 2px dashed rgba(0, 191, 255, 0.4);
   border-radius: 12px;
}

.guide-label {
   position: absolute;
   top: -1.8rem;
   left: 50%;
   transform: translateX(-50%);
   font-size: 0.7rem;
   color: var(--accent);
   letter-spacing: 0.1em;
   white-space: nowrap;
}

.guide-box.ok {
   border-color: rgba(0, 191, 255, 0.8);
   box-shadow: 0 0 18px rgba(0, 191, 255, 0.15);
}

.guide-box.warn {
   border-color: rgba(255, 193, 7, 0.7);
}

.guide-box.bad {
   border-color: rgba(244, 67, 54, 0.7);
}

/* In-frame banner */
#frame-banner {
   position: absolute;
   top: 12px;
   left: 50%;
   transform: translateX(-50%);
   z-index: 10;
   padding: 6px 16px;
   border-radius: 100px;
   font-size: 0.75rem;
   font-weight: 500;
   letter-spacing: 0.08em;
   white-space: nowrap;
   pointer-events: none;
   transition: background 0.3s, color 0.3s, border-color 0.3s;
   border: 1.5px solid transparent;
   backdrop-filter: blur(8px);
}

#frame-banner.out {
   background: rgba(244, 67, 54, 0.18);
   color: #ff6b6b;
   border-color: rgba(244, 67, 54, 0.45);
}

#frame-banner.partial {
   background: rgba(255, 193, 7, 0.18);
   color: #ffd54f;
   border-color: rgba(255, 193, 7, 0.45);
}

#frame-banner.in {
   background: rgba(0, 191, 255, 0.18);
   color: #00BFFF;
   border-color: rgba(0, 191, 255, 0.45);
}

/* Status bar */
.cam-status {
   position: absolute;
   bottom: 0;
   left: 0;
   right: 0;
   background: rgba(0, 0, 0, 0.7);
   padding: 0.6rem 1rem;
   font-size: 0.8rem;
   display: flex;
   align-items: center;
   gap: 0.5rem;
}

.status-dot {
   width: 8px;
   height: 8px;
   border-radius: 50%;
   background: #555;
   flex-shrink: 0;
}

.status-dot.g {
   background: var(--accent);
}

.status-dot.y {
   background: #ffc107;
}

.status-dot.r {
   background: #f44336;
}

/* Countdown ring */
#countdown-ring {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   display: none;
}

.ring-bg {
   fill: none;
   stroke: rgba(255, 255, 255, 0.1);
   stroke-width: 6;
}

.ring-fg {
   fill: none;
   stroke: var(--accent);
   stroke-width: 6;
   stroke-linecap: round;
   /* BUG 1 FIX: Removed hardcoded SVG array (handled by JS) */
   transform: rotate(-90deg);
   transform-origin: 50px 50px;
   transition: stroke-dashoffset 1s linear;
}

.ring-num {
   font-family: var(--font-display);
   font-size: 2rem;
   fill: var(--accent);
   text-anchor: middle;
   dominant-baseline: middle;
}

/* Controls panel */
.control-panel {
   display: flex;
   flex-direction: column;
   gap: 1rem;
}

.panel-card {
   background: var(--bg3);
   border: 1px solid var(--border);
   border-radius: 16px;
   padding: 1.5rem;
}

.panel-card h3 {
   font-size: 0.85rem;
   letter-spacing: 0.15em;
   text-transform: uppercase;
   color: var(--muted);
   margin-bottom: 1.2rem;
}

/* Buttons */
.btn {
   width: 100%;
   padding: 0.85rem;
   border-radius: 100px;
   font-family: var(--font-body);
   font-size: 0.9rem;
   font-weight: 500;
   cursor: pointer;
   border: none;
   letter-spacing: 0.04em;
   transition: all 0.2s;
}

.btn-primary {
   background: var(--accent);
   color: #000000;
}

.btn-primary:hover {
   opacity: 0.88;
   transform: translateY(-1px);
}

.btn-secondary {
   background: transparent;
   color: var(--text);
   border: 1px solid var(--border);
}

.btn-secondary:hover {
   border-color: rgba(255, 255, 255, 0.3);
   background: rgba(255, 255, 255, 0.05);
}

.btn:disabled {
   opacity: 0.35;
   cursor: not-allowed;
   transform: none !important;
}

.btn-row {
   display: flex;
   gap: 0.75rem;
}

/* Sliders & selects */
.slider-row {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   margin-bottom: 0.75rem;
}

.slider-row label {
   font-size: 0.8rem;
   color: var(--muted);
   min-width: 110px;
}

.slider-row input[type=range] {
   flex: 1;
   accent-color: var(--accent);
}

.slider-row span {
   font-size: 0.8rem;
   font-weight: 500;
   min-width: 48px;
   text-align: right;
}

select {
   width: 100%;
   padding: 0.6rem 0.8rem;
   background: var(--bg);
   border: 1px solid var(--border);
   border-radius: 8px;
   color: var(--text);
   font-family: var(--font-body);
   font-size: 0.85rem;
   margin-top: 0.5rem;
}

/* ================================================================
   RESULTS SECTION
   ================================================================ */
#results-section {
   display: none;
   background: var(--bg2);
}

/* Numbered result blocks */
.result-block {
   margin-bottom: 2.5rem;
   /* BUG 5 FIX: Removed scroll-margin-top (handled by JS offset) */
}

.result-block-header {
   display: flex;
   align-items: center;
   gap: 1rem;
   margin-bottom: 1.25rem;
}

.result-step {
   font-family: var(--font-display);
   font-size: 2.5rem;
   color: rgba(0, 191, 255, 0.2);
   line-height: 1;
}

.result-block-title {
   font-size: 0.75rem;
   letter-spacing: 0.25em;
   text-transform: uppercase;
   color: var(--muted);
}

/* Metric cards */
.results-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
   gap: 1rem;
   margin-bottom: 2rem;
}

.metric-card {
   background: var(--bg3);
   border: 1px solid var(--border);
   border-radius: 12px;
   padding: 1.25rem;
   text-align: center;
}

.metric-card .m-label {
   font-size: 0.7rem;
   letter-spacing: 0.2em;
   text-transform: uppercase;
   color: var(--muted);
   margin-bottom: 0.4rem;
}

.metric-card .m-val {
   font-family: var(--font-display);
   font-size: 2.2rem;
   color: var(--accent);
}

.metric-card .m-unit {
   font-size: 0.75rem;
   color: var(--muted);
}

.metric-card.ref-data {
   border-color: rgba(0, 191, 255, 0.2);
   background: rgba(0, 191, 255, 0.02);
   position: relative;
}

.metric-card.ref-data::after {
   content: 'REF';
   position: absolute;
   top: 6px;
   right: 8px;
   font-size: 0.55rem;
   color: var(--accent);
   font-weight: bold;
   opacity: 0.6;
}

/* BMI bar */
.bmi-wrap {
   background: var(--bg3);
   border: 1px solid var(--border);
   border-radius: 16px;
   padding: 1.5rem;
   margin-bottom: 1.5rem;
}

.bmi-bar-track {
   height: 12px;
   border-radius: 6px;
   background: linear-gradient(to right, #4fc3f7, #81c784, #ffd54f, #ff8a65, #e57373);
   margin: 1rem 0;
   position: relative;
}

.bmi-needle {
   position: absolute;
   top: -6px;
   width: 24px;
   height: 24px;
   border-radius: 50%;
   background: var(--text);
   border: 3px solid var(--bg);
   transform: translateX(-50%);
   transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.bmi-scale {
   display: flex;
   justify-content: space-between;
   font-size: 0.7rem;
   color: var(--muted);
}

.bmi-result-text {
   font-size: 1.5rem;
   font-weight: 500;
   margin-top: 0.75rem;
}

/* Body type cards */
.body-types {
   display: grid;
   grid-template-columns: repeat(4, 1fr);
   gap: 1rem;
   margin-bottom: 1.5rem;
}

@media (max-width: 700px) {
   .body-types {
      grid-template-columns: repeat(2, 1fr);
   }
}

.btype-card {
   background: var(--bg3);
   border: 2px solid var(--border);
   border-radius: 16px;
   padding: 1.25rem;
   text-align: center;
   transition: all 0.3s;
}

.btype-card.active {
   border-color: var(--accent);
   background: rgba(0, 191, 255, 0.06);
}

.btype-fig {
   font-size: 2.5rem;
   margin-bottom: 0.5rem;
}

.btype-name {
   font-family: var(--font-display);
   font-size: 1.3rem;
   letter-spacing: 1px;
}

.btype-sub {
   font-size: 0.75rem;
   color: var(--muted);
   margin-top: 0.25rem;
}

.btype-traits {
   font-size: 0.75rem;
   color: var(--muted);
   margin-top: 0.75rem;
   line-height: 1.5;
}

.btype-insight {
   background: rgba(0, 191, 255, 0.06);
   border: 1px solid rgba(0, 191, 255, 0.2);
   border-radius: 12px;
   padding: 1rem 1.25rem;
   font-size: 0.88rem;
   color: var(--text);
   margin-top: 1rem;
   line-height: 1.7;
}

.btype-insight strong {
   color: var(--accent);
}

/* Exercise cards */
.exercise-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
   gap: 1rem;
}

.ex-card {
   background: var(--bg3);
   border: 1px solid var(--border);
   border-radius: 14px;
   padding: 1.1rem 1.25rem;
   display: flex;
   gap: 1rem;
   align-items: flex-start;
   transition: border-color 0.2s;
}

.ex-card:hover {
   border-color: rgba(0, 191, 255, 0.3);
}

.ex-card-icon {
   font-size: 1.6rem;
   width: 36px;
   text-align: center;
   flex-shrink: 0;
}

.ex-card-name {
   font-size: 0.9rem;
   font-weight: 500;
   margin-bottom: 2px;
}

.ex-card-meta {
   font-size: 0.75rem;
   color: var(--muted);
}

.ex-card-tag {
   display: inline-block;
   font-size: 0.65rem;
   padding: 2px 8px;
   border-radius: 100px;
   margin-top: 4px;
   font-weight: 500;
}

.tag-burn {
   background: rgba(244, 67, 54, 0.15);
   color: #ff6b6b;
}

.tag-build {
   background: rgba(76, 240, 176, 0.15);
   color: #4cf0b0;
}

.tag-cardio {
   background: rgba(255, 193, 7, 0.15);
   color: #ffd54f;
}

.tag-flex {
   background: rgba(138, 180, 248, 0.15);
   color: #8ab4f8;
}

/* Diet picker */
.diet-picker {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   margin-bottom: 1.5rem;
   flex-wrap: wrap;
}

.diet-picker-label {
   font-size: 0.8rem;
   color: var(--muted);
}

.diet-btn {
   padding: 0.4rem 1rem;
   border-radius: 100px;
   border: 1px solid var(--border);
   background: transparent;
   color: var(--muted);
   font-size: 0.8rem;
   cursor: pointer;
   transition: all 0.2s;
   font-family: var(--font-body);
}

.diet-btn:hover {
   border-color: rgba(0, 191, 255, 0.4);
   color: var(--text);
}

.diet-btn.active {
   background: rgba(0, 191, 255, 0.12);
   border-color: var(--accent);
   color: var(--accent);
}

/* Meal cards */
.meal-cards-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   gap: 1rem;
}

.meal-card {
   background: var(--bg3);
   border: 1px solid var(--border);
   border-radius: 16px;
   padding: 1.25rem;
   transition: border-color 0.2s;
   position: relative;
   overflow: hidden;
}

.meal-card:hover {
   border-color: rgba(0, 191, 255, 0.25);
}

.meal-card.top-pick {
   border-color: rgba(0, 191, 255, 0.5);
}

.meal-rank {
   position: absolute;
   top: 0.8rem;
   right: 0.8rem;
   font-family: var(--font-display);
   font-size: 0.75rem;
   letter-spacing: 1px;
   padding: 2px 8px;
   border-radius: 100px;
}

.rank-1 {
   background: rgba(0, 191, 255, 0.15);
   color: var(--accent);
}

.rank-2 {
   background: rgba(76, 240, 176, 0.1);
   color: var(--accent2);
}

.rank-other {
   background: rgba(255, 255, 255, 0.05);
   color: var(--muted);
}

.meal-cuisine {
   font-size: 0.7rem;
   letter-spacing: 0.15em;
   text-transform: uppercase;
   color: var(--muted);
   margin-bottom: 0.4rem;
}

.meal-name-big {
   font-family: var(--font-display);
   font-size: 1.4rem;
   letter-spacing: 1px;
   line-height: 1.1;
   margin-bottom: 0.75rem;
}

.meal-macros {
   display: flex;
   gap: 0.75rem;
   margin-bottom: 0.75rem;
}

.macro-pill {
   flex: 1;
   background: rgba(255, 255, 255, 0.04);
   border-radius: 8px;
   padding: 0.4rem 0.5rem;
   text-align: center;
}

.macro-val {
   font-size: 0.95rem;
   font-weight: 500;
}

.macro-lbl {
   font-size: 0.65rem;
   color: var(--muted);
   text-transform: uppercase;
   letter-spacing: 0.08em;
}

.meal-ings {
   font-size: 0.75rem;
   color: var(--muted);
   line-height: 1.5;
}

.meal-score-bar {
   height: 3px;
   border-radius: 2px;
   background: rgba(255, 255, 255, 0.08);
   margin-top: 0.75rem;
}

.meal-score-fill {
   height: 100%;
   border-radius: 2px;
   background: var(--accent);
   transition: width 0.6s ease;
}

.meal-score-txt {
   font-size: 0.7rem;
   color: var(--muted);
   margin-top: 3px;
}

/* ================================================================
   ABOUT SECTION
   ================================================================ */
#about {
   background: var(--bg);
}

.about-grid {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 4rem;
   align-items: center;
   margin-top: 3rem;
}

@media(max-width:700px) {
   .about-grid {
      grid-template-columns: 1fr;
   }
}

.about-text p {
   color: var(--muted);
   font-size: 0.95rem;
   margin-bottom: 1rem;
   font-weight: 300;
}

.about-features {
   display: flex;
   flex-direction: column;
   gap: 1rem;
}

.feat {
   display: flex;
   gap: 1rem;
   align-items: flex-start;
}

.feat-icon {
   width: 36px;
   height: 36px;
   border-radius: 8px;
   background: rgba(0, 191, 255, 0.1);
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 1rem;
   flex-shrink: 0;
}

.feat h4 {
   font-size: 0.9rem;
   font-weight: 500;
   margin-bottom: 0.2rem;
}

.feat p {
   font-size: 0.8rem;
   color: var(--muted);
}

/* ================================================================
   FOOTER
   ================================================================ */
footer {
   background: var(--bg2);
   border-top: 1px solid var(--border);
   padding: 2.5rem 2rem 2rem;
   text-align: center;
   color: var(--muted);
   font-size: 0.8rem;
   position: relative;
}

.footer-content {
   max-width: 600px;
   margin: 0 auto;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 1.2rem;
}

footer .f-logo {
   font-family: var(--font-display);
   font-size: 1.8rem;
   color: var(--accent);
   letter-spacing: 2px;
   margin: 0;
}

.footer-top-row {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 2rem;
   margin-bottom: 0.5rem;
}

.footer-icon-link {
   background: rgba(255, 255, 255, 0.04);
   border: 1px solid var(--border);
   color: var(--muted);
   width: 38px;
   height: 38px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
   text-decoration: none;
   flex-shrink: 0;
}

.footer-icon-link:hover {
   background: rgba(0, 191, 255, 0.1);
   border-color: var(--accent);
   color: var(--accent);
   transform: translateY(-3px);
   box-shadow: 0 5px 15px rgba(0, 191, 255, 0.15);
}

.copyright {
   font-size: 0.75rem;
   color: rgba(255, 255, 255, 0.25);
   letter-spacing: 0.05em;
   margin-top: 1rem;
}

/* Dataset References Dropdown */
.ref-dropdown {
   position: relative;
}

.ref-menu {
   position: absolute;
   bottom: calc(100% + 15px);
   left: 50%;
   transform: translateX(-50%) translateY(10px);
   width: 260px;
   background: rgba(15, 15, 15, 0.95);
   backdrop-filter: blur(16px);
   border: 1px solid var(--border);
   border-radius: 12px;
   padding: 10px;
   text-align: left;
   box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
   opacity: 0;
   visibility: hidden;
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   z-index: 1000;
}

/* Arrow indicator for menu */
.ref-menu::after {
   content: '';
   position: absolute;
   top: 100%;
   left: 50%;
   transform: translateX(-50%);
   border: 8px solid transparent;
   border-top-color: var(--border);
}

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

.ref-menu-header {
   font-size: 0.65rem;
   letter-spacing: 0.15em;
   color: var(--muted);
   margin: 5px 10px 10px;
   font-weight: 700;
}

.ref-item {
   display: flex;
   flex-direction: column;
   padding: 10px 12px;
   border-radius: 8px;
   text-decoration: none;
   transition: background 0.2s;
   border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ref-item:last-child {
   border-bottom: none;
}

.ref-item:hover {
   background: rgba(255, 255, 255, 0.05);
}

.ref-label {
   color: var(--text);
   font-size: 0.8rem;
   font-weight: 500;
}

.ref-url {
   color: var(--accent);
   font-size: 0.65rem;
   opacity: 0.7;
   margin-top: 2px;
}

/* ================================================================
   ANIMATIONS & SCROLL REVEAL
   ================================================================ */
@keyframes fade-in-up {
   from {
      opacity: 0;
      transform: translateY(24px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

.fade-in {
   opacity: 0;
   transform: translateY(20px);
   transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
   opacity: 1;
   transform: none;
}

/* ── Result Loading States ─────────────────────────────────── */
.result-loader-wrap {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   padding: 3rem;
   min-height: 350px;
   background: var(--bg3);
   border-radius: 16px;
   border: 1px dashed var(--border);
   animation: pulse 1.5s infinite;
}

@keyframes pulse {
   0% {
      opacity: 0.6;
   }

   50% {
      opacity: 1;
   }

   100% {
      opacity: 0.6;
   }
}

.spinner {
   width: 40px;
   height: 40px;
   border: 3px solid rgba(0, 191, 255, 0.1);
   border-top-color: var(--accent);
   border-radius: 50%;
   animation: spin 0.8s linear infinite;
   margin-bottom: 1rem;
}

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

.loader-text {
   font-size: 0.8rem;
   letter-spacing: 0.1em;
   color: var(--muted);
   text-transform: uppercase;
   margin-bottom: 1.5rem;
}

.loader-terminal {
   width: 100%;
   max-width: 400px;
   height: 120px;
   background: #0a0a0a;
   border-radius: 8px;
   border: 1px solid rgba(0, 191, 255, 0.2);
   padding: 1rem;
   font-family: 'Courier New', Courier, monospace;
   font-size: 0.7rem;
   color: #4cf0b0;
   text-align: left;
   overflow-y: hidden;
   display: flex;
   flex-direction: column;
   gap: 4px;
   box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.term-line {
   opacity: 0;
   animation: termFade 0.3s forwards;
}

@keyframes termFade {
   to {
      opacity: 0.8;
   }
}

.term-line::before {
   content: '> ';
   color: var(--accent);
}

.result-block {
   transition: opacity 0.5s ease;
}

.result-block.hidden {
   display: none;
}

/* ── Celebration / Confetti ────────────────────────────────── */
.confetti {
   position: fixed;
   top: -20px;
   z-index: 9999;
   pointer-events: none;
   animation: confettiFall linear forwards;
}

@keyframes confettiFall {
   0% {
      transform: translateY(0) rotate(0deg);
      opacity: 1;
   }

   100% {
      transform: translateY(110vh) rotate(720deg);
      opacity: 0;
   }
}