/* The Lectern: ma. components in Ink & Tide.
   Roughly 70% Paper or White, 20% Ink, under 10% turquoise. Borders and grounds, not
   shadows. Tide never carries text on a light ground; Deep Tide does that job. Tide
   as text appears only inside .ink surfaces. Every colour comes from the tokens below. */

@font-face {
  font-family: "Manrope";
  src: url("manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1C2024;
  --ink-raised: #262B30;
  --ink-rule: #3A4047;
  --paper: #F5F3EF;
  --white: #FFFFFF;
  --mist: #E3ECEE;
  --tide: #3FB8AF;
  --deep-tide: #17625E;
  --deep-tide-hover: #0F4B48;
  --slate: #5A6068;
  --line: #D9DCDA;
  --on-ink: #F5F3EF;
  --on-ink-muted: #BCC4C8;
  --critical: #A3261B;
  --warn: #8A5A00;

  --display: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;
  --text: "Manrope", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --pill: 999px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

p, h1, h2, h3, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

a { color: var(--deep-tide); text-underline-offset: 3px; }
a:hover { color: var(--deep-tide-hover); }

:focus-visible { outline: 3px solid var(--deep-tide); outline-offset: 3px; border-radius: 6px; }
.ink :focus-visible { outline-color: var(--tide); }

.skip { position: absolute; left: -9999px; top: 12px; padding: 10px 16px; background: var(--white); border-radius: var(--pill); font-weight: 700; }
.skip:focus { left: 12px; z-index: 10; }

/* Type */

.display { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.h1 { font-size: clamp(2.75rem, 2rem + 3vw, 4rem); line-height: 1; letter-spacing: -0.025em; }
.h2 { font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3rem); line-height: 1.05; }
.h3 { font-size: 1.625rem; line-height: 1.15; }
.stop { color: var(--deep-tide); }
.ink .stop { color: var(--tide); }
.lead { font-size: 1.125rem; line-height: 1.5; max-width: 46ch; }
.small { font-size: 0.875rem; color: var(--slate); }
.label { font-size: 0.75rem; line-height: 1.4; font-weight: 600; letter-spacing: 0.125em; text-transform: uppercase; color: var(--slate); }
.label-accent { color: var(--deep-tide); }
.ink .label { color: var(--on-ink-muted); }

/* Brand lockup: the mark is the logo file */

.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.mark { height: 28px; width: auto; }
.brand-rule { width: 1px; height: 28px; background: var(--line); }
.brand-name { font-size: 0.6875rem; line-height: 1.3; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

/* Buttons: pills, text starts with a verb */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  border-radius: var(--pill); border: 1px solid transparent;
  font: 700 0.9375rem/1 var(--text); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--deep-tide); color: var(--white); }
.btn-primary:hover { background: var(--deep-tide-hover); color: var(--white); }
.btn-secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.ink .btn-on-ink { background: var(--tide); color: var(--ink); }
.ink .btn-on-ink:hover { background: var(--on-ink); color: var(--ink); }

/* Field */

.field { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.field input {
  height: 52px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: var(--pill); background: var(--white);
  font: 400 1rem var(--text); color: var(--ink);
}
.field input::placeholder { color: var(--slate); }

/* Chips and pills */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 16px;
  border-radius: var(--pill); border: 1px solid var(--line); background: var(--white);
  font: 600 0.875rem var(--text); color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill {
  display: inline-block; justify-self: start;
  padding: 5px 12px; border-radius: var(--pill); border: 1px solid var(--line);
  font-size: 0.75rem; line-height: 1.3; font-weight: 700; color: var(--slate); white-space: nowrap;
}
.pill-accent { border-color: var(--deep-tide); color: var(--deep-tide); }

/* Surfaces */

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.panel-mist { background: var(--mist); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.island { border-radius: var(--radius-lg); padding: 26px 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.ink { background: var(--ink); color: var(--on-ink); }
.ink p { color: var(--on-ink-muted); }
.ink a { color: var(--tide); }
.ink a:hover { color: var(--on-ink); }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.5; }
.panel-mist .notice, .card .notice { background: var(--white); }
.notice strong { color: var(--warn); }

/* List */

.list { padding: 0; gap: 0; overflow: hidden; }
.list-head, .row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 130px; gap: 16px; align-items: center; padding: 14px 24px; }
.row { padding: 18px 24px; border-top: 1px solid var(--line); }
.row-title { display: block; font-size: 1.375rem; line-height: 1.2; }
.row-facts, .row-series { font-size: 0.875rem; }
.row-facts { display: block; color: var(--slate); }
.empty { padding: 40px 24px 44px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.empty p { max-width: 48ch; color: var(--slate); }

/* The record panel */

.counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.counts div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.counts dt { font-size: 0.875rem; color: var(--slate); }
.counts dd { font-family: var(--display); font-size: 1.25rem; font-weight: 500; }

.pieces { width: 100%; counter-reset: piece; }
.pieces li { counter-increment: piece; display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--ink-rule); font-size: 0.9375rem; }
.pieces li span:first-child::before { content: counter(piece, decimal-leading-zero) "  "; color: var(--on-ink-muted); font-variant-numeric: tabular-nums; }
.ink .piece-state { color: var(--tide); font-weight: 700; font-size: 0.8125rem; white-space: nowrap; }

/* The signed-in frame */

.shell { display: flex; min-height: 100vh; }
.side { flex: 0 0 256px; padding: 28px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; align-self: flex-start; min-height: 100vh; }
.side .brand { padding: 0 12px; }
.places { display: flex; flex-direction: column; gap: 2px; }
.place { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: var(--pill); font-size: 0.9375rem; font-weight: 600; color: var(--ink); text-decoration: none; }
a.place:hover { background: var(--mist); color: var(--ink); }
.place[aria-current="page"], .place[aria-current="page"]:hover { background: var(--ink); color: var(--paper); }
.place.is-later { color: var(--slate); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 16px 0; border-top: 1px solid var(--line); }
.quiet { display: inline-flex; align-items: center; min-height: 40px; padding: 0; border: 0; background: none; font: 600 0.875rem var(--text); color: var(--slate); text-decoration: none; cursor: pointer; }
.quiet:hover, .quiet.is-current { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.main { flex: 1 1 auto; min-width: 0; padding: 40px 40px 56px; display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; flex-direction: column; gap: 10px; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cols > .list { flex: 999 1 520px; min-width: 0; }
.aside { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 24px; }

.specimens { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px 28px; align-items: start; }
.specimen { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.specimen[data-component="list-row"] { grid-column: 1 / -1; }

/* The signed-out frame */

.door { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.door-card { width: 100%; max-width: 520px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 40px; display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }

/* Phone and small tablet: the places move to the top */

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { flex: 0 0 auto; position: static; min-height: 0; align-self: stretch; padding: 16px 16px 12px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 0 4px; }
  .places { flex-direction: row; flex-wrap: wrap; gap: 4px 6px; }
  .place.is-later { gap: 8px; padding: 0 10px; }
  .place { flex: 0 0 auto; }
  .side-foot { margin-top: 0; flex-direction: row; flex-wrap: wrap; gap: 4px 20px; padding: 8px 4px 0; }
  .main { padding: 28px 16px 40px; gap: 22px; }
  .aside { max-width: none; }
  .list-head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px 18px; }
  .empty { border-top: 0; padding: 28px 18px 32px; }
  .door-card { padding: 28px 22px; }
}
