/* ===== honpo.net — Botanical Herbarium Dashboard ===== */

:root {
  --walnut-ink: #3a2a18;
  --saddle-tan: #6a4f33;
  --tobacco-gold: #a07a4a;
  --foxed-cream: #d9c39a;
  --linen-press: #efe2c4;
  --vellum: #f7eed8;
  --tooled-leather: #1f1410;
  --phosphor-mint: #5cf2a3;
  --oxblood: #7a2820;

  --frame: 28px;
  --masthead-h: 54px;
  --gutter: 24px;

  --slab-display: "Roboto Slab", serif;
  --slab-catalog: "Zilla Slab", serif;
  --caption: "Cormorant Garamond", serif;
  --crt: "VT323", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: var(--caption);
  color: var(--walnut-ink);
  background: var(--linen-press);
  display: grid;
  grid-template-rows: var(--frame) var(--masthead-h) 1fr var(--frame);
  grid-template-columns: var(--frame) 1fr var(--frame);
  position: relative;
}

/* ---------- Leather frame ---------- */
.leather-edge, .leather-corner {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,220,170,.10), transparent 55%),
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(0,0,0,.18) 3px 4px),
    var(--tooled-leather);
}
.leather-top    { top: 0; left: 0; right: 0; height: var(--frame); }
.leather-bottom { bottom: 0; left: 0; right: 0; height: var(--frame); }
.leather-left   { top: 0; bottom: 0; left: 0; width: var(--frame); }
.leather-right  { top: 0; bottom: 0; right: 0; width: var(--frame); }
.leather-corner { width: calc(var(--frame) + 16px); height: calc(var(--frame) + 16px); z-index: 101; }
.lc-tl { top: 0; left: 0; }
.lc-tr { top: 0; right: 0; }
.lc-br { bottom: 0; right: 0; }
.lc-bl { bottom: 0; left: 0; }
/* saddle-stitch dashed inset on corners */
.leather-corner::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--tobacco-gold);
  opacity: .55;
}
.lc-tl::after { border-right: none; border-bottom: none; }
.lc-tr::after { border-left: none; border-bottom: none; }
.lc-br::after { border-left: none; border-top: none; }
.lc-bl::after { border-right: none; border-top: none; }

/* ---------- Masthead ---------- */
.masthead {
  grid-row: 2;
  grid-column: 2;
  position: relative;
  background:
    linear-gradient(180deg, var(--vellum), var(--linen-press));
  border-bottom: 2px solid var(--tobacco-gold);
  display: flex;
  align-items: stretch;
  z-index: 5;
}
.masthead-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}
.wordmark {
  font-family: var(--slab-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--walnut-ink);
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.96rem;
}
.wm-kanji { font-size: 1.25rem; color: var(--saddle-tan); }
.wm-dot { color: var(--tobacco-gold); font-size: 0.8rem; }
.wm-sub {
  font-family: var(--slab-catalog);
  font-weight: 500;
  letter-spacing: 0.14em;
  font-size: 0.66rem;
  color: var(--saddle-tan);
}
.chip-strip { display: flex; gap: 6px; }
.chip {
  font-family: var(--slab-catalog);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.62rem;
  color: var(--saddle-tan);
  background: var(--foxed-cream);
  border: 1px solid var(--tobacco-gold);
  padding: 5px 11px;
  cursor: pointer;
  transition: transform 320ms cubic-bezier(.2,.8,.25,1), box-shadow 320ms, background 320ms, color 320ms;
}
.chip:hover {
  transform: scale(1.024);
  box-shadow: 0 6px 22px rgba(58,42,24,.22);
}
.chip.is-active {
  background: var(--walnut-ink);
  color: var(--vellum);
}
.garland { position: absolute; left: 0; right: 0; width: 100%; height: 16px; pointer-events: none; }
.garland-masthead { bottom: -1px; }

/* ---------- Dashboard ---------- */
.dashboard {
  grid-row: 3;
  grid-column: 2;
  display: grid;
  grid-template-columns: 24% 52% 24%;
  gap: var(--gutter);
  padding: var(--gutter);
  background:
    repeating-linear-gradient(0deg, rgba(160,122,74,.05) 0 1px, transparent 1px 3px),
    var(--linen-press);
  min-height: 0;
}
.col { min-height: 0; display: flex; flex-direction: column; }

