:root {
  --paper: #fbf6ea;
  --paper-2: #f3ecd9;
  --ink: #34413f;
  --ink-soft: #5d6b67;
  --sea: #2e7f99;
  --sea-light: #9fd8de;
  --leaf: #4e8c47;
  --roof: #c75b3f;
  --sun: #f2c66d;
  --line: #d9ccaa;
  --card: #fffdf6;
  --code-bg: #f1ead6;
  --shadow: 0 10px 30px rgba(46, 82, 89, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #18242b;
    --paper-2: #1f2f37;
    --ink: #eae4d3;
    --ink-soft: #b5b8ad;
    --line: #3a4d55;
    --card: #22343c;
    --code-bg: #2b3f48;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 "Nunito", system-ui, sans-serif;
}
h1, h2, h3, .brand, .sign-name { font-family: "Kaisei Decol", Georgia, serif; font-weight: 700; }
a { color: var(--sea); }
code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.88em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; }
.muted { color: var(--ink-soft); }

/* ------------------------------ top bar ------------------------------ */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(to bottom, rgba(251, 246, 234, 0.92), rgba(251, 246, 234, 0));
}
@media (prefers-color-scheme: dark) { .topbar { background: linear-gradient(to bottom, rgba(24, 36, 43, 0.92), rgba(24, 36, 43, 0)); } }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(40, 60, 70, 0.25)); }
/* "by STRATO" sits under the name and ends where the name ends. */
.wordmark { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.wordmark-name { font-size: 1.35rem; }
.wordmark-by { margin-top: 2px; font: 700 0.64rem/1 "Nunito", sans-serif; letter-spacing: 0.12em; color: var(--ink-soft); }
.topbar nav { display: flex; gap: 18px; }
.topbar nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.topbar nav a:hover { color: var(--sea); }

/* -------------------------------- sea -------------------------------- */

.sea { position: relative; height: min(100vh, 56.25vw); min-height: 560px; overflow: hidden; background: #5fb4c4; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.wave { animation: lap 8s ease-in-out infinite; }
@keyframes lap { 0%, 100% { transform: translateX(0); opacity: 1; } 50% { transform: translateX(8px); opacity: 0.35; } }

/* Clouds and their shadows drift together, slowly, left to right. */
.drift { animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-320px); } to { transform: translateX(1920px); } }
.cloud { opacity: 0.96; }
.cloud-shadow { filter: url(#shade); opacity: 0.5; }
.airship .hover { animation: hover 6s ease-in-out infinite; }
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.isle-art { pointer-events: none; }
.label { pointer-events: none; }
.banner { fill: #f7ecd2; stroke: #8a6a45; stroke-width: 1.4; }
.banner-back { fill: #e6d3a8; stroke: #8a6a45; stroke-width: 1.2; }
.label-name { font-family: "Kaisei Decol", Georgia, serif; font-weight: 700; font-size: 17px; fill: #4a3a28; text-anchor: middle; dominant-baseline: middle; }
.label-sub { font: 700 12px "Nunito", sans-serif; fill: #24576b; text-anchor: middle; paint-order: stroke; stroke: rgba(240, 252, 251, 0.9); stroke-width: 3.5px; stroke-linejoin: round; }

.course { fill: none; stroke: #2f7894; stroke-width: 1.6; stroke-dasharray: 1 8; stroke-linecap: round; opacity: 0.55; }
.ship { cursor: pointer; outline: none; transition: opacity 1s ease; }
.ship .bob { animation: bob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2.5deg); } 50% { transform: translateY(-2.5px) rotate(2.5deg); } }
.ship-shadow { fill: #1f5f78; opacity: 0.22; }
.ship:hover .bob, .ship:focus .bob { filter: drop-shadow(0 0 5px #fff4cf); }
.ship.docked { opacity: 0.6; }
.ship.gone { opacity: 0; }

/* Below the chart, the sea gives way to the parchment of the page: the band
   starts in the colour of the chart's bottom edge, so no island is faded. */
.shore {
  height: clamp(90px, 14vh, 160px); margin-bottom: calc(-1 * clamp(40px, 6vw, 80px));
  background: linear-gradient(to bottom, #7fc6da, rgba(127, 198, 218, 0.55) 38%, rgba(220, 236, 228, 0.6) 68%, var(--paper));
}
.legend, .scroll-cue { z-index: 2; }
.scroll-cue { color: var(--ink-soft); }

/* A slow light moving over the water. */
.shimmer {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0.4;
  background:
    repeating-linear-gradient(115deg, transparent 0 90px, rgba(255, 255, 255, 0.22) 120px, transparent 150px 260px),
    radial-gradient(ellipse at 70% 15%, rgba(255, 250, 225, 0.55), transparent 55%);
  background-size: 400% 400%, 100% 100%;
  animation: shimmer 26s linear infinite;
}
@keyframes shimmer { from { background-position: 0% 0%, 0 0; } to { background-position: 100% 100%, 0 0; } }

.sea-card {
  position: absolute; left: clamp(16px, 4vw, 48px); top: 86px;
  padding: 10px 18px;
  background: rgba(251, 246, 234, 0.9); border: 1.5px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); backdrop-filter: blur(3px);
}
@media (prefers-color-scheme: dark) { .sea-card { background: rgba(24, 36, 43, 0.88); } }
.sea-card h1 { margin: 0 0 6px; font-size: 2.2rem; line-height: 1.1; }
.sea-card p { margin: 0 0 12px; }
.tally { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; font-size: 0.95rem; }
.quiet { margin: 4px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tally b { font-family: "Kaisei Decol", serif; font-size: 1.3rem; color: var(--sea); margin-right: 3px; }

.legend { position: absolute; right: 18px; bottom: 18px; display: flex; gap: 14px; padding: 8px 14px; border-radius: 12px; background: rgba(251, 246, 234, 0.85); font-size: 0.85rem; }
@media (prefers-color-scheme: dark) { .legend { background: rgba(24, 36, 43, 0.85); } }
.sail { display: inline-block; width: 10px; height: 13px; margin-right: 6px; vertical-align: -1px; border-radius: 1px 9px 1px 1px; border: 1px solid rgba(70, 50, 30, 0.5); }
.sail.sent { background: #968cb2; } .sail.proven { background: #5896c4; } .sail.vouched { background: #e6b046; } .sail.held { background: #d65846; } .sail.landed { background: #f6f0e0; }

.scroll-cue { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 2rem; color: #fffdf3; text-decoration: none; animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

.tip {
  position: absolute; z-index: 30; width: min(380px, calc(100% - 24px));
  padding: 12px 14px; border-radius: 14px;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: var(--shadow);
  font-size: 0.86rem; line-height: 1.45; pointer-events: auto;
}
.tip-head { display: flex; justify-content: space-between; font-family: "Kaisei Decol", serif; font-size: 1.05rem; margin-bottom: 6px; }
.tip-row { display: grid; grid-template-columns: 88px 1fr; gap: 8px; padding: 3px 0; border-top: 1px dashed var(--line); }
.tip-k { color: var(--ink-soft); }
.tip-v { min-width: 0; overflow-wrap: anywhere; }
.tip .hex { display: inline; white-space: normal; word-break: break-all; }

/* ------------------------------- pages ------------------------------- */

.page { padding: clamp(56px, 9vw, 110px) 16px; }
.page.tinted { background: var(--paper-2); }
.col { max-width: 920px; margin: 0 auto; }
.kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--leaf); font-weight: 700; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.2; margin: 6px 0 18px; }
.sub { margin-top: 48px; font-size: 1.5rem; }
.lede { font-size: 1.12rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 34px 0 10px; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 18px 20px 20px; box-shadow: var(--shadow); }
.card h3 { margin: 6px 0 6px; font-size: 1.3rem; }
.card p { margin: 0; font-size: 0.97rem; }
.card-art {
  position: relative; height: 128px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(#c9eef3, #a6e0ec 60%, #8fd4e6);
  box-shadow: inset 0 0 0 1.5px rgba(138, 106, 69, 0.25);
}
.card-art img { position: absolute; height: auto; pointer-events: none; }
/* The ship art sails left: the wrapper turns it round, the image bobs. */
.card-art .art-ship { position: absolute; display: block; }
.card-art .art-ship.mirrored { transform: scaleX(-1); }
.card-art .art-ship img { position: static; display: block; width: 100%; animation: bob 2.6s ease-in-out infinite; transform-origin: center bottom; }
.card-art .art-cloud { opacity: 0.95; }
.art-wake { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-wake path { fill: none; stroke: #2f7894; stroke-width: 0.9; stroke-dasharray: 0.6 3; stroke-linecap: round; opacity: 0.6; vector-effect: non-scaling-stroke; }

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: "Kaisei Decol", serif; font-weight: 700; background: var(--paper-2); }
tr:last-child td { border-bottom: none; }
.pill { display: inline-block; padding: 0 8px; border-radius: 999px; background: #f5dfaa; color: #6d4b12; font-size: 0.78rem; font-weight: 700; }
.note { font-size: 0.95rem; color: var(--ink-soft); }
.trust { padding-left: 1.1em; }
.trust li { margin: 10px 0; }
.cta { margin-top: 30px; }
.button { display: inline-block; padding: 11px 20px; border-radius: 999px; background: var(--sea); color: #fffdf3; text-decoration: none; font-weight: 700; box-shadow: var(--shadow); }
.button:hover { background: #276d84; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 22px; border-top: 1.5px solid var(--line); font-size: 0.9rem; }

/* -------------------------------- docs ------------------------------- */

.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; max-width: 1200px; margin: 0 auto; padding: 96px 16px 60px; }
.docs nav { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; font-size: 0.92rem; }
.docs nav h4 { font-family: "Kaisei Decol", serif; margin: 18px 0 6px; font-size: 1rem; }
.docs nav a { display: block; color: var(--ink-soft); text-decoration: none; padding: 2px 0; }
.docs nav a:hover { color: var(--sea); }
.docs article { min-width: 0; }
.docs article h1 { font-size: 2.1rem; margin: 0 0 10px; padding-top: 10px; }
.docs article h1:not(:first-child) { margin-top: 70px; border-top: 1.5px solid var(--line); padding-top: 40px; }
.docs article h2 { font-size: 1.5rem; margin-top: 40px; }
.docs article h3 { font-size: 1.2rem; margin-top: 28px; }
.docs pre { background: var(--code-bg); padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: 0.85rem; line-height: 1.5; }
.docs pre code { background: none; padding: 0; }
.docs table { margin: 14px 0; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.docs blockquote { margin: 16px 0; padding: 4px 18px; border-left: 4px solid var(--sun); background: var(--paper-2); border-radius: 0 10px 10px 0; }

@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; }
  .docs nav { position: static; max-height: none; }
  .legend { display: none; }
  /* A narrow screen gets the whole chart at its own shape, and the card below it. */
  .sea { height: auto; min-height: 0; overflow: visible; background: var(--paper); padding-top: 58px; }
  #map { position: relative; height: auto; aspect-ratio: 16 / 9; }
  .shimmer { top: 58px; bottom: auto; height: calc(100vw * 9 / 16); }
  .sea-card { position: relative; left: auto; top: auto; bottom: auto; margin: 14px 16px 0; max-width: none; }
  .scroll-cue { display: none; }
  .topbar nav { gap: 12px; font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wave, .drift, .bob, .hover, .shimmer, .scroll-cue { animation: none; }
}

/* ------------------------------ networks ----------------------------- */

/* Testnet and mainnet are two sites; each names itself and links the other. */
.topbar nav a.net-switch { padding: 0 10px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 0.9em; }
.sea-card .network-tag { margin: 0 0 4px; font: 700 0.7rem/1 "Nunito", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
/* A chain on its way: its island is drawn, faintly, before any ship can reach it. */
.island.soon { opacity: 0.55; filter: saturate(0.5); }
