/* ————————————————————————————————
   The Hartwell Family — family register
   Palette: fern linen / spruce ink / moss stem / madder thread
   ———————————————————————————————— */

:root {
  --paper: #efeee5;
  --paper-raised: #f7f6ef;
  --ink: #253529;
  --ink-soft: #5c6b5e;
  --stem: #8a9b7c;
  --stem-faint: #c3cdb8;
  --thread: #a63d2f;
  --thread-soft: #f0e2de;

  --font-display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Alegreya Sans", "Gill Sans", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", "SF Mono", Menlo, monospace;
}

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

html { height: 100%; }

body {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  background-image: radial-gradient(rgba(37, 53, 41, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

/* ——— site navigation ——— */

.site-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem 3rem;
  border-bottom: 1px solid var(--stem-faint);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-burger {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--stem-faint);
  border-radius: 8px;
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
}

.nav-burger:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

.nav-wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}

/* trace status lives in the bar on the tree page */
.nav-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  min-width: 0;
}

.nav-status .trace-hint,
.nav-status .sync-note {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-crest {
  height: 28px;
  width: auto;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto; /* right-aligns when no status block precedes it */
}

.nav-status ~ .lang-switch { margin-left: 0.75rem; }

.lang-btn {
  font-family: var(--font-data);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0.2rem 0;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.lang-btn:hover { color: var(--ink); }

.lang-btn.is-current {
  color: var(--thread);
  border-bottom-color: var(--thread);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

.lang-sep { color: var(--stem-faint); }

.nav-link {
  font-family: var(--font-data);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.nav-link:hover {
  color: var(--ink);
  border-bottom-color: var(--stem);
}

.nav-link.is-current {
  color: var(--thread);
  border-bottom-color: var(--thread);
}

.nav-link:focus-visible,
.nav-wordmark:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

/* ——— header ——— */

.register-head {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2.5rem 3rem 1.75rem;
  border-bottom: 1px solid var(--stem-faint);
}

.head-crest {
  align-self: center;
  height: 128px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(37, 53, 41, 0.18));
}

.eyebrow {
  font-family: var(--font-data);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--thread);
  margin-bottom: 0.5rem;
}

.family-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.subtitle {
  margin-top: 0.4rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  margin-left: auto;
  text-align: right;
}

.trace-hint {
  max-width: 26ch;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
}

.trace-hint.tracing {
  font-style: normal;
  color: var(--thread);
}

.clear-btn {
  font-family: var(--font-data);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--thread);
  background: var(--paper-raised);
  border: 1px solid var(--thread);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  box-shadow: 0 2px 6px rgba(37, 53, 41, 0.1);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.clear-btn:hover { background: var(--thread); color: var(--paper-raised); }

/* ——— tree ——— */

.tree-wrap {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tree-scroller {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem 0 1.5rem;
  /* two-finger pinches go to the tree's own zoom, not the browser's */
  touch-action: pan-x pan-y;
}

.tree-sizer {
  margin: 0 auto;
}

.tree-canvas {
  position: relative;
  transform-origin: 0 0;
}

.zoom-controls {
  position: absolute;
  right: 1.25rem;
  bottom: 1.5rem;
  display: flex;
  gap: 0.4rem;
  z-index: 5;
}

.zoom-btn {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  background: var(--paper-raised);
  border: 1px solid var(--stem-faint);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(37, 53, 41, 0.12);
  color: var(--ink-soft);
  font-family: var(--font-data);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.zoom-btn:hover {
  color: var(--ink);
  border-color: var(--stem);
}

.zoom-btn:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

.zoom-label { font-size: 0.68rem; letter-spacing: 0.08em; }

.tree-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tree-lines path,
.tree-lines line {
  fill: none;
  stroke: var(--stem);
  stroke-width: 1.5;
  transition: stroke 200ms ease, stroke-width 200ms ease, opacity 200ms ease;
}

.tree-lines circle {
  fill: var(--paper);
  stroke: var(--stem);
  stroke-width: 1.5;
  transition: stroke 200ms ease, opacity 200ms ease;
}

/* generation labels */

.gen-label {
  position: absolute;
  left: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-data);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
}

/* ——— person card ——— */

.person-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.7rem 0.9rem 0.6rem;
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--stem-faint);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(37, 53, 41, 0.07);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease,
              border-color 160ms ease, opacity 200ms ease;
}

.person-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(37, 53, 41, 0.12);
  border-color: var(--stem);
}

.person-card:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

.person-initials {
  display: grid;
  place-items: center;
  flex-shrink: 0; /* long names must not squash the badge into an oval */
  width: 28px;
  height: 28px;
  margin-bottom: 0.25rem;
  border-radius: 50%;
  background: var(--stem);
  color: var(--paper-raised);
  font-family: var(--font-data);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: background 200ms ease;
}

/* honorific chip: sits in the card's free top-right corner */
.person-honorific {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-data);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-raised);
  background: var(--thread);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.person-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  line-height: 1.18;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

