/* Molt & Moss
   ---------------------------------------------------------------------------
   Botanical blackwater. Warm paper in light mode, tannin-stained brown-black in
   dark, moss green throughout. Those are the actual colours of a planted shrimp
   tank with almond leaves in it, which is the point.

   Deliberately avoided: left-border callout boxes, uppercase letterspaced micro
   labels, and flat neutral grey. Those read as template, not as a person who
   keeps tanks.

   Still no red or blue anywhere in the UI. Both are product colours, and a red
   button next to a Sunkist photo makes the shrimp look washed out. */

:root {
  --bg: #faf6ee;
  --surface: #fffdf8;
  --sunken: #f2ece0;
  --fg: #22201b;
  --muted: #6b6558;
  --rule: #e6dfd0;
  --rule-strong: #d6cdb9;

  --moss: #4f6b45;
  --moss-hover: #405838;
  --moss-ink: #fffdf8;
  --moss-soft: #e9efe3;
  --moss-line: #c3d4b8;

  --tannin: #8a6a3b;
  --tannin-soft: #f4ece0;

  --warn: #8a6a1f;
  --danger: #9c4a2f;

  --radius: 10px;
  --radius-sm: 8px;
  --max: 64rem;

  --serif: ui-serif, 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120e;
    --surface: #1c1914;
    --sunken: #100e0b;
    --fg: #f0ebe0;
    --muted: #9a9284;
    --rule: #2e2a23;
    --rule-strong: #423c31;

    --moss: #93b280;
    --moss-hover: #a8c495;
    --moss-ink: #14120e;
    --moss-soft: #1e2719;
    --moss-line: #3a4a32;

    --tannin: #c99b5c;
    --tannin-soft: #241d13;

    --warn: #d1ab5e;
    --danger: #d98b73;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------------------------------------------------------------- chrome --- */

.site-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1.5rem;
}

.brand {
  text-decoration: none;
  display: grid;
  line-height: 1.2;
}
.brand strong {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.brand span {
  font-size: 0.8rem;
  color: var(--muted);
}

.site-head nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.site-head nav a {
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.site-head nav a:hover {
  color: var(--fg);
  border-bottom-color: var(--moss-line);
}
.site-head nav a[aria-current='page'] {
  color: var(--fg);
  border-bottom-color: var(--moss);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.site-foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--muted);
}
.site-foot p { margin: 0 0 0.4em; }

.prose { max-width: 42rem; }
.prose ul,
.prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5em; }
.prose h2 { margin-top: 2em; }

/* --------------------------------------------------------------- notices --- */
/* Soft tinted panel, no coloured left rule. */

.notice {
  background: var(--moss-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 0 0 2rem;
}
.notice.warn { background: var(--tannin-soft); }
.notice p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ grid --- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1.25rem;
  margin: 0 0 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
  border-color: var(--moss-line);
  transform: translateY(-2px);
}
.card h3 { margin: 0.1rem 0 0; }
.card .price {
  font-family: var(--serif);
  font-size: 1.15rem;
}
.card .params {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: auto;
  padding-top: 0.8rem;
  line-height: 1.5;
}

/* Small dot plus label rather than a bordered uppercase chip. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge.ok { color: var(--moss); }
.badge.warn { color: var(--warn); }
.badge.off { color: var(--muted); opacity: 0.75; }

/* ---------------------------------------------------------------- tables --- */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
th,
td {
  text-align: left;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.88rem;
  background: var(--sunken);
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
tbody tr:hover td { background: var(--moss-soft); }

/* ----------------------------------------------------------------- forms --- */

form.stack {
  display: grid;
  gap: 1.2rem;
  max-width: 34rem;
}
.row { display: grid; gap: 0.4rem; }
.row > span { font-size: 0.9rem; font-weight: 600; }
.row small { color: var(--muted); font-weight: 400; }

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.85rem;
}

input,
select,
textarea {
  font: inherit;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  width: 100%;
}
textarea { min-height: 6rem; resize: vertical; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}

button,
.button {
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  background: var(--moss);
  color: var(--moss-ink);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  justify-self: start;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease;
}
button:hover,
.button:hover { background: var(--moss-hover); }

button.secondary,
.button.secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--rule-strong);
}
button.secondary:hover,
.button.secondary:hover { background: var(--sunken); }

button:disabled { opacity: 0.55; cursor: default; }

fieldset {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  background: var(--surface);
}
legend { font-size: 0.9rem; font-weight: 600; padding: 0 0.4rem; }

.checks { display: grid; gap: 0.6rem; }
.check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  cursor: pointer;
}
.check input {
  width: auto;
  margin-top: 0.4rem;
  accent-color: var(--moss);
  flex: none;
}

[hidden] { display: none !important; }

/* ----------------------------------------------------------------- admin --- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin: 0 0 2.5rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat span {
  font-size: 0.85rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin: 2.5rem 0 1rem;
}
.section-head h2 { margin: 0; }

body.admin .brand strong { font-size: 1.15rem; }

/* ------------------------------------------------------------------- art --- */
/* Hand-drawn illustrations, never photographs of stock we do not have.
   These get replaced by real macro shots as the colonies colour up. */

.card-art {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sunken);
  border-radius: var(--radius-sm);
  margin: -0.35rem 0 0.5rem;
  padding: 0.6rem 0.5rem;
  min-height: 6.5rem;
  overflow: hidden;
}
.card-art.plant { color: var(--moss); }
.card-art svg { max-width: 100%; height: auto; display: block; }

.card:hover .shrimp-art {
  transform: translateX(-3px) rotate(-1.5deg);
}
.shrimp-art { transition: transform 0.25s ease; }

.hero-art {
  display: flex;
  justify-content: center;
  background: var(--sunken);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  margin: 0 0 1.75rem;
}
.hero-art svg { max-width: 100%; height: auto; }

/* Home page: a berried female, which is the picture that means the most to a keeper. */
.hero-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  background: var(--moss-soft);
  border-radius: var(--radius);
  padding: 2rem 1.5rem 1.6rem;
  margin: 0 0 2.5rem;
}
.hero-figure svg { max-width: 100%; height: auto; }
.hero-figure figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  max-width: 30rem;
  margin: 0;
}

/* Morph swatches: the colours you can actually buy, as a friendly row. */
.morph-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.morph-row li {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.9rem 0.8rem 1rem;
  text-align: center;
}
.morph-row svg { max-width: 100%; height: auto; }
.morph-row strong { display: block; font-size: 0.95rem; margin-top: 0.3rem; }
.morph-row span { display: block; font-size: 0.8rem; color: var(--muted); }

.moss-rule {
  display: flex;
  justify-content: center;
  color: var(--moss);
  margin: 2.5rem 0 0;
}

/* ----------------------------------------------------------- photography --- */
/* Stock photos stand in until there are shots of our own tanks. The caption
   always says whose tank it is, so nothing here reads as a claim about our stock. */

.photo-figure {
  margin: 0 0 2rem;
  display: grid;
  gap: 0.7rem;
}
.photo-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  background: var(--sunken);
}
.photo-figure figcaption {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  max-width: 34rem;
}

/* Portrait shots inside a care guide should not dominate the column. */
.prose .photo-figure img {
  max-width: 26rem;
}
