/* ══════════════════════════════════════════════════════════
   Nerithys — Stylesheet (Fishipedia-inspired)
   ══════════════════════════════════════════════════════════ */

/* ── Tokens ────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f7f9;
  --surface: #ffffff;
  --ink: #1a1a2e;
  --ink-light: #4a4a68;
  --muted: #7b7b8e;
  --border: #e4e8ec;

  --ocean: #00897b;
  --ocean-dark: #00695c;
  --ocean-light: #e0f2f1;
  --ocean-glow: rgba(0, 137, 123, .15);

  --navy: #0a1628;
  --navy-light: #162038;
  --navy-lighter: #1e2d4a;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .25s;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto }
a { color: inherit; text-decoration: none }
ul { list-style: none }
button { font-family: inherit; cursor: pointer; border: none; background: none }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700 }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem) }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem) }
h3 { font-size: 1rem }

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem }
.section { padding: 3.5rem 0 }

/* ══════════════════════════════════════════════════════════
   HEADER — Dark navy bar (Fishipedia style)
   ══════════════════════════════════════════════════════════ */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: .65rem 1.25rem;
}

/* Logo */
.logo { display: flex; align-items: center; gap: .6rem }
.logo img { width: 36px; height: 36px; border-radius: 6px }
.logo-text { font-weight: 800; font-size: 1.15rem; color: #fff }
.logo-sub { font-size: .65rem; color: rgba(255,255,255,.45); letter-spacing: .03em }

/* Nav links */
.nav-links { display: flex; gap: 1.75rem }
.nav-links a {
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  font-weight: 500;
  transition: color var(--dur);
  position: relative;
  padding: .3rem 0;
}
.nav-links a:hover,
.nav-links a.active { color: #fff }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--ocean);
  border-radius: 1px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform var(--dur), opacity var(--dur);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
.hamburger.open span:nth-child(2) { opacity: 0 }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }

@media (max-width: 768px) {
  .nav-links { display: none }
  .hamburger { display: flex }
}

/* Mobile nav */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--navy);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.mobile-nav.open { opacity: 1; visibility: visible }
.mobile-nav a {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   HERO — Full-width ocean banner
   ══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  background: var(--navy);
  overflow: hidden;
  padding: 5rem 0 4.5rem;
  text-align: center;
  color: #fff;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,137,123,.3) 0%, rgba(10,22,40,.7) 60%);
  z-index: 1;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .35;
}
.hero .container { position: relative; z-index: 2 }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #fff;
  margin-bottom: .6rem;
  font-weight: 700;
}
.hero h1 .accent { color: #4dd0c5 }
.hero .hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.75);
  max-width: 580px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--ocean);
  color: #fff;
  padding: .7rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: background var(--dur), transform var(--dur);
}
.hero-cta:hover { background: var(--ocean-dark); transform: translateY(-1px) }
.hero-cta svg { width: 16px; height: 16px }

/* Stats bar */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.hero-stats .stat { text-align: center }
.hero-stats .stat-num { font-size: 1.6rem; font-weight: 800; color: #4dd0c5 }
.hero-stats .stat-label {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .15rem;
}

@media (max-width: 640px) {
  .hero { padding: 3.5rem 0 3rem }
  .hero-stats { gap: 1.5rem }
}

/* ══════════════════════════════════════════════════════════
   SECTION HEADINGS
   ══════════════════════════════════════════════════════════ */
.section-head {
  margin-bottom: 2rem;
}
.section-head h2 {
  font-family: var(--font-display);
  position: relative;
  display: inline-block;
}
.section-head h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--ocean);
  margin-top: .5rem;
  border-radius: 2px;
}
.section-head p { color: var(--muted); font-size: .92rem; margin-top: .35rem }

