/* Rhumb Line Coffee Roasters · style.css
   "The exploration desk" (design 4D, desk contract v2): a live 3D ship's cabin (canvas #scene, drawn by scene/) fills
   the screen and every object on the table opens a panel of real HTML: ship's-log paper, luggage tags, rubber stamps.
   - html.desk (JavaScript with the scene): no page scroll. A small HUD (title stamp, "On the desk", bean counter,
     sound, byline) floats over the scene; an open panel sits in the left column on desktop (0–42% of the width) and
     in the lower part of the screen on phones (45–100% of the height, above the object bar).
   - Otherwise (no JavaScript, no WebGL): a plain scrolling document over a CSS table and lamp, every panel in order.
   Palette: Chart #F1E8D4, Navy #1B2A3A (12:1 on Chart), Shallow #CFE0D8, Marker #A63A24 (5.3:1 on Chart),
   Roast #5C3B26, Brass #A8834F (objects only, never text). */

@font-face {
  font-family: "RL Garamond Fallback";
  src: local("Georgia");
  size-adjust: 88%;
}

:root {
  --chart: #F1E8D4;
  --paper: #F3EAD6;
  --label: #F7F0E1;
  --navy: #1B2A3A;
  --shallow: #CFE0D8;
  --marker: #A63A24;
  --marker-hi: #E0806A;
  --roast: #5C3B26;
  --brass: #A8834F;
  --brass-hi: #D8BB84;
  --brass-lo: #6B4F2C;
  --brass-dk: #2E2215;
  --muted: #4E5963;
  --pencil: #3F4A54;
  --string: #CDB88E;
  --ground: #0c0a08;
  --f-serif: "EB Garamond", "RL Garamond Fallback", Garamond, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --f-cond: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --focus: var(--chart);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .34 0 0 0 0 .24 0 0 0 0 .13 0 0 0 .085 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .09' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .18 0 0 0 .09 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --wood: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 7px, rgba(255, 214, 170, .04) 7px 8px, transparent 8px 19px), linear-gradient(165deg, #4b2f1b 0%, #2e1b0e 60%, #231409 100%);
  --card-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 10px 18px -6px rgba(0, 0, 0, .45), 0 28px 50px -18px rgba(0, 0, 0, .6);
  --gutter: clamp(16px, 3vw, 56px);
  --col: min(calc(42vw - var(--gutter)), 620px);
  --bar-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ground); }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--chart);
  font-family: var(--f-serif);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; border-radius: 0; text-align: inherit; }
p, h1, h2, h3, h4, ul, ol, dl, dd, fieldset, legend { margin: 0; padding: 0; }
h1, h2, h3, h4 { font-weight: inherit; font-size: inherit; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
::selection { background: var(--marker); color: var(--chart); }
[hidden] { display: none !important; }
html:not(.desk) { scroll-behavior: smooth; }

/* Focus: a thick ring in the surface's ink plus a halo, so it reads over paper, wood and any sky in the scene. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 7px rgba(12, 10, 8, .55); }
.paper :focus-visible { box-shadow: 0 0 0 7px rgba(241, 232, 212, .7); }
:focus:not(:focus-visible) { outline: none; }
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

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

/* ---------- The scene layer ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--ground); }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; }
/* A soft shadow under an open panel, so paper edges stay crisp over bright skies. */
.scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s ease;
  background: linear-gradient(90deg, rgba(8, 6, 4, .55) 0%, rgba(8, 6, 4, .3) 30%, rgba(8, 6, 4, 0) 46%);
}

/* No JavaScript or no WebGL: a dark teak table under a warm lamp, a porthole on the bulkhead. */
html:not(.js) .scene, html.no-webgl .scene {
  background:
    radial-gradient(46% 38% at 64% 34%, rgba(255, 190, 110, .30), rgba(255, 160, 80, .10) 48%, transparent 72%),
    radial-gradient(150% 110% at 62% 38%, transparent 42%, rgba(0, 0, 0, .7) 100%),
    repeating-linear-gradient(91deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px 11px, rgba(255, 214, 170, .035) 11px 12px, transparent 12px 27px),
    repeating-linear-gradient(89.3deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 53px),
    linear-gradient(178deg, #3d2615 0%, #2a190c 55%, #1b0f07 100%);
}
html:not(.js) #scene, html.no-webgl #scene { display: none; }
html:not(.js) .scene::before, html.no-webgl .scene::before {
  content: ""; position: absolute; left: 76%; top: 8vh; width: min(18vw, 230px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #f2c79a 0%, #c98d6b 22%, #4b5a6e 58%, #1d2a38 100%);
  box-shadow: 0 0 0 10px #8b6a3d, 0 0 0 13px #3a2a16, 0 0 0 16px #b89660, inset 0 0 40px rgba(0, 0, 0, .5), 0 20px 50px rgba(0, 0, 0, .6);
  opacity: .9;
}

/* ---------- Materials ---------- */
.paper {
  --focus: var(--navy);
  position: relative;
  color: var(--navy);
  background-color: var(--chart);
  background-image:
    radial-gradient(130% 100% at 50% 50%, transparent 62%, rgba(128, 94, 52, .16) 100%),
    var(--fibre), var(--grain);
  box-shadow: var(--card-shadow);
}
.tack {
  position: absolute; left: 50%; top: -9px; z-index: 3; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-hi), var(--brass) 45%, var(--brass-lo));
  box-shadow: 2px 3px 3px rgba(0, 0, 0, .45);
}

/* Section label: a ruled log heading in condensed capitals, red ink, with a small course arrow. */
.loglabel {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-cond); font-weight: 600; font-size: 14px; line-height: 1.2; letter-spacing: .22em; text-transform: uppercase;
  color: var(--marker);
}
.loglabel::before {
  content: ""; flex: 0 0 auto; width: 18px; height: 8px;
  background: linear-gradient(currentColor 0 0) 0 50% / 12px 2px no-repeat;
  clip-path: polygon(0 3px, 11px 3px, 11px 0, 18px 4px, 11px 8px, 11px 5px, 0 5px);
}
.loglabel--sub { display: flex; margin-top: 22px; }

