/* Red Seal · ship's log layout: one narrow reading column, log fields in mono, hull red as the only accent. */
:root {
  --paper: #f3f5f4;
  --ink: #15191b;
  --muted: #5a6468;
  --rule: #cfd6d6;
  --hull: #7e151a;
  --field: #e6ebea;
  --display: "Barlow", "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101416; --ink: #e9eded; --muted: #9aa6aa; --rule: #2a3236;
    --hull: #e0646b; --field: #1a2024; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101416; --ink: #e9eded; --muted: #9aa6aa; --rule: #2a3236;
  --hull: #e0646b; --field: #1a2024; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
}
.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding-block: 3rem 4rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 3rem;
}
a { color: var(--hull); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--hull); outline-offset: 3px; }

/* Masthead */
.mast { display: grid; gap: .75rem; }
.mast .name {
  font: 600 clamp(2.6rem, 9vw, 4rem)/.95 var(--display);
  letter-spacing: -.005em;
  margin: 0;
  text-wrap: balance;
}
.mast .name a { color: var(--hull); text-decoration: none; }
.mast .name span { color: var(--hull); }
.mast .lede { margin: 0; max-width: 34rem; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font: 500 .8rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.nav a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.nav a:hover { border-color: var(--hull); }

/* Section labels */
h2.label {
  margin: 0 0 1rem;
  font: 600 .75rem/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: .5rem;
}

/* Particulars: a ship's register table */
.particulars { width: 100%; border-collapse: collapse; font: 400 .9rem/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.particulars th { text-align: left; font-weight: 400; color: var(--muted); padding: .35rem 1rem .35rem 0; width: 9rem; vertical-align: top; }
.particulars td { padding: .35rem 0; }
.particulars tr + tr { border-top: 1px dashed var(--rule); }

/* Log index */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.entries li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px dashed var(--rule); }
.entries time { font: 400 .85rem/1.6 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.entries a { font: 700 1.15rem/1.35 var(--display); color: var(--ink); text-decoration: none; }
.entries a:hover { color: var(--hull); }
.entries p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.entries div { min-width: 0; }
@media (max-width: 30rem) { .entries li { grid-template-columns: 1fr; gap: .2rem; } }

/* Elsewhere */
.elsewhere { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font: 400 .95rem/1.5 var(--mono); }
.elsewhere span { color: var(--muted); display: inline-block; min-width: 7rem; }

/* Entry page */
.entry-head { display: grid; gap: 1rem; }
.entry-head h1 { margin: 0; font: 700 clamp(1.9rem, 6vw, 2.75rem)/1.05 var(--display); letter-spacing: -.015em; text-wrap: balance; }
.logfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); font: 400 .8rem/1.4 var(--mono); }
.logfields div { background: var(--field); padding: .5rem .65rem; min-width: 0; }
.logfields dt { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; }
.logfields dd { margin: .15rem 0 0; font-variant-numeric: tabular-nums; }
.prose { display: grid; gap: 1.1rem; }
.prose p { margin: 0; max-width: 65ch; }
.prose h2 { margin: .75rem 0 0; font: 700 1.3rem/1.25 var(--display); }
.prose figure { margin: .5rem 0; }
.prose figure img { width: 100%; height: auto; display: block; }
.prose figcaption { font: 400 .8rem/1.5 var(--mono); color: var(--muted); margin-top: .4rem; }
.prose blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--hull); font-style: italic; }
.draft { font: 500 .75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--hull); }
.embed { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; border: 0; background: var(--field); }

.foot { font: 400 .75rem/1.6 var(--mono); color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1rem; display: grid; gap: .25rem; }
.foot a { color: var(--muted); }

/* Cover: the boat photo edge to edge, centred on the hull; click opens the full photo. */
.cover { margin: 0; }
.cover-link { display: block; }
.cover img { display: block; width: 100%; height: clamp(18rem, 62vh, 40rem); object-fit: cover; object-position: 50% 80%; }
.cover-link:focus-visible { outline: 3px solid var(--hull); outline-offset: -3px; }

/* Band: a brand-red strip across the full width under the cover; the logo pill sits on it and stands out above and below. */
.band { background: #7e151a; height: 3rem; }
.band-inner {
  max-width: 42rem; height: 100%; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center;
}
.pill {
  margin: 0; flex: none;
  background: #7e151a;
  border-radius: 999px;
  padding: .8rem 1.6rem;
  box-shadow: 0 0 0 4px var(--paper);
  line-height: 0;
}
.pill a { display: block; }
.pill img { display: block; height: clamp(3.2rem, 7vw, 4.2rem); width: auto; }
.pill a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 999px; }

/* Keeper: photo beside a short text, stacked on phones. */
.keeper { display: grid; grid-template-columns: 7rem 1fr; gap: 1.25rem; align-items: start; }
.keeper > * { min-width: 0; }
.keeper-photo { margin: 0; }
.keeper-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.keeper-text { display: grid; gap: .75rem; }
.keeper-text p { margin: 0; }
@media (max-width: 30rem) { .keeper { grid-template-columns: 5.5rem 1fr; gap: 1rem; } }

/* Placeholders for photos not yet chosen. */
.ph { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 2; background: var(--field); border: 1px dashed var(--rule); color: var(--muted); font: 400 .75rem/1.3 var(--mono); text-align: center; padding: 1rem; }
.cover .ph { aspect-ratio: auto; height: clamp(14rem, 50vh, 32rem); border: 0; border-bottom: 1px dashed var(--rule); }

/* Post photos with captions: two across, one on phones. */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; min-width: 0; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.gallery figcaption { font: 400 .78rem/1.5 var(--mono); color: var(--muted); margin-top: .4rem; }

/* Log list: each entry shows its cover. */
.entries li { grid-template-columns: 8rem 1fr; align-items: start; }
.entries .thumb { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.entries .thumb.ph { padding: .25rem; font-size: .62rem; }
.entries .meta { display: grid; gap: .1rem; }
@media (max-width: 30rem) { .entries li { grid-template-columns: 6rem 1fr; gap: .9rem; } }
