@font-face { font-family: "Pirata One"; src: url("PirataOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("Alegreya-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #5b4429; }
body {
  min-height: 100vh; display: flex; padding: 10px; overflow-x: hidden;
  font: 500 18px/1.45 "Alegreya", Georgia, serif; color: #2a1f17;
  background: url("grain.svg"), radial-gradient(ellipse at 50% 45%, #f3e8cc 0%, #eadcb9 45%, #d4bf91 78%, #8c6b3f 112%) #eadcb9;
}
.backdrop { position: fixed; inset: 0; pointer-events: none; }
.backdrop svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rhumbs { opacity: .2; }
.sea { opacity: .55; }

/* chart border: double rule with a ticked scale band between */
.sheet {
  position: relative; flex: 1; display: flex; flex-direction: column; padding: 18px 14px 12px;
  border: 3px solid #2a1f17; outline: 1px solid #2a1f17; outline-offset: -11px;
  box-shadow: inset 0 0 0 7px rgba(212, 191, 145, .55), inset 0 0 90px rgba(91, 68, 41, .45);
}
.winds { display: none; }

main { flex: 1; display: grid; grid-template-columns: 1fr; justify-items: center; align-content: center; gap: 10px; }
main svg { display: block; width: 100%; height: auto; overflow: visible; }
.compass { max-width: 190px; }
.title { text-align: center; max-width: 36rem; padding: 0 6px; }
h1 { font: 400 clamp(54px, 17vw, 118px)/1 "Pirata One", serif; letter-spacing: .01em; white-space: nowrap; text-shadow: 0 2px 0 #f3e8cc, 3px 4px 0 rgba(180, 140, 60, .55); }
main .flourish { max-width: 340px; margin: 14px auto 12px; }
.soon {
  display: inline-block; margin: 20px 0 36px; padding: 4px 32px 8px; transform: rotate(-3deg);
  font: 400 clamp(34px, 9vw, 52px)/1.25 "Pirata One", serif; color: #8f2c1f; background: rgba(243, 232, 204, .75);
  border: 3px solid #8f2c1f; outline: 1px solid #8f2c1f; outline-offset: 3px; border-radius: 6px 3px 7px 4px;
}
.mail { list-style: none; display: grid; gap: 14px; }
.mail span { display: block; font-size: 15px; color: #5b4834; }
a { color: #8f2c1f; text-underline-offset: 3px; }
a:hover { color: #2a1f17; }
a:focus-visible { outline: 3px solid #8f2c1f; outline-offset: 3px; }
.mail a { display: inline-block; padding: 3px 4px; font-size: 20px; }
.ship { max-width: 340px; }
.serpent { max-width: 280px; }
.isle { display: none !important; }
footer { position: relative; text-align: center; font-size: 14px; padding: 14px 4px 4px; }
footer a { color: inherit; }
.pt { font: 400 36px "Pirata One", serif; fill: #2a1f17; }

/* tablet: art in pairs under the text */
@media (min-width: 640px) {
  main { grid-template-columns: 1fr 1fr; column-gap: 24px; align-items: center; }
  .compass, .title { grid-column: 1 / -1; }
}

/* desktop chart: title in the middle, art around it */
@media (min-width: 1100px) and (min-height: 640px) {
  .sheet { padding: 24px 36px 14px; }
  main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 40rem) minmax(0, 1fr);
    grid-template-areas: "compass title ship" "isle title ship" "serpent title isleb";
    grid-template-rows: auto auto auto; column-gap: 12px; align-content: space-evenly; align-items: center;
  }
  .compass { grid-area: compass; max-width: min(300px, 34vh); }
  .title { grid-area: title; grid-column: 2; }
  .ship { grid-area: ship; max-width: min(440px, 52vh); }
  .serpent { grid-area: serpent; max-width: min(360px, 42vh); }
  .isle { display: block !important; }
  .isle-a { grid-area: isle; max-width: min(230px, 25vh); justify-self: end; }
  .isle-b { grid-area: isleb; max-width: min(290px, 31vh); }
}
@media (min-width: 1100px) and (min-height: 860px) {
  .winds { display: block; position: absolute; top: 24px; left: 50%; width: 340px; translate: -50% 0; opacity: .8; }
}

@media (prefers-reduced-motion: no-preference) {
  .needle { transform-origin: 200px 200px; animation: needle 11s ease-in-out infinite; }
  .bob { transform-origin: 240px 260px; animation: bob 6s ease-in-out infinite; }
  .winds path { stroke-dasharray: 150 60; animation: drift 14s linear infinite; }
}
@keyframes needle { 0%, 100% { transform: rotate(-9deg); } 30% { transform: rotate(7deg); } 55% { transform: rotate(-3deg); } 78% { transform: rotate(12deg); } }
@keyframes bob { 0%, 100% { transform: rotate(-1.2deg) translateY(0); } 50% { transform: rotate(1.2deg) translateY(4px); } }
@keyframes drift { to { stroke-dashoffset: -420; } }