/* ---------- Buttons: a luggage tag on a string, or a rubber stamp ---------- */
.tag {
  --tag: #E6D3A8;
  --focus: var(--navy);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 26px 12px 46px;
  font-family: var(--f-cond); font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: .16em; text-transform: uppercase;
  color: var(--navy); text-decoration: none; white-space: nowrap;
  filter: drop-shadow(1px 3px 2px rgba(0, 0, 0, .38));
  transform-origin: 22px 50%;
  transition: transform .35s var(--ease);
}
.tag::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-color: var(--tag);
  background-image: var(--grain);
  clip-path: polygon(15px 0, 100% 0, 100% 100%, 15px 100%, 0 50%);
  -webkit-mask: radial-gradient(circle at 22px 50%, transparent 4.6px, #000 5.3px);
  mask: radial-gradient(circle at 22px 50%, transparent 4.6px, #000 5.3px);
  transition: background-color .2s;
}
.tag::after {
  content: ""; position: absolute; left: -22px; top: calc(50% - 20px); width: 44px; height: 20px;
  border: 1.5px solid var(--string); border-width: 1.5px 1.5px 0 0; border-radius: 0 100% 0 0;
  pointer-events: none;
}
.tag:hover { transform: rotate(-3deg); }
.tag:hover::before { background-color: #F0E1BF; }
.tag:active { transform: rotate(-1deg) translateY(1px); }
.tag:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.tag:focus-visible { box-shadow: none; outline-offset: 4px; }

.stampbtn {
  --focus: var(--navy);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  font-family: var(--f-cond); font-weight: 600; font-size: 14px; line-height: 1; letter-spacing: .2em; text-transform: uppercase;
  color: var(--marker); text-decoration: none; transform: rotate(-2.5deg); transition: transform .3s var(--ease);
}
.stampbtn::before, .stampbtn::after { content: ""; position: absolute; pointer-events: none; }
.stampbtn::before { inset: 0; border: 2px solid currentColor; border-radius: 6px; }
.stampbtn::after { inset: 5px; border: 1px solid currentColor; border-radius: 3px; }
.stampbtn:hover { transform: rotate(-1deg) scale(1.04); }
.stampbtn:active { transform: rotate(-2.5deg) scale(.96); }

/* ---------- Sea sound: a small brass plate ---------- */
.sound { position: fixed; z-index: 31; top: max(12px, env(safe-area-inset-top)); right: clamp(10px, 1.2vw, 24px); display: grid; justify-items: end; gap: 6px; pointer-events: none; }
.sound > * { pointer-events: auto; }
.sound__toggle {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 7px 8px 7px 12px;
  font-family: var(--f-cond); font-weight: 600; font-size: 13px; line-height: 1; letter-spacing: .18em; text-transform: uppercase;
  color: var(--chart); border-radius: 4px;
  background: linear-gradient(160deg, #3b2616, #1f130a);
  box-shadow: inset 0 0 0 1px rgba(216, 187, 132, .55), inset 0 0 0 3px rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .5);
}
.sound__toggle::before { content: ""; width: 14px; height: 12px; flex: 0 0 auto; background: currentColor; clip-path: polygon(0 32%, 30% 32%, 62% 0, 62% 100%, 30% 68%, 0 68%); }
.sound__state { min-width: 34px; padding: 5px 6px 4px; text-align: center; border-radius: 2px; font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; color: var(--brass-hi); background: rgba(0, 0, 0, .45); }
.sound__toggle[aria-pressed="true"] .sound__state { color: var(--ground); background: var(--brass-hi); }
/* Out of the flow, so showing or hiding it never moves the toggle. */
.sound__hint {
  position: absolute; right: 0; top: calc(100% + 6px); width: max-content; max-width: min(60vw, 320px); text-align: right;
  padding: 4px 8px; font-family: var(--f-mono); font-size: 11px; line-height: 1.3; color: var(--chart);
  background: rgba(12, 10, 8, .72); border-radius: 2px; pointer-events: none;
}
html:not(.js) .sound { display: none; }
html.desk.panel-open .sound__hint { display: none; }

/* =====================================================================================================================
   The plain document (default: no JavaScript, or no scene)
   ===================================================================================================================== */
.deskroom { position: relative; z-index: 2; display: grid; gap: 40px; width: min(720px, calc(100% - 32px)); margin: 0 auto; padding-block: 64px 40px; }
.deskhud, .beancount, .objbuttons, .objtag, .hintstack, .interlude, .objectbar, .objectdock, .panel__bar, .chartpick, .sailing, .legnav, .panelnext, .landfall__actions, .deskmenu__extra { display: none; }

/* Object icons, shared by the phone bar and the desktop dock */
.objectbar__list { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.objectbar__list li { flex: 1 1 0; min-width: 0; }
.objectbar__btn {
  --focus: var(--chart);
  display: grid; place-items: center; width: 100%; min-width: 44px; height: 50px; border-radius: 4px; color: var(--chart); text-decoration: none;
}
.objectbar__btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.objectbar__btn:hover { color: var(--brass-hi); }
.objectbar__btn[aria-current] { color: var(--ground); background: var(--brass-hi); }
.objectbar__btn:focus-visible { outline-offset: -3px; box-shadow: none; }

/* Photographs of each origin (written in by tools/qa/rhumb-photos.mjs): prints taped into the log and the chest.
   The frame's ratio is fixed (wide 3:2, tall 4:5) and the photo is cropped to it, so nothing moves as it loads. */
.photos { display: grid; grid-template-columns: repeat(var(--photo-cols, 1), minmax(0, 1fr)); gap: 22px 18px; align-items: start; padding: 14px 6px 0; }
.photos--2 { --photo-cols: 2; }
.photos--1 .photo { width: min(300px, 76%); }
.photo { position: relative; justify-self: center; width: 100%; margin: 0; padding: 8px 8px 10px; background: #fbf8f1; box-shadow: var(--card-shadow); transform: rotate(-1.6deg); }
.photos .photo:nth-child(2) { margin-top: 28px; transform: rotate(1.9deg); }
.photo::before, .photo::after { content: ""; position: absolute; top: -10px; width: 62px; height: 22px; background: rgba(236, 226, 194, .78); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); pointer-events: none; }
.photo::before { left: 6px; transform: rotate(-8deg); }
.photo::after { right: 6px; transform: rotate(7deg); }
.photo__frame { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #d9cfbb; }
.photo--tall .photo__frame { aspect-ratio: 4 / 5; }
.photo__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { margin-top: 7px; font-family: var(--f-mono); font-size: 12px; line-height: 1.35; color: #3d4247; }
/* In the chest: a small square print beside each sack found */
.sacks .sack { grid-template-columns: 92px minmax(0, 1fr) 96px; }
.photo--sack { grid-column: 3; padding: 5px 5px 6px; transform: rotate(2.2deg); }
.photo--sack::before { top: -7px; left: 50%; width: 38px; height: 14px; margin-left: -19px; transform: rotate(-4deg); }
.photo--sack::after { display: none; }
.photo--sack .photo__frame { aspect-ratio: 1 / 1; }
html.desk .sack[data-found="false"] .photo--sack { display: none; }
@media (max-width: 599px) {
  .sacks .sack { grid-template-columns: 70px minmax(0, 1fr) 72px; gap: 10px; }
  .photos { gap: 18px 12px; padding-inline: 2px; }
  .photo { padding: 6px 6px 8px; }
  .photo figcaption { font-size: 11px; }
}

/* The cup of coffee: today's cup and four ways to brew it ashore */
.cupcard { padding: 26px clamp(20px, 3vw, 34px) 26px; background-color: var(--label); }
.cupcard__title { margin-top: 12px; font-weight: 500; font-size: clamp(30px, 2.8vw, 44px); line-height: 1.05; }
.cupcard__intro { margin-top: 12px; font-size: 19px; line-height: 1.45; }
.cupcard__today { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(27, 42, 58, .4); font-family: var(--f-mono); font-size: 14px; line-height: 1.45; }
.cuplabel { margin: 6px 0 0 4px; font-family: var(--f-cond); font-weight: 600; font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--brass-hi); }
.recipes { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.recipe { padding: 18px 22px 20px; background-color: var(--paper); }
.recipe__name { font-family: var(--f-cond); font-weight: 600; font-size: 16px; letter-spacing: .16em; text-transform: uppercase; color: var(--marker); }
.recipe__line { margin-top: 6px; font-family: var(--f-mono); font-size: 14px; line-height: 1.5; }
.recipe__line span { white-space: nowrap; }
.recipe__tip { margin-top: 8px; font-size: 17px; line-height: 1.45; }
.cupnote { margin: 0 4px; font-style: italic; font-size: 16px; line-height: 1.45; color: var(--chart); }

/* Title card */
.titlecard { padding: clamp(34px, 3.4vw, 46px) clamp(24px, 3vw, 44px) clamp(30px, 3vw, 40px); background-color: var(--label); }
.titlecard::before { content: ""; position: absolute; inset: 12px; border: 1px solid var(--navy); box-shadow: inset 0 0 0 3px var(--label), inset 0 0 0 4px rgba(27, 42, 58, .5); pointer-events: none; }
.wordmark { position: relative; text-align: center; font-weight: 500; line-height: 1; }
.wordmark__main { display: block; font-size: clamp(34px, 4.4vw, 64px); letter-spacing: .09em; margin-right: -.09em; white-space: nowrap; }
.wordmark__sub { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-family: var(--f-cond); font-weight: 500; font-size: 15px; letter-spacing: .42em; text-transform: uppercase; }
.wordmark__sub::before, .wordmark__sub::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--navy); }
.titlecard__tagline { position: relative; margin-top: 20px; text-align: center; font-style: italic; font-size: clamp(20px, 1.8vw, 25px); line-height: 1.3; text-wrap: balance; }
.titlecard__cta { position: relative; display: flex; width: max-content; margin: 24px auto 0; }

/* On the desk: a list of every object (a table of contents without the scene) */
.deskmenu { padding: 26px clamp(20px, 3vw, 34px) 28px; background-color: var(--label); }
.deskmenu__title { font-family: var(--f-cond); font-weight: 600; font-size: 14px; letter-spacing: .22em; text-transform: uppercase; color: var(--marker); }
.deskmenu__list { display: grid; margin-top: 10px; }
.deskmenu__item {
  display: grid; width: 100%; min-height: 52px; padding: 8px 4px; align-content: center; text-decoration: none; border-top: 1px dashed rgba(27, 42, 58, .4);
}
.deskmenu__list li:first-child .deskmenu__item { border-top: 0; }
.deskmenu__name { font-weight: 500; font-size: 22px; line-height: 1.15; }
.deskmenu__hint { font-family: var(--f-mono); font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.deskmenu__item:hover .deskmenu__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.deskmenu__cta { margin: 18px 0 0 22px; }

/* Panels as sections */
.panel { display: block; }
.panel__body { display: grid; gap: 28px; }

/* Log pages: ruled paper, a red margin, punched holes along the spine. */
.logpage { padding: 30px clamp(22px, 2.6vw, 40px) 34px clamp(46px, 4.4vw, 64px); background-color: var(--paper); }
.logpage::before { content: ""; position: absolute; left: clamp(34px, 3.4vw, 50px); top: 0; bottom: 0; width: 4px; pointer-events: none; border-left: 1px solid rgba(166, 58, 36, .55); border-right: 1px solid rgba(166, 58, 36, .35); }
.logpage::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 18px; width: 14px; pointer-events: none; background: radial-gradient(circle at 7px 7px, #1b120b 0 4.5px, rgba(0, 0, 0, .28) 5.5px, transparent 6.5px) 0 0 / 14px 44px repeat-y; }
.logpage__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; padding-bottom: 10px; border-bottom: 3px double rgba(27, 42, 58, .55); }
.logpage__date { font-family: var(--f-mono); font-size: 13px; letter-spacing: .02em; }
.logpage__title { margin-top: 18px; font-weight: 500; font-size: clamp(30px, 2.8vw, 46px); line-height: 1.05; text-wrap: balance; }
.logpage__port { margin-top: 18px; font-weight: 500; font-size: clamp(22px, 1.8vw, 30px); line-height: 1.15; letter-spacing: .07em; text-transform: uppercase; text-wrap: balance; }
.logpage__coords { margin-top: 6px; font-family: var(--f-mono); font-size: 14px; color: var(--marker); }
.logmeta { margin-top: 14px; }
.logmeta div { display: grid; gap: 2px; }
.logmeta dt { font-family: var(--f-cond); font-weight: 600; font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.logmeta dd { font-style: italic; font-size: 18px; line-height: 1.3; }
.logmeta__pos { font-family: var(--f-mono); font-style: normal; font-size: 12.5px; white-space: nowrap; }
.logpage__weather { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; padding: 5px 10px 5px 8px; font-family: var(--f-mono); font-size: 13px; line-height: 1.35; background: rgba(207, 224, 216, .55); }
.logpage__weather::before { content: ""; flex: 0 0 auto; width: 18px; height: 10px; background: var(--navy); clip-path: polygon(0 40%, 70% 40%, 70% 0, 100% 50%, 70% 100%, 70% 60%, 0 60%); }
.logpage__cols { display: grid; gap: 16px; margin-top: 16px; }
.logpage__margin { display: grid; gap: 4px; font-family: var(--f-mono); font-size: 13px; line-height: 1.5; color: var(--muted); }
.logpage__body {
  --lh: 1.6em;
  margin-top: 8px; font-size: 19px; line-height: var(--lh);
  background-image: linear-gradient(to bottom, transparent calc(100% - 1px), rgba(27, 42, 58, .16) calc(100% - 1px));
  background-size: 100% var(--lh); background-position: 0 -.3em;
}
.orders { position: relative; margin-top: 22px; padding: 14px 16px 14px 18px; font-family: var(--f-mono); font-size: 14px; line-height: 1.55; border: 2px solid var(--marker); color: var(--navy); background: rgba(247, 240, 225, .7); transform: rotate(-.6deg); }

/* Ocean chart: ports, the bearing readout, legs */
.chartcard { padding: 26px clamp(20px, 3vw, 34px) 26px; background-color: var(--label); }
.chartcard__title { margin-top: 12px; font-weight: 500; font-size: clamp(30px, 2.8vw, 44px); line-height: 1.05; }
.ports { display: grid; margin-top: 14px; counter-reset: port; }
.port {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; align-items: center;
  min-height: 52px; padding: 8px 6px; text-decoration: none; border-top: 1px dashed rgba(27, 42, 58, .4);
}
.ports li:first-child .port { border-top: 0; }
.port__n { grid-row: 1 / 4; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-family: var(--f-mono); font-size: 12px; color: var(--marker); border: 1.5px solid var(--marker); }
.port__name { font-size: 19px; line-height: 1.2; }
.port__comma { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.port__country { font-family: var(--f-cond); font-weight: 500; font-size: 13px; line-height: 1.25; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.port__coords { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.port:hover .port__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.port.is-found .port__n { color: var(--chart); background: var(--marker); }
.port[aria-current] { background: rgba(207, 224, 216, .6); }
.chartpick { gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(27, 42, 58, .35); }
.chartpick__line { font-style: italic; font-size: 19px; }
.bearing { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; font-family: var(--f-mono); font-size: 14px; line-height: 1.4; }
.bearing__label { font-family: var(--f-cond); font-weight: 600; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.bearing__deg { min-width: 3.4ch; color: var(--marker); font-weight: 600; font-size: 17px; }
.bearing__arrow { color: var(--marker); }
.bearing__name { font-family: var(--f-serif); font-style: italic; font-size: 17px; }

.leg { display: grid; gap: 26px; }

/* Bag tag: a canvas label tied to the log page with string, stamped on arrival. */
.bagtag { position: relative; justify-self: end; width: min(320px, 86%); margin-right: 4%; transform: rotate(1.8deg); filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .5)) drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.bagtag::before { content: ""; position: absolute; left: 50%; top: -58px; width: 90px; height: 72px; margin-left: -80px; pointer-events: none; border: 1.5px solid var(--string); border-width: 0 0 1.5px 1.5px; border-radius: 0 0 0 80%; }
.bagtag__stamp {
  position: absolute; left: -16px; top: 29%; z-index: 2; padding: 8px 12px 7px; pointer-events: none;
  font-family: var(--f-cond); font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: .16em; text-transform: uppercase;
  color: var(--marker); border: 3px double currentColor; border-radius: 6px; background: rgba(247, 240, 225, .82); transform: rotate(-9deg);
}
.baglabel { width: 100%; height: auto; aspect-ratio: 340 / 470; }
.baglabel__fallback { display: grid; gap: 6px; padding: 26px 24px 22px; color: var(--roast); background: var(--label); border: 1px solid var(--roast); box-shadow: inset 0 0 0 5px var(--label), inset 0 0 0 6px var(--roast); }
.baglabel__name { display: block; font-weight: 500; font-size: 28px; line-height: 1.1; }
.baglabel__farm { display: block; font-style: italic; font-size: 18px; }
.baglabel__specs { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--roast); }
.baglabel__row { display: block; font-size: 17px; line-height: 1.3; }
.baglabel__dt { font-family: var(--f-cond); font-weight: 600; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.baglabel__flavors { display: block; font-family: var(--f-mono); font-size: 12px; }

/* Sea moments: torn slips (in the document between legs; over the scene at the desk) */
.interlude-slip, .interlude {
  position: relative; max-width: 460px; padding: 22px 24px 28px;
  font-family: var(--f-mono); font-size: 16px; line-height: 1.6; color: var(--navy);
  background-color: #EADFC6; background-image: var(--fibre), var(--grain);
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .55));
  transform: rotate(-1.4deg);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at 50% 100%, transparent, #000 1deg 89deg, transparent 90deg) bottom / 14px 8px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at 50% 100%, transparent, #000 1deg 89deg, transparent 90deg) bottom / 14px 8px repeat-x;
}
.interlude-slip--night, .interlude[data-moment="night"] { color: var(--chart); background-color: #17222e; background-image: radial-gradient(circle at 97% 10px, rgba(241, 232, 212, .6) 0 1px, transparent 1.6px), radial-gradient(circle at 92% calc(100% - 12px), rgba(241, 232, 212, .45) 0 1px, transparent 1.6px), radial-gradient(circle at 8px 55%, rgba(241, 232, 212, .4) 0 1px, transparent 1.6px), var(--grain); transform: rotate(1.2deg); }
.interlude-slip--dusk, .interlude[data-moment="homeward"] { background-color: #EEDCC0; transform: rotate(-.8deg); }
.interlude[data-moment="cape"] { transform: rotate(-3deg); }

/* Sample chest */
.chestcard { padding: 26px clamp(20px, 3vw, 34px) 28px; background-color: var(--label); }
.chestcard__title { margin-top: 12px; font-weight: 500; font-size: clamp(30px, 2.8vw, 44px); line-height: 1.05; }
.chestcard__progress { margin-top: 6px; font-family: var(--f-mono); font-size: 14px; color: var(--roast); }
.sacks { display: grid; gap: 12px; margin-top: 16px; }
.sack { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px; background: rgba(92, 59, 38, .06); border: 1px solid rgba(92, 59, 38, .25); }
.sack__art { position: relative; display: block; width: 92px; aspect-ratio: 340 / 470; }
.sack__art .baglabel--thumb { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }
.sack__empty {
  position: absolute; inset: 8% 6% 0; opacity: .5;
  background: repeating-linear-gradient(45deg, rgba(92, 59, 38, .18) 0 2px, transparent 2px 6px), rgba(92, 59, 38, .12);
  clip-path: polygon(22% 0, 78% 0, 64% 18%, 100% 36%, 96% 100%, 4% 100%, 0 36%, 36% 18%);
}
.sack[data-found="false"] .baglabel--thumb { visibility: hidden; }
.sack[data-found="true"] .sack__empty { display: none; }
.sack__go { display: flex; align-items: center; min-height: 44px; font-size: 18px; line-height: 1.25; text-decoration: none; }
.sack__go:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.sack[data-found="false"] .sack__go { color: var(--muted); font-style: italic; }

/* Landfall */
.landfall { padding: 28px clamp(22px, 3vw, 36px) 30px; background-color: var(--label); }
.landfall__title { margin-top: 12px; font-weight: 500; font-size: clamp(30px, 2.8vw, 44px); line-height: 1.05; text-wrap: balance; }
.landfall__body { margin-top: 12px; font-size: 19px; line-height: 1.5; }
.landfall__actions { flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 22px; padding-left: 22px; }

/* Cupping: index cards and a volvelle with a brass rim */
.indexcard { padding: 28px 30px 30px; background-color: var(--label); }
.indexcard::before { content: ""; position: absolute; left: 0; right: 0; top: 64px; height: 1px; background: rgba(166, 58, 36, .5); pointer-events: none; }
.indexcard__title { margin-top: 18px; font-weight: 500; font-size: clamp(36px, 3.4vw, 52px); line-height: 1; }
.indexcard__text { margin-top: 14px; font-size: 19px; line-height: 1.45; }
.indexcard__hint { margin-top: 14px; font-family: var(--f-mono); font-size: 13px; }
html:not(.js) .indexcard__hint { display: none; }
.volvelle { --focus: var(--chart); position: relative; justify-self: center; width: min(calc(100% - 36px), 420px); aspect-ratio: 1; margin: 18px; border-radius: 50%; box-shadow: 10px 18px 34px rgba(0, 0, 0, .55); }
.volvelle__rim { position: absolute; inset: -16px; border-radius: 50%; pointer-events: none; background: conic-gradient(from 160deg, #6B4F2C, #D8BB84 14%, #8B6A3D 30%, #CBAA70 48%, #6B4F2C 64%, #D1B37A 82%, #6B4F2C); -webkit-mask: radial-gradient(circle, transparent calc(50% - 17px), #000 calc(50% - 16px)); mask: radial-gradient(circle, transparent calc(50% - 17px), #000 calc(50% - 16px)); }
.volvelle__rivet { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 35% 30%, var(--brass-hi), var(--brass) 45%, var(--brass-lo)); box-shadow: 2px 3px 4px rgba(0, 0, 0, .45); }
html:not(.js) .volvelle, html:not(.js) .picked { display: none; }
.dial { position: relative; width: 100%; height: 100%; border-radius: 50%; cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.dial.is-dragging { cursor: grabbing; }
.dial:focus-visible { outline-offset: 22px; }
.dial__svg { width: 100%; height: 100%; overflow: visible; }
.dial__face { fill: var(--chart); stroke: var(--navy); stroke-width: 1.2; }
.dial__ring { fill: none; stroke: var(--navy); stroke-width: 1; }
.dial__ring--fine { stroke-width: .6; }
.dial__ticks { stroke: var(--navy); stroke-width: .8; }
.dial__lubber { fill: var(--marker); }
.dial__window { fill: none; stroke: var(--marker); stroke-width: 2.5; }
.dial__wedge { fill: transparent; stroke: none; transition: fill .3s; }
.dial__sector.is-north .dial__wedge { fill: var(--shallow); }
.dial__spoke { stroke: var(--navy); stroke-width: .9; }
.dial__name { font-family: var(--f-cond); font-weight: 600; font-size: 25px; letter-spacing: .16em; text-transform: uppercase; fill: var(--navy); transition: fill .3s; }
.dial__note { font-family: var(--f-serif); font-style: italic; font-size: 14px; fill: var(--navy); }
.dial__sector.is-north .dial__name { fill: var(--marker); }
.dial__gem { fill: var(--marker); }
.dial__star-lt { fill: var(--chart); stroke: var(--navy); stroke-width: .9; stroke-linejoin: round; }
.dial__star-dk { fill: var(--navy); stroke: var(--navy); stroke-width: .9; stroke-linejoin: round; }
.picked { padding: 24px 28px 26px; background-color: var(--label); }
.picked__n { font-family: var(--f-mono); font-size: 13px; }
.picked__name { margin-top: 4px; font-weight: 500; font-size: clamp(42px, 4vw, 60px); line-height: 1; }
.picked__detail { margin-top: 10px; font-family: var(--f-mono); font-size: 14px; line-height: 1.5; }
.picked__desc { margin-top: 10px; font-size: 19px; line-height: 1.45; }
.picked__origins { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(27, 42, 58, .45); font-family: var(--f-cond); font-weight: 600; font-size: 13.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--roast); }
.picked__origins span { display: inline-flex; align-items: center; gap: 6px; }
.picked__origins span::before { content: ""; width: 10px; height: 12px; background: var(--roast); clip-path: polygon(22% 0, 78% 0, 64% 20%, 100% 38%, 96% 100%, 4% 100%, 0 38%, 36% 20%); }
.picked__origins .sr-only::before { display: none; }
.flist { padding: 0; background-color: var(--label); }
.flist__label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 22px; cursor: pointer; list-style: none; font-family: var(--f-cond); font-weight: 600; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; }
.flist__label::-webkit-details-marker { display: none; }
.flist__label::after { content: ""; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .3s; }
.flist[open] .flist__label::after { transform: rotate(-135deg); }
.flist__items { display: grid; padding: 0 22px 16px; }
.flist__item { position: relative; padding: 10px 0 11px 22px; border-top: 1px solid rgba(27, 42, 58, .3); }
.flist__item::before { content: ""; position: absolute; left: 2px; top: 24px; width: 8px; height: 8px; border: 1px solid var(--navy); transform: rotate(45deg); }
.flist__item:has([aria-pressed="true"])::before { background: var(--marker); border-color: var(--marker); }
.flist__btn { display: flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--f-cond); font-weight: 600; font-size: 17px; letter-spacing: .14em; text-transform: uppercase; }
.flist__n { font-family: var(--f-mono); font-weight: 400; font-size: 12px; letter-spacing: 0; }
.flist__btn:hover [data-f="name"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.flist__btn[aria-pressed="true"] { color: var(--marker); }
.flist__detail { font-style: italic; font-size: 16px; line-height: 1.35; }
.flist__desc { margin-top: 4px; font-size: 16px; line-height: 1.4; }

/* The crew list: an order form with punched holes, a quiz and a stamped berth */
.orderform { padding: 34px clamp(22px, 2.6vw, 40px) 38px clamp(48px, 4.4vw, 62px); background-color: var(--label); }
.orderform::after { content: ""; position: absolute; left: 12px; top: 20px; bottom: 20px; width: 16px; pointer-events: none; background: radial-gradient(circle at 8px 8px, #1b120b 0 5px, rgba(0, 0, 0, .28) 6px, transparent 7px) 0 0 / 16px 52px repeat-y; }
.orderform__title { margin-top: 12px; font-weight: 500; font-size: clamp(36px, 3.4vw, 54px); line-height: 1.02; }
.orderform__intro { margin-top: 12px; font-size: 19px; line-height: 1.45; }
html:not(.js) .quiz { display: none; }
.quiz { position: relative; margin-top: 22px; }
.quiz__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--navy); }
.quiz__progress { font-family: var(--f-cond); font-weight: 600; font-size: 14px; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; }
.quiz__scale { display: grid; grid-template-columns: repeat(4, 1fr); width: min(180px, 42%); height: 8px; border: 1px solid var(--navy); }
.quiz__scale i { border-left: 1px solid var(--navy); transition: background-color .3s; }
.quiz__scale i:first-child { border-left: 0; }
.quiz__scale i.is-done { background: var(--navy); }
.quiz__scale i.is-current { background: var(--marker); }
.q { margin-top: 22px; }
.js .q:not(.is-current) { display: none; }
.q__title { font-weight: 500; font-size: clamp(24px, 2.1vw, 32px); line-height: 1.15; margin-bottom: 14px; }
.q__opts { display: grid; }
.opt { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 14px; align-items: center; min-height: 54px; padding: 10px 12px; border-top: 1px dashed rgba(27, 42, 58, .45); cursor: pointer; transition: background-color .2s; }
.opt:last-child { border-bottom: 1px dashed rgba(27, 42, 58, .45); }
.opt:hover { background: rgba(207, 224, 216, .5); }
.opt:has(input:checked) { background: var(--shallow); }
.opt input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--navy); background: transparent; cursor: pointer; }
.opt input:checked { background: linear-gradient(45deg, transparent 42%, var(--marker) 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, var(--marker) 42% 58%, transparent 58%); }
.opt input:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; box-shadow: none; }
.opt__text { font-size: 20px; line-height: 1.25; }
.quiz__nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding-left: 22px; }
.quiz__next { margin-left: auto; min-width: 130px; }
.quiz.is-done .quiz__top, .quiz.is-done .quiz__nav { display: none; }
.result { position: relative; margin-top: 8px; }
.result__label { font-family: var(--f-cond); font-weight: 600; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--marker); }
.result__plan { margin-top: 6px; font-weight: 500; font-size: clamp(50px, 4.6vw, 72px); line-height: 1; }
.result__summary { margin-top: 10px; font-family: var(--f-mono); font-size: 14px; }
.result__pitch { margin-top: 10px; font-style: italic; font-size: 20px; line-height: 1.4; max-width: 24em; }
.result__specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px 20px; margin-top: 20px; padding-block: 14px; border-block: 1px solid var(--navy); }
.result__specs dt { font-family: var(--f-cond); font-weight: 600; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; }
.result__specs dd { margin-top: 4px; font-size: 19px; line-height: 1.25; }
.result__specs .result__price { font-family: var(--f-mono); font-size: 24px; color: var(--marker); font-weight: 500; }
.result__stamp { position: absolute; right: 0; top: 18px; padding: 10px 16px 8px; pointer-events: none; font-family: var(--f-cond); font-weight: 600; font-size: 26px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; color: var(--marker); border: 3px double currentColor; border-radius: 10px; transform: rotate(-12deg); opacity: .85; }
.result__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 22px; padding-left: 22px; }
.js .plans { display: none; }
.plans { margin-top: 22px; }
.plans__intro { font-style: italic; }
.plans__list { display: grid; margin-top: 12px; }
.plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; padding: 16px 0; border-top: 1px solid var(--navy); }
.plan:last-child { border-bottom: 1px solid var(--navy); }
.plan__name { font-weight: 500; font-size: 30px; line-height: 1.1; }
.plan__summary { grid-column: 1; font-family: var(--f-mono); font-size: 14px; }
.plan__price { grid-column: 2; grid-row: 1 / 3; font-family: var(--f-mono); font-size: 26px; color: var(--marker); }
.plan__pitch { grid-column: 1 / -1; margin-top: 6px; font-style: italic; }

