@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============================================================
   FitLine with Nicole — Editorial Dark Crimson v4
   Inspired by: fluid.glass, kookie-kollective, thisisstudiox
   Philosophy: Magazine flow. Big images. No card boxes.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: color 0.3s; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

:root {
  --red: #d91e49;
  --red-soft: rgba(217, 30, 73, 0.10);
  --red-glow: rgba(217, 30, 73, 0.15);
  --gold: #c9a84c;

  /* Dark zone (video, stats bar, footer) */
  --dark: #0c0408;
  --dark-alt: #110810;
  --dark-surface: #18101a;

  /* Light zone (main content — warm cream like fluid.glass / thisisstudiox) */
  --bg: #f5f2ed;
  --bg-alt: #edeae4;
  --surface: #ffffff;
  --text: #4a4550;
  --text-bright: #1a1520;
  --text-muted: #8a8490;
  --border: rgba(0,0,0,0.06);
  --max-w: 1200px;
  --content-w: 800px;
}

/* --- Typography (massive, editorial) --- */
h1, h2, h3, h4 {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-bright);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
p { font-size: clamp(0.9rem, 1.2vw, 1.05rem); }

/* --- Scroll Bar --- */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--red); z-index: 9999;
  transform-origin: left; transform: scaleX(0);
}

main { position: relative; z-index: 1; }

