/* ============================================================
   BUGGSAQUATICS — shared stylesheet
   Nano tanks, nano fish, nano shrimp, nano plants.
   Palette is drawn from the tank itself: water, plant, substrate.
   Edit tokens below once; every page updates.
   ============================================================ */

/* ---- 1. Design tokens ------------------------------------- */
:root {
  /* Surfaces */
  --paper:   #FAFDFF;   /* page background */
  --panel:   #F0F8FC;   /* tinted section background */
  --surface: #FFFFFF;   /* card background */
  --line:    #DCEEF5;   /* hairline borders */
  --line-2:  #C7E3EE;   /* slightly stronger border */

  /* Text */
  --ink:   #122832;   /* primary text */
  --mist:  #5A7480;   /* muted text */

  /* Accents — water / plant / substrate */
  --water:      #62C3EC;  /* baby blue — primary accent */
  --water-deep: #1D8FC4;  /* deeper blue — buttons, links */
  --moss:       #5FA987;  /* plant accent */
  --sand:       #E3AE6B;  /* substrate accent */
  --coral-soft: #F2897B;  /* rare alert / shrimp tag accent */

  /* Type */
  --display: "Sora", system-ui, sans-serif;
  --body:    "Inter", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Layout */
  --maxw: 1160px;
  --pad: clamp(20px, 5vw, 56px);
  --radius: 18px;
  --radius-sm: 12px;
}

/* ---- 2. Reset + base -------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0;
}
p { margin: 0; }
::selection { background: var(--water); color: #06222D; }

/* ---- 3. Layout helpers ------------------------------------ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.section { padding-block: clamp(56px, 8vw, 110px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--water-deep);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--water);
}
.lead { color: var(--mist); font-size: clamp(17px, 2vw, 20px); max-width: 58ch; }
.section-head { max-width: 680px; margin-bottom: clamp(32px, 5vw, 52px); }
.section-head h2 { font-size: clamp(26px, 4vw, 42px); margin: 14px 0 0; }
.section-head .lead { margin-top: 14px; }

/* ---- 4. Buttons & badges ------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  cursor: pointer; background: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--water-deep); color: #fff; }
.btn-primary:hover { background: #167AAD; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--water-deep); color: var(--water-deep); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--ink);
}
.tag.fish { color: var(--water-deep); border-color: #BFE6F6; background: #EAF8FE; }
.tag.shrimp { color: #C45A48; border-color: #F6D2C9; background: #FDF1ED; }
.tag.plant { color: #3D7A5C; border-color: #CDE7DA; background: #EEF8F2; }
.tag.equipment { color: #8A6420; border-color: #EFD9B0; background: #FBF3E2; }

/* spec chip — the signature instrument-readout element */
.spec-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-family: var(--mono); font-size: 12.5px;
  padding: 6px 11px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line-2);
  color: var(--ink);
}
.spec-chip b { font-weight: 600; color: var(--water-deep); }

/* ---- 5. Navigation ---------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,253,255,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand .mark { width: 26px; height: 26px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--mist); font-size: 15px; font-weight: 500; transition: color .15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-cta { display: inline-flex; align-items: center; gap: 14px; }

.nav-account { position: relative; }
.nav-account-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  cursor: pointer; background: var(--surface);
}
.nav-account-btn .avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--water); color: #06222D;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
}
.nav-account-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  min-width: 190px; padding: 8px; box-shadow: 0 14px 32px rgba(18,40,50,.12);
}
.nav-account-menu.open { display: block; }
.nav-account-menu a, .nav-account-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px;
  font-size: 14px; color: var(--ink); border: 0; background: none; cursor: pointer;
}
.nav-account-menu a:hover, .nav-account-menu button:hover { background: var(--panel); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; color: var(--ink); }
.mobile-menu { display: none; }

/* ---- 6. Hero ------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero-inner {
  position: relative; z-index: 2;
  padding-block: clamp(56px, 10vw, 110px) clamp(40px, 6vw, 70px);
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center;
}
.hero h1 { font-size: clamp(36px, 5.6vw, 62px); max-width: 14ch; margin: 16px 0 0; }
.hero h1 .glow { color: var(--water-deep); }
.hero .lead { margin-top: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero .spec-strip { margin-top: 28px; }

.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(90% 70% at 85% -10%, rgba(98,195,236,.22), transparent 55%),
              radial-gradient(70% 60% at 0% 100%, rgba(95,169,135,.14), transparent 60%);
}

/* tank illustration (signature visual) */
.tank-illo { position: relative; z-index: 2; aspect-ratio: 4/3; width: 100%; }
.tank-illo svg { width: 100%; height: 100%; }
.tank-illo .waterline { animation: shimmer 5s ease-in-out infinite; transform-origin: center; }
.tank-illo .bubble { animation: rise 4.5s linear infinite; opacity: 0; }
.tank-illo .bubble:nth-child(2) { animation-delay: 1.1s; }
.tank-illo .bubble:nth-child(3) { animation-delay: 2.3s; }
.tank-illo .bubble:nth-child(4) { animation-delay: 3.4s; }
@keyframes rise { 0% { opacity: 0; transform: translateY(0) scale(.8); } 10% { opacity: .8; } 90% { opacity: .5; } 100% { opacity: 0; transform: translateY(-92px) scale(1.1); } }
@keyframes shimmer { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.04); } }