/* The letter: the season's last line, the newsletter, the port */
.logend__line { justify-self: start; padding: 12px 18px; font-style: italic; font-size: 21px; line-height: 1.35; color: var(--navy); background-color: var(--paper); background-image: var(--grain); box-shadow: var(--card-shadow); transform: rotate(-.8deg); border-left: 3px solid var(--marker); }
.tidecard { padding: 30px 32px 26px; background-color: var(--label); }
.tidecard__title { font-weight: 500; font-size: clamp(30px, 2.6vw, 42px); line-height: 1.05; }
.tidecard__body { margin-top: 10px; font-size: 19px; }
.nl { margin-top: 18px; }
.nl__row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.nl__input { flex: 1 1 200px; min-width: 0; min-height: 50px; padding: 10px 2px; border: 0; border-bottom: 1.5px solid var(--navy); border-radius: 0; background: transparent; color: var(--navy); font-family: var(--f-mono); font-size: 16px; }
.nl__input::placeholder { color: rgba(27, 42, 58, .62); }
.nl__input:focus-visible { outline-offset: 2px; }
.nl__input[aria-invalid="true"] { border-bottom-color: var(--marker); }
.nl__msg { min-height: 1.6em; margin-top: 10px; font-family: var(--f-mono); font-size: 14px; }
.portcard { justify-self: start; width: min(360px, 100%); padding: 22px 26px; background-color: var(--chart); transform: rotate(1.2deg); }
.portcard__name { font-weight: 500; font-size: 26px; letter-spacing: .2em; text-transform: uppercase; line-height: 1.1; }
.portcard__coords { margin-top: 6px; font-family: var(--f-mono); font-size: 14px; color: var(--marker); }
.portcard__address { margin-top: 2px; font-style: italic; font-size: 18px; }