/* --- Scroll Video --- */
.scroll-video-section { height: 400vh; position: relative; background: #0c0408; }
.scroll-video-pin { position: relative; will-change: transform; }
.scroll-video-pin canvas { display: block; width: 100%; height: 100%; }
#scroll-video-loader { transition: opacity 0.5s ease; }

/* === NAV === */
.glass-nav { background: transparent; transition: all 0.3s; }
.glass-nav.scrolled {
  background: rgba(245,242,237,0.92); backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.glass-nav.scrolled .nav-link { color: #8a8490; }
.glass-nav.scrolled .nav-link:hover { color: #1a1520; }
.glass-nav.scrolled .nav-brand { color: #1a1520; }
.glass-nav.scrolled .burger-line { background: #1a1520; }

/* Dark nav (for dark sections at top/bottom) */
.glass-nav.nav-dark {
  background: rgba(12,4,8,0.92); backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.glass-nav.nav-dark .nav-link { color: #5c5060; }
.glass-nav.nav-dark .nav-link:hover { color: #f0edf0; }
.glass-nav.nav-dark .nav-brand { color: #f0edf0; }
.glass-nav.nav-dark .burger-line { background: #f0edf0; }
.glass-nav.nav-light {
  background: rgba(255,255,255,0.92); backdrop-filter: blur(24px);
  border-bottom: none;
}
.glass-nav.nav-light .nav-link { color: #666; }
.glass-nav.nav-light .nav-link:hover { color: #111; }
.glass-nav.nav-light .nav-brand { color: #111; }
.glass-nav.nav-light .burger-line { background: #111; }
.burger-line { background: var(--text-bright); }
.nav-brand { color: var(--text-bright); }
.nav-link {
  font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
  letter-spacing: 0.03em; transition: color 0.25s; position: relative;
}
.nav-link:hover { color: var(--text-bright); }

/* === SECTION SYSTEM (editorial) === */
.s { padding: clamp(4rem, 8vw, 8rem) clamp(1.5rem, 4vw, 3rem); }
.s-inner { max-width: var(--max-w); margin: 0 auto; }
.s-narrow { max-width: var(--content-w); margin: 0 auto; }
.s-alt { background: var(--bg-alt); }

/* Dark zone — for video, stats bar, CTA footer, footer */
.s-dark { background: var(--dark); color: #c8c0ca; }
.s-dark h1, .s-dark h2, .s-dark h3, .s-dark h4 { color: #f0edf0; }
.s-dark p, .s-dark li { color: #9a9099; }
.s-dark .stat-num { color: #f0edf0; }
.s-dark .stat-sub { color: #5c5060; }
.s-dark .btn-outline { border-color: rgba(255,255,255,0.15); color: #c8c0ca; }
.s-dark .btn-outline:hover { border-color: rgba(255,255,255,0.3); color: #f0edf0; }
.s-dark-alt { background: var(--dark-alt); color: #c8c0ca; }
.s-dark-alt h1, .s-dark-alt h2, .s-dark-alt h3, .s-dark-alt h4 { color: #f0edf0; }
.s-dark-alt p, .s-dark-alt li { color: #9a9099; }
.s-label {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--red); margin-bottom: 1.5rem;
  display: block;
}
.s-header { margin-bottom: clamp(2rem, 4vw, 4rem); }
.s-header h2 { margin-bottom: 0.75rem; }
.s-header p { max-width: 520px; }
.s-header-center { text-align: center; }
.s-header-center p { margin: 0 auto; }

/* === BUTTONS (clean, editorial) === */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1.75rem; font-size: 0.85rem; font-weight: 600;
  border-radius: 6px; transition: all 0.3s; white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #b8163d; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,0.12); }
.btn-outline:hover { border-color: rgba(255,255,255,0.3); color: var(--text-bright); }
.btn-green { background: #25d366; color: #fff; }
.btn-green:hover { background: #1da851; }
.btn-lg { padding: 0.9rem 2.2rem; font-size: 0.95rem; }

/* === STAT BAR === */
.stat-bar { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.stat-item { text-align: center; }
.stat-num {
  font-family: 'Montserrat'; font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900; color: var(--text-bright); line-height: 1;
}
.stat-num span { color: var(--red); }
.stat-sub { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 0.3rem; }

/* === PRODUCT GRID (large images, no borders) === */
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.product-item {
  background: var(--surface); border-radius: 16px; overflow: hidden;
  cursor: pointer; transition: transform 0.4s, box-shadow 0.4s;
  border: 1px solid var(--border);
}
.product-item:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(0,0,0,0.08); }
.product-item-img {
  width: 100%; aspect-ratio: 4/3; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #faf8f5, #f0ede8);
  padding: 2.5rem; overflow: hidden;
}
.product-item-img img {
  max-height: 160px; width: auto; object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.15));
  animation: float 6s ease-in-out infinite;
}
.product-item-body { padding: 1.5rem 1.75rem; }
.product-item-body h3 { margin-bottom: 0.4rem; }
.product-item-body p { font-size: 0.88rem; margin-bottom: 1rem; }

/* === AWARDS (clean horizontal, no boxes) === */
.awards-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
  text-align: center;
}
.award-item img {
  width: 100%; max-height: 120px; object-fit: contain;
  margin-bottom: 0.75rem; filter: grayscale(0.2);
  transition: filter 0.3s;
}
.award-item:hover img { filter: grayscale(0); }
.award-item h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.15rem; }
.award-item p { font-size: 0.7rem; color: var(--text-muted); }

/* === CERTS (clean, no heavy boxes) === */
.cert-row { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 2rem; }
.cert-icon {
  width: 64px; height: 64px; flex-shrink: 0; object-fit: contain;
  background: #fff; border-radius: 12px; padding: 8px;
}
.cert-text { flex: 1; }
.cert-text h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.cert-text p { font-size: 0.88rem; }
.cert-accordion { max-height: 0; overflow: hidden; transition: max-height 0.5s ease; }
.cert-accordion.open { max-height: 500px; }
.cert-detail {
  background: var(--bg-alt); border-radius: 12px; padding: 1rem 1.25rem;
  margin-top: 0.75rem; font-size: 0.85rem;
}
.cert-check { display: none; } /* removing the buggy SVG checks */

/* === TRUST STATS === */
.trust-stats { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.trust-stat { text-align: center; }
.trust-stat .num {
  font-family: 'Montserrat'; font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 900; color: var(--red); line-height: 1;
}
.trust-stat .label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.2rem; }

/* === VIDEO THEATER === */
.video-frame {
  position: relative; border-radius: 12px; overflow: hidden;
  background: #000;
}
.video-frame video { width: 100%; display: block; }
.video-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3); cursor: pointer; transition: background 0.3s; z-index: 5;
}
.video-play-overlay:hover { background: rgba(0,0,0,0.1); }
.play-btn {
  width: 60px; height: 60px; background: var(--red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px var(--red-glow); transition: transform 0.3s;
}
.play-btn:hover { transform: scale(1.1); }
.play-btn svg { fill: #fff; width: 22px; height: 22px; margin-left: 3px; }

/* === GALLERY === */
.gallery-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.gallery-item {
  aspect-ratio: 1; overflow: hidden; border-radius: 8px; cursor: pointer;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.gallery-item:hover img { transform: scale(1.05); }

/* === WHY FITLINE (editorial rows) === */
.editorial-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4vw, 4rem);
  align-items: center; margin-bottom: clamp(3rem, 6vw, 6rem);
}
.editorial-row:last-child { margin-bottom: 0; }
.editorial-img { border-radius: 12px; overflow: hidden; }
.editorial-img img { width: 100%; height: auto; transition: transform 0.6s; }
.editorial-img:hover img { transform: scale(1.02); }
.editorial-text h3 { margin-bottom: 0.6rem; }
.editorial-text p { margin-bottom: 0.8rem; }

/* === NTC HIGHLIGHT === */
.highlight-box {
  background: var(--surface); border-radius: 16px; border: 1px solid var(--border);
  padding: clamp(2rem, 4vw, 3.5rem); text-align: center;
  max-width: 700px; margin: 0 auto;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}
.highlight-box::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 200px; height: 2px; background: linear-gradient(90deg, transparent, var(--red), transparent);
}

/* === MAP === */
.map-wrap { border-radius: 12px; overflow: hidden; }
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; filter: grayscale(0.7) invert(0.9) contrast(0.85); }

/* FABs are now inline-styled pill buttons */

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s; padding: 1rem;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 16px;
  max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-close {
  position: absolute; top: 0.75rem; right: 0.75rem; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text); transition: all 0.2s; z-index: 10;
}
.modal-close:hover { background: var(--red); color: #fff; }

/* === LIGHTBOX === */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.95);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s; cursor: zoom-out;
}
.lightbox.active { opacity: 1; pointer-events: all; }
.lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 8px; }

/* === DIVIDER === */
.divider { width: 48px; height: 1px; background: var(--red); margin: 0 auto; opacity: 0.5; }

/* === ANIMATIONS === */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* === RESPONSIVE — Tablet (1024px) === */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .awards-row { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === RESPONSIVE — Mobile (768px) === */
@media (max-width: 768px) {
  /* Layout */
  .editorial-row { grid-template-columns: 1fr !important; direction: ltr !important; }
  .editorial-row > * { direction: ltr !important; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .awards-row { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .cert-row { flex-direction: column; align-items: center; text-align: center; }

  /* Spacing — tighter on mobile */
  .s { padding: clamp(2.5rem, 6vw, 4rem) 1rem; }
  .s-header { margin-bottom: 1.5rem; }

  /* Stats */
  .stat-bar { gap: 1rem; }
  .trust-stats { gap: 1rem; }

  /* Typography — ensure readability */
  h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); }
  h2 { font-size: clamp(1.4rem, 5vw, 2rem); }
  h3 { font-size: clamp(1rem, 3.5vw, 1.2rem); }
  .s-label { font-size: 0.6rem; }

  /* Nav */
  .glass-nav { padding: 0 !important; }

  /* Product cards */
  .product-item-img { aspect-ratio: 1; padding: 1.5rem; }
  .product-item-img img { max-height: 120px; }
  .product-item-body { padding: 1rem 1.25rem; }
  .product-item-body h3 { font-size: 0.9rem; }
  .product-item-body p { font-size: 0.78rem; }

  /* Map */
  .map-wrap { height: 240px !important; }

  /* Video frames */
  .video-frame { border-radius: 10px; }
  .play-btn { width: 48px; height: 48px; }
  .play-btn svg { width: 18px; height: 18px; }

  /* Gallery */
  .gallery-grid { gap: 0.4rem; }
  .gallery-item { border-radius: 6px; }

  /* Buttons — ensure touch-friendly 44px min */
  .btn { min-height: 44px; padding: 0.7rem 1.5rem; }
  .btn-lg { min-height: 48px; }

  /* FAB pills — compact on mobile */
  #fab-group { right: 0.75rem; bottom: 1rem; gap: 0.5rem; }
  #fab-group a { font-size: 0.75rem !important; padding: 0.6rem 1rem !important; }
  #fab-group svg { width: 18px !important; height: 18px !important; }
  #fab-welcome { right: 0.75rem; bottom: 7rem; }
  #fab-welcome > div { max-width: 200px; }

  /* Scroll video caption */
  #scroll-video-caption img { width: 48px !important; height: 48px !important; }
}

/* === RESPONSIVE — Small Mobile (480px) === */
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; max-width: 340px; margin: 0 auto; }
  .stat-bar { flex-direction: column; align-items: center; gap: 0.75rem; }
  .awards-row { grid-template-columns: 1fr; max-width: 260px; margin: 0 auto; }
  .trust-stats { flex-direction: column; gap: 0.75rem; }

  /* Hero content — stack nicely */
  #about .grid { gap: 2rem !important; }
  #about-stats { gap: 1rem !important; }

  /* Loader — smaller number on small screens */
  #loader-counter { font-size: clamp(3rem, 15vw, 5rem) !important; }
}

/* === RESPONSIVE — Large Desktop (1440px+) === */
@media (min-width: 1440px) {
  :root { --max-w: 1280px; }
  .product-grid { gap: 2rem; }
  .gallery-grid { gap: 1rem; }
}

@media print {
  #fab-group, #fab-welcome, #scroll-progress, .glass-nav, #site-loader { display: none !important; }
  body { background: #fff; color: #000; }
  .s-dark, .s-dark-alt { background: #f5f5f5 !important; color: #000 !important; }
  .s-dark h1, .s-dark h2, .s-dark h3, .s-dark-alt h1, .s-dark-alt h2, .s-dark-alt h3 { color: #000 !important; }
}
