/* ════════════════════════════════════════════════════════════
   HABITATS DIRECTORY · index
   Theme: Ecotone (light)  ·  Brygada 1918 + Outfit + DM Mono
   Shares the habitat content-tier palette with the habitat profiles.
   Loads last, after ../css/base.css and ../css/plant-profile.css.
   ════════════════════════════════════════════════════════════ */

:root {
  --bg:       #f4f0e6;
  --bg-warm:  #ebe3d2;
  --bg-card:  #faf6ec;
  --bg-tint:  #e8ecdd;

  --border:        rgba(48, 52, 38, 0.12);
  --border-accent: rgba(74, 107, 74, 0.24);

  --green:      #4a6b4a;
  --green-soft: #84a07e;
  --sun:        #cda23f;
  --sun-soft:   #e2c67e;

  --stone:       #8f897b;
  --stone-light: #c4bca8;

  --text:       #34362d;
  --text-dim:   #565748;
  --text-faint: #888471;

  --ink:     #28302a;
  --heading: var(--ink);
  --h2:      #5c7d58;

  --accent: #4a6b4a;

  --display: 'Brygada 1918', Georgia, 'Times New Roman', serif;
  --body:    'Outfit', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { background: #e5dcc8; min-height: 100%; }

body {
  max-width: 760px;
  margin: 1.5rem auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.7;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(40, 48, 42, 0.06), 0 18px 50px rgba(40, 48, 42, 0.10);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── PAGE NAVIGATION ───────────────────────── */
.page-nav {
  position: fixed;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  width: min(720px, calc(100% - 1.5rem));
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
}
.page-nav a {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: rgba(250, 246, 236, 0.8);
  border: 1px solid rgba(74, 107, 74, 0.2);
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(36, 42, 32, 0.08);
}
.page-nav a:hover { color: var(--accent); border-color: var(--accent); background: rgba(250, 246, 236, 0.94); }
@media (max-width: 520px) {
  .page-nav { top: 0.65rem; width: calc(100% - 1rem); }
  .page-nav a { font-size: 0.5rem; padding: 0.36rem 0.58rem; }
}

/* ── HERO (text only) ───────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 1.6rem 2.6rem;
  text-align: center;
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(226,198,126,0.20) 0%, rgba(226,198,126,0) 56%),
    radial-gradient(120% 90% at 18% 6%, var(--bg-tint) 0%, rgba(232,236,221,0) 58%),
    linear-gradient(168deg, #f6f3ea 0%, var(--bg) 62%, var(--bg-warm) 100%);
  border-bottom: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
}
.badge {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--bg-tint);
  border: 1px solid var(--border-accent);
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.8rem, 8vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--heading);
  margin: 1.1rem 0 0.4rem;
}
.hero h1 em {
  display: block;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  color: var(--green);
  margin-top: 0.5rem;
}
.hero-tagline {
  max-width: 34rem;
  font-size: 1.02rem;
  color: var(--text-dim);
  margin: 1rem auto 0;
}

/* ── SECTIONS ───────────────────────── */
.section {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.4rem 1.5rem 0.5rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.section.visible { opacity: 1; transform: none; }
.eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 0.5rem;
}
.section h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.14;
  color: var(--h2);
  margin: 0 0 0.4rem;
}
.section > p { margin: 0 0 1rem; color: var(--text-dim); font-size: 0.96rem; }

/* ── HABITAT CARD GRID ───────────────────────── */
.hab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.1rem;
}
.hab-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.35rem 1.3rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.hab-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--card-from, var(--green)), var(--card-to, var(--sun)));
}
a.hab-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(40, 48, 42, 0.1);
}
.hab-card--planned { opacity: 0.6; }
.hab-type {
  font-family: 'DM Mono', monospace;
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0.2rem 0 0;
}
.hab-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.34rem;
  line-height: 1.15;
  color: var(--heading);
  margin: 0;
}
.hab-summary { font-size: 0.88rem; color: var(--text-dim); margin: 0.2rem 0 0.2rem; }
.hab-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 0.6rem; }
.hab-chip {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.24rem 0.52rem;
}
.hab-status {
  position: absolute;
  top: 0.9rem;
  right: 0.95rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hab-status--live    { color: var(--green); }
.hab-status--planned { color: var(--text-faint); }

/* ── FOOTER ───────────────────────── */
footer {
  margin: 3.4rem 0 0;
  padding: 2.6rem 1.5rem 3.4rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  text-align: center;
}
footer p { font-size: 0.78rem; line-height: 1.7; color: var(--text-faint); margin: 0; }
footer strong { color: var(--green); font-weight: 500; }

/* ── RESPONSIVE ───────────────────────── */
@media (max-width: 640px) {
  .hab-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  html { background: var(--bg); }
  body { margin: 0; border-left: none; border-right: none; border-radius: 0; box-shadow: none; }
  .hero { border-radius: 0; padding-top: 4.4rem; }
  footer { border-radius: 0; }
}