.byline { position: relative; z-index: 2; margin: 0; padding: 0 16px 40px; text-align: center; }
.byline a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-family: var(--f-mono); font-size: 12.5px; color: var(--chart); background: rgba(12, 10, 8, .74); text-underline-offset: 4px; }

/* Dialog */
.modal { width: min(92vw, 500px); padding: clamp(28px, 4vw, 42px); margin: auto; border: 0; background-color: var(--label); box-shadow: 0 30px 60px rgba(0, 0, 0, .6); }
.modal::backdrop { background: rgba(10, 7, 4, .74); }
.modal__stamp { position: absolute; right: 22px; top: 22px; width: 64px; height: 64px; border-radius: 50%; border: 3px double var(--marker); opacity: .8; transform: rotate(-14deg); background: radial-gradient(circle, transparent 40%, rgba(166, 58, 36, .15) 41% 44%, transparent 45%); }
.modal__title { max-width: 14em; padding-right: 60px; font-weight: 500; font-size: clamp(28px, 3vw, 38px); line-height: 1.1; }
.modal__body { margin-top: 12px; font-size: 19px; }
.modal__close { margin: 24px 0 0 22px; }

/* =====================================================================================================================
   The exploration desk (html.desk)
   ===================================================================================================================== */
html.desk, html.desk body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.desk .deskroom { position: fixed; inset: 0; z-index: 10; display: block; width: auto; margin: 0; padding: 0; pointer-events: none; }
html.desk.panel-open .scene::after { opacity: 1; }

