/* Watermark. A tide station on a sea of coins.
   The page is two worlds stacked, the way his reference picture is built: a dark full bleed scene
   with a signboard rail floating over it, a torn surf edge, and a cream tide sheet under it.
   Nothing here is a bordered CSS rectangle standing in for an object: every surface is a generated
   pixel sprite, nine sliced. */

@font-face {
  font-family: "Jersey 25";
  src: url("/css/fonts/jersey25-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/css/fonts/silkscreen-400-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/css/fonts/silkscreen-700-latin.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  /* An address is the one string on the page that must not be guessed at: a mono with a slashed
     zero and distinct 1/l/I, used nowhere else. */
  font-family: "JetBrains Mono";
  src: url("/css/fonts/jetbrains-mono-500-latin.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/css/fonts/pixelify-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  --sea-deep: #052238;
  --sea: #0E4F86;
  --sea-mid: #1A6AA8;
  --sea-light: #3D93CF;
  --sky: #FFE6A8;
  --gold: #FFC84A;
  --gold-hi: #FFE08A;
  --gold-dk: #8A5E12;
  --paper: #FFF2D2;
  --paper-2: #F6E3B4;
  --ink: #0B1C2E;
  --ink-2: #41505F;
  --rule: #C9B176;
  --foam: #FFFFFF;

  --display: "Jersey 25", "Pixelify Sans", system-ui, sans-serif;
  --label: "Silkscreen", "Pixelify Sans", monospace;
  --body: "Pixelify Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 4.5vw, 72px);
  --band-gap: clamp(56px, 7vw, 96px);
  --sheet-max: 1440px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sea-deep);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

img, canvas { display: block; max-width: 100%; }
.scene-img, .rope-fig img, .deep { image-rendering: pixelated; }

a { color: inherit; }

/* The world behind everything: the same sea, blurred, drifting on its own clock. */
.deep {
  position: fixed;
  inset: -8vh -6vw;
  background: url("/img/hero-sea.webp") center / cover no-repeat, var(--sea-deep);
  filter: blur(26px) saturate(1.1) brightness(0.62);
  transform: scale(1.12);
  animation: drift 64s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}
@keyframes drift {
  from { transform: scale(1.12) translate3d(-1.4%, 0.6%, 0); }
  to   { transform: scale(1.18) translate3d(1.4%, -0.8%, 0); }
}

#app { position: relative; z-index: 1; }
.view[hidden] { display: none; }

/* ---------------------------------------------------------------- the scene */

.scene {
  position: relative;
  height: min(68vh, 760px);
  min-height: 460px;
  overflow: hidden;
  background: var(--sea-deep);
}
.scene-short { height: min(34vh, 340px); min-height: 230px; }

.scene-art { position: absolute; inset: 0; }
.scene-img,
.scene-water {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-water { mix-blend-mode: screen; opacity: .5; }

/* the signboard rail: a painted plank, then brass keys in groups, with a rope running out to both
   edges of the frame. It is part of the scene and it scrolls away with it. */
.rail {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: clamp(18px, 2.4vw, 30px) var(--gutter) 0;
  flex-wrap: wrap;
}
.rope {
  flex: 1 1 40px;
  min-width: 24px;
  height: 6px;
  background:
    linear-gradient(180deg, transparent 0 1px, #C79A3C 1px 2px, #8A5E12 2px 4px, #5A3B08 4px 5px, transparent 5px),
    none;
}
.keys { display: flex; gap: 10px; flex-wrap: wrap; }

.plank {
  display: inline-grid;
  place-items: center;
  min-height: 76px;
  padding: 8px 24px;
  /* A nine slice only insets the content when the element really has a border: border-image-width
     alone paints over the content box. Every plate below does the same. */
  border: solid transparent;
  border-width: 12px 16px;
  border-image: url("/img/plank-sign.webp") 24 15 24 15 fill / 12px 16px 12px 16px / 0 stretch;
  text-decoration: none;
  color: var(--sky);
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  letter-spacing: .02em;
  text-shadow: 0 2px 0 #04243f;
  transition: transform .12s ease;
}
.plank:hover { transform: translateY(-2px); }
.plank:active { transform: translateY(1px); }

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 14px;
  background: none;
  border: solid transparent;
  border-width: 13px 17px;
  border-image: url("/img/key-brass.webp") 37 35 37 35 fill / 13px 17px 13px 17px / 0 stretch;
  color: #2A1A04;
  font-family: var(--label);
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s ease, filter .12s ease;
}
.key:hover { filter: brightness(1.12); transform: translateY(-2px); }
.key:active { transform: translateY(1px); }
.key[aria-current="page"] {
  filter: brightness(1.3) saturate(1.35);
  color: #140C00;
  box-shadow: 0 0 0 2px rgba(255, 224, 138, .5), 0 0 18px rgba(255, 200, 74, .55);
}
.key[aria-disabled="true"],
.key:disabled {
  filter: grayscale(.72) brightness(.72);
  cursor: not-allowed;
  color: #3B3328;
}
.key-wide { min-width: 220px; }
.key-buy { filter: brightness(1.1) saturate(1.25); }
.key-buy[aria-disabled="true"] { filter: grayscale(.72) brightness(.72); }

.mark {
  width: 20px; height: 20px;
  background: center / contain no-repeat;
  flex: 0 0 auto;
}
.mark-x { background-image: url("/brand/x.svg"); }
.mark-dex { background-image: url("/brand/dexscreener.png"); }

/* the live reading, bolted on the harbour rail at the water's edge */
.gauge {
  position: absolute;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(30px, 4vh, 72px);
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 14px 6px;
  border: solid transparent;
  /* the art's own title strip is the top 24% of the plate, so the top border has to clear it */
  border-width: 54px 30px 32px 26px;
  border-image: url("/img/station-cabinet.webp") 159 83 92 70 fill / 54px 30px 32px 26px / 0 stretch;
  min-width: min(780px, 86vw);
}
.gauge::before {
  content: "The station";
  position: absolute;
  top: -42px;
  left: 26px;
  font-family: var(--label);
  font-size: 16px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #3A2606;
}
.scene-short .gauge { display: none; }
.gauge-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 26px;
  text-align: center;
  min-width: 190px;
}
.gauge-k { font-family: var(--label); font-size: 16px; color: #9FC6E6; }
.gauge-v { font-family: var(--display); font-size: clamp(30px, 2.4vw, 40px); line-height: 1; color: var(--gold-hi); }

/* the torn edge between the two worlds: the waterline */
.surf {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: -1px;
  height: clamp(26px, 3.2vw, 50px);
  background: url("/img/foam-edge.webp") repeat-x top left / auto 100%;
  /* the strip is drawn water-under-air; flipped it becomes the sea's own ragged lower edge */
  transform: scaleY(-1);
  image-rendering: pixelated;
}

/* ---------------------------------------------------------------- the sheet */

.sheet {
  position: relative;
  background: var(--paper) url("/img/sheet-paper.webp") repeat;
  background-size: 560px;
  padding: clamp(44px, 6vw, 86px) 0 clamp(64px, 8vw, 110px);
}
.sheet::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,28,46,.10), transparent 180px);
  pointer-events: none;
}