/* ---------- Left: Specimen Index ---------- */
.col-index {
  background: var(--foxed-cream);
  border: 1px solid var(--tobacco-gold);
  box-shadow: inset 0 0 18px rgba(31,20,16,.18);
  padding: 12px;
  gap: 10px;
}
.monogram-drawer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border: 1px solid var(--saddle-tan);
  background: linear-gradient(180deg, var(--vellum), var(--foxed-cream));
}
.wax-seal {
  width: 64px; height: 64px; flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.18), transparent 50%),
    radial-gradient(circle at 65% 75%, rgba(0,0,0,.35), transparent 55%),
    var(--oxblood);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(31,20,16,.4), inset 0 0 8px rgba(0,0,0,.35);
}
.wax-kanji {
  font-family: var(--slab-display);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--walnut-ink);
  text-shadow: 0 1px 0 rgba(255,200,160,.25), 0 -1px 1px rgba(0,0,0,.5);
}
.monogram-label { display: flex; flex-direction: column; gap: 2px; }
.ml-line1 {
  font-family: var(--slab-catalog);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--walnut-ink);
}
.ml-line2 {
  font-family: var(--caption);
  font-style: italic;
  font-size: 0.84rem;
  color: var(--saddle-tan);
}
.drawer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}
.drawer-scroll::-webkit-scrollbar { width: 8px; }
.drawer-scroll::-webkit-scrollbar-track { background: var(--foxed-cream); }
.drawer-scroll::-webkit-scrollbar-thumb { background: var(--tobacco-gold); border-radius: 4px; }