/* The title stamp and "On the desk" */
html.desk .deskhud { display: flex; position: fixed; z-index: 20; left: 12px; top: max(12px, env(safe-area-inset-top)); align-items: center; gap: 10px; pointer-events: none; }
html.desk .deskhud > * { pointer-events: auto; }
html.desk.panel-open .deskhud { visibility: hidden; }
.stamp {
  --focus: var(--chart);
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px 8px 9px; text-decoration: none;
  color: var(--navy); transform: rotate(-2deg); filter: drop-shadow(2px 5px 5px rgba(0, 0, 0, .5)); transition: transform .3s var(--ease);
}
.stamp::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background-color: var(--chart);
  -webkit-mask: radial-gradient(circle, transparent 2.4px, #000 2.8px) 0 0 / 8px 8px round, linear-gradient(#000 0 0) 4px 4px / calc(100% - 8px) calc(100% - 8px) no-repeat;
  mask: radial-gradient(circle, transparent 2.4px, #000 2.8px) 0 0 / 8px 8px round, linear-gradient(#000 0 0) 4px 4px / calc(100% - 8px) calc(100% - 8px) no-repeat;
}
.stamp::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(27, 42, 58, .45); pointer-events: none; }
.stamp img { width: 30px; height: 30px; border-radius: 50%; }
.stamp__word { font-weight: 500; font-size: 15px; letter-spacing: .2em; white-space: nowrap; }
.stamp:hover { transform: rotate(0deg) scale(1.03); }
.menutoggle {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px 8px 12px; border-radius: 4px;
  font-family: var(--f-cond); font-weight: 600; font-size: 14px; line-height: 1; letter-spacing: .16em; text-transform: uppercase; color: var(--chart);
  background: var(--wood); box-shadow: inset 0 0 0 1px rgba(216, 187, 132, .55), inset 0 0 0 3px rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .5);
}
.menutoggle__icon { width: 16px; height: 12px; background: linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor 0 0) 0 5px / 70% 2px no-repeat, linear-gradient(currentColor 0 0) 0 10px / 100% 2px no-repeat; }
.menutoggle[aria-expanded="true"] { color: var(--ground); background: var(--brass-hi); }

