* { box-sizing: border-box; }
    [hidden] { display: none !important; }
    html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
    body {
      --edge: clamp(.65rem, 3vw, 2.1rem);
      --helm-key: 46px;
      --helm-gap: 5px;
      --bottom-edge: max(1rem, env(safe-area-inset-bottom));
      color: #f6ebd1;
      background: #091122 url("./print/og.jpg") center / cover no-repeat;
      font: 16px/1.45 "Courier New", monospace;
    }
    button, a { font: inherit; }
    button { cursor: pointer; }
    a { color: inherit; text-underline-offset: .2em; }
    :focus-visible { outline: 2px solid #ffe3aa; outline-offset: 4px; }
    #sea { display: block; position: fixed; inset: 0; width: 100%; height: 100%; }
    #sea:focus { outline: none; }
    #sea:focus-visible { outline: 1px solid #f0d9ad99; outline-offset: -3px; }
    header, .helm {
      position: fixed;
      left: 0;
      right: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .75rem;
      padding: .75rem var(--edge);
      pointer-events: none;
    }
    header {
      top: 0;
      justify-content: flex-end;
      background: linear-gradient(#070d19dc, #070d1900);
    }
    #portfolio-fallback { display: flex; flex-wrap: wrap; gap: .35rem; min-width: 0; margin-inline-end: auto; }
    #storm-mix { display: flex; gap: .35rem; }
    header a, header button, #read-island, .helm button { pointer-events: auto; }
    .link-button, #sound {
      min-height: 2.25rem;
      display: inline-flex;
      align-items: center;
      color: #fff0d1;
      border: 1px solid #b49c778c;
      background: #141e2f;
      padding: .25rem .55rem;
      text-decoration: none;
      box-shadow: 2px 2px 0 #090e18;
      overflow-wrap: anywhere;
    }
    .link-button:hover, #sound:hover { background: #24344b; border-color: #e5bd76; }
    #sound[aria-pressed="true"], #storm-mix [aria-pressed="true"] { color: #ffcf84; }
    #storm-mix [aria-pressed="true"] { border-color: #e5bd76; }
    .helm {
      bottom: 0;
      align-items: end;
      padding-bottom: var(--bottom-edge);
      background: linear-gradient(0deg, #080d19db, #080d1900);
    }
    .direction { max-width: 20rem; }
    .direction p {
      margin: 0;
      font-size: .95rem;
      line-height: 1.5;
      color: #f5e7ca;
      text-shadow: 0 2px 7px #03070f;
    }
    .touch-hint { display: none; }
    #read-island {
      margin: .1rem 0 .2rem;
      border-color: #e5bd76;
    }
    .helm-actions {
      flex: none;
      display: grid;
      grid-template: repeat(2, var(--helm-key)) / repeat(3, var(--helm-key));
      gap: var(--helm-gap);
    }
    .helm-actions button {
      padding: 0;
      font: 1.3rem/1 system-ui, sans-serif;
      color: #f6ead0;
      border: 1px solid #cdb38b8a;
      background: #101a28dd;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
    }
    .helm-actions button[aria-pressed="true"] { background: #edcea0; color: #281d16; }
    [data-control="ahead"] { grid-area: 1 / 2; }
    [data-control="port"] { grid-area: 2 / 1; }
    [data-control="astern"] { grid-area: 2 / 2; }
    [data-control="starboard"] { grid-area: 2 / 3; }
    #launch-note { max-width: 28rem; }

    .island-card {
      --card-bottom: calc(var(--bottom-edge) + var(--helm-key) + var(--helm-key) + var(--helm-gap) + .65rem);
      --portrait-size: clamp(5.75rem, 12vw, 7.2rem);
      position: fixed;
      z-index: 1;
      left: var(--edge);
      bottom: var(--card-bottom);
      width: min(34rem, calc(100% - 2 * var(--edge)));
      max-height: min(16rem, 38dvh, calc(100dvh - var(--card-bottom) - 4.5rem));
      display: flex;
      flex-direction: column;
      background: #f0ddbb;
      color: #2d241e;
      border: 2px solid #a97d4c;
      box-shadow: 0 0 0 2px #0a1422, 4px 4px 0 #0a1422, inset 0 0 0 2px #f8ebd0;
    }
    .card-heading {
      flex: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .5rem;
      padding: 0 .2rem 0 .85rem;
      background: #203047;
      color: #f5dfb5;
      border-bottom: 2px solid #a97d4c;
    }
    #island-name { margin: 0; font-size: .82rem; font-weight: 700; letter-spacing: .035em; }
    .card-body { display: flex; min-height: 0; }
    .card-copy {
      flex: 1;
      min-width: 0;
      overflow: auto;
      overscroll-behavior: contain;
      scrollbar-width: thin;
      scrollbar-color: #987451 #f0ddbb;
      padding: .72rem 1rem .85rem .82rem;
      overflow-wrap: anywhere;
      font: 1rem/1.4 Georgia, serif;
    }
    .island-card h2 { font: 700 1.08rem/1.2 "Courier New", monospace; margin: 0 0 .4rem; }
    .card-copy p { margin-block: 0 .42rem; }
    .card-copy .sources { display: flex; flex-wrap: wrap; gap: .35rem; margin: .6rem 0 .12rem; }
    .card-copy .link-button {
      color: #362719;
      background: #f8e8ca;
      border: 1px solid #986c42;
      box-shadow: 2px 2px 0 #bc996e;
      padding-inline: .55rem;
      font: 700 .75rem/1.2 "Courier New", monospace;
    }
    .card-copy .link-button:hover { background: #e8cea4; border-color: #614228; }
    .card-copy :focus-visible { outline-color: #68492e; outline-offset: 2px; }
    .card-copy:focus-visible { outline-offset: -3px; }
    .sound-credits { margin-top: .65rem; font-size: .88rem; }
    .sound-credits summary { cursor: pointer; color: #63452e; }
    .sound-credits ul { padding-left: 1.15rem; }
    #close-card {
      display: grid;
      place-items: center;
      min-width: 2.15rem;
      min-height: 2.15rem;
      padding: .25rem;
      color: inherit;
      background: transparent;
      border: 1px solid transparent;
      font-size: 1.35rem;
    }
    #close-card:hover { background: #30465e; border-color: #cfb082; }
    #close-card:focus-visible { outline-offset: -4px; }
    #captain-portrait {
      display: block;
      flex: none;
      align-self: flex-start;
      width: var(--portrait-size);
      height: var(--portrait-size);
      object-fit: cover;
      object-position: center 42%;
      margin: .77rem 0 .8rem .78rem;
      background: #25374a;
      border: 2px solid #775439;
      box-shadow: 2px 2px 0 #c5a273;
      image-rendering: pixelated;
    }
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
    @media (pointer: coarse) {
      body { --helm-key: 48px; }
      .touch-hint { display: inline; }
      .key-hint { display: none; }
      .link-button, #sound, #close-card { min-height: 44px; }
      #close-card { min-width: 44px; }
    }
    @media (max-width: 430px) {
      header, .helm { gap: .35rem; }
      .direction p, header a, header button, #read-island { font-size: .83rem; }
      header .link-button, #sound { padding-inline: .4rem; }
      .island-card {
        --portrait-size: clamp(4rem, 21vw, 5.25rem);
        max-height: min(15.25rem, 40dvh, calc(100dvh - var(--card-bottom) - 3.6rem));
      }
      .card-copy { padding: .65rem .74rem .7rem .65rem; font-size: .95rem; }
      #captain-portrait { margin: .68rem 0 .72rem .6rem; }
    }
    @media (max-height: 430px) {
      .island-card { --portrait-size: 4rem; }
    }
    body:not(.interactive) .island-card:has(section:target) { display: flex !important; bottom: var(--bottom-edge); }
    body:not(.interactive) .island-card section:target { display: block !important; }
    body:not(.interactive) .card-heading { display: none; }
