/* BioTrops — lime + teal on cream */
:root {
  --bg: #f3ecdb;
  --bg-warm: #ebe3cd;
  --surface: #fbf6e8;
  --surface-2: #e6dfc8;
  --ink: #133929;
  --ink-soft: #1a4d3a;
  --leaf: #7cc638;          /* primary lime */
  --leaf-deep: #5fa628;
  --leaf-pale: #d6ec9f;
  --teal: #1ba39a;          /* secondary teal */
  --teal-deep: #0e6e68;
  --teal-pale: #b5e3df;
  --earth: #5a614e;
  --warn: #d97706;
  --danger: #d6433a;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(19,57,41,0.10);
  --max: 1100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 700px 360px at 8% 6%, rgba(124,198,56,0.18), transparent 65%),
    radial-gradient(ellipse 600px 320px at 92% 14%, rgba(27,163,154,0.16), transparent 65%),
    radial-gradient(ellipse 800px 380px at 50% 100%, rgba(214,236,159,0.45), transparent 65%);
  background-attachment: fixed;
  line-height: 1.65;
}

a { color: var(--ink-soft); text-decoration: none; }
a:hover { color: var(--leaf-deep); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 .6em 0;
  font-weight: 800;
  line-height: 1.2;
}
h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.3rem; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  background: rgba(251,246,232,0.88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  color: var(--ink);
  border-bottom: 1px solid var(--surface-2);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(19,57,41,0.04), 0 8px 24px rgba(19,57,41,0.05);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: .8rem; padding-bottom: .8rem;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  color: var(--ink);
  font-size: 1.6rem; letter-spacing: -0.02em;
  font-weight: 900;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 10px; background: transparent; }