/* Title card over the desk, folding into the stamp. A compact plaque; desk.js moves it (by transform, --tc-x/--tc-y)
   to the clearest spot above or beside the things on the table. */
html.desk .titlecard {
  position: fixed; z-index: 22; left: 0; top: 0; width: min(380px, 34vw); padding: 24px 24px 22px;
  transform-origin: 0 0; transform: translate(var(--tc-x, var(--gutter)), var(--tc-y, 72px)) scale(.94); opacity: 0; visibility: hidden; pointer-events: auto;
  transition: opacity .4s var(--ease), transform .55s var(--ease), visibility 0s linear .55s;
}
html.desk.title-open .titlecard { opacity: 1; visibility: visible; transform: translate(var(--tc-x, var(--gutter)), var(--tc-y, 72px)); transition-delay: 0s; }
html.desk .titlecard::before { inset: 8px; }
html.desk .wordmark__main { font-size: clamp(28px, 2.5vw, 38px); }
html.desk .wordmark__sub { margin-top: 10px; gap: 10px; font-size: 12px; letter-spacing: .34em; }
html.desk .titlecard__tagline { margin-top: 12px; font-size: 17px; line-height: 1.3; }
html.desk .titlecard__cta { margin-top: 14px; min-height: 44px; padding: 10px 18px 10px 38px; font-size: 13px; }

/* The list of objects */
html.desk .deskmenu { position: fixed; z-index: 25; left: 12px; top: 72px; width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 96px); overflow: auto; display: none; padding: 18px 22px 20px; pointer-events: auto; }
html.desk.menu-open .deskmenu { display: block; animation: rise .3s var(--ease) both; }
html.desk .deskmenu__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html.desk .deskmenu__extra { display: block; }
html.desk .deskmenu__list { margin-top: 0; }
html.desk .deskmenu__cta { margin-top: 14px; }

/* Bean counter */
.beancount__sacks { display: inline-grid; grid-auto-flow: column; gap: 3px; }
.beancount__sacks i { display: block; width: 11px; height: 13px; background: rgba(241, 232, 212, .22); clip-path: polygon(22% 0, 78% 0, 64% 20%, 100% 38%, 96% 100%, 4% 100%, 0 38%, 36% 20%); transition: background-color .5s; }
.beancount__sacks i.is-found { background: var(--brass-hi); }
html.desk .beancount {
  display: inline-flex; align-items: center; gap: 10px; position: fixed; z-index: 20; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  min-height: 40px; padding: 6px 14px; border-radius: 4px; pointer-events: none;
  font-family: var(--f-mono); font-size: 12.5px; color: var(--chart); white-space: nowrap;
  background: var(--wood); box-shadow: inset 0 0 0 1px rgba(216, 187, 132, .5), 0 6px 14px rgba(0, 0, 0, .45);
}