/* very long names drop a size so their dates stay visible */
.person-name.long { font-size: 0.78rem; }
.person-name.xlong { font-size: 0.7rem; }

/* names may clamp to whole lines but never shrink into half-cut glyphs */
.person-name { flex-shrink: 0; }

.person-dates,
.person-place { flex-shrink: 0; }

.person-dates {
  font-family: var(--font-data);
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

.person-place {
  font-size: 0.75rem;
  line-height: 1.3;
  font-style: italic;
  color: var(--ink-soft);
}

/* ——— former partnerships: dashed and quieter ——— */

.person-card.former {
  border-style: dashed;
  background: var(--paper);
}

.person-card.former .person-initials {
  background: var(--stem-faint);
  color: var(--ink-soft);
}

.person-card.former .person-name { color: var(--ink-soft); }

.tree-lines .former-link {
  stroke-dasharray: 4 3;
}

/* ——— the red thread ——— */

.is-tracing .person-card { opacity: 0.38; }
.is-tracing .tree-lines path,
.is-tracing .tree-lines line,
.is-tracing .tree-lines circle { opacity: 0.3; }

.is-tracing .person-card.lit { opacity: 1; border-color: var(--thread); }
.is-tracing .person-card.lit .person-initials { background: var(--thread); }

.is-tracing .tree-lines .lit {
  opacity: 1;
  stroke: var(--thread);
  stroke-width: 2;
}

.person-card.selected {
  background: var(--thread-soft);
  border-color: var(--thread);
}

/* ——— add buds: grow new relatives from the tree ——— */

.add-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border: 1.5px dashed var(--stem);
  border-radius: 50%;
  color: var(--stem);
  font-family: var(--font-data);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 160ms ease, background 160ms ease,
              color 160ms ease, border-color 160ms ease;
}

.add-btn:hover,
.add-btn:focus-visible {
  opacity: 1;
  background: var(--stem);
  border-style: solid;
  color: var(--paper-raised);
}

.add-btn:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

.is-tracing .add-btn { opacity: 0.12; pointer-events: none; }

/* pencil on each card: edit that person */

.edit-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  background: var(--paper-raised);
  border: 1px solid var(--stem-faint);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 160ms ease, border-color 160ms ease, color 160ms ease;
}

.edit-btn:hover,
.edit-btn:focus-visible,
.person-card:hover + .edit-btn {
  opacity: 1;
  border-color: var(--stem);
  color: var(--ink);
}

@media (hover: none) {
  .edit-btn { opacity: 0.5; }
}

.edit-btn:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

.is-tracing .edit-btn { opacity: 0; pointer-events: none; }

.bud-hint {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px dashed var(--stem);
  border-radius: 50%;
  color: var(--stem);
  font-family: var(--font-data);
  font-size: 0.65rem;
  vertical-align: -2px;
}

/* ——— add-relative dialog ——— */

.person-dialog {
  margin: auto;
  width: min(92vw, 380px);
  background: var(--paper-raised);
  border: 1px solid var(--stem);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(37, 53, 41, 0.28);
  padding: 1.6rem 1.6rem 1.4rem;
  color: var(--ink);
  font-family: var(--font-body);
}

.person-dialog::backdrop {
  background: rgba(37, 53, 41, 0.35);
}

.dialog-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
}

.field-row {
  display: flex;
  gap: 0.85rem;
}

.field-row .field { flex: 1; }

/* when one label wraps (e.g. "Fallecimiento (opcional)"), keep the row's
   inputs bottom-aligned by letting labels fill the leftover height */
.field-row .field-label { flex: 1; }

.field-label {
  font-family: var(--font-data);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field-label em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.field input {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stem-faint);
  border-radius: 7px;
  padding: 0.5rem 0.65rem;
}

.field input[type="number"] { font-family: var(--font-data); font-size: 0.85rem; }

.field input:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 1px;
  border-color: var(--thread);
}

.field-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.field-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--thread);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.dialog-submit {
  font-family: var(--font-data);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-raised);
  background: var(--thread);
  border: 1px solid var(--thread);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: background 160ms ease;
}

.dialog-submit:hover { background: #8f3225; }

.dialog-submit:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

/* ——— chronicle (history page) ——— */

.hero {
  text-align: center;
  padding: 2.5rem 0 1rem;
}

.hero-crest {
  height: 200px;
  width: auto;
  filter: drop-shadow(0 3px 8px rgba(37, 53, 41, 0.2));
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  margin: 1.2rem 0 0.8rem;
}

.hero-desc {
  max-width: 58ch;
  margin: 0 auto;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 2rem;
  font-family: var(--font-data);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--thread);
}

.section-label::before,
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--stem-faint);
}

@media (max-width: 700px) {
  .hero { padding-top: 1.5rem; }
  .hero-crest { height: 140px; }
}

.chronicle {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* the scroller is a centred 740px column, so its scrollbar would run down
     the middle of the page — hide the bar, keep the scrolling */
  scrollbar-width: none;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
}

