/* ============================================================================
   Field Archive v2 — shared chrome for the arc-* screens.

   A clone of option 3, kept deliberately separate so the original
   `*-3-field-archive.html` set stays untouched. Everything the six screens
   share lives here rather than being re-inlined per page, so the nav is one
   edit instead of six.

   What changed from the original archive chrome:
   - the nav floats (gap at both sides and the bottom) instead of being welded
     to the bottom edge, borrowing the geometry of options 2 and 5 while
     keeping the archive's gold-hairline, Cinzel-label aesthetic;
   - the capture seal protrudes 8px above the bar instead of 38px — it still
     breaks the rule, it just no longer leaps off the page;
   - the capture glyph is a camera, not a hexagon, because the button's job is
     "photograph the animal in front of you" and a faceted token did not say
     that to anyone;
   - the wordmark sits top-left and a day/night control sits top-right, so the
     screen title moves into its own centred block underneath.
   ========================================================================== */

:root {
  --gold: #d7b579;
  --gold-dim: #8d7448;
  --gold-hair: rgba(215, 181, 121, 0.28);
  --cream: #f2e9d8;
  --cream-2: #b9ac94;
  --cream-3: #7d7361;
  --ink-plate: rgba(9, 11, 16, 0.46);
  --bar: linear-gradient(180deg, rgba(11, 14, 21, 0.72), rgba(6, 8, 13, 0.9));
  --bar-collar: rgba(8, 10, 16, 0.9);
  --font-title: "Cinzel", "Perpetua Titling MT", Georgia, serif;
}

.device {
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--cream);
}

/* The `hidden` attribute is only `display: none` in the UA sheet, so ANY author
   `display` rule silently beats it — which quietly broke every filter on the
   index, because `.entry`, `.sec` and `.index` all declare a display. */
[hidden] {
  display: none !important;
}

/* Clears the floating bar (16 bottom + 66 tall) with room to breathe. */
.screen {
  padding: 0 0 112px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* engraved plate: hairline frame + corner ticks */
.plate {
  position: relative;
  background: var(--ink-plate);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border: 1px solid var(--gold-hair);
}
.plate::before,
.plate::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid var(--gold);
  opacity: 0.55;
  z-index: 3;
  pointer-events: none;
}
.plate::before {
  top: 5px;
  left: 5px;
  border-right: 0;
  border-bottom: 0;
}
.plate::after {
  bottom: 5px;
  right: 5px;
  border-left: 0;
  border-top: 0;
}

/* ---------------------------------------------------------------- topbar
   Chrome only. The wordmark moved down into the title block on Home, so this
   row now carries nothing but the day/night control — and holds the top inset
   when that control is suppressed. */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 12px;
  padding: 18px 18px 0;
}
.daynight {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px 0 9px;
  border-radius: 999px;
  border: 1px solid var(--gold-hair);
  background: var(--ink-plate);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--cream-2);
  font-family: var(--font-title);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: color 240ms, border-color 240ms;
}
.daynight:hover {
  color: var(--gold);
  border-color: rgba(215, 181, 121, 0.5);
}
.daynight svg {
  width: 14px;
  height: 14px;
}

/* the screen's own title, centred under the chrome row */
.title {
  padding: 16px 22px 12px;
  text-align: center;
}
.title h1 {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--cream);
}
/* Home only: the mark stands in for the title, set a little taller than the
   type it replaces so it reads as the masthead rather than a logo dropped in. */
.title h1.wordmark {
  line-height: 0;
  text-indent: 0;
}
.title h1.wordmark img {
  display: block;
  height: 30px;
  width: auto;
  margin: 0 auto;
}
.rule-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 8px;
}
.rule-row i {
  display: block;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-hair));
}
.rule-row i + i {
  background: linear-gradient(90deg, var(--gold-hair), transparent);
}
.rule-row span {
  font-size: 8.5px;
  letter-spacing: 0.28em;
  color: var(--cream-3);
}
.diamond {
  width: 4px;
  height: 4px;
  background: var(--gold);
  transform: rotate(45deg);
  opacity: 0.75;
}

