/* ColoRogue site. Flat bands of the game's palette, pale at the surface and deep at the bottom. The numbers get squeezed on the way down. */
@font-face { font-family: Anybody; font-weight: 400 900; font-stretch: 50% 150%; src: url("../fonts/Anybody-var.woff2") format("woff2"); font-display: swap; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
:root { --sky: #d3f5fb; --night: #044d58; --x: clamp(40px, 12vw, 190px); --g: clamp(16px, 4vw, 56px); }
body { margin: 0; background: var(--sky); color: var(--night); font: 450 18px/1.5 Anybody, system-ui, sans-serif; font-stretch: 100%; overflow-x: clip; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-underline-offset: 4px; }
canvas, img { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.skip { position: absolute; left: -999px; z-index: 9; }
.skip:focus { left: 12px; top: 12px; background: #fff; color: #000; padding: 10px; }

.top { position: fixed; inset: 0 0 auto; z-index: 8; display: flex; align-items: center; gap: 22px; padding: 14px var(--g); background: var(--hbg, var(--sky)); color: var(--hink, var(--night)); }
.name { font-weight: 800; font-stretch: 120%; text-decoration: none; font-size: 20px; }
.top > nav { display: flex; gap: 18px; margin-right: auto; font-size: 16px; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.gauge { display: flex; gap: 12px; align-items: baseline; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gauge b { font-weight: 800; min-width: 8ch; text-align: right; font-stretch: 75%; font-size: 21px; }
.go { background: var(--hink, var(--night)); color: var(--hbg, var(--sky)); padding: 8px 18px; text-decoration: none; font-weight: 700; border-radius: 4px; }

/* The fishing line. Every band holds its own copy, fixed to the window but cut off at the band's edges, so the line
   changes colour exactly where the water does and nothing of it shows above the surface. */
.ln { position: absolute; inset: 0; z-index: 1; clip-path: inset(0); pointer-events: none; visibility: hidden; }
.ln.near { visibility: visible; }
.ln::before { content: ""; position: fixed; left: calc(var(--x) - 1px); top: 0; width: 2px; height: 60vh; background: var(--ink, #fff); }
.ln::after { content: ""; position: fixed; left: calc(var(--x) - 28px); top: calc(60vh - 2px); width: 36px; height: 56px; background: var(--ink, #fff); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 56'%3E%3Cg fill='none' stroke='%23000' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='28' cy='5' r='3.2'/%3E%3Cpath d='M28 8.500V40a11.500 11.500 0 0 1-23 0V28L13 36'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 56'%3E%3Cg fill='none' stroke='%23000' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='28' cy='5' r='3.2'/%3E%3Cpath d='M28 8.500V40a11.500 11.500 0 0 1-23 0V28L13 36'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; transform: rotate(var(--sway, 0deg)); transform-origin: 28px 2px; }
/* The rod's tip is 1/30 of the boat's width from its left edge. The dip joins the line in the hero to the one in round 1. */
.boat { --w: clamp(190px, 21vw, 310px); position: absolute; left: calc(var(--x) - var(--w) / 30); bottom: 0; width: var(--w); aspect-ratio: 300 / 220; overflow: visible; }
.dip { position: absolute; z-index: 1; left: calc(var(--x) - 1px); bottom: 0; width: 2px; height: 34px; background: var(--night); }
@media (prefers-reduced-motion: no-preference) { .bob { animation: bob 3.2s ease-in-out infinite alternate; } }
@keyframes bob { from { transform: translateY(-2px); } to { transform: translateY(4px); } }

.depth { position: fixed; z-index: 7; right: 0; top: 62px; bottom: 0; width: 14px; display: flex; flex-direction: column; cursor: pointer; border-left: 2px solid var(--hbg, var(--sky)); }
.depth i { flex: 1; }
.depth b { position: absolute; right: 0; top: 0; width: 22px; height: 4px; margin-top: -2px; background: var(--hink, var(--night)); box-shadow: 0 0 0 2px var(--hbg, var(--sky)); pointer-events: none; }

.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 6px 14px; border: 2px solid currentColor; border-radius: 4px; font-weight: 700; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 0; top: calc(100% + 14px); display: grid; min-width: 210px; padding: 8px 0; background: var(--hink, var(--night)); color: var(--hbg, var(--sky)); border-radius: 4px; }
.menu nav a { padding: 10px 20px; font-size: 18px; }

.hero { position: relative; min-height: 100svh; display: grid; align-content: space-between; padding: 110px var(--g) 108px calc(var(--x) + 60px); overflow: hidden; }
h1 { font-weight: 900; font-stretch: 150%; font-size: clamp(54px, min(11.6vw, 25vh), 230px); line-height: 0.84; letter-spacing: -0.045em; margin-left: -0.05em; }
h1 span { display: block; }
.hero > div { max-width: 28em; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.4; margin-top: 34px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.cta a { border: 2px solid currentColor; border-radius: 4px; padding: 10px 18px; font-weight: 700; text-decoration: none; }
.cta a:first-child { background: var(--night); color: var(--sky); border-color: var(--night); }
.cta a:hover { text-decoration: underline; }
.hero > div, .hero h1, .go-down { position: relative; z-index: 1; }
.lighthouse { position: absolute; right: clamp(10px, 4vw, 70px); bottom: -2px; height: min(86vh, 62vw); aspect-ratio: 420 / 880; overflow: visible; }
.beam { fill: #effcff; transform-origin: 230px 194px; }
@media (prefers-reduced-motion: no-preference) { .beam { animation: turn 16s ease-in-out infinite alternate; } }
@keyframes turn { from { transform: scaleX(1); } to { transform: scaleX(0.04); } }
/* The sea: a darker swell behind the rock, and the first round's colour in front of it */
.hero::before, .hero::after { content: ""; position: absolute; inset: auto 0 -1px; }
.hero::before { height: 74px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='26'%3E%3Cpath d='M0 14Q30 0 60 14T120 14V26H0Z' fill='%237fd9e8'/%3E%3C/svg%3E") repeat-x 50px 0 / 120px 26px, linear-gradient(#7fd9e8, #7fd9e8) 0 25px / 100% 60px no-repeat; }
.hero::after { height: 34px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='26'%3E%3Cpath d='M0 14Q30 0 60 14T120 14V26H0Z' fill='%23bbeff7'/%3E%3C/svg%3E") repeat-x 0 0 / 120px 26px, linear-gradient(#bbeff7, #bbeff7) 0 25px / 100% 20px no-repeat; }
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: swell 9s linear infinite; }
  .hero::after { animation: swell 6s linear infinite reverse; }
}
@keyframes swell { from { background-position-x: 0, 0; } to { background-position-x: 120px, 0; } }
.go-down { margin: 64px 0 0 clamp(150px, 18vw, 280px); max-width: 17em; }

.r { position: relative; background: var(--bg); color: var(--ink); padding-left: calc(var(--x) + 60px); padding-right: var(--g); }
.row { display: grid; grid-template-columns: minmax(44px, 7vw) 1fr; align-items: baseline; padding: clamp(18px, 3.4vh, 38px) 0; min-height: 116px; }
.n { font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; }
.t { font-weight: var(--b); font-stretch: var(--w); font-size: clamp(38px, 8.4vw, 148px); line-height: 0.95; letter-spacing: var(--l); white-space: nowrap; }
.sea { position: absolute; z-index: 1; top: 50%; width: min(var(--s), 18vw); height: min(var(--s), 18vw); transform: translate(0, -50%); border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
.sea canvas { width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) { .sea { transition: transform 1.1s cubic-bezier(0.3, 0, 0.2, 1); } }
.sea.off { transform: translate(60vw, -70%) rotate(-8deg); }
.r .row, .stop { position: relative; z-index: 2; pointer-events: none; }
.stop > * { pointer-events: auto; }
.stop { padding: 30px 0 76px clamp(44px, 7vw, 101px); }
.stop h2, .end h2 { font-weight: 800; font-stretch: 110%; font-size: clamp(30px, 4.4vw, 64px); line-height: 1; letter-spacing: -0.02em; margin-bottom: 22px; text-wrap: balance; }
h3 { font-weight: 800; font-stretch: 110%; font-size: 25px; }
.prose { max-width: 33em; font-size: clamp(18px, 1.7vw, 23px); line-height: 1.5; }
.prose p + p { margin-top: 16px; }
.p { max-width: 33em; font-size: 19px; }
figure img { border-radius: 4px; width: min(100%, 980px); }
figcaption { margin-top: 10px; }
.zeros { font-weight: 800; font-stretch: 60%; font-size: clamp(20px, 2.5vw, 37px); line-height: 1.02; overflow-wrap: anywhere; margin-top: 20px; }
.open { display: grid; grid-template-columns: minmax(0, 480px) minmax(300px, 1fr); gap: 40px; margin-top: 24px; align-items: center; }
#open, .run canvas { width: 100%; aspect-ratio: 1; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; max-width: 360px; margin-bottom: 22px; }
.pick button { border: 2px solid transparent; border-radius: 12px; background: none; padding: 3px; }
.pick button:hover { border-color: color-mix(in srgb, currentColor 40%, transparent); }
.pick button[aria-pressed="true"] { border-color: currentColor; }
.pick canvas { width: 100%; aspect-ratio: 1; }
#bd { margin-top: 12px; }
#bd li { padding: 7px 0; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); font-size: 16px; line-height: 1.4; }
.builds a { display: grid; grid-template-columns: 11em 1fr; gap: 2px 20px; padding: 14px 0; border-top: 2px solid currentColor; text-decoration: none; max-width: 900px; }
.builds b { font-weight: 800; font-size: 20px; }
.builds a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.builds span { grid-column: 2; }
.rr { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 18px; }
.run { width: min(100%, 360px); }
/* A run alone at its round gets a bigger board, with its score beside it */
.one .run { width: 100%; display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: 36px; align-items: center; }
.one .run p { font-size: 21px; }
.one .run b { font-size: clamp(48px, 6vw, 92px); line-height: 1; margin-bottom: 10px; }
.run p { margin-top: 8px; line-height: 1.35; }
.run b { display: block; font-weight: 900; font-stretch: 80%; font-size: 35px; line-height: 1.1; }

.end { position: relative; z-index: 4; background: #0b0d12; color: #fff; padding: 110px var(--g) 30px calc(var(--x) + 60px); min-height: 100svh; }
.end .n { font-weight: 900; font-stretch: 50%; font-size: clamp(120px, 26vw, 420px); line-height: 0.8; margin-left: -0.03em; }
.end h2 { margin-top: 30px; }
.end .rr { margin-top: 40px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 30px; margin-top: 90px; border-top: 2px solid #fff; padding-top: 26px; }
.foot p { line-height: 1.7; }
.end .cta a:first-child { background: #fff; color: #0b0d12; border-color: #fff; }
.credit { text-align: right; margin-top: 40px; }
#tip { position: fixed; z-index: 20; pointer-events: none; max-width: none; }

@media (max-width: 1080px) { .top > nav { display: none; } .menu { display: block; } .gauge { margin-left: auto; } }
@media (max-width: 1100px) {
  h1 { font-size: min(10.4vw, 25vh); }
  .hero { align-content: start; gap: 24px; }
  .hero > div { margin-top: 0; max-width: 50vw; }
  .lighthouse { height: min(80vh, 56vw); }
  .go-down { margin: 20px 0 0; max-width: 46%; }
  .open { grid-template-columns: minmax(0, 480px); gap: 20px; }
}
@media (max-width: 760px) {
  :root { --x: 20px; }
  .r, .hero, .end { padding-left: 46px; }
  .top { gap: 12px; }
  .top .gauge span { display: none; }
  .name { font-size: 17px; }
  .row { grid-template-columns: 42px 1fr; min-height: 92px; }
  .n { font-size: 17px; }
  .stop { padding-left: 0; padding-bottom: 54px; }
  .open { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .builds a { grid-template-columns: 1fr; }
  .builds span { grid-column: 1; }
  .sea { width: calc(var(--s) * 0.36); height: calc(var(--s) * 0.36); min-width: 48px; min-height: 48px; }
  .t { font-size: min(36px, 9.2vw); }
  h1 { font-size: min(15vw, 110px); }
  .hero { min-height: max(100svh, 780px); }
  .go-down { max-width: 56%; }
  .boat { --w: 150px; bottom: 16px; }
  .ln::after { left: calc(var(--x) - 17.5px); width: 22px; height: 34px; transform-origin: 17px 2px; }
  .depth { display: none; }
  .one .run { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .menu summary { padding: 6px 10px; }
  .lighthouse { height: min(46svh, 360px); right: 4px; }
  .hero > div { max-width: none; }
  .go-down { margin-top: 0; }
}
@media (max-width: 359px) { .sea { display: none; } }
@media (max-width: 430px) { .gauge { display: none; } .menu { margin-left: auto; } }