.brand-text { display: inline-flex; gap: 0; font-style: italic; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.brand-text .bio { color: var(--ink); }
.brand-text .trops { color: var(--teal); }
.brand:hover .trops { color: var(--teal-deep); }
.brand:hover .bio { color: var(--ink-soft); }

.nav { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.nav a {
  color: var(--ink);
  font-size: .95rem; font-weight: 600;
  padding: .35rem 0;
  position: relative;
}
.nav a:hover { color: var(--leaf-deep); text-decoration: none; }
.nav a:not(.pill):hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--leaf); border-radius: 2px;
}
.nav .pill {
  background: var(--leaf); padding: .5rem 1rem; border-radius: 999px;
  color: #fff; box-shadow: 0 4px 12px rgba(124,198,56,0.35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.nav .pill:hover { background: var(--leaf-deep); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(124,198,56,0.45); }
.nav .pill:hover::after { display: none; }

/* Hero */
.hero {
  background:
    radial-gradient(ellipse 700px 360px at 88% 18%, rgba(124,198,56,0.30), transparent 62%),
    radial-gradient(ellipse 600px 320px at 8% 88%, rgba(27,163,154,0.28), transparent 62%),
    linear-gradient(135deg, #f6efde 0%, #f3ecdb 55%, #ece2c5 100%);
  color: var(--ink);
  padding: 5rem 0 5.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 400'><g opacity='0.10'><path d='M40 280 C 80 100, 280 60, 380 150 C 460 240, 360 360, 200 350 C 80 340, 20 320, 40 280 Z' fill='%237cc638'/><path d='M380 60 C 520 100, 560 240, 480 320 C 400 360, 340 280, 360 200 C 370 130, 360 80, 380 60 Z' fill='%231ba39a'/></g></svg>");
  background-repeat: no-repeat;
  background-position: right -40px top -30px;
  background-size: 800px auto;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--ink); font-size: 3.7rem; margin-bottom: .6rem; letter-spacing: -0.035em; line-height: 1.05; }
.hero h1 .accent { color: var(--teal); }
.hero p { font-size: 1.18rem; max-width: 620px; color: var(--ink-soft); }
.hero .cta { margin-top: 1.6rem; display: flex; gap: .8rem; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--leaf); color: #fff;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  border: 2px solid var(--leaf); cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(124,198,56,0.35);
  letter-spacing: 0;
}
.btn:hover { background: var(--leaf-deep); border-color: var(--leaf-deep); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124,198,56,0.45); }
.btn.teal { background: var(--teal); border-color: var(--teal); box-shadow: 0 4px 14px rgba(27,163,154,0.35); }
.btn.teal:hover { background: var(--teal-deep); border-color: var(--teal-deep); box-shadow: 0 6px 18px rgba(27,163,154,0.45); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); box-shadow: none; }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); box-shadow: 0 4px 12px rgba(19,57,41,0.25); }
.btn.dark:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn.danger { background: var(--danger); border-color: var(--danger); box-shadow: 0 4px 12px rgba(214,67,58,0.3); }
.btn.danger:hover { background: #b8362e; border-color: #b8362e; }
.btn.small { padding: .4rem .9rem; font-size: .85rem; box-shadow: none; }

/* Cards */
.grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(13,58,42,0.14); }
.card .thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--leaf-pale) 0%, var(--teal-pale) 100%) center/cover no-repeat;
}
.card .body { padding: 1rem 1.2rem 1.3rem; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin-bottom: .35rem; }
.card .meta { color: var(--earth); font-size: .85rem; margin-bottom: .6rem; }
.card .excerpt { color: #284439; flex: 1; }
.card .badge {
  display: inline-block;
  background: var(--leaf-pale); color: #2c5e0f;
  font-size: .72rem; font-weight: 700;
  padding: .28rem .7rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .55rem;
}
.card .badge.video { background: var(--teal-pale); color: var(--teal-deep); }

/* Sections */
.section { padding: 3.5rem 0; }
.section.alt { background: linear-gradient(180deg, rgba(214,236,159,0.30), rgba(243,236,219,0)); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.8rem; flex-wrap: wrap; gap: .5rem; }
.section-head h2 { margin: 0; }
.section-head a { color: var(--leaf-deep); font-weight: 600; }

/* Article */
.article {
  background: var(--surface); border-radius: var(--radius);
  padding: 2.4rem 2.4rem; box-shadow: var(--shadow);
  border: 1px solid var(--surface-2);
}
.article h1 { margin-bottom: .3rem; }
.article .meta { color: var(--earth); margin-bottom: 1.5rem; }
.article .hero-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; margin-bottom: 1.5rem; }
.article .video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 10px; margin-bottom: 1.5rem; }
.article .video-wrap iframe, .article .video-wrap video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000;
}
.article .content { font-size: 1.05rem; }
.article .content img { max-width: 100%; height: auto; border-radius: 8px; }
.article .content p { margin: 0 0 1em; }
.article .content blockquote {
  border-left: 4px solid var(--teal); margin: 1em 0; padding: .6em 1em;
  background: rgba(27,163,154,0.08); border-radius: 0 10px 10px 0;
}
.article .content code {
  background: rgba(19,57,41,0.07); padding: .15em .4em; border-radius: 5px;
  font-family: "JetBrains Mono", Consolas, Menlo, monospace; font-size: .92em;
}

/* Forum */
.forum-list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--surface-2); overflow: hidden; box-shadow: var(--shadow); }
.thread-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--surface-2);
  transition: background .12s ease;
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: rgba(214,236,159,0.30); }
.thread-row .title { font-size: 1.1rem; font-weight: 700; }
.thread-row .title a { color: var(--ink); }
.thread-row .title a:hover { color: var(--leaf-deep); text-decoration: none; }
.thread-row .meta { color: var(--earth); font-size: .85rem; }
.thread-row .count {
  background: var(--leaf-pale); color: var(--ink-soft);
  border-radius: 999px; padding: .35rem .9rem;
  font-size: .85rem; font-weight: 600;
}
.thread-row.pinned { background: rgba(217,119,6,0.10); }
.thread-row .pin { color: var(--warn); margin-right: .35rem; }