/* ------------------------------------------------------------ section head */
.sec {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px 22px 16px;
}
/* The 40px above is the gap *between* sections. A head that opens the screen
   is already sitting under the title block's own bottom padding, so it takes
   the short measure instead — 8px, which is what Home's first head clears by
   once its hero padding and its own are added up. */
.title + .sec {
  padding-top: 8px;
}
.sec h2 {
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gold);
  white-space: nowrap;
}
.sec i {
  flex: 1;
  min-width: 12px;
  height: 1px;
  background: var(--gold-hair);
}
.sec b {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--cream-3);
  white-space: nowrap;
}

/* dotted-leader row — the archive's signature list form */
/* One horizontal per row, not two. The rule and the dotted leader were saying
   the same thing twice and the plate read as ruled paper; the leader alone
   already carries the eye across, so the rule goes and the row gets the air
   the rule was standing in for. */
.led-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
}
.led-row span {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-2);
}
.led-row i {
  flex: 1;
  height: 0;
  border-bottom: 1px dotted rgba(215, 181, 121, 0.24);
  transform: translateY(-3px);
}
.led-row b {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 600;
  color: var(--cream);
}
.led-row b em {
  font-style: normal;
  font-size: 11px;
  color: var(--cream-3);
}

/* back control, shown on pushed screens — a full-width bar rather than a
   corner link, so the way out is as easy to hit as everything else */
.backline {
  padding: 8px 22px 0;
}
.backline button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 0;
  border: 1px solid var(--gold-hair);
  background: rgba(8, 10, 15, 0.55);
  color: var(--cream-2);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: color 220ms, border-color 220ms;
}
.backline button:hover,
.backline button:focus-visible {
  color: var(--gold);
  border-color: rgba(215, 181, 121, 0.5);
}
.backline svg {
  width: 13px;
  height: 13px;
}

/* The shutter button, standardised. Born on the capture screen as STRIKE THE
   PLATE and now the one shape every primary action wears — it borrows the
   device's element tint when a page has one and falls back to gold when not. */
.strike {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 44px);
  margin: 16px 22px 0;
  height: 56px;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--cream);
  text-decoration: none;
  background: rgba(8, 10, 15, 0.72);
  border: 1px solid color-mix(in srgb, var(--el, var(--gold)) 55%, transparent);
  box-shadow: 0 0 26px rgba(var(--el-rgb, 215, 181, 121), 0.22);
  cursor: pointer;
  transition: color 320ms, border-color 320ms, box-shadow 320ms;
}
.strike:hover,
.strike:focus-visible {
  color: var(--gold);
  box-shadow: 0 0 30px rgba(var(--el-rgb, 215, 181, 121), 0.42);
}
/* an action already taken — present, legible, and refusing the cursor */
.strike:disabled {
  color: var(--cream-3);
  border-color: var(--gold-hair);
  box-shadow: none;
  cursor: default;
}
[data-theme="light"] .backline button,
[data-theme="light"] .strike {
  background: rgba(253, 250, 242, 0.82);
}

/* ============================================================== FLOATING NAV
   Inset from all three edges so the plate reads underneath it. The engraved
   inner hairline is the archive's plate frame restated as a pill — corner
   ticks do not survive a 20px radius, an inset rule does. */
.dock {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 16px;
  z-index: 40;
}
.bar {
  position: relative;
  height: 66px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: var(--bar);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  border: 1px solid var(--gold-hair);
  box-shadow:
    inset 0 1px 0 rgba(215, 181, 121, 0.14),
    0 24px 46px -16px rgba(0, 0, 0, 0.92);
}
.bar::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 15px;
  border: 1px solid rgba(215, 181, 121, 0.1);
  pointer-events: none;
}
.tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--cream-3);
  text-decoration: none;
  transition: color 240ms;
}
.tab svg {
  width: 19px;
  height: 19px;
}
.tab span {
  font-family: var(--font-title);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
}
.tab.on {
  color: var(--gold);
}
/* a struck diamond marks the open page — the archive's own punctuation */
.tab.on::after {
  content: "";
  position: absolute;
  /* clears the engraved inner ring (inset 5px) once rotated */
  bottom: -7px;
  width: 4px;
  height: 4px;
  background: var(--gold);
  transform: rotate(45deg);
}
.tab.gap {
  visibility: hidden;
}