.chronicle::-webkit-scrollbar { width: 0; height: 0; }

.timeline {
  list-style: none;
  position: relative;
}

/* the stem the chronicle grows along */
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: var(--stem);
}

.t-entry {
  position: relative;
  padding: 0 0 2.4rem 2.4rem;
}

.t-entry:last-child { padding-bottom: 0.5rem; }

/* a ring at each entry, like the marriage rings on the tree */
.t-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--stem);
}

.entry-year {
  font-family: var(--font-data);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--thread);
}

.entry-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 0.3rem 0 0.45rem;
}

.entry-text {
  max-width: 62ch;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

/* ——— memoir: "Mi padre" ——— */

.memoir {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--stem-faint);
}

/* the memoir on its own page needs no separator from a timeline above */
.memoir-page {
  margin-top: 0;
  padding-top: 2rem;
  border-top: none;
}

.memoir-head {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-bottom: 1.8rem;
}

.memoir-portrait {
  flex-shrink: 0;
  text-align: center;
}

.memoir-portrait img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--paper-raised);
  outline: 1.5px solid var(--stem);
  box-shadow: 0 3px 10px rgba(37, 53, 41, 0.2);
}

.memoir-portrait figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-data);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.memoir-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

.memoir-subtitle {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 62ch;
}

@media (max-width: 700px) {
  .memoir-head { flex-direction: column; text-align: center; gap: 1rem; }
  .memoir-subtitle { margin: 0 auto; }
}

.memoir-p {
  max-width: 68ch;
  margin-bottom: 1rem;
  font-size: 0.98rem;
  color: var(--ink);
  text-align: justify;
  hyphens: auto;
}

.memoir-table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0 1.4rem;
}

.memoir-table {
  border-collapse: collapse;
  font-size: 0.85rem;
}

.memoir-table td {
  padding: 0.3rem 1.4rem 0.3rem 0;
  border-bottom: 1px solid var(--stem-faint);
  white-space: nowrap;
}

.memoir-table td:first-child {
  font-family: var(--font-data);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--thread);
}

/* ——— search ——— */

.search-box {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-box input {
  width: 180px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--stem-faint);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  box-shadow: 0 2px 6px rgba(37, 53, 41, 0.1);
}

.search-box input:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 1px;
  border-color: var(--thread);
}

.search-count {
  font-family: var(--font-data);
  font-size: 0.7rem;
  color: var(--thread);
  min-width: 2.5rem;
}

.person-card.search-hit {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .search-box { top: 0.6rem; right: 0.6rem; }
  .search-box input { width: 130px; font-size: 0.8rem; }
}

/* ——— footer ——— */

.register-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 3rem 1.5rem;
  border-top: 1px solid var(--stem-faint);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.foot-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sync-note {
  font-family: var(--font-data);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--stem);
}

.sync-note.sync-warn { color: var(--thread); }

.register-foot code {
  font-family: var(--font-data);
  font-size: 0.72rem;
  background: var(--paper-raised);
  border: 1px solid var(--stem-faint);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

.foot-actions {
  display: flex;
  gap: 0.6rem;
}

.foot-btn {
  font-family: var(--font-data);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--stem-faint);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.foot-btn:hover {
  color: var(--ink);
  border-color: var(--stem);
}

.foot-btn:focus-visible {
  outline: 2px solid var(--thread);
  outline-offset: 2px;
}

.foot-btn.armed {
  color: var(--thread);
  border-color: var(--thread);
}

/* ——— small screens ——— */

/* small screens: keep the chrome minimal so the tree gets the room */
@media (max-width: 700px) {
  .site-nav { padding: 0.5rem 1rem; gap: 0.9rem; }
  .nav-wordmark { font-size: 0.85rem; }
  .nav-crest { height: 24px; }

  /* nav links collapse behind the hamburger */
  .nav-burger { display: grid; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0.75rem;
    z-index: 30;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
    background: var(--paper-raised);
    border: 1px solid var(--stem-faint);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(37, 53, 41, 0.18);
  }
  .site-nav.open .nav-links { display: flex; }

  .register-head {
    padding: 0.8rem 1rem 0.75rem;
    gap: 0.3rem 1rem;
    align-items: center;
  }
  .head-crest { display: none; }
  .eyebrow { font-size: 0.58rem; margin-bottom: 0.2rem; }
  .family-name { font-size: 1.45rem; }
  .subtitle { display: none; }

  .head-right {
    align-items: flex-start;
    text-align: left;
    margin-left: 0;
    gap: 0.3rem;
  }
  /* show the thread status only while tracing; the buds explain themselves */
  .trace-hint { display: none; font-size: 0.78rem; max-width: none; }
  .trace-hint.tracing { display: block; }

  .register-foot { padding: 0.6rem 1rem 0.8rem; gap: 0.5rem 0.75rem; }
  .foot-text > p:first-child { display: none; }
  .foot-btn { font-size: 0.58rem; padding: 0.28rem 0.7rem; }
  .zoom-controls { right: 0.9rem; bottom: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