.post-bubble {
  background: var(--surface); border: 1px solid var(--surface-2);
  border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.post-bubble .author { display: flex; justify-content: space-between; margin-bottom: .8rem; color: var(--earth); font-size: .88rem; }
.post-bubble .author strong { color: var(--ink); font-size: .95rem; font-weight: 700; }
.post-bubble.op { border-left: 4px solid var(--leaf); }

/* Forms */
.form { background: var(--surface); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--surface-2); box-shadow: var(--shadow); max-width: 520px; margin: 2rem auto; }
.form.wide { max-width: 880px; }
.form h2 { margin-bottom: 1.2rem; }
.field { margin-bottom: 1.1rem; display: flex; flex-direction: column; }
.field label { font-size: .88rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink-soft); }
.field input[type=text], .field input[type=password], .field input[type=email],
.field input[type=url], .field input[type=file], .field select, .field textarea {
  padding: .7rem .9rem; border-radius: 8px; border: 1.5px solid var(--surface-2);
  background: #fff; font-family: inherit; font-size: 1rem; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(124,198,56,0.22);
}
.field textarea { min-height: 200px; resize: vertical; line-height: 1.55; }
.field .hint { color: var(--earth); font-size: .85rem; margin-top: .3rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 200px; }

/* Flash messages */
.flash { padding: .9rem 1.1rem; border-radius: 10px; margin: 1rem auto; border: 1px solid; max-width: var(--max); }
.flash.success { background: rgba(124,198,56,0.15); border-color: var(--leaf); color: #2c5e0f; }
.flash.error { background: rgba(214,67,58,0.10); border-color: var(--danger); color: #a82e26; }
.flash.info { background: rgba(27,163,154,0.12); border-color: var(--teal); color: var(--teal-deep); }

/* Footer */
.site-footer {
  background: linear-gradient(180deg, #133929 0%, #061d14 100%);
  color: #d8e8d6;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
  position: relative;
}
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--leaf), var(--teal), var(--leaf));
}
.site-footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; }
.site-footer a { color: var(--leaf-pale); }
.site-footer a:hover { color: #fff; }
.site-footer .copy { text-align: center; opacity: .65; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.10); font-size: .88rem; }

@media (max-width: 720px) {
  .site-header .container { flex-wrap: wrap; }
  .nav { gap: .8rem; font-size: .9rem; }
  .hero { padding: 2.5rem 0; }
  .hero h1 { font-size: 2.2rem; }
  .article { padding: 1.4rem 1.2rem; }
  .site-footer .container { grid-template-columns: 1fr; }
  .thread-row { grid-template-columns: 1fr; }
}

/* Admin */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 100px); }
.admin-sidebar {
  background: var(--surface); color: var(--ink);
  padding: 1.5rem 0; border-right: 1px solid var(--surface-2);
}
.admin-sidebar h4 { color: var(--ink-soft); padding: 0 1.2rem; margin-bottom: .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.admin-sidebar a {
  display: block; padding: .7rem 1.2rem;
  color: var(--ink); border-left: 3px solid transparent;
  font-weight: 500; font-size: .95rem;
}
.admin-sidebar a:hover { background: rgba(214,236,159,0.40); color: var(--leaf-deep); text-decoration: none; }
.admin-sidebar a.active {
  background: rgba(124,198,56,0.18); border-left-color: var(--leaf);
  color: var(--leaf-deep); font-weight: 700;
}
.admin-main { padding: 2.2rem; background: var(--bg); }
.admin-main h1 { margin-bottom: 1.5rem; }

table.data { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data th, table.data td { padding: .9rem 1.1rem; text-align: left; border-bottom: 1px solid var(--surface-2); }
table.data th { background: var(--leaf-pale); color: var(--ink-soft); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: rgba(214,236,159,0.30); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.media-tile { background: var(--surface); border-radius: 10px; overflow: hidden; border: 1px solid var(--surface-2); transition: transform .12s ease; }
.media-tile:hover { transform: translateY(-2px); }
.media-tile .preview { height: 140px; background: linear-gradient(135deg, var(--leaf-pale), var(--teal-pale)) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-weight: 700; }
.media-tile .info { padding: .55rem .75rem; font-size: .8rem; word-break: break-all; }

@media (max-width: 720px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { padding: 1rem; }
  .admin-sidebar a { display: inline-block; padding: .4rem .8rem; }
}