/* Object buttons (keyboard and screen readers; the pointer goes to the canvas) and the name tag */
html.desk .objbuttons { display: block; }
.objbtn {
  --focus: var(--chart);
  position: fixed; z-index: 5; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  transform: translate(var(--ox, -9999px), var(--oy, -9999px)); pointer-events: none; opacity: 0; visibility: hidden;
}
.objbtn.is-placed { visibility: visible; }
.objbtn:focus-visible { opacity: 1; background: rgba(241, 232, 212, .2); box-shadow: 0 0 0 7px rgba(12, 10, 8, .55), inset 0 0 0 2px rgba(12, 10, 8, .55); }
html.desk.panel-open .objbtn { visibility: hidden; }
html.desk .objtag {
  display: grid; gap: 2px; position: fixed; z-index: 6; left: 0; top: 0; max-width: 260px; padding: 7px 12px 8px; border-radius: 3px;
  color: var(--navy); background: var(--label); box-shadow: 0 8px 18px rgba(0, 0, 0, .45); border-left: 3px solid var(--marker);
  transform: translate(var(--tx, -9999px), var(--ty, -9999px)) translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .18s ease; pointer-events: none;
}
html.desk .objtag.is-below { transform: translate(var(--tx, -9999px), var(--ty, -9999px)) translate(-50%, 12px); }
html.desk .objtag.is-shown { opacity: 1; }
.objtag__name { font-family: var(--f-cond); font-weight: 600; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.objtag__hint { font-style: italic; font-size: 16px; line-height: 1.25; }

/* Hint */
html.desk .hintstack {
  display: flex; flex-direction: column; align-items: center; gap: 6px; position: fixed; z-index: 15; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none; transition: opacity .4s ease;
}
html.desk .deskhint, html.desk .nexthint {
  display: block; padding: 6px 14px; border-radius: 3px; font-family: var(--f-mono); font-size: 13px; line-height: 1.35; text-align: center; color: var(--chart);
  background: rgba(12, 10, 8, .72);
}
html.desk .nexthint { color: var(--brass-hi); box-shadow: inset 0 0 0 1px rgba(216, 187, 132, .45); }
html.desk .nexthint:empty { display: none; }
html.desk.panel-open .hintstack, html.desk.title-open .hintstack, html.desk.menu-open .hintstack { opacity: 0; }

/* Sea moments at the desk */
html.desk .interlude-slip { display: none; }
html.desk .interlude { display: block; position: fixed; z-index: 15; left: var(--gutter); top: 42%; width: min(440px, var(--col)); pointer-events: none; animation: rise .5s var(--ease) both; }

/* Panels */
/* The bottom 50px of a panel is a strip of its own: the "more below" chevron lives there, never over the text. */
html.desk .panel { display: none; position: fixed; z-index: 12; left: var(--gutter); top: 12px; bottom: 6px; width: var(--col); flex-direction: column; padding-bottom: 50px; pointer-events: auto; }
html.desk .panel.is-open { display: flex; animation: panel-in .5s var(--ease) both; }
html.desk .panel__bar { display: flex; flex: 0 0 auto; align-items: center; padding: 0 0 10px; }
.panel__close {
  --focus: var(--chart);
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 16px 8px 12px; border-radius: 4px;
  font-family: var(--f-cond); font-weight: 600; font-size: 14px; line-height: 1; letter-spacing: .16em; text-transform: uppercase; color: var(--chart);
  background: var(--wood); box-shadow: inset 0 0 0 1px rgba(216, 187, 132, .55), inset 0 0 0 3px rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .5);
}
.panel__arrow { font-family: var(--f-mono); font-size: 16px; letter-spacing: 0; }
.panel__close:hover { color: var(--brass-hi); }
html.desk .panel__body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; padding: 12px 14px 24px 2px; scrollbar-width: thin; scrollbar-color: rgba(216, 187, 132, .6) transparent; }
html.desk .panel__body > .paper:first-child { margin-top: 4px; }
/* More below: the scroll area fades out at the bottom and a small brass chevron points down. */
html.desk .panel[data-more="true"] .panel__body {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 96px), rgba(0, 0, 0, .15) calc(100% - 12px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 96px), rgba(0, 0, 0, .15) calc(100% - 12px), transparent);
}
html.desk .panel::before, html.desk .panel::after { content: ""; position: absolute; left: calc(50% - 7px); pointer-events: none; opacity: 0; transition: opacity .3s ease; }
html.desk .panel::before { bottom: 5px; width: 40px; height: 40px; margin-left: -13px; border-radius: 50%; background: var(--wood); box-shadow: inset 0 0 0 1px rgba(216, 187, 132, .6), 0 6px 14px rgba(0, 0, 0, .5); }
html.desk .panel::after { bottom: 22px; width: 12px; height: 12px; margin-left: 1px; border-right: 2px solid var(--brass-hi); border-bottom: 2px solid var(--brass-hi); transform: rotate(45deg); }
html.desk .panel[data-more="true"]::before, html.desk .panel[data-more="true"]::after { opacity: 1; }
@keyframes panel-in { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; } }

/* Chart at the desk: one leg at a time */
html.desk .leg { display: none; }
html.desk .leg.is-current { display: grid; }
html.desk .chartpick { display: grid; }
html.desk .panel--chart.has-leg .chartpick { display: none; }
html.desk .panel--chart.has-leg .ports { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
html.desk .panel--chart.has-leg .port { grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; min-height: 50px; padding: 5px 8px; border: 1px solid rgba(27, 42, 58, .25); }
html.desk .panel--chart.has-leg .port__n { grid-row: 1 / 3; width: 24px; height: 24px; font-size: 11px; }
html.desk .panel--chart.has-leg .port__name { font-size: 15.5px; line-height: 1.15; }
html.desk .panel--chart.has-leg .port__country { font-size: 11.5px; letter-spacing: .1em; }
html.desk .panel--chart.has-leg .port__coords { display: none; }
html.desk .panel--chart.has-leg .chartcard__title { font-size: clamp(24px, 2vw, 32px); }
html.desk .legnav { display: none; }
html.desk .panel--chart .sailing:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(27, 42, 58, .35); }
.sailing__line { flex: 1 1 16em; min-width: 0; font-style: italic; font-size: 19px; line-height: 1.35; }
.sailing__line::before { content: ""; display: inline-block; margin-right: 10px; width: 22px; height: 12px; vertical-align: -1px; background: var(--marker); clip-path: polygon(0 50%, 100% 50%, 80% 100%, 16% 100%); }
.sailing__line::before { animation: bob 1.1s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(-2px) rotate(-4deg); } to { transform: translateY(2px) rotate(4deg); } }
html.desk .panelnext { display: flex; justify-content: flex-end; margin: 0; padding: 6px 6px 0 22px; }
@media (min-width: 900px) {
  html.desk.panel-open .objectdock {
    display: block; position: fixed; z-index: 30; left: calc(42vw + 24px); bottom: 12px; padding: 5px; border-radius: 6px;
    background: var(--wood); box-shadow: inset 0 0 0 1px rgba(216, 187, 132, .55), 0 10px 22px rgba(0, 0, 0, .5);
  }
  html.desk .objectdock .objectbar__list { gap: 4px; }
  html.desk .objectdock .objectbar__btn { width: 46px; height: 46px; }
  html.desk .objectdock .objectbar__btn svg { width: 24px; height: 24px; }
}
html.desk .panel--chart.has-leg .legnav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 0 6px 0 22px; }