/* ---- 7. Grids & cards ---------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 16px 32px rgba(18,40,50,.06); }
.card h3 { font-size: 19px; margin: 0 0 8px; }
.card p { color: var(--mist); font-size: 15px; }
.card .icon { width: 30px; height: 30px; color: var(--water-deep); margin-bottom: 14px; }

/* product / gallery tile */
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(18,40,50,.07); }
.tile-media {
  aspect-ratio: 4/3; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.tile-media svg { width: 46%; opacity: .9; }
.tile-media::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.55) 1px, transparent 1.4px);
  background-size: 18px 18px; mix-blend-mode: overlay; opacity: .5;
}
.tile-media.hue-water { background: linear-gradient(155deg, #BFEAF9, #6EC6EE); }
.tile-media.hue-shrimp { background: linear-gradient(155deg, #FBD7CD, #F2A18F); }
.tile-media.hue-plant { background: linear-gradient(155deg, #CDEBDB, #7DBE9C); }
.tile-media.hue-sand { background: linear-gradient(155deg, #F6E2C2, #E3AE6B); }
.tile-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tile-body h3 { font-size: 17px; }
.tile-body .price { font-family: var(--mono); font-weight: 600; color: var(--water-deep); font-size: 14.5px; }
.tile-body p { color: var(--mist); font-size: 14.5px; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; gap: 10px; }

/* filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.filter-chip {
  font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--mist); cursor: pointer; background: var(--surface);
}
.filter-chip.active, .filter-chip:hover { border-color: var(--water-deep); color: var(--water-deep); }

/* ---- 8. Forum -------------------------------------------------------- */
.cat-list { display: grid; gap: 14px; }
.cat-row {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; transition: border-color .15s ease, transform .15s ease;
}
.cat-row:hover { border-color: var(--line-2); transform: translateX(2px); }
.cat-row .icon { width: 34px; height: 34px; flex: none; color: var(--water-deep); }
.cat-row .meta { flex: 1; }
.cat-row h3 { font-size: 17px; }
.cat-row p { color: var(--mist); font-size: 14px; margin-top: 4px; }
.cat-row .count { font-family: var(--mono); font-size: 13px; color: var(--mist); white-space: nowrap; }

.thread-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.thread-row { background: var(--surface); padding: 16px 20px; display: flex; align-items: center; gap: 16px; }
.thread-row .title { flex: 1; font-weight: 600; font-size: 15.5px; }
.thread-row .who { color: var(--mist); font-size: 13px; font-family: var(--mono); white-space: nowrap; }
.thread-row:hover .title { color: var(--water-deep); }

.post {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; background: var(--surface);
  display: flex; gap: 16px;
}
.post .author { width: 38px; height: 38px; border-radius: 50%; background: var(--water); color: #06222D; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 700; flex: none; }
.post .body { flex: 1; }
.post .meta { font-size: 12.5px; color: var(--mist); font-family: var(--mono); margin-bottom: 6px; }
.post .text { font-size: 15px; line-height: 1.7; white-space: pre-wrap; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--mist); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty-state b { color: var(--ink); }

/* ---- 9. Forms -------------------------------------------------------- */
.form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--mist); }
.field input, .field textarea, .field select {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 12px 14px; color: var(--ink); font-family: var(--body); font-size: 15px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--water-deep); box-shadow: 0 0 0 3px rgba(29,143,196,.16);
}
.form-note { color: var(--mist); font-size: 13px; }
.form-error { color: #C0392B; font-size: 13.5px; background: #FBEAE7; border: 1px solid #F2C6BE; padding: 10px 12px; border-radius: 8px; display: none; }
.form-error.show { display: block; }
.form-success { color: #2E7D52; font-size: 13.5px; background: #EAF6EF; border: 1px solid #C7E6D2; padding: 10px 12px; border-radius: 8px; display: none; }
.form-success.show { display: block; }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-tab { padding: 10px 4px; margin-right: 18px; font-weight: 600; color: var(--mist); cursor: pointer; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--ink); border-color: var(--water-deep); }

/* profile */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 36px; }
.profile-head .avatar-lg {
  width: 64px; height: 64px; border-radius: 50%; background: var(--water); color: #06222D;
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 700; font-size: 22px; flex: none;
}

/* ---- 10. CTA band + Footer ------------------------------------------ */
.cta-band {
  background: linear-gradient(135deg, rgba(98,195,236,.16), rgba(95,169,135,.10));
  border: 1px solid var(--line); border-radius: 26px;
  padding: clamp(36px, 6vw, 64px); text-align: center;
}
.cta-band h2 { font-size: clamp(26px, 4vw, 42px); }
.cta-band p { color: var(--mist); margin: 14px auto 0; max-width: 50ch; }
.cta-band .btn { margin-top: 26px; }

.footer { border-top: 1px solid var(--line); padding-block: 52px; margin-top: 20px; background: var(--panel); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer h4 { font-family: var(--display); font-size: 19px; margin: 0 0 12px; }
.footer p { color: var(--mist); font-size: 14.5px; max-width: 38ch; }
.footer a { color: var(--mist); font-size: 14.5px; display: block; padding: 4px 0; }
.footer a:hover { color: var(--ink); }
.footer .col-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-family: var(--mono); color: var(--water-deep); margin-bottom: 8px; }
.footer-bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line-2); color: var(--mist); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-family: var(--mono); }

/* ---- 11. Scroll reveal ----------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- 12. Responsive --------------------------------------------------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .tank-illo { max-width: 420px; margin: 0 auto; }
}
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2, .footer-grid { grid-template-columns: 1fr; }
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-menu.open {
    display: flex; flex-direction: column; gap: 4px;
    padding: 8px var(--pad) 20px; border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  .mobile-menu a, .mobile-menu button { padding: 12px 0; color: var(--ink); font-size: 17px; border-bottom: 1px solid var(--line); text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; }
  .mobile-menu .btn { margin-top: 14px; justify-content: center; }
  .profile-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* ---- 13. Accessibility ------------------------------------------------ */
a:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--water-deep); outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