.band {
  position: relative;
  max-width: var(--sheet-max);
  margin: 0 auto var(--band-gap);
  padding: 0 var(--gutter);
}
.band:last-child { margin-bottom: 0; }
.band + .band { padding-top: var(--band-gap); }
.band + .band::before {
  content: "";
  position: absolute;
  left: var(--gutter); right: var(--gutter); top: 0;
  height: 2px;
  background: var(--rule);
}

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--label);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #B0741A;
}
.display {
  margin: 0 0 22px;
  font-family: var(--display);
  font-size: clamp(54px, 7.2vw, 104px);
  line-height: .92;
  letter-spacing: .005em;
  color: var(--ink);
  text-wrap: balance;
}
.head {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(36px, 3.6vw, 52px);
  line-height: 1;
  color: var(--ink);
}
.step-h {
  margin: 18px 0 10px;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  color: var(--ink);
}
.lead { margin: 0; max-width: min(46ch, 100%); color: var(--ink-2); }
.sub { margin: 0 0 26px; max-width: min(62ch, 100%); color: var(--ink-2); }
.cap { margin: 0; color: var(--ink-2); font-size: 18px; }
.note {
  margin: 14px 0 2px;
  padding: 10px 6px;
  font-family: var(--label);
  font-size: 16px;
  line-height: 1.7;
  color: #8A6A2E;
}
.hint { margin: 8px 0 0; font-size: 16px; color: #9FC6E6; }

.band > * { min-width: 0; }
.band-premise { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 72px); align-items: start; }
.band-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 72px); align-items: start; }
.band-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 72px); align-items: start; }
.band-form .band-text { display: grid; gap: 26px; }
.band-form-fig { margin-top: 4px; }
.band-how .doc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(24px, 2.6vw, 40px);
}
.band-how .plate-risk { grid-column: 1 / -1; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); }