/* ---- capture seal
   Sits 8px above the bar's top edge (bar top = 82px from the device bottom,
   seal top = 90px), matching the floating console's restraint rather than the
   original archive's half-a-button leap. The collar is the bar's own fill, so
   the seal reads as set into the bar instead of floating in front of it. */
.capture {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: 66px;
  height: 66px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
  background: radial-gradient(circle at 50% 28%, #f0d8a2, #c39d55 42%, #8a6a30 74%, #5d4720);
  box-shadow:
    0 0 0 4px var(--bar-collar),
    0 0 0 5px rgba(215, 181, 121, 0.34),
    0 0 24px rgba(215, 181, 121, 0.26),
    0 14px 26px -10px rgba(0, 0, 0, 0.9);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.capture::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(60, 42, 14, 0.5);
}
.capture svg {
  position: relative;
  width: 29px;
  height: 29px;
  color: #3a2a0e;
}
.capture:active {
  transform: translateX(-50%) scale(0.94);
}
/* on the intake screen the seal is the open page, so its inner rule lights */
.capture.on::before {
  border-color: rgba(60, 42, 14, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 205, 0.55);
}
.capture-ring {
  position: absolute;
  z-index: 49;
  left: 50%;
  bottom: 24px;
  width: 66px;
  height: 66px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1px solid rgba(215, 181, 121, 0.35);
  pointer-events: none;
  animation: seal 4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes seal {
  0% {
    opacity: 0.5;
    transform: translateX(-50%) scale(1);
  }
  70%,
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.42);
  }
}
@media (prefers-reduced-motion: reduce) {
  .capture-ring {
    animation: none;
    opacity: 0;
  }
}

/* ==================================================== DAY — the same book,
   printed on paper instead of read by lamplight. Gold darkens to bronze so it
   holds against white; cream inverts to ink. */
[data-theme="light"] {
  --gold: #8a672c;
  --gold-dim: #b19256;
  --gold-hair: rgba(122, 92, 40, 0.32);
  --cream: #201b12;
  --cream-2: #564c3a;
  --cream-3: #7a6d58;
  --ink-plate: rgba(253, 250, 242, 0.82);
  --bar: linear-gradient(180deg, rgba(253, 251, 245, 0.86), rgba(248, 244, 234, 0.96));
  --bar-collar: rgba(251, 249, 242, 0.96);
}
[data-theme="light"] .plate {
  box-shadow: 0 14px 32px -22px rgba(80, 66, 40, 0.6);
}
/* The wordmark ships as one warm-gold PNG; day darkens it to bronze rather
   than shipping a second asset that could drift out of sync with the first. */
[data-theme="light"] .title h1.wordmark img {
  filter: brightness(0.44) saturate(1.5);
}
[data-theme="light"] .bar {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 24px 44px -20px rgba(80, 66, 40, 0.5);
}
[data-theme="light"] .bar::before {
  border-color: rgba(122, 92, 40, 0.14);
}
[data-theme="light"] .capture {
  box-shadow:
    0 0 0 4px var(--bar-collar),
    0 0 0 5px rgba(122, 92, 40, 0.34),
    0 0 20px rgba(160, 126, 60, 0.24),
    0 14px 26px -12px rgba(80, 66, 40, 0.6);
}
[data-theme="light"] .capture-ring {
  border-color: rgba(122, 92, 40, 0.4);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: ease-out;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.01ms;
  }
}