/* ══════════════════════════════════════════════════════════
   SPECIES CARDS — photo card with overlay name
   ══════════════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur), box-shadow var(--dur);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card a { display: block; text-decoration: none }

.card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--navy-light);
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.card:hover .card-img { transform: scale(1.06) }

.card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10,22,40,.85) 0%, rgba(10,22,40,.15) 55%, transparent 100%);
  pointer-events: none;
}

.card-body {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 1rem 1rem .85rem;
  color: #fff;
  z-index: 2;
}
.card-name {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .15rem;
}
.card-sci {
  font-size: .74rem;
  font-style: italic;
  color: rgba(255,255,255,.55);
  margin-bottom: .45rem;
}
.card-badges { display: flex; flex-wrap: wrap; gap: .3rem }

/* ══════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.5;
}
.badge-green  { background: rgba(72,199,142,.2); color: #48c78e }
.badge-teal   { background: rgba(0,137,123,.2); color: #4dd0c5 }
.badge-amber  { background: rgba(255,183,77,.2); color: #ffb74d }
.badge-red    { background: rgba(239,83,80,.2); color: #ef5350 }
.badge-slate  { background: rgba(255,255,255,.12); color: rgba(255,255,255,.7) }
.badge-ocean  { background: var(--ocean-glow); color: var(--ocean) }

/* On light backgrounds */
.badge-green-solid  { background: #e8f5e9; color: #2e7d32 }
.badge-teal-solid   { background: #e0f2f1; color: #00695c }
.badge-amber-solid  { background: #fff8e1; color: #f57f17 }
.badge-red-solid    { background: #fce4ec; color: #c62828 }
.badge-slate-solid  { background: #eceff1; color: #546e7a }

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .88rem;
  transition: all var(--dur);
  border: none;
  cursor: pointer;
}
.btn-ocean { background: var(--ocean); color: #fff }
.btn-ocean:hover { background: var(--ocean-dark) }
.btn-outline {
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--ocean); color: var(--ocean) }
.btn-sm { padding: .4rem .9rem; font-size: .82rem }

/* ══════════════════════════════════════════════════════════
   FEATURES GRID (Why Nerithys)
   ══════════════════════════════════════════════════════════ */
.features-section { background: var(--bg-alt) }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: box-shadow var(--dur), transform var(--dur);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-card .icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--ocean-light);
  color: var(--ocean);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .85rem;
}
.feature-card .icon-wrap svg { width: 20px; height: 20px }
.feature-card h3 { margin-bottom: .3rem }
.feature-card p { font-size: .87rem; color: var(--muted); line-height: 1.6 }

/* ══════════════════════════════════════════════════════════
   CTA BANNER (dark section)
   ══════════════════════════════════════════════════════════ */
.cta-section {
  background: var(--navy);
  padding: 3.5rem 0;
  text-align: center;
  color: #fff;
}
.cta-section h2 { color: #fff; margin-bottom: .5rem; font-family: var(--font-display) }
.cta-section p { color: rgba(255,255,255,.6); margin-bottom: 1.5rem }

/* ══════════════════════════════════════════════════════════
   PARAMS GRID (fiche detail)
   ══════════════════════════════════════════════════════════ */
.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}
.param-card {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.param-card .label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .2rem;
}
.param-card .value {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
}

/* Difficulty dots */
.diff-dots { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle }
.diff-dots .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #e0e0e0;
}
.diff-dots .dot.filled { background: var(--ocean) }

/* Info boxes */
.info-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  font-size: .9rem;
  line-height: 1.6;
}
.info-box-teal {
  background: var(--ocean-light);
  border-left: 3px solid var(--ocean);
  color: var(--ocean-dark);
}
.info-box-red {
  background: #fce4ec;
  border-left: 3px solid #e57373;
  color: #b71c1c;
}

/* ══════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.lightbox.open { opacity: 1; visibility: visible }
.lightbox .lb-inner { position: relative; max-width: 92vw; max-height: 92vh }
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--radius);
}
.lightbox .close-btn {
  position: absolute;
  top: -12px; right: -12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: none;
}

/* ══════════════════════════════════════════════════════════
   FILTERS (listing page)
   ══════════════════════════════════════════════════════════ */
.filters-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: .85rem;
  margin-bottom: .85rem;
}
@media (max-width: 768px) {
  .filters-bar { grid-template-columns: 1fr }
}
.filter-group label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}
.filter-group input,
.filter-group select {
  width: 100%;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--dur);
  appearance: none;
}
.filter-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5L5 7l3-3.5' fill='none' stroke='%237b7b8e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2rem;
}
.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--ocean);
  box-shadow: 0 0 0 3px var(--ocean-glow);
}
.filters-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.filters-meta .count { font-size: .82rem; color: var(--muted) }
.btn-reset {
  font-size: .82rem;
  color: var(--ocean);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
}
.btn-reset:hover { text-decoration: underline }

/* ══════════════════════════════════════════════════════════
   FOOTER — Dark bottom bar
   ══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.5);
  padding: 3rem 0 1.25rem;
  margin-top: 4rem;
  font-size: .85rem;
}
.site-footer a { color: rgba(255,255,255,.65); transition: color var(--dur) }
.site-footer a:hover { color: #fff }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr }
}
.footer-brand { font-weight: 800; font-size: 1.1rem; color: #fff }
.footer-desc { margin-top: .4rem; line-height: 1.6 }
.site-footer h4 {
  color: rgba(255,255,255,.8);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .65rem;
}
.site-footer ul li { margin-top: .35rem }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
  text-align: center;
  font-size: .72rem;
  color: rgba(255,255,255,.3);
}

/* ══════════════════════════════════════════════════════════
   FICHE DETAIL
   ══════════════════════════════════════════════════════════ */
.fiche-hero-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: transform var(--dur);
}
.fiche-hero-img:hover { transform: scale(1.01) }

.fiche-section {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.fiche-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .45rem;
}
.fiche-section p {
  color: var(--ink-light);
  line-height: 1.75;
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  grid-column: 1 / -1;
}
.empty-state p { font-size: .9rem; margin-top: .5rem }

/* ══════════════════════════════════════════════════════════
   ANIMATIONS (subtle)
   ══════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0) }
.reveal-d1 { transition-delay: .08s }
.reveal-d2 { transition-delay: .16s }
.reveal-d3 { transition-delay: .24s }

/* ══════════════════════════════════════════════════════════
   BACK BUTTON (fiche detail)
   ══════════════════════════════════════════════════════════ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--ocean);
  margin-bottom: 1.5rem;
  transition: color var(--dur);
}
.back-link:hover { color: var(--ocean-dark) }
.back-link svg { width: 14px; height: 14px }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .section { padding: 2.5rem 0 }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem }
  .features-grid { grid-template-columns: 1fr }
}
