/*
Theme Name: Austin Ginder v2
Theme URI: https://austinginder.com/
Author: Austin Ginder
Author URI: https://austinginder.com/
Description: Single-page personal site for Austin Ginder — hero, fleet, charts & instruments, session heatmap, ship's log timeline, contact, an apps shelf of every project (and a sea chart of them) and a video shelf of talks and interviews. Day/night mode.
Version: 2.6.0
Requires at least: 6.0
Requires PHP: 7.4
License: MIT
License URI: https://opensource.org/licenses/MIT
Text Domain: austinginder-v2
*/

/* ============================================================
   Fonts — Spectral (serif) and JetBrains Mono (mono)
   ============================================================ */

/* JetBrains Mono — 400 */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/8c18d7d0-3ea8-4bc6-887d-864ea9d64fa3.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/cbf04856-8887-4f4a-9e8c-b4bc361ab0db.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/4916d958-2770-4024-9a9f-5e6dd5a8fefd.woff2") format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/bfba13fc-9f0b-4c68-a762-cc4dbc7953da.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/1f57caca-a202-4940-b4ff-e9d20895ea71.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/9a11e820-7f51-4c3d-994a-4f31866c2ae9.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* JetBrains Mono — 500 (shares subset files with 400) */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/8c18d7d0-3ea8-4bc6-887d-864ea9d64fa3.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/cbf04856-8887-4f4a-9e8c-b4bc361ab0db.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/4916d958-2770-4024-9a9f-5e6dd5a8fefd.woff2") format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/bfba13fc-9f0b-4c68-a762-cc4dbc7953da.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/1f57caca-a202-4940-b4ff-e9d20895ea71.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/9a11e820-7f51-4c3d-994a-4f31866c2ae9.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Spectral italic 400 */
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 400; font-display: swap;
  src: url("assets/fonts/b1022812-82a6-4361-97a3-59485f8e1da2.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 400; font-display: swap;
  src: url("assets/fonts/8eadf21f-b98d-4c10-a137-9bd5920cf83a.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 400; font-display: swap;
  src: url("assets/fonts/a4f5a2bc-25f7-49dc-ac6b-370c0e7a13ae.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 400; font-display: swap;
  src: url("assets/fonts/8bbca808-c323-4052-9efe-cdf384ac728c.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 400; font-display: swap;
  src: url("assets/fonts/0ac1f82a-bbfb-4c6b-a8e0-e94e1f0a87ee.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Spectral 300 */
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 300; font-display: swap;
  src: url("assets/fonts/a480d70f-577c-47e3-be7d-2f38d1b55f4f.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 300; font-display: swap;
  src: url("assets/fonts/26dded1a-7e1f-433f-9065-c0dec731b541.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 300; font-display: swap;
  src: url("assets/fonts/8e571daf-044e-414a-94e6-9ac416ab453b.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 300; font-display: swap;
  src: url("assets/fonts/eaaa0088-a6e2-4a62-affc-9f5cee805088.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 300; font-display: swap;
  src: url("assets/fonts/681c91a3-a469-406b-9b45-7a0c7d480376.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Spectral 400 */
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/b4a651dc-6de2-4010-a8e5-8a5dbb1d18f4.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/a9ae0add-ba88-4b9b-ad1b-21622c50d7cf.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/242e67df-2d18-4b88-8ace-5bcd78120074.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/2d938650-d30e-496e-a0f2-02d8070d4794.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/83a7cb4c-28a4-485f-b62a-9baa033016d6.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ============================================================
   Theme styles
   ============================================================ */

:root {
  --bg: #0a0e1a;
  --fg: #e8e4d4;
  --dim: rgba(232, 228, 212, 0.78);
  --faint: rgba(232, 228, 212, 0.56);
  --rule: rgba(232, 228, 212, 0.10);
  --accent: #c9a14a;
  --violet: #8d7cff;

  --serif: "Spectral", Georgia, serif;
  --mono:  "JetBrains Mono", ui-monospace, Menlo, monospace;
}

[data-mode="day"] {
  --bg: #f3ecd9;
  --fg: #1a1d2b;
  --dim: rgba(26, 29, 43, 0.78);
  --faint: rgba(26, 29, 43, 0.56);
  --rule: rgba(26, 29, 43, 0.14);
  --accent: #1f3a6b;
  --violet: #5a3aa0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 500ms ease, color 500ms ease;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px clamp(20px, 6vw, 36px) 88px;
}

/* top row: tiny mark + toggle */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--faint);
  letter-spacing: 0.04em;
  margin-bottom: 96px;
}
.top .mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.top button {
  background: none;
  border: 0;
  color: var(--faint);
  font: inherit;
  cursor: pointer;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.top button:hover { color: var(--accent); }

/* icon helper */
.ic {
  width: 1.3em;
  height: 1.3em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.12em;
  flex: none;
}

/* hero */
h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 28px;
  text-wrap: pretty;
}
h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}
h1 a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 200ms, text-decoration-color 200ms;
}
h1 a:hover { color: var(--accent); text-decoration-color: var(--accent); }

p { margin: 0 0 18px; }
p a {
  border-bottom: 1px solid var(--rule);
  transition: color 200ms, border-color 200ms;
}
p a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.meta {
  font-family: var(--mono);
  font-size: 17.5px;
  color: var(--dim);
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 28px;
}
.meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.meta .ic { color: var(--accent); }
.meta a {
  color: inherit;
  border-bottom: 1px solid var(--rule);
  transition: color 200ms, border-color 200ms;
}
.meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* front page: the top bar and intro break out of the 720 column; sections below keep it */
.home { --hero: min(960px, 100vw - 2 * clamp(20px, 6vw, 36px)); }
.home .top, .hero {
  width: var(--hero);
  margin-left: calc((100% - var(--hero)) / 2);
}

/* section heads */
h2 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 16.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 80px 0 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2 .ic { width: 19px; height: 19px; color: var(--accent); }

/* lists: vessels & links */
ul.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 14px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--rule);
  border-radius: 4px;
  position: relative;
  transition: background-color 200ms ease;
}
ul.list li:first-child { border-top: 1px solid var(--rule); }
ul.list .ic {
  width: 22px; height: 22px;
  color: var(--accent);
  align-self: center;
  transition: transform 200ms ease;
}
ul.list a {
  display: contents;
}
ul.list .title {
  font-family: var(--serif);
  font-size: 24px;
  transition: color 200ms ease;
}
ul.list .desc {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 21px;
  color: var(--dim);
  margin-left: 8px;
  transition: color 200ms ease;
}
ul.list .arr {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--faint);
  font-variant-emoji: text;
  transition: transform 200ms, color 200ms;
}

/* timeline */
.tl-year {
  font-family: var(--mono);
  font-size: 15.5px;
  letter-spacing: 0.15em;
  color: var(--dim);
  margin: 28px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.tl-year:first-child { border-top: 0; padding-top: 0; margin-top: 4px; }
.tl-entry {
  display: grid;
  grid-template-columns: 88px 1fr auto auto;
  gap: 18px;
  align-items: baseline;
  padding: 12px 0;
  color: inherit;
}
a.tl-entry { text-decoration: none; }
a.tl-entry:hover .tl-title { color: var(--accent); }
a.tl-entry:hover .tl-arr { transform: translateX(3px); color: var(--accent); }
.tl-date {
  font-family: var(--mono);
  font-size: 15.5px;
  color: var(--dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tl-title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.35;
  transition: color 200ms;
}
.tl-arr {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--faint);
  transition: transform 200ms, color 200ms;
}

.tl-cat {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  transition: color 200ms;
}
.tl-cat::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 7px;
  opacity: 0.9;
}
.tl-cat[data-cat="projects"] { color: var(--accent); }
.tl-cat[data-cat="talks"]    { color: var(--violet); }
.tl-cat[data-cat="notes"]    { color: var(--dim); }
.tl-cat-spacer { display: inline-block; }

@media (max-width: 520px) {
  .tl-entry { grid-template-columns: 66px 1fr auto; gap: 12px; }
  .tl-date { font-size: 14.5px; }
  .tl-title { font-size: 20px; }
  .tl-cat, .tl-cat-spacer { display: none; }
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 5vh, 56px) 16px;
  background: rgba(5, 9, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  opacity: 0;
  transition: opacity 220ms ease;
}
[data-mode="day"] .modal { background: rgba(40, 38, 30, 0.55); }
.modal.open { display: flex; opacity: 1; }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 780px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 56px) clamp(40px, 6vw, 64px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  transform: translateY(8px);
  transition: transform 240ms ease;
  overflow: hidden;
}
.modal.open .modal-card { transform: translateY(0); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms, border-color 200ms;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }
.modal-date {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.modal-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 0 0 24px;
  color: var(--fg);
}
.modal-body {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.65;
  color: var(--fg);
  padding-bottom: 72px;
}
.modal.no-nav .modal-body { padding-bottom: 0; }
.modal-body p { margin: 0 0 16px; }
.modal-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.modal-body a:hover { border-bottom-color: var(--accent); }
.modal-body img,
.modal-body iframe,
.modal-body video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px 0;
  border-radius: 4px;
}

/* responsive WP embeds */
.modal-body figure,
.modal-body .wp-block-embed {
  margin: 22px 0;
  max-width: 100%;
}
.modal-body .wp-block-embed__wrapper,
.modal-body .wp-embed-aspect-16-9 .wp-block-embed__wrapper,
.modal-body .wp-has-aspect-ratio .wp-block-embed__wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
}
.modal-body .wp-embed-aspect-4-3 .wp-block-embed__wrapper { aspect-ratio: 4 / 3; }
.modal-body .wp-embed-aspect-1-1 .wp-block-embed__wrapper { aspect-ratio: 1 / 1; }
.modal-body .wp-embed-aspect-9-16 .wp-block-embed__wrapper { aspect-ratio: 9 / 16; }
.modal-body .wp-block-embed__wrapper iframe,
.modal-body .wp-block-embed__wrapper embed,
.modal-body .wp-block-embed__wrapper object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}
.modal-body > iframe,
.modal-body p > iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}
.modal-body blockquote.wp-embedded-content { display: none; }
.modal-body figcaption {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  margin-top: 8px;
  text-align: center;
}
.modal-body h1, .modal-body h2, .modal-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.25;
  margin: 28px 0 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg);
  display: block;
}
.modal-body h2 { font-size: 22px; }
.modal-body h3 { font-size: 19px; }
.modal-body blockquote {
  margin: 18px 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--accent);
  color: var(--dim);
  font-style: italic;
}
.modal-body pre, .modal-body code {
  font-family: var(--mono);
  font-size: 14px;
}
.modal-body pre {
  background: rgba(0,0,0,0.25);
  padding: 14px 16px;
  border-radius: 4px;
  overflow-x: auto;
}
[data-mode="day"] .modal-body pre { background: rgba(0,0,0,0.05); }
.modal-body ul, .modal-body ol { padding-left: 22px; }
.modal-body li { margin: 4px 0; }
.modal-link { display: none; }
.modal-hints {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 18px;
  margin: 32px calc(-1 * clamp(24px, 5vw, 56px)) calc(-1 * clamp(40px, 6vw, 64px));
  background: var(--bg);
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--faint);
  text-transform: uppercase;
  pointer-events: none;
}
.modal-hints .h {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.modal-hints kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  background: transparent;
}
.modal-loading {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--faint);
}
body.modal-open { overflow: hidden; }

