@font-face {
  font-family: "REM";
  src: url("/assets/fonts/rem-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --foam: #CAE6DE;      /* the chart's water, as drawn on the approved picture */
  --pale-foam: #D3E3DF;
  --deep: #1E4F57;      /* Deep Teal, the sea set's anchor (B28) */
  --ink: #0F3A49;       /* the chart's line ink */
  --stone: #8F8E72;
  --clay: #9E4935;      /* Seed Clay, the one warm accent */
  --ground: #ECE5D8;
  --ivory: #F6F1E7;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--foam); -webkit-text-size-adjust: 100%; scrollbar-color: var(--deep) var(--pale-foam); }
body {
  margin: 0;
  background: var(--foam);
  color: var(--deep);
  font-family: "REM", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--deep); color: var(--ivory); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
a:hover { color: var(--clay); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

/* The page is one chart, laid out in percent of the approved picture and sized in container units. */
.page {
  position: relative;
  width: 100%;
  aspect-ratio: 941 / 1672;
  container-type: inline-size;
  overflow: clip;
}
.sea { position: absolute; inset: 0; }
.chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart-desk { display: none; }
/* Chart lettering carries a halo of its ground, as printed charts do, so lines never cut through words. */
.chart text { paint-order: stroke; stroke-linejoin: round; text-anchor: middle; font-family: "REM", sans-serif; }
.chart .snd { fill: var(--ink); font-style: italic; stroke: var(--foam); stroke-width: 3; }
.chart .pl-water { fill: var(--ink); font-style: italic; letter-spacing: 0.08em; stroke: var(--foam); stroke-width: 4; }
.chart .pl-land { fill: var(--ink); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; stroke: #A9AA8E; stroke-width: 4; }
.chart .leader { stroke: var(--ink); stroke-dasharray: 9 7; fill: none; }
.chart .pin-ring { fill: var(--pale-foam); stroke: var(--ink); }
.chart .pin { fill: var(--ink); }

/* Title block: the chart's double-rule frame, with corner ticks */
.title-block {
  position: absolute;
  left: 3.8%; top: 3.6%; width: 52.7%; height: 11.5%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4%;
  border: 1.5px solid var(--deep);
  outline: 1px solid var(--deep);
  outline-offset: 0.9cqw;
  background: color-mix(in srgb, var(--foam) 82%, transparent);
}
.wordmark { width: 82%; }
.title-place {
  margin: 0;
  font-size: max(6.5px, 1.6cqw);
  font-weight: 600;
  letter-spacing: 0.2em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--deep);
}

.headline {
  position: absolute;
  left: 4.25%; top: 31.2%;
  margin: 0;
  max-width: 62%;
  font-size: 8.9cqw;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
  text-shadow: 0 0 6px var(--foam), 0 0 3px var(--foam), 0 0 1px var(--foam);
}
.subline {
  position: absolute;
  left: 5.1%; top: 42.6%;
  margin: 0;
  font-size: max(11px, 3.3cqw);
  line-height: 1.32;
  color: var(--ink);
  text-shadow: 0 0 5px var(--foam), 0 0 2px var(--foam), 0 0 1px var(--foam);
}

/* The magnified view: a double ring with four ticks around the stitch photo */
.lens {
  position: absolute;
  left: 14.9%; top: 48.5%; width: 44.6%;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 0.9cqw;
  background: var(--pale-foam);
}
.lens::before, .lens::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.lens::before { left: 50%; top: -6%; width: 2px; height: 112%; transform: translateX(-50%); mask: linear-gradient(#000 0 5%, transparent 5% 95%, #000 95%); }
.lens::after { top: 50%; left: -6%; height: 2px; width: 112%; transform: translateY(-50%); mask: linear-gradient(90deg, #000 0 5%, transparent 5% 95%, #000 95%); }
.lens-photo { position: absolute; inset: 4%; border-radius: 50%; overflow: hidden; }
.lens-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-pending { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--pale-foam) 0 10px, #c3dcd5 10px 20px); }
.photo-pending span { font-size: max(9px, 2.4cqw); text-align: center; max-width: 60%; }

/* Legend */
.legend {
  position: absolute;
  left: 3.8%; top: 77.8%; width: 55.3%; height: 20.3%;
  padding: 3.2cqw 3.4cqw;
  border: 1.5px solid var(--deep);
  outline: 1px solid var(--deep);
  outline-offset: 0.9cqw;
  background: color-mix(in srgb, var(--foam) 88%, transparent);
  display: flex;
  flex-direction: column;
  gap: 2.2cqw;
  color: var(--ink);
}
.legend-title { margin: 0; font-size: max(7px, 2cqw); font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; }
.legend-keys {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.6cqw 2.4cqw;
  font-size: max(7.5px, 1.95cqw);
}
.legend-keys li { display: flex; align-items: center; gap: 1.4cqw; white-space: nowrap; }
.legend-keys svg { width: 5.4cqw; min-width: 15px; height: auto; overflow: visible; flex: none; }
.k-dash { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 3 2.4; fill: none; }
.k-ferry { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 6 4; fill: none; }
.k-line { stroke: var(--ink); stroke-width: 1.4; fill: none; stroke-linecap: round; }
.k-fill { fill: var(--ink); }
.k-flare { stroke: var(--clay); stroke-width: 1.2; stroke-linecap: round; }
.k-num { display: inline-block; width: 5.4cqw; min-width: 15px; text-align: center; font-style: italic; }
.legend-follow {
  margin-top: auto;
  display: flex; align-items: center; gap: 1.6cqw;
  min-height: 24px;
  font-size: max(10.5px, 2.6cqw);
  font-weight: 600;
  text-decoration: none;
  color: var(--deep);
}
.legend-follow:hover { color: var(--clay); text-decoration: underline; }
.k-dot { width: max(10px, 2.8cqw); height: max(10px, 2.8cqw); border-radius: 50%; background: var(--deep); flex: none; }

/* Below the chart: the shore */
.shore {
  background: var(--ground);
  padding: 2.5rem 1.25rem 3rem;
  display: grid;
  justify-items: center;
  gap: 1.75rem;
  text-align: center;
  color: var(--deep);
}
.character { margin: 0; width: min(54vw, 240px); }
.character figcaption { margin-top: 0.5rem; font-size: 0.85rem; letter-spacing: 0.04em; }
.shore-text { display: grid; gap: 0.9rem; justify-items: center; }
.about { margin: 0; max-width: 28ch; font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem); line-height: 1.35; text-wrap: balance; }
.contact, .sister { margin: 0; font-size: 1.05rem; }
.source { margin: 0.75rem 0 0; font-size: 0.75rem; opacity: 0.8; max-width: 40ch; }

/* Wide screens: the approved desktop picture */
@media (min-width: 760px) {
  /* The whole chart fits the window's height on wide screens; beyond its sides the sea continues. */
  .page { aspect-ratio: 1672 / 941; width: min(100%, calc(100svh * 1672 / 941)); margin: 0 auto; }
  .chart-phone { display: none; }
  .chart-desk { display: block; }
  .title-block { left: 3%; top: 5.8%; width: 30.2%; height: 18.8%; outline-offset: 0.5cqw; }
  .title-place { font-size: max(9.5px, 0.95cqw); letter-spacing: 0.32em; }
  .headline { left: 4.5%; top: 33.6%; font-size: 5.3cqw; max-width: 40%; }
  .subline { left: 4.8%; top: 53.4%; font-size: 1.95cqw; }
  .lens { left: 41.3%; top: 39.3%; width: 20.3%; outline-offset: 0.45cqw; }
  .photo-pending span { font-size: 1.2cqw; }
  .legend { left: 3.1%; top: 68%; width: 23.9%; height: 27.8%; padding: 1.3cqw 1.5cqw; gap: 0.9cqw; outline-offset: 0.45cqw; }
  .legend-title { font-size: 0.85cqw; }
  .legend-keys { gap: 0.6cqw 1cqw; font-size: 0.9cqw; }
  .legend-keys svg, .k-num { width: 2.4cqw; }
  .legend-keys li { gap: 0.6cqw; }
  .legend-follow { font-size: 1cqw; gap: 0.7cqw; white-space: nowrap; }
  .k-dot { width: 1.2cqw; height: 1.2cqw; }
  .shore { grid-template-columns: auto minmax(0, 32rem); justify-content: center; align-items: center; text-align: left; gap: 3rem; padding: 3.5rem 2rem 4rem; }
  .shore-text { justify-items: start; }
  .character { width: 220px; }
}

/* The link to the sister brand: its own mark, so the family reads at a glance */
.sister-link { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; padding: 0.4rem 0.2rem; }
.sister-link img { width: 5.5rem; height: auto; }
.sister-link .sister-url { font-size: 0.95rem; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
.sister-link:hover .sister-url { color: var(--clay); }

/* When the window is wider than the chart, the chart sits on the sea with a printed chart's neat line around it. */
@media (min-width: 760px) and (min-aspect-ratio: 1672 / 941) {
  html, body { background: var(--pale-foam); }
  .page { box-shadow: 0 0 0 1.5px var(--deep), 0 0 0 6px var(--pale-foam), 0 0 0 7px var(--deep); }
}

/* Finish-review fixes, 2026-10-27 */
.chart .knockout { fill: var(--foam); opacity: 0.92; }
/* Chart frames: the rules overshoot at each corner, as on a printed chart's title block and legend */
.title-block, .legend { position: absolute; }
.title-block::before, .legend::before,
.title-block::after, .legend::after { content: ""; position: absolute; pointer-events: none; }
.title-block::before, .legend::before { inset: -1.3cqw -2.6cqw; border-top: 1px solid var(--deep); border-bottom: 1px solid var(--deep); }
.title-block::after, .legend::after { inset: -2.6cqw -1.3cqw; border-left: 1px solid var(--deep); border-right: 1px solid var(--deep); }
/* The legend fits its contents */
.legend { height: auto; width: 60%; }
@media (min-width: 760px) {
  .title-block::before, .legend::before { inset: -0.65cqw -1.2cqw; }
  .title-block::after, .legend::after { inset: -1.2cqw -0.65cqw; }
  .legend { width: 23.9%; }
  .legend-keys svg, .k-num { width: 2.8cqw; }
}

/* One screen, no scrolling (the owner, 2026-10-27): the chart fits the room the window has, framed by its neat line
   on the sea; the strip below holds the illustrated character, the line, the email, the sister link and the credits. */
html, body { height: 100%; background: var(--pale-foam); }
body { display: flex; flex-direction: column; height: 100svh; }
.stage {
  --ar: calc(941 / 1672);
  flex: 1 1 auto;
  min-height: 0;
  container-type: size;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 8px;
}
.page {
  flex: none;
  width: min(100%, calc((100cqh - 16px) * var(--ar)));
  max-width: none;
  margin: 0;
  box-shadow: 0 0 0 1.5px var(--deep), 0 0 0 5px var(--pale-foam), 0 0 0 6px var(--deep);
}
.shore {
  flex: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  padding: 0.5rem 1rem 0.6rem;
  text-align: left;
  background: var(--ground);
}
.character { width: auto; display: flex; flex-direction: column; align-items: center; flex: none; }
.character img { height: 78px; width: auto; }
.character figcaption { margin-top: 0.15rem; font-size: 0.62rem; letter-spacing: 0.02em; white-space: nowrap; }
.shore-text { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 0.15rem 1.1rem; }
.about { font-size: clamp(0.9rem, 0.8rem + 0.4vw, 1.1rem); max-width: none; flex-basis: 100%; text-wrap: balance; }
.contact, .sister { font-size: 0.95rem; }
.sister-link { padding: 0.1rem; }
.sister-link img { width: 4.2rem; }
.source { margin: 0; font-size: 0.68rem; flex-basis: 100%; max-width: none; }
@media (min-width: 760px) {
  .stage { --ar: calc(1672 / 941); }
  .page { width: min(100%, calc((100cqh - 16px) * var(--ar))); }
  .shore { gap: 1.5rem; padding: 0.55rem 2rem 0.7rem; }
  .character img { height: 92px; }
  .shore-text { justify-items: start; }
}
.shore { max-width: 100vw; overflow: hidden; }
.shore-text { min-width: 0; flex: 1 1 auto; }
.sister-link { flex-wrap: wrap; }
/* Phone: a compact strip so the chart keeps most of the screen */
@media (max-width: 759px) {
  .shore { gap: 0.6rem; padding: 0.4rem 0.75rem 0.5rem; align-items: center; }
  .character img { height: 58px; }
  .character figcaption { font-size: 0.55rem; }
  .shore-text { gap: 0.05rem 0.8rem; }
  .about { font-size: 0.82rem; line-height: 1.25; }
  .contact, .sister { font-size: 0.82rem; }
  .sister-link { gap: 0.35rem; }
  .sister-link img { width: 3.2rem; }
  .source { font-size: 0.58rem; }
}
/* The kelp key is Hatto: sea otters rest in kelp beds (the owner's idea, 2026-10-27) */
.k-icon { display: inline-flex; justify-content: center; width: 5.4cqw; min-width: 15px; flex: none; }
.k-icon img { height: 1.9em; width: auto; margin: -0.45em 0; }
@media (min-width: 760px) { .k-icon { width: 2.8cqw; } }

/* R1-B as a chart cartouche over open water (the owner: the footer "looks weird"); the footer is one line like WINK's */
.cartouche {
  position: absolute;
  left: 69.5%; top: 78%; width: 27.5%;
  margin: 0;
  padding: 2cqw 2cqw 1.6cqw;
  border: 1.5px solid var(--deep);
  outline: 1px solid var(--deep);
  outline-offset: 0.9cqw;
  background: color-mix(in srgb, var(--foam) 88%, transparent);
  color: var(--ink);
  text-align: center;
}
.cartouche img { width: 100%; height: auto; }
.cartouche figcaption { margin-top: 1cqw; font-size: max(7px, 1.75cqw); line-height: 1.2; }
@media (min-width: 760px) {
  .cartouche { left: 28.4%; top: 68.5%; width: 11.2%; padding: 0.8cqw 0.8cqw 0.6cqw; outline-offset: 0.45cqw; }
  .cartouche figcaption { margin-top: 0.4cqw; font-size: max(8px, 0.75cqw); }
}
.shore { flex-wrap: wrap; gap: 0.2rem 1.4rem; padding: 0.55rem 1rem 0.65rem; justify-content: center; align-items: center; text-align: center; }
.shore-text { display: contents; }
.shore .about { flex-basis: auto; font-size: clamp(0.85rem, 0.78rem + 0.35vw, 1.05rem); margin: 0; }
.shore .contact, .shore .sister { margin: 0; font-size: clamp(0.85rem, 0.8rem + 0.25vw, 1rem); }
.shore .sister-link img { width: 4.6rem; }
.shore .source { flex-basis: 100%; margin: 0.1rem 0 0; font-size: 0.66rem; opacity: 0.75; }
.k-icon img { filter: contrast(1.6) saturate(1.4); }
@media (max-width: 759px) {
  .shore { gap: 0.1rem 0.9rem; padding: 0.45rem 0.75rem 0.5rem; }
  .shore .about { flex-basis: 100%; font-size: 0.82rem; }
  .shore .contact, .shore .sister { font-size: 0.82rem; }
  .shore .sister-link img { width: 3.4rem; }
  .shore .source { font-size: 0.58rem; }
}
.osm {
  position: absolute; right: 1.2%; bottom: 0.6%; margin: 0;
  font-size: max(7px, 1.3cqw); color: var(--ink); opacity: 0.8;
  text-shadow: 0 0 3px var(--foam), 0 0 2px var(--foam);
}
@media (min-width: 760px) {
  .cartouche { left: 30.2%; }
  .osm { font-size: max(8px, 0.62cqw); right: 0.7%; bottom: 0.8%; }
}
.shore .maker { margin: 0; font-size: clamp(0.85rem, 0.8rem + 0.25vw, 1rem); font-style: italic; }
@media (max-width: 759px) { .shore .maker { font-size: 0.82rem; } }
.cartouche { padding-bottom: 2cqw; }
@media (min-width: 760px) { .cartouche { padding-bottom: 0.8cqw; } }

/* The lens: a drawing of stitches; look closer (hover or tap) and it becomes the close-up (the owner's pick) */
button.lens-photo { border: 0; padding: 0; margin: 0; background: var(--pale-foam); cursor: zoom-in; font: inherit; }
button.lens-photo[aria-pressed="true"] { cursor: zoom-out; }
.lens-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lens-photo .lens-draw { transition: transform 520ms var(--ease, cubic-bezier(0.22, 1, 0.36, 1)), opacity 360ms ease-out; }
.lens-photo .lens-real { opacity: 0; transform: scale(1.18); transition: opacity 360ms ease-out, transform 620ms cubic-bezier(0.22, 1, 0.36, 1); }
.lens-photo[aria-pressed="true"] .lens-real { opacity: 1; transform: scale(1); }
.lens-photo[aria-pressed="true"] .lens-draw { transform: scale(1.12); opacity: 0; }
@media (hover: hover) {
  .lens-photo:hover .lens-real { opacity: 1; transform: scale(1); }
  .lens-photo:hover .lens-draw { transform: scale(1.12); opacity: 0; }
}
.lens-photo:focus-visible { outline: 2px solid var(--clay); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .lens-photo img { transition: none; } }
.lens::before, .lens::after { pointer-events: none; z-index: 1; }
/* The sister link sits at the right end of the footer, as on WINK's page (the owner: keep it consistent) */
@media (min-width: 760px) {
  .shore { justify-content: flex-start; padding-left: 2rem; padding-right: 2rem; }
  .shore .sister { margin-left: auto; }
}
@media (min-width: 760px) { .shore .about { margin-left: auto; } }
/* The chart fills the screen's height like WINK's sheet (the owner: "largen the map to fit the screen") */
.stage { padding: 0; }
.page { width: min(100%, calc(100cqh * var(--ar))); box-shadow: -1.5px 0 0 var(--deep), 1.5px 0 0 var(--deep), -6px 0 0 var(--pale-foam), 6px 0 0 var(--pale-foam), -7px 0 0 var(--deep), 7px 0 0 var(--deep); }
@media (min-width: 760px) { .page { width: min(100%, calc(100cqh * var(--ar))); } .shore { padding-top: 0.55rem; padding-bottom: 0.7rem; } }
/* No pale strips above and below the chart when the window is taller than it (2026-10-27). Phones: the chart keeps
   its shape (stretching it pushes the coast under the title block) and the footer takes the spare height. 16:10
   desktops: the chart grows a little to the footer; its centred slice crop loses a sliver top and bottom. */
@media (max-width: 759px) {
  .stage { flex: 0 1 calc(100vw / var(--ar)); }
  .shore { flex: 1 0 auto; align-content: center; }
}
@media (min-width: 760px) {
  @container (max-aspect-ratio: 1672 / 941) {
    .page { width: 100%; height: min(100cqh, calc(100cqw / var(--ar) * 1.12)); aspect-ratio: auto; }
  }
}
/* Both pages' footer strips are the same height on wider screens (the owner, 2026-11-07): 56 px, the sister mark
   brought down to about the height of WINK's SIMOY line. */
@media (min-width: 760px) {
  .shore { min-height: 56px; }
  .shore .sister-link img { width: 3.6rem; }
}