/* Landfall at the desk: over the scene, beside the panel */
html.desk .landfall { display: none; position: fixed; z-index: 23; left: calc(42vw + 24px); top: 50%; width: min(440px, 40vw); transform: translateY(-50%); pointer-events: auto; }
html.desk.landfall-open .landfall { display: block; animation: rise .6s var(--ease) both; }
html.desk .landfall__actions { display: flex; }

/* Byline in a corner */
html.desk .byline { position: fixed; z-index: 31; right: 12px; bottom: 10px; padding: 0; text-align: right; }
html.desk .byline a { min-height: 32px; font-size: 11.5px; }

/* ---------- Phones and portrait tablets ---------- */
@media (max-width: 899.98px) {
  body { font-size: 18px; }
  html:not(.js) .scene::before, html.no-webgl .scene::before { left: 50%; top: 7vh; width: min(46vw, 220px); transform: translateX(-50%); }
  .deskroom { gap: 30px; padding-block: 72px 32px; }
  .titlecard { padding: 30px 20px 26px; }
  .wordmark__main { font-size: clamp(32px, 10.4vw, 52px); }
  .wordmark__sub { font-size: 13px; letter-spacing: .34em; gap: 10px; }
  .titlecard__tagline { font-size: 19px; margin-top: 14px; }
  .titlecard__cta { margin-top: 18px; }
  .logpage { padding: 24px 18px 26px 40px; }
  .logpage::before { left: 30px; }
  .logpage::after { left: 7px; }
  .logpage__body { font-size: 18px; }
  .bagtag { width: min(290px, 84%); margin-right: 2%; }
  .interlude-slip, .interlude { font-size: 15px; }
  .orderform { padding: 26px 18px 30px 42px; }
  .orderform::after { left: 8px; }
  .quiz__nav, .result__actions { padding-left: 18px; }
  .result__stamp { font-size: 20px; top: 6px; }
  .indexcard, .picked { padding: 24px 20px 24px; }
  .indexcard::before { top: 58px; }
  .tidecard { padding: 26px 22px 22px; }
  .sack { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }
  .sack__art { width: 70px; }
  .sack__go { font-size: 17px; }

  html.desk { --bar-h: calc(84px + env(safe-area-inset-bottom)); --col: auto; }
  html.desk .stamp__word { display: none; }
  html.desk .stamp { padding: 8px 10px; }
  html.desk .deskhud { gap: 8px; }
  html.desk .menutoggle { padding: 8px 12px; }

  html.desk .titlecard { width: min(420px, calc(100vw - 24px)); padding: 14px 16px 12px; }
  /* The card spans the top of a phone screen: the sea sound hint waits until it has folded into the stamp.
     (visibility, not display: scene/sound.js owns the hint's hidden attribute.) */
  html.desk.title-open .sound__hint { visibility: hidden; }
  html.desk .titlecard::before { inset: 6px; }
  html.desk .wordmark__main { font-size: 28px; }
  html.desk .wordmark__sub { margin-top: 8px; font-size: 11px; letter-spacing: .3em; }
  html.desk .titlecard__tagline { margin-top: 8px; font-size: 15px; }
  html.desk .titlecard__cta { margin-top: 10px; }
  html.desk .deskmenu { left: 0; right: 0; top: auto; bottom: var(--bar-h); width: auto; max-height: calc(100svh - var(--bar-h) - 72px); border-radius: 8px 8px 0 0; }
  html.desk .hintstack { bottom: calc(var(--bar-h) + 10px); }
  html.desk .deskhint, html.desk .nexthint { font-size: 12px; }
  html.desk .interlude { left: 16px; right: 16px; top: auto; bottom: calc(var(--bar-h) + 56px); width: auto; max-width: none; }

  /* Object bar: six things with a panel, and the bean counter */
  html.desk .objectbar {
    display: block; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--bar-h); padding: 6px 8px env(safe-area-inset-bottom);
    background: var(--wood); box-shadow: inset 0 2px 0 rgba(216, 187, 132, .6), 0 -10px 24px rgba(0, 0, 0, .45);
  }
  html.desk .beancount {
    top: auto; left: auto; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 4px); transform: none; z-index: 31;
    flex-direction: row; align-items: center; gap: 6px; min-height: 0; padding: 0; background: none; box-shadow: none;
    font-size: 10.5px; line-height: 1.2;
  }
  html.desk .beancount .beancount__sacks { display: none; } /* the count alone, so it fits beside the byline */
  html.desk .byline { left: 8px; right: auto; bottom: calc(env(safe-area-inset-bottom) + 1px); }
  html.desk .byline a { min-height: 24px; padding: 0 6px; font-size: 10.5px; background: none; }

  html.desk .panel {
    left: 0; right: 0; top: 45svh; bottom: var(--bar-h); width: auto; padding: 0 10px 50px;
    background: linear-gradient(180deg, rgba(12, 9, 6, .2), rgba(12, 9, 6, .82) 40px);
  }
  html.desk .panel.is-open { animation-name: panel-up; }
  html.desk .panel__bar { padding: 8px 2px; }
  html.desk .panel__close { min-height: 44px; }
  html.desk .panel__body { padding: 6px 2px 20px; gap: 22px; }
  html.desk .panel--chart.has-leg .ports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.desk .landfall { left: 10px; right: 10px; top: auto; bottom: calc(var(--bar-h) + 8px); width: auto; max-height: calc(54svh - var(--bar-h) + 40px); padding: 16px 18px 16px; overflow: auto; overscroll-behavior: contain; transform: none; }
  html.desk .landfall .loglabel { font-size: 12.5px; }
  html.desk .landfall__title { margin-top: 6px; font-size: 23px; }
  html.desk .landfall__body { margin-top: 6px; font-size: 15.5px; line-height: 1.38; }
  html.desk .landfall__actions { margin-top: 12px; padding-left: 16px; gap: 8px 12px; }
  html.desk .landfall .tag { min-height: 44px; padding: 10px 12px 10px 32px; font-size: 12px; letter-spacing: .1em; }
  html.desk .landfall .tag::after { left: -16px; width: 32px; }
  html.desk .landfall .stampbtn { min-height: 44px; padding: 8px 12px; font-size: 12px; letter-spacing: .14em; }
  @keyframes panel-up { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
}

/* ---------- Enlarged photo prints (app/lightbox.js) ---------- */
.photo__frame--zoom { cursor: zoom-in; }
.photo__frame--zoom:focus-visible { outline: 3px solid var(--marker); outline-offset: 3px; }
.photo { transition: transform .25s ease; }
@media (hover: hover) { .photo:has(.photo__frame--zoom:hover) { transform: rotate(0deg) scale(1.03); } }
.lightbox { max-width: none; max-height: none; width: auto; margin: auto; padding: 0; border: 0; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(8, 10, 14, .86); }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; gap: 16px; animation: lightbox-in .28s ease-out; }
.lightbox__print { margin: 0; padding: 10px 10px 12px; background: #fbf8f1; box-shadow: 0 30px 70px rgba(0, 0, 0, .65); transform: rotate(-.6deg); }
.lightbox__img { display: block; width: auto; height: auto; max-width: min(92vw, 1400px); max-height: calc(100svh - 170px); object-fit: contain; background: #d9cfbb; }
.lightbox__caption { max-width: min(92vw, 1400px); margin-top: 8px; font-family: var(--f-mono); font-size: 14px; line-height: 1.4; color: #3d4247; }
@keyframes lightbox-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