/* a picture in a rope frame, the sheet's one picture surface */
.rope-fig {
  margin: 0;
  padding: 0;
  border: solid transparent;
  border-width: clamp(24px, 2.6vw, 38px);
  border-image: url("/img/frame-rope.webp") 124 111 125 111 fill / clamp(24px, 2.6vw, 38px) / 0 stretch;
}
.rope-fig img { width: 100%; height: auto; }

/* a brass data plate: every group of rows on the sheet sits on one */
.plate {
  padding: 22px 26px 24px;
  border: solid transparent;
  border-width: 30px;
  border-image: url("/img/frame-brass.webp") 64 63 62 62 fill / 30px / 0 stretch;
  color: var(--sky);
}
.plate-wide { width: 100%; }
.plate-title {
  margin: 0 0 18px;
  font-family: var(--label);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
}
.plate .doc-p { margin: 0; color: #CFE2F0; font-size: 18px; }
.plate-risk { filter: saturate(.75); }

.rows { margin: 0; display: grid; gap: 2px; }
.row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) 1.3fr;
  gap: 10px;
  padding: 14px 22px;
  border-top: 2px solid rgba(255, 200, 74, .22);
  align-items: baseline;
}
.row:first-child { border-top: 0; }
.row dt { font-family: var(--label); font-size: 16px; color: #9FC6E6; min-width: 0; }
.row dd { margin: 0; font-size: 18px; color: var(--sky); min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- the tables */

.table {
  width: 100%;
  padding: 18px 22px 20px;
  border: solid transparent;
  border-width: 30px;
  border-image: url("/img/frame-brass.webp") 64 63 62 62 fill / 30px / 0 stretch;
}
.table-head,
.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr 1fr 1fr;
  gap: 16px;
  align-items: center;
}
.table-log .table-head,
.table-log .table-row { grid-template-columns: 2.2fr 1fr 1.2fr 1fr 1fr 1.2fr; }
.table-head[hidden] { display: none; }
.table-head {
  font-family: var(--label);
  font-size: 16px;
  color: #9FC6E6;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 200, 74, .3);
}
.table-row {
  padding: 16px 0;
  border-top: 2px solid rgba(255, 200, 74, .14);
  color: var(--sky);
  font-size: 18px;
  min-height: 72px;
}
.table-row:first-child { border-top: 0; }
.table-head span,
.table-row span { min-width: 0; overflow-wrap: anywhere; padding: 10px 18px; }
.table-body:empty + .note { display: block; }

.row-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-act input {
  width: 100%;
  min-width: 0;
  flex: 1 1 130px;
  min-height: 48px;
  padding: 8px 14px;
  background: rgba(3, 18, 32, .72);
  border: 2px solid rgba(255, 200, 74, .4);
  color: var(--sky);
  font-family: var(--body);
  font-size: 17px;
}

.coin-cell { display: flex; align-items: center; gap: 14px; }
.coin-name { display: flex; flex-direction: column; gap: 2px; }
.coin-name b { font-family: var(--display); font-size: 26px; line-height: 1; font-weight: 400; }
.coin-name small { font-family: var(--label); font-size: 16px; color: #9FC6E6; }

/* a coin's depth: the pillar sprite with the water drawn over it at the right height */
.depth {
  position: relative;
  width: 34px;
  height: 64px;
  flex: 0 0 auto;
  overflow: hidden;
}
.depth i {
  position: absolute;
  inset: 0;
  background: url("/img/pillar-tall.webp") center top / 100% auto no-repeat;
  image-rendering: pixelated;
}
.depth u {
  position: absolute;
  left: -20%; right: -20%;
  bottom: 0;
  height: var(--wet, 50%);
  background: url("/img/water-overlay.webp") repeat-x top center / auto 100%;
  image-rendering: pixelated;
  text-decoration: none;
}
.depth-taken i { filter: drop-shadow(0 0 6px rgba(255, 200, 74, .85)); }

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 6px;
  font-family: var(--label);
  font-size: 16px;
  color: #2A1A04;
  border: solid transparent;
  border-width: 10px 14px;
  border-image: url("/img/key-brass.webp") 37 35 37 35 fill / 10px 14px 10px 14px / 0 stretch;
}
.state-under { filter: grayscale(.7) brightness(.8); color: #3B3328; }

/* ---------------------------------------------------------------- the form */

.form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-family: var(--label); font-size: 16px; color: #9FC6E6; }
.field input {
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  background: rgba(3, 18, 32, .72);
  border: 2px solid rgba(255, 200, 74, .4);
  color: var(--sky);
  font-family: var(--body);
  font-size: 18px;
}
.field input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.form-keys { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.form-state, .cab-note {
  margin: 4px 0 0;
  font-family: var(--label);
  font-size: 16px;
  line-height: 1.7;
  color: #9FC6E6;
}

/* ---------------------------------------------------------------- the station */

.band-station { display: flex; justify-content: center; }
.cabinet {
  width: min(960px, 100%);
  padding: 8px 10px 14px;
  border: solid transparent;
  border-width: 86px 46px 50px 40px;
  border-image: url("/img/station-cabinet.webp") 159 83 92 70 fill / 86px 46px 50px 40px / 0 stretch;
  position: relative;
}
.cab-title {
  position: absolute;
  top: -66px;
  left: 30px;
  margin: 0;
  padding: 0;
  font-family: var(--label);
  font-size: 18px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #3A2606;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cab-ticker { color: #5A3B08; }
.cab-body { padding: 0; }
.cab-label {
  margin: 0 0 8px;
  font-family: var(--label);
  font-size: 16px;
  color: #9FC6E6;
}
.mint {
  margin: 0 0 22px;
  padding: 18px 20px;
  background: rgba(3, 18, 32, .72);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, .55), inset 0 -2px 0 rgba(255, 224, 138, .18);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: .01em;
  line-height: 1.6;
  color: var(--gold-hi);
  overflow-wrap: anywhere;
  user-select: all;
  min-width: 0;
}
.cab-keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 20px; }
.cab-keys .key-wide { min-width: 0; width: 100%; }

/* ---------------------------------------------------------------- phone */

@media (max-width: 1100px) {
  .band-premise, .band-two, .band-form { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .band-how .doc { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  body { font-size: 18px; }
  .scene { height: min(80vh, 680px); min-height: 560px; }
  .scene-short { height: min(46vh, 420px); min-height: 330px; }
  .scene-img { object-position: center 72%; }
  /* the plank takes its own line, then the five keys flow three and two */
  .rail { gap: 8px; justify-content: center; padding-top: 14px; }
  .keys { display: contents; }
  .plank { flex: 1 1 100%; }
  .rail .key { flex: 1 1 calc(33.333% - 8px); min-height: 46px; border-width: 10px 14px; padding: 6px 4px; }
  .rope { display: none; }
  .plank { font-size: 30px; min-height: 58px; padding: 6px 18px; border-width: 10px 14px; }
  .gauge {
    min-width: 0;
    width: calc(100% - 2 * var(--gutter));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    align-items: start;
    padding: 4px 6px 2px;
    border-width: 40px 20px 22px 18px;
    bottom: clamp(26px, 4vh, 44px);
  }
  .gauge::before { top: -31px; left: 18px; font-size: 15px; }
  /* the labels take one grid row and the values the next, so the three readings line up */
  .gauge-row { display: contents; }
  .gauge-k { font-size: 16px; line-height: 1.25; text-align: center; padding: 2px 4px 6px; }
  .gauge-v { font-size: 24px; text-align: center; padding: 0 4px 4px; align-self: end; }
  .key-wide { min-width: 0; flex: 1 1 100%; }
  .cab-keys { grid-template-columns: 1fr; }
  .key { padding: 8px 10px; border-width: 13px 14px; }

  .table { padding: 18px 18px 20px; }
  .table-head { display: none; }
  .table-row,
  .table-log .table-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 0;
  }
  .table-row span::before {
    content: attr(data-k) " ";
    font-family: var(--label);
    font-size: 15px;
    color: #9FC6E6;
    display: block;
    margin-bottom: 2px;
  }
  .table-row .coin-cell::before { content: none; }
}

@media (max-width: 420px) {
  .plank { font-size: 28px; }
  .display { font-size: 46px; }
  /* at 320 the two column rows stack so the label and the value each get the full width */
  .row { grid-template-columns: 1fr; gap: 4px; padding: 14px 20px; }
  .plate { border-width: 22px; padding: 16px 18px 18px; }
  .table { border-width: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .deep { animation: none; }
  .scene-water { display: none; }
  .key, .plank { transition: none; }
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