.drawer {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 8px;
  background: linear-gradient(180deg, var(--vellum), var(--foxed-cream));
  border-bottom: 1px solid var(--saddle-tan);
  cursor: pointer;
  transition: transform 320ms cubic-bezier(.2,.8,.25,1), box-shadow 320ms;
  position: relative;
}
.drawer:hover {
  transform: translateX(6px) scale(1.024);
  box-shadow: 0 6px 22px rgba(58,42,24,.22);
}
.drawer.is-open {
  transform: translateX(24px);
  box-shadow: 0 8px 26px rgba(31,20,16,.32);
  background: var(--vellum);
}
.drawer.is-open:hover { transform: translateX(24px) scale(1.024); }
.drawer-glyph { width: 14px; height: 14px; flex: none; color: var(--saddle-tan); }
.drawer-code {
  font-family: var(--slab-catalog);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.62rem;
  color: var(--walnut-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-code .dc-binom {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--saddle-tan);
  font-family: var(--caption);
  font-size: 0.78rem;
}
.drawer-pull {
  margin-left: auto;
  width: 8px; height: 4px; flex: none;
  background: var(--tobacco-gold);
  border-top: 1px solid #c79a5e;
  box-shadow: 0 0 0 rgba(255,220,170,0);
  transition: box-shadow 320ms;
}
.drawer:hover .drawer-pull { box-shadow: 0 0 6px rgba(255,220,170,.7); }

/* ---------- Center: Mounting Sheet ---------- */
.col-mount {
  align-items: stretch;
  justify-content: stretch;
}
.plate {
  flex: 1;
  position: relative;
  background: var(--vellum);
  border: 1px solid var(--tobacco-gold);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(31,20,16,.2), inset 0 0 30px rgba(122,82,42,.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 320ms cubic-bezier(.2,.8,.25,1), box-shadow 320ms;
  filter: url(#paperGrain);
}
.plate:hover {
  transform: scale(1.024);
  box-shadow: 0 6px 22px rgba(58,42,24,.22), inset 0 0 30px rgba(122,82,42,.10);
}
.plate-noise {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .5; pointer-events: none; mix-blend-mode: multiply;
}
.foxing {
  position: absolute; width: 130px; height: 130px; pointer-events: none;
  background: radial-gradient(circle, rgba(122,82,42,.18), transparent 70%);
}
.fx-tl { top: -40px; left: -40px; }
.fx-tr { top: -40px; right: -40px; }
.fx-br { bottom: -40px; right: -40px; }
.fx-bl { bottom: -40px; left: -40px; }

.plate-header {
  padding: 22px 28px 6px;
  position: relative; z-index: 2;
}
.plate-binomial {
  font-family: var(--slab-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  letter-spacing: 0.005em;
  line-height: 0.96;
  color: var(--walnut-ink);
}
.plate-common {
  font-family: var(--caption);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--saddle-tan);
  margin-top: 4px;
}
.plate-illo {
  flex: 1;
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 6px 28px;
  min-height: 0;
}
.plate-illo svg { width: 100%; height: 100%; max-height: 100%; }
.botanical-stroke { fill: none; stroke: var(--walnut-ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.botanical-hatch { fill: none; stroke: var(--walnut-ink); stroke-width: 0.5; opacity: .55; }

.ink-mask {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, var(--foxed-cream), var(--saddle-tan) 60%, var(--walnut-ink));
  mix-blend-mode: multiply;
  border-radius: 50%;
  transform: scale(0);
  pointer-events: none;
  z-index: 3;
}
.ink-mask.bleeding {
  animation: inkBleed 1.6s ease-in-out forwards;
}
@keyframes inkBleed {
  0%   { transform: scale(0);   opacity: .85; }
  55%  { transform: scale(0.6); opacity: .5;  }
  100% { transform: scale(1.6); opacity: 0;   }
}

.index-tag {
  position: absolute;
  right: 26px; bottom: 64px;
  background: var(--foxed-cream);
  color: var(--walnut-ink);
  font-family: var(--caption);
  font-style: italic;
  font-size: 0.84rem;
  padding: 6px 12px 10px;
  border: 1px solid var(--saddle-tan);
  box-shadow: 2px 4px 8px rgba(31,20,16,.22);
  transform: rotate(-2deg);
  transition: transform 1.6s cubic-bezier(.2,.8,.25,1);
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
}
.plate:hover .index-tag { transform: rotate(3deg); }

.caption-rail {
  position: relative; z-index: 2;
  margin: 0 24px 18px;
  padding: 10px 14px;
  border-top: 1px solid var(--tobacco-gold);
  background: rgba(247,238,216,.6);
  font-family: var(--caption);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--walnut-ink);
  min-height: 3.4em;
  display: flex; align-items: flex-start; gap: 8px;
}
.cap-pen { font-style: normal; color: var(--saddle-tan); font-size: 0.95rem; line-height: 1.9; }
.caption-text { white-space: pre-wrap; }
.cap-cursor {
  color: var(--saddle-tan);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

/* ---------- Right: Telemetry ---------- */
.col-tele { }
.tele-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: var(--gutter);
  min-height: 0;
}
.tile {
  background:
    radial-gradient(circle at 50% 0%, rgba(92,242,163,.06), transparent 60%),
    var(--tooled-leather);
  border: 1px solid var(--tobacco-gold);
  border-radius: 4px;
  box-shadow: 0 3px 12px rgba(31,20,16,.4), inset 0 0 16px rgba(0,0,0,.45);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 320ms cubic-bezier(.2,.8,.25,1), box-shadow 320ms;
}
.tile::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  pointer-events: none; opacity: .5;
}
.tile:hover {
  transform: scale(1.024);
  box-shadow: 0 6px 22px rgba(31,20,16,.5), inset 0 0 16px rgba(0,0,0,.45);
}
.tile-head {
  font-family: var(--slab-catalog);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.56rem;
  color: var(--phosphor-mint);
  opacity: .8;
}
.tile-foot {
  font-family: var(--crt);
  font-size: 0.85rem;
  color: var(--phosphor-mint);
  opacity: .75;
  text-shadow: 0 0 6px rgba(92,242,163,.6), 0 0 1px var(--phosphor-mint);
}
.tile-big {
  font-family: var(--crt);
  font-size: 2.1rem;
  color: var(--phosphor-mint);
  line-height: 1;
  text-shadow: 0 0 6px rgba(92,242,163,.6), 0 0 1px var(--phosphor-mint);
}
.tile-mid {
  font-family: var(--crt);
  font-size: 1.35rem;
  color: var(--phosphor-mint);
  text-shadow: 0 0 6px rgba(92,242,163,.6), 0 0 1px var(--phosphor-mint);
}
.tile-svg {
  width: 100%;
  flex: 1;
  min-height: 0;
  filter: drop-shadow(0 0 3px var(--phosphor-mint));
}
.sine-trace { stroke: var(--phosphor-mint); stroke-width: 1.6; }
.ph-bars { flex: none; height: 30px; }
.ph-bars rect { fill: var(--phosphor-mint); }
.aspect-svg { flex: 1; }
.aspect-petal { fill: var(--phosphor-mint); }
.aspect-ring { fill: none; stroke: var(--phosphor-mint); stroke-width: 0.6; opacity: .35; }
.ph-readout {
  font-family: var(--crt);
  font-size: 1.6rem;
  color: var(--phosphor-mint);
  text-shadow: 0 0 6px rgba(92,242,163,.6), 0 0 1px var(--phosphor-mint);
}
.tile-count, .tile-pressed, .tile-notes { justify-content: center; }
.tile-count .tile-big, .tile-notes .tile-big { margin: 2px 0; }

/* ---------- Footer ---------- */
.folio-footer {
  grid-row: 4;
  grid-column: 2;
  position: relative;
  background: linear-gradient(0deg, var(--vellum), var(--linen-press));
  border-top: 2px solid var(--tobacco-gold);
  display: flex; align-items: center;
  z-index: 5;
}
.garland-footer { top: -1px; transform: scaleY(-1); }
.footer-inner {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  font-family: var(--caption);
  font-style: italic;
  font-size: 0.7rem;
  color: var(--saddle-tan);
}
.ff-mid {
  font-family: var(--slab-catalog);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.56rem;
  color: var(--tobacco-gold);
}

/* ---------- responsive squeeze ---------- */
@media (max-width: 1000px) {
  .dashboard { grid-template-columns: 30% 1fr; }
  .col-tele { display: none; }
}
@media (max-width: 680px) {
  .dashboard { grid-template-columns: 1fr; grid-template-rows: 180px 1fr; }
  .col-index { order: 2; }
  .col-mount { order: 1; }
  .wm-sub, .ff-mid { display: none; }
}