/* Interactive-row hover/focus: tint the row, brighten title + description,
 * nudge icon and arrow. Scoped via :has(> a) so non-interactive
 * Charts & Instruments rows don't false-advertise. .opens-modal rows
 * share the same treatment via the block below. */
ul.list li:has(> a):hover,
ul.list li.opens-modal:hover,
ul.list li.opens-modal:focus-visible {
  background-color: color-mix(in srgb, var(--accent) 3%, transparent);
}
ul.list li:has(> a):hover .title,
ul.list li.opens-modal:hover .title,
ul.list li.opens-modal:focus-visible .title {
  color: var(--accent);
}
ul.list li:has(> a):hover .desc,
ul.list li.opens-modal:hover .desc,
ul.list li.opens-modal:focus-visible .desc {
  color: var(--fg);
}
ul.list li:has(> a):hover .ic,
ul.list li.opens-modal:hover .ic,
ul.list li.opens-modal:focus-visible .ic {
  transform: translateX(2px);
}
ul.list li:has(> a):hover .arr,
ul.list li.opens-modal:hover .arr,
ul.list li.opens-modal:focus-visible .arr {
  transform: translateX(3px);
  color: var(--accent);
}

@media (max-width: 520px) {
  ul.list li { grid-template-columns: 28px 1fr auto; }
  ul.list .desc { display: block; margin-left: 0; margin-top: 2px; }
}

/* rows that open the modal instead of linking out */
ul.list li.opens-modal {
  cursor: pointer;
  outline: none;
}
ul.list li.opens-modal:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ranked list inside the modal (Coffee picks, etc.) */
.modal-body .ranked-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.modal-body .ranked-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.modal-body .ranked-list li:first-child { border-top: 1px solid var(--rule); }
.modal-body .ranked-list .rank {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.modal-body .ranked-list a {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 0;
  transition: color 200ms;
}
.modal-body .ranked-list a:hover {
  color: var(--accent);
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
  text-underline-offset: 0.18em;
}

/* CVE reports list (WP Registry published_cve export) */
.modal-body .cve-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.modal-body .cve-list li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.modal-body .cve-list li:first-child { border-top: 1px solid var(--rule); }
.modal-body .cve-sev {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 0;
  color: var(--dim);
}
.modal-body .cve-sev[data-sev="critical"] { color: #e07070; }
.modal-body .cve-sev[data-sev="high"] { color: #e0a060; }
.modal-body .cve-sev[data-sev="medium"] { color: #d0c060; }
.modal-body .cve-sev[data-sev="low"] { color: var(--faint); }
[data-mode="day"] .modal-body .cve-sev[data-sev="critical"] { color: #b04040; }
[data-mode="day"] .modal-body .cve-sev[data-sev="high"] { color: #b06820; }
.modal-body .cve-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal-body .cve-id {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 0;
  width: fit-content;
}
.modal-body .cve-id:hover {
  border-bottom: 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.modal-body .cve-title {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
  color: var(--fg);
  margin: 0;
}
.modal-body .cve-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.02em;
}
.modal-body .cve-foot {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  line-height: 1.5;
}
.modal-body .cve-foot a {
  font-size: inherit;
  border-bottom-color: var(--rule);
}

/* hide post-navigation hints when modal is in custom (non-post) mode */
.modal.no-nav .modal-hints { display: none; }

/* footer: "Send a signal" beside the Lancaster map, then a slim closing line */
footer.site-footer { margin-top: 80px; }
footer.site-footer .ic { width: 19px; height: 19px; color: var(--accent); }

.home-port {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 40px;
  align-items: start;
}
.signal h2 { margin-top: 0; }
.signal-lead { color: var(--dim); font-size: 21px; margin: 0 0 22px; text-wrap: pretty; }
.signal-links { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 16.5px; letter-spacing: 0.01em; }
.signal-links li { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.signal-links .ic { width: 20px; height: 20px; color: var(--accent); flex: none; }
.signal-links a { color: var(--fg); border-bottom: 1px solid transparent; transition: color 200ms, border-color 200ms; }
.signal-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.copy-email {
  margin-left: 2px;
  padding: 2px 9px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--dim);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
}
.copy-email:hover, .copy-email.is-copied { color: var(--accent); border-color: var(--accent); }

.footer-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.to-harbor { color: var(--dim); transition: color 200ms; }
.to-harbor:hover { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

::selection { background: var(--accent); color: var(--bg); }
a:focus-visible, button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   Single post template (fallback when JS is off / direct visit)
   ============================================================ */

article.single {
  max-width: 780px;
  margin: 0 auto;
  padding: 0;
}
article.single .modal-date { margin-top: 32px; }
article.single .modal-title { font-size: clamp(30px, 4vw, 40px); }
article.single .single-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
}
article.single .single-back:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================================
   Session heatmap (Command Center export)
   Rolling window: today is the right edge, weeks roll left.
   ============================================================ */

.heatmap-lead, .section-lead {
  font-size: 21px;
  color: var(--dim);
  margin: -6px 0 18px;
  text-wrap: pretty;
}
.heatmap-lead a {
  border-bottom: 1px solid var(--rule);
  transition: color 200ms, border-color 200ms;
}
.heatmap-lead a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.heatmap-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 14px 12px;
  overflow-x: auto;
  background: color-mix(in srgb, var(--fg) 3%, transparent);
}
.heatmap-card svg {
  display: block;
  width: 100%;
  min-width: 420px;
  height: auto;
}
.heatmap-skeleton {
  height: 98px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--fg) 4%, transparent) 0%,
    color-mix(in srgb, var(--fg) 9%, transparent) 50%,
    color-mix(in srgb, var(--fg) 4%, transparent) 100%
  );
  background-size: 200% 100%;
  animation: hm-shimmer 1.4s ease-in-out infinite;
}
@keyframes hm-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.heatmap-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--dim);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}
.heatmap-meta a {
  border-bottom: 1px solid var(--rule);
  transition: color 200ms, border-color 200ms;
}
.heatmap-meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.heatmap-legend svg { display: block; }

/* Emerald ramp — separate steps for night/day (dataviz sequential). */
.hm-l0 { fill: color-mix(in srgb, var(--fg) 8%, transparent); }
.hm-l1 { fill: color-mix(in srgb, var(--accent) 24%, var(--bg)); }
.hm-l2 { fill: color-mix(in srgb, var(--accent) 46%, var(--bg)); }
.hm-l3 { fill: color-mix(in srgb, var(--accent) 72%, var(--bg)); }
.hm-l4 { fill: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
[data-mode="day"] .hm-l0 { fill: color-mix(in srgb, var(--fg) 10%, transparent); }
[data-mode="day"] .hm-l4 { fill: var(--accent); }

.hm-cell { cursor: default; transition: stroke 120ms ease; }
.hm-cell:hover { stroke: var(--fg); stroke-width: 1; }
.hm-label {
  fill: var(--dim);
  font-size: 10px;
  font-family: var(--mono), ui-monospace, Menlo, monospace;
}

#heatmap-tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: #12151f;
  color: #e8e4d4;
  border: 1px solid rgba(232, 228, 212, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  max-width: 240px;
}
[data-mode="day"] #heatmap-tooltip {
  background: #1a1d2b;
  color: #f3ecd9;
  border-color: rgba(243, 236, 217, 0.12);
}
#heatmap-tooltip .hm-tip-value { font-weight: 500; letter-spacing: 0.01em; }
#heatmap-tooltip .hm-tip-sub { color: rgba(232, 228, 212, 0.55); margin-top: 2px; }
[data-mode="day"] #heatmap-tooltip .hm-tip-sub { color: rgba(243, 236, 217, 0.55); }
#heatmap-tooltip[hidden] { display: none !important; }

/* ============================================================
   Harbor masthead (front page). Line art in the icon style;
   the day/night toggle trades the sun and moon through the horizon.
   ============================================================ */

body { overflow-x: clip; } /* sky and sea run into the margins */

.harbor {
  --hb-ink: color-mix(in srgb, var(--fg) 62%, transparent);
  --hb-soft: color-mix(in srgb, var(--fg) 30%, transparent);
  margin: -44px 0 34px;
}
.harbor-art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.harbor-art * { vector-effect: non-scaling-stroke; }

.hb-ink, .hb-rays, .hb-gull, .hb-horizon, .hb-waves, .hb-glints path, .hb-dipper-line {
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hb-ink { stroke: var(--hb-ink); transition: stroke 500ms ease, fill 500ms ease; }
.hb-fill { fill: var(--bg); }
.hb-ink-accent { fill: var(--bg); stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; transition: stroke 500ms, fill 500ms; }
.hb-rays { stroke: var(--accent); }
.hb-band { fill: color-mix(in srgb, var(--accent) 34%, transparent); transition: fill 500ms; }
.hb-pennant { fill: var(--accent); transition: fill 500ms; }
.hb-horizon { stroke: var(--hb-soft); stroke-width: 1; }
.hb-waves { stroke: var(--hb-ink); animation: hb-sea var(--hb-sea, 22s) linear infinite; }
.hb-far  { --hb-sea: 34s; opacity: 0.38; }
.hb-mid  { --hb-sea: 27s; opacity: 0.6; }
.hb-near { --hb-sea: 21s; opacity: 0.8; }
@keyframes hb-sea { to { transform: translateX(var(--u)); } }

/* sky bodies wait below the horizon in the east (right). The incoming one rises from there;
   the outgoing one sets in the west (left), then harbor.js snaps it back east, out of sight. */
.hb-sun-x, .hb-moon-x { transform: translateX(84px); }
.hb-sun-y, .hb-moon-y { transform: translateY(132px); }
[data-mode="day"] .hb-sun-x, [data-mode="night"] .hb-moon-x { transform: none; transition: transform 1.7s cubic-bezier(.55,0,.6,.6) 1.45s; }
[data-mode="day"] .hb-sun-y, [data-mode="night"] .hb-moon-y { transform: none; transition: transform 1.7s cubic-bezier(.15,.5,.3,1) 1.45s; }
.harbor.sun-setting .hb-sun-x, .harbor.moon-setting .hb-moon-x { transform: translateX(-84px); transition: transform 1.4s cubic-bezier(.3,.5,.45,1); }
.harbor.sun-setting .hb-sun-y, .harbor.moon-setting .hb-moon-y { transform: translateY(132px); transition: transform 1.4s cubic-bezier(.6,0,.85,.5); }
.hb-sun, .hb-moon { cursor: pointer; }
.hb-rays { transform-box: view-box; transform-origin: 390px 46px; animation: hb-turn 90s linear infinite; }
@keyframes hb-turn { to { transform: rotate(360deg); } }

/* stars come out one by one after the moon is up; the dipper's lines draw last */
.hb-star { fill: var(--fg); opacity: 0; transition: opacity 400ms ease; animation: hb-twinkle var(--tw) ease-in-out var(--d) infinite alternate; }
[data-mode="night"] .hb-star { opacity: 1; transition: opacity 900ms ease calc(1s + var(--d)); }
.hb-dipper-star { fill: color-mix(in srgb, var(--fg) 85%, var(--accent)); }
.hb-polaris { fill: var(--accent); }
@keyframes hb-twinkle { from { fill-opacity: 1; } to { fill-opacity: 0.35; } }
.hb-dipper-line { stroke: color-mix(in srgb, var(--fg) 16%, transparent); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 300ms; }
.hb-pointer { stroke-dasharray: 0.04 0.06; stroke-dashoffset: 0; opacity: 0; transition: opacity 300ms; }
[data-mode="night"] .hb-dipper-line { stroke-dashoffset: 0; transition: stroke-dashoffset 2.6s cubic-bezier(.4,0,.2,1) 2.6s; }
[data-mode="night"] .hb-pointer { opacity: 1; transition: opacity 1.2s ease 4.8s; }

/* the lighthouse: lamp, halo flash and sweeping beam at night */
.hb-beam-stop { stop-color: var(--accent); }
.hb-lamp { fill: var(--bg); stroke: var(--hb-ink); stroke-width: 1; transition: fill 600ms ease .4s; }
[data-mode="night"] .hb-lamp { fill: var(--accent); stroke: var(--accent); transition-delay: 1.2s; }
.hb-halo { fill: url(#hb-halo-grad); opacity: 0; transform-box: fill-box; transform-origin: center; }
.hb-beam { fill: url(#hb-beam-grad); }
.hb-beam-wrap { opacity: 0; transition: opacity 500ms ease; }
[data-mode="night"] .hb-beam-wrap { opacity: 1; transition: opacity 1.4s ease 1.4s; }
[data-mode="night"] .hb-halo { animation: hb-flash 9s linear 1.4s infinite; }
.hb-beam { transform-box: fill-box; transform-origin: 0 50%; animation: hb-sweep 9s 1.4s infinite; }
@keyframes hb-sweep {
  0%   { transform: scaleX(1);      animation-timing-function: cubic-bezier(.12,0,.39,0); }
  25%  { transform: scaleX(0.002);  animation-timing-function: cubic-bezier(.61,1,.88,1); }
  50%  { transform: scaleX(-1);     animation-timing-function: cubic-bezier(.12,0,.39,0); }
  75%  { transform: scaleX(-0.002); animation-timing-function: cubic-bezier(.61,1,.88,1); }
  100% { transform: scaleX(1); }
}
@keyframes hb-flash {
  0%, 19% { opacity: .25; transform: scale(.6); }
  25%     { opacity: 1;   transform: scale(1.25); }
  31%, 100% { opacity: .25; transform: scale(.6); }
}

/* moonlight on the water */
.hb-glints { opacity: 0; transition: opacity 400ms; }
[data-mode="night"] .hb-glints { opacity: 1; transition: opacity 1.2s ease 2.4s; }
.hb-glints path { stroke: var(--accent); opacity: 0; }
[data-mode="night"] .hb-glints path { animation: hb-glint 2.8s ease-in-out var(--g) infinite alternate; }
@keyframes hb-glint { from { opacity: .15; } to { opacity: .75; } }

/* the sloop rides the swell and wanders a little; a masthead light at night */
.hb-boat { transform-box: fill-box; transform-origin: 50% 90%; animation: hb-bob 4.6s ease-in-out infinite alternate; }
.hb-drift { animation: hb-drift 38s ease-in-out infinite alternate; }
@keyframes hb-bob { from { transform: rotate(-1.8deg) translateY(-0.6px); } to { transform: rotate(1.6deg) translateY(1.1px); } }
@keyframes hb-drift { from { transform: translateX(-16px); } to { transform: translateX(18px); } }
.hb-masthead { fill: var(--accent); opacity: 0; transition: opacity 500ms; }
[data-mode="night"] .hb-masthead { opacity: 1; transition: opacity 800ms ease 1.6s; }

/* gulls by day */
.hb-gull { stroke: var(--hb-ink); transform-box: fill-box; transform-origin: center; animation: hb-flap .9s ease-in-out infinite alternate; }
.hb-gull-2 { animation-delay: -.4s; animation-duration: 1.1s; }
.hb-gulls { opacity: 1; transition: opacity 1s ease 1s; }
[data-mode="night"] .hb-gulls { opacity: 0; transition: opacity 500ms; }
.hb-gull-path { animation: hb-glide 26s ease-in-out infinite alternate; }
@keyframes hb-flap { from { transform: scaleY(1); } to { transform: scaleY(.45) translateY(1px); } }
@keyframes hb-glide { from { transform: translate(-30px, 4px); } to { transform: translate(70px, -6px); } }

/* no transitions on first paint (a stored "day" shouldn't play a sunrise); pause off screen */
.harbor:not(.is-ready) * { transition: none !important; }
.harbor.is-paused * { animation-play-state: paused !important; }

@media (max-width: 600px) {
  .harbor { margin: -56px 0 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .harbor * { animation: none !important; transition-duration: 0s !important; transition-delay: 0s !important; }
  [data-mode="night"] .hb-beam { transform: scaleX(-0.85); }
  [data-mode="night"] .hb-glints path { opacity: .45; }
}

/* ============================================================
   Lantern light: interactive rows glow where the pointer is
   (main.js sets --mx/--my) and the rule beneath catches the light.
   ============================================================ */

:root { --lantern: color-mix(in srgb, var(--accent) 17%, transparent); }
[data-mode="day"] { --lantern: color-mix(in srgb, #fffaf0 75%, transparent); }

ul.list li:has(> a), ul.list li.opens-modal, a.tl-entry { --mx: 50%; --my: 50%; isolation: isolate; }
a.tl-entry { position: relative; margin: 0 -12px; padding: 12px; border-radius: 4px; }

ul.list li:has(> a)::before, ul.list li.opens-modal::before, a.tl-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx) var(--my), var(--lantern), transparent 72%);
  opacity: 0;
  transition: opacity 300ms ease;
}
/* log rows have no rules to meet the glow, so theirs is a flat ellipse that fades out inside the row */
a.tl-entry::before { background: radial-gradient(210px 30px at var(--mx) 50%, var(--lantern), transparent); }

ul.list li:has(> a)::after, ul.list li.opens-modal::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: radial-gradient(170px 100% at var(--mx) 50%, color-mix(in srgb, var(--accent) 80%, transparent), transparent);
  opacity: 0;
  transition: opacity 300ms ease;
}
ul.list li:has(> a):hover::before, ul.list li:has(> a):hover::after,
ul.list li:has(> a):focus-within::before, ul.list li:has(> a):focus-within::after,
ul.list li.opens-modal:hover::before, ul.list li.opens-modal:hover::after,
ul.list li.opens-modal:focus-visible::before, ul.list li.opens-modal:focus-visible::after,
a.tl-entry:hover::before, a.tl-entry:focus-visible::before { opacity: 1; }

/* ============================================================
   Row icons (inc/icons.php): each acts out its name on hover/focus.
   ============================================================ */

.ic-anim * { transform-box: view-box; }
.ic-lamp { fill: none; transition: fill 200ms; }
.ic-rays { opacity: 0; }
.ic-dot, .ic-blip { fill: currentColor; stroke: none; }
.ic-faint { opacity: .45; }
.ic-blip { opacity: 0; }
.ic-tick, .ic-line, .ic-wave { stroke-dasharray: 1; stroke-dashoffset: 0; }
.ic-rail { stroke-dasharray: 2.6 1.9; }
.ic-bar { vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: 50% 100%; }
.ic-bubble { transform-box: fill-box; transform-origin: 30% 80%; }
.ic-bubble[style*="--i:1"] { transform-origin: 70% 80%; }
.ic-solid { fill: currentColor; }
.ic-step { fill: currentColor; stroke: none; }
.ic-strike { stroke-dasharray: 1; stroke-dashoffset: 0; }
.ic-step, .ic-cell, .ic-eye, .ic-press, .ic-flip, .ic-play { transform-box: fill-box; transform-origin: center; }
.ic-progress { stroke-dasharray: 1; stroke-dashoffset: .62; }
.ic-squeak { opacity: 0; }

.ic-swing   { transform-origin: 12px 3px; }
.ic-gear    { transform-origin: 12px 12px; }
.ic-launch  { transform-origin: 12px 13px; }
.ic-page    { transform-origin: 12px 12px; }
.ic-needle  { transform-origin: 12px 12px; }
.ic-sweep   { transform-origin: 12px 12px; }
.ic-scope   { transform-origin: 11.5px 12px; }
.ic-rose    { transform-origin: 12px 12px; }
.ic-ball    { transform-origin: 12px 12px; }
.ic-coral   { transform-origin: 12px 21.6px; }
.ic-tilt    { transform-origin: 12px 19px; }
.ic-hopper  { transform-origin: 12px 17px; }
.ic-ollie   { transform-origin: 12px 14px; }
.ic-alive   { transform-origin: 12px 15.5px; }
.ic-lid     { transform-origin: 12px 15.5px; }
.ic-wisp path { opacity: 0; }

:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-swing   { animation: ic-swing 1.15s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-gear    { animation: ic-gear 1.1s cubic-bezier(.3,1.5,.5,1); }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-lamp    { fill: currentColor; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-rays    { animation: ic-flash 1.8s ease-in-out infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-page    { animation: ic-page .75s cubic-bezier(.45,0,.3,1); }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-tick    { animation: ic-draw .32s ease-out calc(.1s + var(--i) * .2s) both; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-needle  { animation: ic-needle 1.5s ease-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-cursor  { animation: ic-blink 1s steps(1) infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-prompt  { animation: ic-nudge .5s ease-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-sail    { animation: ic-sail 1.5s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-lap     { animation: ic-lap 1.8s ease-in-out infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-sidebar { animation: ic-slide .8s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-line    { animation: ic-draw .3s ease-out calc(.15s + var(--i) * .12s) both; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-scope   { animation: ic-scope 2s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-crate   { animation: ic-crate 1.1s ease-out both; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-launch  { animation: ic-launch 1.5s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-rail    { animation: ic-rail 1.5s linear; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-bubble  { animation: ic-pop 1.4s ease-in-out calc(var(--i) * .7s) infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-sweep   { animation: ic-spin 1.6s linear infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-blip    { animation: ic-blip 1.6s ease-out .9s infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-blip-2  { animation-delay: .25s; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-wave    { animation: ic-draw .9s cubic-bezier(.45,0,.25,1) both; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-bar     { animation: ic-level .5s ease-in-out calc(var(--i) * -.13s) infinite alternate; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-bar[style*="--i:1"],
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-bar[style*="--i:3"] { animation-duration: .62s; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-steam path { animation: ic-steam 1.5s ease-in-out calc(var(--i) * .3s) infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-call    { animation: ic-call 1.3s ease-out infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-rose    { animation: ic-rose 1.5s cubic-bezier(.45,0,.25,1); }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-nag     { animation: ic-nag .45s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-strike  { animation: ic-draw .22s ease-out calc(.4s + var(--i) * .16s) both; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-ball    { animation: ic-bounce 1.2s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-step    { animation: ic-hop .42s ease-in-out calc(var(--i) * .08s); }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-coral   { animation: ic-sway 2.2s ease-in-out infinite; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-part    { animation: ic-part .9s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-scan    { animation: ic-scan 1.5s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-tilt    { animation: ic-tilt 1.3s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-eye     { animation: ic-wink 1.3s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-look    { animation: ic-look 1.6s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-hopper  { animation: ic-popcorn 1.1s ease-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-squeak  { animation: ic-squeak 1.1s ease-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-press   { animation: ic-cell .3s ease-in-out .55s; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-ollie   { animation: ic-ollie 1.2s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-flip    { animation: ic-kickflip 1.2s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-alive   { animation: ic-alive 1.2s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-boot    { animation: ic-boot .9s steps(1); }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-lid     { animation: ic-lid 2.6s ease-in-out; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, ul.list li.opens-modal:hover, .app:hover, .app:focus-visible) .ic-wisp path { animation: ic-steam 1s ease-in-out calc(.6s + var(--i) * .15s) both; }
:is(ul.list li:has(> a):hover, ul.list li:focus-within, .apps-toggle:hover, .apps-toggle:focus-visible) .ic-cell { animation: ic-cell .5s ease-in-out calc(var(--i) * .07s); }
:is(.videos-toggle:hover, .videos-toggle:focus-visible) .ic-play { animation: ic-cell .35s ease-in-out; }
:is(.videos-toggle:hover, .videos-toggle:focus-visible) .ic-progress { animation: ic-progress 1.6s cubic-bezier(.4,0,.6,1) .25s both; }

@keyframes ic-swing  { 18% { transform: rotate(-16deg); } 40% { transform: rotate(11deg); } 62% { transform: rotate(-6deg); } 82% { transform: rotate(2.5deg); } }
@keyframes ic-gear   { to { transform: rotate(45deg); } }
@keyframes ic-flash  { 0%, 100% { opacity: 0; } 12% { opacity: 1; } 30% { opacity: .1; } 46% { opacity: 1; } 70% { opacity: 0; } }
@keyframes ic-page   { from { transform: scaleX(1); } to { transform: scaleX(-1); } }
@keyframes ic-draw   { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ic-needle { 18% { transform: rotate(42deg); } 40% { transform: rotate(-28deg); } 60% { transform: rotate(14deg); } 80% { transform: rotate(-5deg); } }
@keyframes ic-blink  { 50% { opacity: 0; } }
@keyframes ic-nudge  { 40% { transform: translateX(1.5px); } }
@keyframes ic-sail   { 45% { transform: translateX(13px); opacity: 0; } 46% { transform: translateX(-13px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes ic-lap    { 33% { transform: translateX(1.6px); } 66% { transform: translateX(-1.2px); } }
@keyframes ic-slide  { 45% { transform: translateX(2.5px); } }
@keyframes ic-scope  { 22% { transform: translateY(-3px); } 36%, 58% { transform: translateY(-3px) scaleX(-1); } 74% { transform: translateY(-3px); } }
@keyframes ic-crate  { 0% { transform: translateY(-9px); opacity: 0; } 50% { transform: none; opacity: 1; } 64% { transform: translateY(-1.2px); } 80% { transform: none; } }
@keyframes ic-launch { 40%, 62% { transform: translate(2.6px, -0.7px) rotate(-2deg); } }
@keyframes ic-rail   { to { stroke-dashoffset: -9; } }
@keyframes ic-pop    { 0%, 50%, 100% { transform: none; } 18% { transform: scale(1.16); } 34% { transform: scale(.96); } }
@keyframes ic-spin   { to { transform: rotate(360deg); } }
@keyframes ic-blip   { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ic-level  { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
@keyframes ic-steam  { 0% { transform: translateY(1px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-2.5px); opacity: 0; } }
@keyframes ic-call   { 0%, 100% { opacity: .3; transform: none; } 45% { opacity: 1; transform: translateX(calc(var(--dx) * 1.3px)); } }
@keyframes ic-rose   { 70% { transform: rotate(196deg); } 86% { transform: rotate(175deg); } 100% { transform: rotate(180deg); } }
@keyframes ic-nag    { 25% { transform: translateX(-1px); } 50% { transform: translateX(1px); } 75% { transform: translateX(-.5px); } }
@keyframes ic-bounce { 30% { transform: translateY(-2px) rotate(-80deg); } 55% { transform: rotate(-150deg); } 72% { transform: translateY(-.8px) rotate(-170deg); } 88%, 100% { transform: rotate(-180deg); } }
@keyframes ic-hop    { 45% { transform: translateY(-1.8px); } }
@keyframes ic-sway   { 25% { transform: rotate(-4deg); } 75% { transform: rotate(3.5deg); } }
@keyframes ic-part   { 40%, 60% { transform: translateX(calc(var(--dx) * 1.6px)); } }
@keyframes ic-scan   { 30% { transform: translate(-3.5px, -4.5px); } 62% { transform: translate(-1px, -1.6px); } }
@keyframes ic-cell   { 40% { transform: scale(.72); } }
@keyframes ic-tilt   { 30%, 65% { transform: rotate(-9deg); } }
@keyframes ic-wink   { 0%, 44%, 56%, 100% { transform: none; } 50% { transform: scaleY(.15); } }
@keyframes ic-look   { 25%, 45% { transform: translateX(3.2px); } 65%, 80% { transform: translateX(-.8px); } }
@keyframes ic-popcorn { 25% { transform: translateY(-3px) rotate(-7deg); } 45% { transform: none; } 62% { transform: translateY(-1.4px) rotate(4deg); } 78% { transform: none; } }
@keyframes ic-squeak { 0%, 100% { opacity: 0; } 20%, 60% { opacity: 1; } }
@keyframes ic-ollie  { 30% { transform: translateY(-3px) rotate(-10deg); } 55% { transform: translateY(-3.2px) rotate(6deg); } 78% { transform: none; } }
@keyframes ic-kickflip { 0%, 30% { transform: none; } 50% { transform: scaleY(-1); } 70%, 100% { transform: none; } }
@keyframes ic-boot   { 0% { opacity: 0; } 25% { opacity: 1; } 35% { opacity: .2; } 50%, 100% { opacity: 1; } }
@keyframes ic-alive  { 20% { transform: translateY(-2.6px) rotate(-8deg) scale(1.1); } 40% { transform: none; } 58% { transform: translateY(-1.6px) rotate(6deg) scale(1.05); } 76% { transform: none; } }
@keyframes ic-lid    { 22%, 76% { transform: scaleY(.12); } }
@keyframes ic-progress { from { stroke-dashoffset: .62; } 80%, to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ic-anim *, .ic-anim *::before { animation: none !important; }
  ul.list li::before, ul.list li::after, a.tl-entry::before { transition: none; }
}

/* ============================================================
   Footer home port: Lancaster County as line art (parts/lancaster.php).
   main.js arms it and draws the outline the first time it's in view.
   ============================================================ */

.lancaster-map { margin: 0; display: flex; flex-direction: column; align-items: flex-end; max-width: 100%; }
.lancaster-map svg { display: block; width: 260px; max-width: 100%; height: auto; overflow: visible; }
.lancaster-map svg * { vector-effect: non-scaling-stroke; }
.lancaster-map figcaption {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-top: 10px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--faint);
}
.hp-time { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; color: var(--fg); }
.lancaster-map .hp-time-icon { width: 16px; height: 16px; color: var(--accent); }

.hp-county { fill: color-mix(in srgb, var(--accent) 5%, transparent); stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.hp-river { fill: none; stroke: var(--accent); stroke-opacity: .2; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.hp-label { font-family: var(--serif); font-style: italic; font-size: 12px; fill: var(--dim); letter-spacing: 0; text-transform: none; }
.hp-city-label { font-size: 13px; fill: var(--fg); }
.hp-north path { fill: none; stroke: var(--dim); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.hp-north text { font-family: var(--mono); font-size: 9.5px; fill: var(--dim); letter-spacing: 0; }
.hp-dot { fill: var(--accent); }
.hp-ping { fill: none; stroke: var(--accent); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: hp-ping 3.2s ease-out infinite; }
@keyframes hp-ping { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(4.2); opacity: 0; } }

/* armed (JS present): hidden until it scrolls into view, then the border draws itself,
   the river fills in, and the city lights up last */
.lancaster-map.is-armed .hp-county { stroke-dashoffset: 1; fill-opacity: 0; }
.lancaster-map.is-armed :is(.hp-river, .hp-label, .hp-north, .hp-city) { opacity: 0; }
.lancaster-map.is-armed.is-drawn .hp-county { stroke-dashoffset: 0; fill-opacity: 1; transition: stroke-dashoffset 2.8s cubic-bezier(.45,0,.2,1), fill-opacity 1s ease 2.4s; }
.lancaster-map.is-armed.is-drawn .hp-river { opacity: 1; transition: opacity 1.2s ease 1.6s; }
.lancaster-map.is-armed.is-drawn :is(.hp-label, .hp-north) { opacity: 1; transition: opacity 1s ease 2.4s; }
.lancaster-map.is-armed.is-drawn .hp-city { opacity: 1; transition: opacity .5s ease 2.8s; }

@media (max-width: 640px) {
  .home-port { grid-template-columns: 1fr; }
  .lancaster-map, .lancaster-map figcaption { align-items: flex-start; }
}
@media (max-width: 420px) {
  .footer-line { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-ping { animation: none; opacity: 0; }
}

/* ============================================================
   Voyage (harbor easter egg, harbor.js): at night the bright stars
   sail the page out to sea. The page fades, the drawing goes
   full-window, more stars and open water fill in; esc or the
   button brings you back to shore.
   ============================================================ */

html:has(.harbor) { scrollbar-gutter: stable; }
.harbor-art { pointer-events: none; }
.hb-sun, .hb-moon { pointer-events: auto; }

/* the bright stars: a soft four-point glint, only out (and clickable) at night */
.hb-bright { cursor: pointer; opacity: 0; transition: opacity 400ms ease; }
[data-mode="night"] .hb-bright { opacity: 1; transition: opacity 900ms ease 1.8s; }
.hb-bright-hit { fill: transparent; }
[data-mode="night"] .hb-bright-hit { pointer-events: all; }
.hb-bright-core { fill: var(--fg); transform-box: fill-box; transform-origin: center; transition: transform 300ms ease; }
.hb-bright-glint {
  stroke: var(--fg);
  stroke-width: 0.9;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  animation: hb-glint-tw 3.4s ease-in-out infinite alternate;
}
.hb-polaris .hb-bright-core { fill: var(--accent); }
.hb-polaris .hb-bright-glint { stroke: var(--accent); }
.hb-bright:hover .hb-bright-glint { animation: none; opacity: 1; transform: scale(1.7) rotate(45deg); transition: transform 350ms ease, opacity 350ms ease; }
.hb-bright:hover .hb-bright-core { transform: scale(1.45); }
.hb-bright.is-wished .hb-bright-glint { animation: hb-wish 1s ease-out; }
@keyframes hb-glint-tw { from { opacity: .25; transform: scale(.55); } to { opacity: .75; transform: scale(1); } }
@keyframes hb-wish { 0% { opacity: 1; transform: scale(1.7) rotate(45deg); } 100% { opacity: 0; transform: scale(5) rotate(135deg); } }

/* the page steps aside */
html.has-voyage .wrap > :not(.harbor) { transition: opacity 800ms ease; }
html.voyage-dim .wrap > :not(.harbor) { opacity: 0.001; }   /* invisible, but kept painted so fading back in doesn't stall on a repaint */
html.is-voyage { overflow: hidden; }

/* the drawing takes the whole window; the edge fades lift so sky and sea run to every edge */
.harbor-art.is-voyage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; }
#hb-fade-grad stop, #hb-sea-grad stop { transition: stop-opacity 1.2s ease; }
.harbor-art.is-voyage-open #hb-fade-grad stop, .harbor-art.is-voyage-open #hb-sea-grad stop { stop-opacity: 1; }

/* what the voyage adds: stars rippling out from the one you clicked, rows of open water, a moonlit path */
.hb-vstar { fill: var(--fg); opacity: 0; transition: opacity 600ms ease; animation: hb-twinkle var(--tw) ease-in-out var(--d) infinite alternate; }
.is-voyage-open .hb-vstar { opacity: 1; transition: opacity 1.1s ease var(--d); }
/* landing: the added layers hold still and fade out whole, not as hundreds of separate fades */
.is-landing :is(.hb-vstar, .hb-vglints) { opacity: 1; transition: none; }
.is-landing .hb-vwave { opacity: var(--o); transition: none; }
.is-landing :is(.hb-vstar, .hb-vwave, .hb-vglints path) { animation-play-state: paused; }
.is-landing :is(.hb-voyage-sky, .hb-voyage-sea) { opacity: 0; transition: opacity 500ms ease; }
.hb-vwave { opacity: 0; transition: opacity 600ms ease; }
.is-voyage-open .hb-vwave { opacity: var(--o); transition: opacity 1.2s ease var(--d); }
.hb-vglints { opacity: 0; transition: opacity 600ms ease; }
.is-voyage-open .hb-vglints { opacity: 1; transition: opacity 1.6s ease 1.8s; }
.hb-vglints path { fill: none; stroke: var(--accent); stroke-width: 1.25; stroke-linecap: round; animation: hb-glint 2.8s ease-in-out var(--g) infinite alternate; }
.hb-meteor-stop { stop-color: var(--fg); }
.hb-meteor { stroke: url(#hb-meteor-grad); stroke-width: 1.4; stroke-linecap: round; opacity: 0; animation: hb-meteor 1.15s cubic-bezier(.2,.6,.35,1) forwards; }
@keyframes hb-meteor { 0% { opacity: 0; transform: none; } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--mx), var(--my)); } }

/* the way back */
.voyage-return {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 31;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 20px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg) 22%, transparent);
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition: opacity 400ms ease, transform 400ms ease, visibility 0s linear 400ms, color 200ms, border-color 200ms;
}
html.voyage-open .voyage-return {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 800ms ease 2.4s, transform 800ms ease 2.4s, visibility 0s linear 2.4s, color 200ms, border-color 200ms;
}
.voyage-return:hover, .voyage-return:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; border-radius: 999px; }
.voyage-return kbd {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  color: var(--dim);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
@media (hover: none) {
  .voyage-return { padding-right: 20px; }
  .voyage-return kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.has-voyage .wrap > :not(.harbor), .voyage-return, html.voyage-open .voyage-return { transition-duration: 0s; transition-delay: 0s; }
}

/* click the boat: it surges ahead over a swell with a little bow spray and a wake, then drifts back */
.hb-boat-hit { fill: transparent; pointer-events: all; cursor: pointer; }
.hb-sail-on { transform-box: fill-box; transform-origin: 50% 90%; }
.hb-sail-on.is-sailing { animation: hb-surge 3.6s cubic-bezier(.25,.6,.3,1); }
@keyframes hb-surge {
  10%  { transform: translate(-5px, -1.5px) rotate(6deg); }
  24%  { transform: translate(-20px, 0) rotate(-3deg); }
  36%  { transform: translate(-30px, 0.5px) rotate(1.5deg); }
  48%  { transform: translate(-32px, 0) rotate(-0.5deg); }
}
.hb-wake { fill: none; stroke: var(--hb-ink); stroke-width: 1.1; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: 0 50%; }
.is-sailing .hb-wake { animation: hb-wake 1.9s ease-out .1s; }
@keyframes hb-wake { 0% { opacity: 0; transform: scaleX(.3); } 18% { opacity: .9; } 100% { opacity: 0; transform: translateX(16px) scaleX(1.6); } }
.hb-spray circle { fill: var(--fg); opacity: 0; }
.is-sailing .hb-spray circle { animation: hb-spray .9s ease-out .12s; }
@keyframes hb-spray {
  0%   { opacity: 0; transform: none; }
  20%  { opacity: 1; }
  55%  { transform: translate(calc(var(--sx) * .6), var(--sy)); }
  100% { opacity: 0; transform: translate(var(--sx), 4px); }
}

/* the helm: a wake off the stern while the boat is steered, and a hint for the keys */
.hb-trail { fill: none; stroke: var(--hb-ink); stroke-width: 1.1; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: center; animation: hb-trail 1.6s ease-out forwards; }
@keyframes hb-trail { 0% { opacity: .85; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.9, 1.2); } }
.voyage-hint {
  position: fixed;
  left: 50%;
  bottom: calc(max(28px, env(safe-area-inset-bottom)) + 64px);
  z-index: 31;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--dim);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.voyage-hint kbd { font: inherit; font-size: 12px; min-width: 22px; padding: 1px 5px; text-align: center; border: 1px solid var(--rule); border-radius: 4px; color: var(--fg); }
.voyage-hint kbd:last-of-type { margin-right: 4px; }
html.voyage-open .voyage-hint { opacity: 1; transform: translate(-50%, 0); transition: opacity 800ms ease 3.2s, transform 800ms ease 3.2s; }
html.voyage-open.voyage-steered .voyage-hint { opacity: 0; transition: opacity 600ms ease; }
@media (hover: none) { .voyage-hint { display: none; } }

/* ============================================================
   Globe (assets/js/globe.js): the footer map opens a spinnable
   Earth with Lancaster County still outlined in gold.
   ============================================================ */

.lancaster-map > svg { cursor: pointer; border-radius: 6px; }
.lancaster-map .hp-county { transition: fill 300ms ease; }
.lancaster-map > svg:hover .hp-county, .lancaster-map > svg:focus-visible .hp-county { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.lancaster-map > svg:focus-visible { outline: 1px solid var(--accent); outline-offset: 6px; }

html.has-globe .wrap > * { transition: opacity 700ms ease; }
html.globe-dim .wrap > * { opacity: 0.001; }
html.globe-open { overflow: hidden; }

.globe-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; touch-action: none; cursor: grab; }
.globe-canvas.is-dragging { cursor: grabbing; }

html.globe-open .globe-return {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 800ms ease 3s, transform 800ms ease 3s, visibility 0s linear 3s, color 200ms, border-color 200ms;
}
html.globe-open .globe-hint { opacity: 1; transform: translate(-50%, 0); transition: opacity 800ms ease 3.4s, transform 800ms ease 3.4s; }
html.globe-open.globe-spun .globe-hint { opacity: 0; transition: opacity 600ms ease; }
@media (hover: none) { .globe-hint { display: inline-flex; } }

.globe-caption {
  position: fixed;
  top: max(30px, env(safe-area-inset-top));
  left: 50%;
  z-index: 31;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--fg);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.globe-caption span { display: block; margin-top: 4px; font-family: var(--mono); font-style: normal; font-size: 13px; letter-spacing: 0.08em; color: var(--dim); }
html.globe-open .globe-caption { opacity: 1; transform: translate(-50%, 0); transition: opacity 800ms ease 2.8s, transform 800ms ease 2.8s; }
@media (prefers-reduced-motion: reduce) {
  html.has-globe .wrap > *, html.globe-open .globe-return, html.globe-open .globe-hint, html.globe-open .globe-caption { transition-duration: 0s; transition-delay: 0s; }
}

/* ============================================================
   Apps shelf (inc/apps.php, assets/js/apps.js): every project as
   a home screen of icons. The page steps back and fades, the icons
   fly in and settle on their grid; esc or the button brings the
   page forward again.
   ============================================================ */

/* the way in: an Apps button beside the day/night toggle (and Videos before it), and the last row of The Workshop */
.top-actions { display: inline-flex; align-items: center; gap: 26px; }
.apps-toggle[hidden], .videos-toggle[hidden], ul.list li[hidden] { display: none; }
.apps-toggle-label, .videos-toggle-label { text-transform: uppercase; }
@media (max-width: 600px) { .apps-toggle-label, .videos-toggle-label { display: none; } }   /* icons alone; the buttons keep their labels */
@media (max-width: 440px) {
  .top-actions { gap: 18px; }
  #modeLabel { display: none; }   /* the moon or sun alone, beside them */
}
@media (max-width: 374px) {
  .top { font-size: 15px; }
  .top-actions { gap: 14px; }
}

/* the page steps back; the harbor holds still behind it (the video shelf does the same) */
html:is(.has-apps, .has-videos) { overflow: hidden; scrollbar-gutter: stable; }
html:is(.has-apps, .has-videos) .wrap { transition: opacity 550ms cubic-bezier(.4,0,.2,1), transform 800ms cubic-bezier(.22,1,.36,1); }
html:is(.apps-dim, .videos-dim) .wrap { opacity: 0.001; transform: scale(.94); }   /* invisible, but kept painted for the way back */
html:is(.apps-open, .videos-open) .harbor * { animation-play-state: paused !important; }

.apps, .videos {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}
.apps[hidden], .videos[hidden] { display: none; }
/* a lantern glow over the shelf, and a fade under the button so icons don't scroll into it */
:is(.apps, .videos)::before, :is(.apps, .videos)::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms ease;
}
:is(.apps, .videos)::before { top: 0; height: 70vh; background: radial-gradient(ellipse 60% 75% at 50% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 72%); }
:is(.apps, .videos)::after { bottom: 0; height: 120px; z-index: 1; background: linear-gradient(to bottom, transparent, var(--bg) 72%); }
html.apps-open .apps::before, html.videos-open .videos::before { opacity: 1; transition: opacity 1.2s ease .2s; }
html.apps-open .apps::after, html.videos-open .videos::after { opacity: 1; transition: opacity 600ms ease .8s; }

.apps-inner, .videos-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(56px, 11vh, 120px) clamp(16px, 5vw, 48px) 150px;
}
.apps-head { text-align: center; margin-bottom: clamp(36px, 6vh, 60px); }
.apps-eyebrow {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
}
.apps-title {
  display: block;
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--fg);
  text-wrap: balance;
}
.apps-title em { font-style: italic; color: var(--accent); }

.apps-group + .apps-group { margin-top: clamp(28px, 5vh, 44px); }
.apps-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
}
.apps-group-title .ic { width: 17px; height: 17px; color: var(--accent); }
.apps-group-title::after { content: ""; flex: 1; height: 1px; margin-left: 6px; background: var(--rule); }

.apps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 4px 10px;
}

/* a tile: the icon on its rounded square, the name, and what it is */
.app {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 6px 14px;
  border-radius: 18px;
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}
.app::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -14px;
  width: 170px;
  height: 150px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--lantern), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
}
.app-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 12px;
  border-radius: 21px;
  color: var(--accent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--fg) 9%, var(--bg)), color-mix(in srgb, var(--fg) 3%, var(--bg)));
  border: 1px solid color-mix(in srgb, var(--fg) 13%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--fg) 9%, transparent), 0 14px 28px -16px rgba(0, 0, 0, 0.85);
  transition: transform 350ms cubic-bezier(.3,1.5,.5,1), border-color 250ms ease, box-shadow 350ms ease;
}
.app-icon .ic { width: 36px; height: 36px; }
.app-icon .ic-bar { stroke-width: 2.1; }   /* the levels keep a screen-space stroke; match the others at this size */
.apps-group-fleet .app-icon {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 24%, var(--bg)), color-mix(in srgb, var(--accent) 8%, var(--bg)));
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
}
[data-mode="day"] .app-icon {
  background: linear-gradient(160deg, #fffaf0, color-mix(in srgb, var(--fg) 4%, var(--bg)));
  border-color: color-mix(in srgb, var(--fg) 14%, transparent);
  box-shadow: inset 0 1px 0 #fffdf6, 0 12px 24px -16px rgba(26, 29, 43, 0.5);
}
[data-mode="day"] .apps-group-fleet .app-icon {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, #fffaf0), color-mix(in srgb, var(--accent) 14%, var(--bg)));
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.app-name {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.25;
  transition: color 200ms ease;
}
.app-desc {
  margin-top: 4px;
  max-width: 17em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.35;
  color: var(--dim);
  text-wrap: pretty;
  transition: color 200ms ease;
}
.app:hover::before, .app:focus-visible::before { opacity: 1; }
.app:hover .app-icon, .app:focus-visible .app-icon {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--fg) 9%, transparent), 0 20px 34px -16px rgba(0, 0, 0, 0.9), 0 0 0 5px color-mix(in srgb, var(--accent) 9%, transparent);
}
[data-mode="day"] .app:hover .app-icon, [data-mode="day"] .app:focus-visible .app-icon {
  box-shadow: inset 0 1px 0 #fffdf6, 0 18px 30px -16px rgba(26, 29, 43, 0.55), 0 0 0 5px color-mix(in srgb, var(--accent) 8%, transparent);
}
.app:active .app-icon { transform: scale(.94); transition-duration: 90ms; }
.app:hover .app-name, .app:focus-visible .app-name { color: var(--accent); }
.app:hover .app-desc, .app:focus-visible .app-desc { color: var(--fg); }
.app:focus-visible { outline-offset: -2px; border-radius: 18px; }

/* the way back: the voyage's button, shown once the icons have landed */
html.apps-open .apps-return, html.videos-open .videos-return {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 700ms ease .9s, transform 700ms ease .9s, visibility 0s linear .9s, color 200ms, border-color 200ms;
}

/* phones: three across, smaller icons */
@media (max-width: 560px) {
  .apps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 4px; }
  .app { padding: 12px 2px 10px; border-radius: 16px; }
  .app::before { width: 130px; height: 120px; top: -10px; }
  .app-icon { width: 62px; height: 62px; border-radius: 17px; margin-bottom: 9px; }
  .app-icon .ic { width: 30px; height: 30px; }
  .app-icon .ic-bar { stroke-width: 1.75; }
  .app-name { font-size: 15.5px; }
  .app-desc { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html:is(.has-apps, .has-videos) .wrap { transition: none; }
  html:is(.apps-dim, .videos-dim) .wrap { transform: none; }
  .apps::before, .apps::after, html.apps-open .apps::before, html.apps-open .apps::after, .apps-return, html.apps-open .apps-return { transition-duration: 0s; transition-delay: 0s; }
  .app-icon { transition: none; }
}

/* ============================================================
   Chart (assets/js/chart.js, assets/chart.svg from
   scripts/build-chart.py): the map button on the apps shelf
   unrolls a made-up sea chart with every project as a landmark.
   The icons fly off the shelf onto their spots while the coast
   draws itself in; esc or the button sends them home.
   ============================================================ */

/* the way in: a map beside the count, easy to miss */
.apps-map {
  display: inline-grid;
  place-items: center;
  margin: -6px 0 -6px 12px;
  padding: 5px;
  vertical-align: -1px;
  color: var(--faint);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: color 200ms ease;
}
.apps-map[hidden] { display: none; }
.apps-map .ic { width: 19px; height: 19px; }
.apps-map:hover, .apps-map:focus-visible { color: var(--accent); }
.apps-map .ic-route { stroke-dasharray: 1; stroke-dashoffset: 1; }
.apps-map .ic-x { opacity: 0; }
.apps-map:hover .ic-route, .apps-map:focus-visible .ic-route { stroke-dashoffset: 0; transition: stroke-dashoffset .7s cubic-bezier(.4,0,.2,1); }
.apps-map:hover .ic-x, .apps-map:focus-visible .ic-x { opacity: 1; transition: opacity .2s ease .6s; }

/* the shelf stays where it is, under the chart's icons on their way out and back */
html.has-chart .apps { overflow: hidden; }
html.has-chart .apps-inner { z-index: 1; pointer-events: none; }
html.has-chart .apps::before, html.has-chart .apps::after { opacity: 0; transition: opacity 400ms ease; }
html.has-chart .apps-return { opacity: 0; visibility: hidden; transform: translate(-50%, 10px); transition: opacity 300ms ease, transform 300ms ease, visibility 0s linear 300ms; }

.chart {
  --ch-ink: color-mix(in srgb, var(--fg) 80%, transparent);
  --ch-soft: color-mix(in srgb, var(--fg) 34%, transparent);
  --ch-faint: color-mix(in srgb, var(--fg) 20%, transparent);
  --ch-land: color-mix(in srgb, var(--fg) 4.5%, var(--bg));
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 500ms ease 250ms;
}
.chart[hidden] { display: none; }
html.chart-open .chart { opacity: 1; }
html.has-chart:not(.chart-open) .chart { transition: opacity 450ms ease 350ms; }
[data-mode="day"] .chart { --ch-land: color-mix(in srgb, #fffaf0 55%, var(--bg)); --ch-faint: color-mix(in srgb, var(--fg) 24%, transparent); }

.chart-scroll {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: auto;
  overscroll-behavior: contain;
  outline: none;
  scrollbar-width: none;
}
.chart-scroll::-webkit-scrollbar { display: none; }
.chart-map {
  flex: none;
  display: block;
  margin: auto;
  width: min(100vw - 40px, (100vh - 120px) * 1.6, 1760px);
  height: auto;
  padding: 24px 0 88px;
  box-sizing: content-box;
  overflow: hidden;
  font-family: var(--serif);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* phones and narrow windows: full height, pan across */
@media (max-width: 820px), (max-aspect-ratio: 1/1) {
  .chart-map { width: calc((100svh - 130px) * 1.6); min-width: 980px; padding: 20px 16px 96px; }
}

/* scenery */
.ch-land { fill: var(--ch-land); }
.ch-coast { stroke: var(--ch-ink); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.ch-wl { stroke: var(--ch-faint); stroke-width: .8; opacity: calc(1 - var(--i) * .28); }
.ch-depth { stroke: var(--ch-faint); stroke-width: .8; stroke-dasharray: 1.5 5; }
.ch-rhumb { stroke: color-mix(in srgb, var(--fg) 8%, transparent); stroke-width: .6; }
.ch-sound { font-family: var(--mono); font-size: 9.5px; fill: color-mix(in srgb, var(--fg) 34%, transparent); text-anchor: middle; }
.ch-lane { stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-width: 1; stroke-dasharray: 7 6; }
.ch-hill { stroke: color-mix(in srgb, var(--fg) 17%, transparent); stroke-width: .8; }
.ch-plot { stroke: color-mix(in srgb, var(--fg) 20%, transparent); stroke-width: .7; }
.ch-furrow { stroke: color-mix(in srgb, var(--fg) 12%, transparent); stroke-width: .6; }
.ch-river { stroke: var(--ch-soft); stroke-width: 1.1; }
.ch-road { stroke: var(--ch-soft); stroke-width: 1; stroke-dasharray: 4 3.5; }
.ch-bridge { stroke: var(--ch-ink); stroke-width: 1.2; }
.ch-pier { fill: var(--ch-land); stroke: var(--ch-ink); stroke-width: 1.1; }
.ch-plank { stroke: var(--ch-faint); stroke-width: .7; }
.ch-basin { stroke: var(--ch-ink); stroke-width: 1.2; }
.ch-basin-in { stroke: var(--ch-soft); stroke-width: .7; }
.ch-gate { stroke: var(--ch-ink); stroke-width: 1.2; }
.ch-tree { stroke: color-mix(in srgb, var(--fg) 30%, transparent); stroke-width: .9; fill: var(--ch-land); }
.ch-region { font-style: italic; letter-spacing: .42em; text-transform: uppercase; text-anchor: middle; fill: color-mix(in srgb, var(--fg) 30%, transparent); }
.ch-river-name { font-style: italic; font-size: 12px; letter-spacing: .24em; fill: color-mix(in srgb, var(--fg) 40%, transparent); }
.ch-neat { stroke: var(--ch-soft); stroke-width: 1; }
.ch-band { fill: color-mix(in srgb, var(--fg) 26%, transparent); }
.ch-coord { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; fill: color-mix(in srgb, var(--fg) 40%, transparent); }
.ch-cartouche .ch-fill { fill: var(--bg); stroke: var(--ch-ink); stroke-width: 1; }
.ch-c-in { stroke: var(--ch-faint); stroke-width: .8; }
.ch-c-kicker { font-style: italic; font-size: 16px; fill: var(--dim); }
.ch-c-title { font-weight: 300; font-size: 29px; letter-spacing: -.01em; fill: var(--fg); }
.ch-c-title tspan { font-style: italic; fill: var(--accent); }
.ch-c-meta { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; fill: var(--faint); }

/* landmarks: drawn in ink, gold where something is lit, all gold when you point at one */
.ch-mark { color: var(--ch-ink); cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.ch-hit { fill: transparent; stroke: none; }
.ch-art { stroke: currentColor; stroke-width: 1.3; transform-box: fill-box; transform-origin: 50% 100%; transition: color 200ms ease; }
.ch-art * { transform-box: fill-box; }
.ch-fill { fill: var(--bg); }
.ch-on-land .ch-fill { fill: var(--ch-land); }
.ch-solid { fill: currentColor; }
.ch-gold { stroke: var(--accent); }
.ch-flag { fill: var(--accent); stroke: var(--accent); stroke-width: .8; }
.ch-lamp { fill: var(--accent); stroke: none; }
.ch-window { fill: var(--accent); stroke: none; opacity: .9; }
.ch-glow { stroke: none; opacity: .5; }
.ch-beam-stop { stop-color: var(--accent); stop-opacity: .45; }
.ch-beam-stop:last-child { stop-opacity: 0; }
[data-mode="day"] .ch-beam { display: none; }   /* the light only shows at night, as in the harbor */
.ch-halo { fill: var(--accent); stroke: none; opacity: .12; }
.ch-ripple, .ch-faint { stroke: var(--ch-soft); stroke-width: .9; }
.ch-rode { stroke-width: 1; stroke-dasharray: 2 3; opacity: .75; }
.ch-wake { stroke: var(--ch-soft); stroke-width: 1.1; stroke-dasharray: 1 4.5; }
.ch-isle { fill: var(--ch-land); }
.ch-lagoon { fill: var(--bg); }
.ch-pond { fill: var(--accent); stroke: none; opacity: .8; }
.ch-screen { fill: color-mix(in srgb, var(--accent) 35%, transparent); stroke-width: .9; }
.ch-dpad { stroke-width: 3.4; }
.ch-crayon { stroke: var(--violet); stroke-width: 1.6; }
.ch-crayon-2 { stroke-width: 1; opacity: .55; }
.ch-shadow { stroke: var(--ch-soft); stroke-width: .8; stroke-dasharray: 2 3; }
.ch-orbit { stroke: var(--ch-soft); stroke-width: .8; stroke-dasharray: 1.5 3.5; }
.ch-ring { stroke-width: 1.2; }
.ch-spark { stroke-width: 1; fill: var(--accent); }
.ch-board { stroke-width: 2.6; }
.ch-scaffold { stroke: var(--ch-soft); }
.ch-ticks { stroke-width: .7; }
.ch-rose .ch-north { color: var(--accent); }
.ch-n { font-size: 15px; font-style: italic; fill: var(--accent); stroke: none; }
.ch-dot { fill: var(--accent); stroke: none; }
.ch-ping { fill: none; stroke: var(--accent); stroke-width: 1.2; transform-origin: center; }
.ch-moon { fill: var(--accent); stroke: none; opacity: .8; }
.ch-crate { stroke-width: 1; }
.ch-label {
  font-style: italic;
  font-size: 15px;
  fill: var(--fg);
  stroke: var(--bg);
  stroke-width: 4.5;
  stroke-linejoin: round;
  paint-order: stroke;
  transition: fill 200ms ease;
}
.ch-on-land .ch-label { stroke: var(--ch-land); }
.ch-on-dock .ch-label { stroke: var(--bg); }
.ch-major .ch-label { font-style: normal; font-size: 17.5px; }
.ch-small .ch-label { font-size: 12.5px; }
.ch-mark:is(:hover, :focus-visible) { color: var(--accent); }
.ch-mark:is(:hover, :focus-visible) .ch-label { fill: var(--accent); }
.ch-mark:focus-visible .ch-label { text-decoration: underline; text-underline-offset: 3px; }
.chart.is-launching .ch-scenery, .chart.is-launching .ch-border, .chart.is-launching .ch-cartouche, .chart.is-launching .ch-mark { opacity: .12; transition: opacity 300ms ease; }
.chart.is-launching .ch-mark:is(:hover, :focus-visible, :focus) { opacity: 1; }

/* on the way in the coast draws itself, then the water and the land fill in around it */
html.has-chart:not(.chart-open) .ch-coast { stroke-dashoffset: 1; }
html.has-chart:not(.chart-open) :is(.ch-wl, .ch-depth, .ch-rhumb, .ch-sound, .ch-lane, .ch-land, .ch-hill, .ch-plot, .ch-furrow, .ch-river, .ch-road, .ch-bridge, .ch-tree, .ch-region, .ch-river-name, .ch-pier, .ch-plank, .ch-basin, .ch-gate) { opacity: 0; }
html.chart-open .ch-coast { transition: stroke-dashoffset 1.8s cubic-bezier(.4,0,.2,1) .2s; }
html.chart-open .ch-scenery > :not(.ch-coast) { transition: opacity 900ms ease 900ms; }
html.chart-open :is(.ch-land, .ch-wl) { transition-delay: .6s; }
html.chart-open :is(.ch-rhumb, .ch-depth, .ch-sound) { transition-delay: 1.2s; }

/* the place keeps moving a little while it's open */
html.chart-open .ch-bob { transform-origin: 50% 100%; animation: ch-bob var(--bob, 3s) ease-in-out infinite alternate; }
@keyframes ch-bob { from { transform: translateY(-.8px) rotate(-1.2deg); } to { transform: translateY(1px) rotate(1.2deg); } }
html.chart-open .ch-float { animation: ch-float var(--bob, 4s) ease-in-out infinite alternate; }
@keyframes ch-float { from { transform: translateY(-2.5px); } to { transform: translateY(2.5px); } }
html.chart-open .ch-beam { transform-origin: 100% 50%; animation: ch-beam 10s ease-in-out infinite; }
@keyframes ch-beam { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
html.chart-open .ch-wheel { transform-origin: center; animation: ch-turn 16s linear infinite; }
@keyframes ch-turn { to { transform: rotate(-360deg); } }
html.chart-open .ch-smoke circle { fill: none; stroke: var(--ch-soft); stroke-width: .9; transform-origin: center; animation: ch-smoke 4.5s ease-out infinite; animation-delay: calc(var(--i) * -1.5s); }
@keyframes ch-smoke { 0% { opacity: 0; transform: translate(0, 4px) scale(.6); } 25% { opacity: .9; } 100% { opacity: 0; transform: translate(5px, -16px) scale(1.7); } }
.ch-smoke circle { opacity: 0; }
html.chart-open .ch-lap { animation: ch-lap 5s ease-in-out infinite alternate; }
@keyframes ch-lap { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
html.chart-open .ch-ping { animation: hp-ping 3.2s ease-out infinite; }
html.chart-open .ch-blink { animation: ch-blink 2.4s steps(1) infinite; }
@keyframes ch-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }
html.chart-open .ch-dish { transform-origin: center; animation: ch-dish 3.6s ease-in-out infinite; }
@keyframes ch-dish { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
.ch-pulse circle, .ch-rings ellipse { stroke: var(--accent); stroke-width: .8; opacity: 0; transform-origin: center; }
html.chart-open .ch-pulse circle { animation: ch-pulse 3.6s ease-out infinite; animation-delay: calc(var(--i) * -1.8s); }
@keyframes ch-pulse { 0% { opacity: .7; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.6); } }
html.chart-open .ch-rings ellipse { animation: ch-pulse 4s ease-out infinite; animation-delay: calc(var(--i) * -2s); }
.ch-signal path { stroke: var(--accent); stroke-width: 1.1; opacity: 0; }
html.chart-open .ch-signal path { animation: ch-signal 2.4s ease-out infinite; animation-delay: calc(var(--i) * .3s); }
@keyframes ch-signal { 0% { opacity: 0; } 15% { opacity: .95; } 60%, 100% { opacity: 0; } }
html.chart-open .ch-halo { transform-origin: center; animation: ch-halo 4s ease-in-out infinite alternate; }
@keyframes ch-halo { from { opacity: .08; transform: scale(.9); } to { opacity: .2; transform: scale(1.1); } }

/* and a few act out their names when you point at them */
.ch-mark:is(:hover, :focus-visible) .ch-rose { transform-origin: center; animation: ch-about 1.2s cubic-bezier(.5,0,.2,1); }
@keyframes ch-about { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.ch-mark:is(:hover, :focus-visible) .ch-strike { stroke-dasharray: 1; animation: ch-strike .35s ease-out calc(var(--i) * .18s) backwards; }
@keyframes ch-strike { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.ch-mark:is(:hover, :focus-visible) .ch-call { animation: ch-call .9s ease-in-out infinite alternate; }
@keyframes ch-call { from { opacity: .2; } to { opacity: 1; } }
.ch-mark:is(:hover, :focus-visible) .ch-look { transform-origin: 20% 100%; animation: ch-look 1.6s ease-in-out; }
@keyframes ch-look { 0%, 100% { transform: none; } 40%, 70% { transform: scaleX(-1); } }
.ch-mark:is(:hover, :focus-visible) .ch-swing { transform-origin: 50% 0; animation: ch-swing 1.4s ease-in-out; }
@keyframes ch-swing { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(7deg); } 60% { transform: rotate(-5deg); } }
.ch-mark:is(:hover, :focus-visible) .ch-launch { animation: ch-launch 1.4s cubic-bezier(.5,0,.3,1); }
@keyframes ch-launch { 0%, 100% { transform: none; } 55% { transform: translate(-14px, 5px); } }
.ch-mark:is(:hover, :focus-visible) .ch-hop { transform-origin: 50% 100%; animation: ch-hop .6s cubic-bezier(.3,0,.4,1) 2; }
@keyframes ch-hop { 0%, 100% { transform: none; } 45% { transform: translateY(-6px) rotate(-4deg); } }
.ch-mark:is(:hover, :focus-visible) .ch-ollie { transform-origin: center; animation: ch-ollie .9s cubic-bezier(.3,0,.4,1); }
@keyframes ch-ollie { 0%, 100% { transform: none; } 50% { transform: translate(14px, -14px) rotate(200deg); } }
.ch-mark:is(:hover, :focus-visible) .ch-press { animation: ch-press .5s ease 2; }
@keyframes ch-press { 50% { fill: var(--accent); } }
.ch-mark:is(:hover, :focus-visible) .ch-alive { transform-origin: 50% 100%; animation: ch-hop .55s cubic-bezier(.3,0,.4,1) 3; }
.ch-mark:is(:hover, :focus-visible) .ch-step { animation: ch-step .45s cubic-bezier(.3,0,.4,1) calc(var(--i) * .07s); }
@keyframes ch-step { 50% { transform: translateY(-5px); } }
.ch-mark:is(:hover, :focus-visible) .ch-notes { animation: ch-notes 1.4s ease-out infinite; }
@keyframes ch-notes { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.ch-mark:is(:hover, :focus-visible) .ch-chat { animation: ch-call .7s ease-in-out infinite alternate; }
.ch-mark:is(:hover, :focus-visible) .ch-rock { transform-origin: 50% 100%; animation: ch-rock 1s ease-in-out; }
@keyframes ch-rock { 0%, 100% { transform: none; } 30% { transform: rotate(-3deg); } 70% { transform: rotate(2deg); } }

/* what a landmark is, over it */
.chart-tip {
  position: fixed;
  z-index: 2;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: max-content;
  max-width: min(300px, 100vw - 24px);
  padding: 11px 15px 12px;
  text-align: center;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translate(-50%, calc(-100% - 6px));
  transition: opacity 160ms ease, transform 160ms ease;
}
.chart-tip.is-below { transform: translate(-50%, 6px); }
.chart-tip.is-shown { opacity: 1; transform: translate(-50%, calc(-100% - 12px)); }
.chart-tip.is-below.is-shown { transform: translate(-50%, 12px); }
[data-mode="day"] .chart-tip { box-shadow: 0 16px 34px -18px rgba(26, 29, 43, .55); }
.chart-tip-name { font-family: var(--serif); font-size: 18px; line-height: 1.2; color: var(--fg); }
.chart-tip-desc { font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.35; color: var(--dim); }
.chart-tip-url { margin-top: 3px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; color: var(--accent); }

/* the way back */
html.chart-open .chart-return {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 700ms ease 1.6s, transform 700ms ease 1.6s, visibility 0s linear 1.6s, color 200ms, border-color 200ms;
}

@media (prefers-reduced-motion: reduce) {
  .chart, html.has-chart:not(.chart-open) .chart, html.chart-open .ch-coast, html.chart-open .ch-scenery > *, .chart-return, html.chart-open .chart-return, .chart-tip { transition-duration: 0s; transition-delay: 0s; }
  .chart * { animation: none !important; }
}

/* ============================================================
   Video shelf (inc/videos.php, assets/js/videos.js): my talks and
   interviews as a wall of thumbnails. It opens the way the apps
   shelf does; a thumbnail zooms up into the player and shrinks
   back into its slot on esc.
   ============================================================ */

.videos { scrollbar-gutter: stable; }
html.videos-playing .videos { overflow: hidden; }   /* the wall holds still behind the player */
.videos-inner { transition: opacity 450ms ease, transform 700ms cubic-bezier(.22,1,.36,1); }
html.videos-playing .videos-inner { opacity: .05; transform: scale(.965); }

.videos-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 34px 28px;
}

/* a card: the thumbnail with its play button, the show and year, and the episode */
.video {
  display: flex;
  flex-direction: column;
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}
.video:focus-visible { outline-offset: 6px; border-radius: 16px; }
.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 14px;
  background: color-mix(in srgb, var(--fg) 6%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--fg) 13%, transparent);
  box-shadow: 0 18px 34px -20px rgba(0, 0, 0, 0.9);
  transition: transform 350ms cubic-bezier(.3,1.5,.5,1), border-color 250ms ease, box-shadow 350ms ease;
}
.video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* YouTube's stills are letterboxed 4:3; the bars fall outside the 16:9 frame */
  filter: saturate(.85) brightness(.86);   /* dimmed for the night sky, full colour on hover */
  transition: filter 400ms ease;
}
[data-mode="day"] .video-thumb img { filter: none; }
[data-mode="day"] .video-thumb {
  border-color: color-mix(in srgb, var(--fg) 14%, transparent);
  box-shadow: 0 14px 28px -18px rgba(26, 29, 43, 0.55);
}
.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  color: var(--accent);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 250ms ease, transform 350ms cubic-bezier(.3,1.5,.5,1), background 250ms ease, color 250ms ease, border-color 250ms ease;
}
@media (hover: hover) { .video-play { opacity: 0; transform: scale(.8); } }   /* it would cover the title art; touch keeps it as the cue */
.video-play svg { width: 22px; height: 22px; margin-left: 2px; fill: currentColor; }
.video-show {
  margin-bottom: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.video-name {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
  text-wrap: pretty;
  transition: color 200ms ease;
}
.video:hover .video-thumb, .video:focus-visible .video-thumb {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.95), 0 0 0 5px color-mix(in srgb, var(--accent) 9%, transparent);
}
[data-mode="day"] .video:hover .video-thumb, [data-mode="day"] .video:focus-visible .video-thumb {
  box-shadow: 0 20px 34px -18px rgba(26, 29, 43, 0.6), 0 0 0 5px color-mix(in srgb, var(--accent) 8%, transparent);
}
.video:hover .video-thumb img, .video:focus-visible .video-thumb img { filter: none; }
.video:hover .video-play, .video:focus-visible .video-play { opacity: 1; transform: scale(1.1); color: var(--bg); background: var(--accent); border-color: var(--accent); }
.video:hover .video-name, .video:focus-visible .video-name { color: var(--accent); }
.video:active .video-thumb { transform: scale(.98); transition-duration: 90ms; }

/* the player: the screen the thumbnail grows into, as large as the window allows, and its caption */
.video-stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: clamp(48px, 8vh, 88px) clamp(16px, 4vw, 48px) 108px;
  outline: none;
}
.video-stage[hidden] { display: none; }
.video-player { width: min(1180px, 100%, max(300px, (100vh - 330px) * 16 / 9)); }
@supports (height: 100dvh) {
  .video-player { width: min(1180px, 100%, max(300px, (100dvh - 330px) * 16 / 9)); }
}
.video-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  transform-origin: 0 0;   /* videos.js flies it from a thumbnail's corner */
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px color-mix(in srgb, var(--fg) 12%, transparent);
}
[data-mode="day"] .video-screen { box-shadow: 0 34px 70px -30px rgba(26, 29, 43, 0.6), 0 0 0 1px color-mix(in srgb, var(--fg) 12%, transparent); }
.video-poster, .video-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-poster { object-fit: cover; }
.video-frame { opacity: 0; transition: opacity 500ms ease; }
.video-frame.is-ready { opacity: 1; }

.video-caption {
  margin-top: 22px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
}
html.videos-playing .video-caption { opacity: 1; transform: none; transition: opacity 600ms ease .45s, transform 600ms cubic-bezier(.22,1,.36,1) .45s; }
.video-caption-show {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.video-caption-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(21px, 2.6vw, 29px);
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  text-wrap: balance;
}
.video-caption-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.video-caption-links a { color: var(--dim); border-bottom: 1px solid var(--rule); transition: color 200ms, border-color 200ms; }
.video-caption-links a:hover, .video-caption-links a:focus-visible { color: var(--accent); border-color: var(--accent); }

@media (max-width: 560px) {
  .videos-grid { gap: 28px; }
  .video-name { font-size: 17.5px; }
  .video-stage { padding: 56px 12px 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .videos::before, .videos::after, html.videos-open .videos::before, html.videos-open .videos::after, .videos-return, html.videos-open .videos-return { transition-duration: 0s; transition-delay: 0s; }
  .videos-inner, .video-thumb, .video-thumb img, .video-play, .video-frame, .video-caption, html.videos-playing .video-caption { transition: none; }
  html.videos-playing .videos-inner { transform: none; }
}
