/* Robin & Coco. Plain CSS, no build step.
   The colours are the app's: its sunset bands, its sand, and the cream and ink of Robin's speech bubbles.
   The page runs through a day on the island: blue sky, the sand, dusk in bands, and night at the foot. */

@font-face {
  font-family: 'Roomie Pixel'; /* the app's own font, the one Robin's speech bubbles are written in */
  src: url(../fonts/roomie_pixel.ttf) format('truetype');
  font-display: swap;
}

:root {
  --ink: #231d44;
  --line: #2a2440;
  --cream: #fff8ee;
  --night: #0e0c1f;
  --indigo: #262559;
  --purple: #5c3a7e;
  --pink: #b0517a;
  --orange: #f07a58;
  --amber: #ffb565;
  --sand: #f3dda6;
  --sand-2: #e2c383;

  --pixel: 'Roomie Pixel', 'Pixelify Sans', ui-monospace, Consolas, monospace;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --k: 3;                         /* screen pixels to one pixel of the art */
  --u: calc(var(--k) * 1px);
}
@media (max-width: 900px) { :root { --k: 2; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font: 18px/1.6 var(--text); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 2px; }
:focus-visible { outline: 4px solid var(--amber); outline-offset: 3px; }
.px, .sprite { image-rendering: pixelated; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(1120px, 100%); margin-inline: auto; padding-inline: clamp(18px, 4vw, 40px); }
.wrap.narrow { width: min(760px, 100%); }
.center { text-align: center; justify-content: center; }

/* ---- The bar at the top: the way back to Side B Labs, always in sight ---- */

.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  padding: 10px clamp(14px, 3vw, 28px); background: var(--ink); color: var(--cream);
  font: 24px/1 var(--pixel); border-bottom: 4px solid var(--line);
}
.bar a { text-decoration: none; padding: 4px 0; }
.bar a:hover { color: var(--amber); }
.home { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 10px !important; background: var(--amber); color: var(--ink); }
.home:hover { background: var(--cream); color: var(--ink) !important; }
.bar-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-left: auto; }

/* ---- The island ---- */

.hero {
  --sky: linear-gradient(#286dba, #2f7fd8 30%, #4d97e4 55%, #74b2ee 75%, #c9e6f8);
  --sea: linear-gradient(#5297e0 0 10%, #2a6fb8 10% 40%, #2f86c6 40% 80%, #3a9ed2 80%);
  --foam: #e2f0fb;
  --dim: none;
  position: relative; overflow: hidden; background: var(--sky); color: var(--cream);
}
.hero[data-sky='dusk'] {
  --sky: linear-gradient(var(--indigo) 0 18%, var(--purple) 18% 40%, var(--pink) 40% 62%, var(--orange) 62% 84%, var(--amber) 84%);
  --sea: linear-gradient(#6662a2 0 10%, #6a4688 10% 40%, #a4527a 40% 70%, #d06a60 70%);
  --foam: #ffd2a8;
  --dim: saturate(.92) brightness(.93);
}
.hero[data-sky='night'] {
  --sky: linear-gradient(var(--night), #181430 45%, var(--indigo));
  --sea: linear-gradient(#3e3a7a 0 10%, #231d44 10% 50%, #262559 50%);
  --foam: #6662a2;
  --dim: saturate(.7) brightness(.55);
}
.stars { display: none; position: absolute; inset: 0; opacity: .9;
  background:
    radial-gradient(2px 2px at 8% 12%, #fff8ee 50%, transparent 51%), radial-gradient(2px 2px at 21% 30%, #fff8ee 50%, transparent 51%),
    radial-gradient(3px 3px at 33% 9%, #ffb565 50%, transparent 51%), radial-gradient(2px 2px at 47% 22%, #fff8ee 50%, transparent 51%),
    radial-gradient(2px 2px at 58% 7%, #fff8ee 50%, transparent 51%), radial-gradient(3px 3px at 69% 27%, #fff8ee 50%, transparent 51%),
    radial-gradient(2px 2px at 81% 14%, #fff8ee 50%, transparent 51%), radial-gradient(2px 2px at 92% 33%, #ffb565 50%, transparent 51%),
    radial-gradient(2px 2px at 14% 44%, #fff8ee 50%, transparent 51%), radial-gradient(2px 2px at 74% 46%, #fff8ee 50%, transparent 51%);
}
.hero[data-sky='night'] .stars, .foot .stars { display: block; }

.hero-text { position: relative; z-index: 2; padding: clamp(36px, 7vh, 72px) clamp(18px, 4vw, 40px) 0; text-align: center; }
h1 { font: 400 clamp(48px, 9vw, 96px)/1 var(--pixel); text-shadow: .083em .083em 0 var(--line); }
.sub { margin-top: 10px; font: 400 clamp(24px, 4.5vw, 48px)/1 var(--pixel); color: var(--amber); text-shadow: .083em .083em 0 var(--line); }
.lede { max-width: 26em; margin: 22px auto 0; font: 400 24px/1.35 var(--pixel); text-shadow: 2px 2px 0 var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 26px; }

.btn {
  display: inline-block; padding: 12px 18px 10px; background: var(--cream); color: var(--ink);
  border: 4px solid var(--line); box-shadow: 4px 4px 0 var(--line);
  font: 400 24px/1 var(--pixel); text-decoration: none; text-shadow: none; transition: transform .1s, box-shadow .1s;
}
.btn.primary { background: var(--amber); }
a.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--line); }
a.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }
.btn.soon { background: transparent; color: var(--cream); border-style: dashed; border-color: var(--cream); box-shadow: none; }

/* The scene is laid out in pixels of the art (--u), from its middle, so it holds together at any width. */
.scene { position: relative; height: calc(180 * var(--u)); margin-top: calc(-28 * var(--u)); }
.sprite { position: absolute; background: no-repeat 0 0 / 100% 100%; }
.scene > .sprite, .robin { filter: var(--dim); }
.sea { position: absolute; inset: auto 0 calc(46 * var(--u)); height: calc(30 * var(--u)); background: var(--sea); }
.sand {
  position: absolute; inset: auto 0 0; height: calc(48 * var(--u)); filter: var(--dim);
  background: url(../assets/sprites/sand.png) 50% 0 / calc(660 * var(--u)) auto repeat-x; image-rendering: pixelated;
  border-top: calc(2 * var(--u)) solid var(--foam);
}
.wreck  { left: calc(50% - 168 * var(--u)); bottom: calc(30 * var(--u)); width: calc(63 * var(--u)); height: calc(32 * var(--u)); background-image: url(../assets/sprites/wreck.png); }
.hut    { left: calc(50% - 104 * var(--u)); bottom: calc(26 * var(--u)); width: calc(68 * var(--u)); height: calc(60 * var(--u)); background-image: url(../assets/sprites/hut.png); }
.palm   { left: calc(50% + 34 * var(--u));  bottom: calc(28 * var(--u)); width: calc(81 * var(--u)); height: calc(143 * var(--u)); background-image: url(../assets/sprites/palm.png); }
.coco   { left: calc(50% + 24 * var(--u));  bottom: calc(18 * var(--u)); width: calc(23 * var(--u)); height: calc(24 * var(--u)); background-image: url(../assets/sprites/coco.png); }
.bottle { left: calc(50% + 128 * var(--u)); bottom: calc(36 * var(--u)); width: calc(22 * var(--u)); height: calc(23 * var(--u)); background-image: url(../assets/sprites/bottle.png); }
.ship   { left: calc(50% - 40 * var(--u));  bottom: calc(70 * var(--u)); width: calc(19 * var(--u)); height: calc(22 * var(--u)); background-image: url(../assets/sprites/ship.png); animation: sail 90s linear infinite alternate; }
.crab   { left: calc(50% - 70 * var(--u));  bottom: calc(4 * var(--u));  width: calc(30 * var(--u)); height: calc(20 * var(--u)); background-image: url(../assets/sprites/crab.png); animation: scuttle 9s steps(24) infinite alternate; }
.cloud  { width: calc(29 * var(--u)); height: calc(16 * var(--u)); background-image: url(../assets/sprites/cloud-small.png); animation: drift 120s linear infinite; }
.c1 { top: calc(8 * var(--u)); left: 8%; }
.c2 { top: calc(34 * var(--u)); left: 62%; width: calc(26 * var(--u)); height: calc(15 * var(--u)); background-image: url(../assets/sprites/cloud-big.png); animation-duration: 170s; }
.c3 { top: calc(52 * var(--u)); left: 30%; animation-duration: 210s; }
.seagull { top: calc(22 * var(--u)); left: -12%; width: calc(40 * var(--u)); height: calc(21 * var(--u)); background-image: url(../assets/sprites/seagull.png); animation: fly 38s linear 4s infinite; }
@keyframes drift   { to { transform: translateX(60vw); } }
@keyframes sail    { to { transform: translateX(calc(60 * var(--u))); } }
@keyframes scuttle { to { transform: translateX(calc(40 * var(--u))); } }
@keyframes fly     { 0% { transform: translate(0, 0); } 30%, 100% { transform: translate(130vw, calc(-14 * var(--u))); } }

/* Robin, and what she says */
.robin-spot { position: absolute; left: 50%; bottom: calc(16 * var(--u)); width: 0; display: flex; flex-direction: column; align-items: center; }
.robin {
  appearance: none; flex: none; padding: 0; border: 0; cursor: pointer; background: url(../assets/sprites/robin-idle.png) 0 0 / auto 100% no-repeat; image-rendering: pixelated;
  width: calc(96 * var(--u)); height: calc(89 * var(--u)); animation: idle 1.2s steps(4) infinite;
}
.robin.huff { background-image: url(../assets/sprites/robin-huff.png); width: calc(132 * var(--u)); height: calc(91 * var(--u)); animation: huff .9s steps(9) 2; }
@keyframes idle { to { background-position-x: calc(-384 * var(--u)); } }
@keyframes huff { to { background-position-x: calc(-1188 * var(--u)); } }

.bubble {
  --b: var(--line);
  padding: 22px 26px; color: var(--ink);
  background:
    linear-gradient(var(--b) 0 0) 4px 4px / 4px 4px no-repeat,
    linear-gradient(var(--b) 0 0) calc(100% - 4px) 4px / 4px 4px no-repeat,
    linear-gradient(var(--b) 0 0) 4px calc(100% - 4px) / 4px 4px no-repeat,
    linear-gradient(var(--b) 0 0) calc(100% - 4px) calc(100% - 4px) / 4px 4px no-repeat,
    var(--cream);
  box-shadow: inset 0 0 0 4px var(--b);
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}
.say {
  flex: none; width: max-content; max-width: min(calc(128 * var(--u)), 88vw); padding: calc(5 * var(--u)) calc(8 * var(--u)) calc(4 * var(--u));
  font: 400 calc(12 * var(--u))/1.25 var(--pixel); text-align: center;
}
.tail { flex: none; width: calc(10 * var(--u)); height: calc(6 * var(--u)); margin: calc(-2 * var(--u)) 0 calc(-4 * var(--u)); position: relative; z-index: 1; shape-rendering: crispEdges; }
.t-line { fill: var(--line); }
.t-fill { fill: var(--cream); }

/* ---- The bands of the day ---- */

.band { --bg: var(--sand); --prev: var(--sand); --on: var(--ink); position: relative; padding: clamp(64px, 9vw, 112px) 0; background: var(--bg); color: var(--on); }
/* each band begins with the app's sunset dither: thinning stripes of the band above it */
.band::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 32px;
  background: linear-gradient(var(--bg) 0 4px, var(--prev) 4px 12px, var(--bg) 12px 16px, var(--prev) 16px 20px, var(--bg) 20px 28px, var(--prev) 28px 32px);
}
.sandy  { --bg: var(--sand);   --prev: var(--sand-2); }
.amber  { --bg: var(--amber);  --prev: var(--sand); }
.orange { --bg: var(--orange); --prev: var(--amber); }
.pink   { --bg: var(--pink);   --prev: var(--orange); --on: var(--cream); }
.purple { --bg: var(--purple); --prev: var(--pink);   --on: var(--cream); }
.indigo { --bg: var(--indigo); --prev: var(--purple); --on: var(--cream); }
.sandy::before { display: none; }

h2 { font: 400 clamp(36px, 6vw, 60px)/1.05 var(--pixel); }
.pink h2, .purple h2, .indigo h2 { text-shadow: 4px 4px 0 var(--line); }
.h-sub { margin-top: 10px; font: 400 24px/1.2 var(--pixel); opacity: .85; }
.band h2, .band .h-sub { text-align: center; }
.sandy h2 { text-align: left; }
h3 { font: 400 24px/1.25 var(--pixel); }
.after { max-width: 44em; margin: 36px auto 0; }
.after.center { text-align: center; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); align-items: start; margin-top: 40px; }
.sandy .two { align-items: center; margin-top: 0; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.sandy p { margin-top: 16px; max-width: 34em; }
.tip { font: 400 24px/1.3 var(--pixel); color: #8a4a2e; }
.bubble > * + * { margin-top: 14px; }

.duo { display: grid; justify-items: center; gap: 14px; }
.duo figcaption { font: 400 24px/1.2 var(--pixel); text-align: center; }
.big-coco { position: static; width: calc(23px * 8); height: calc(24px * 8); background-image: url(../assets/sprites/coco.png); animation: wobble 3.4s steps(2) infinite; transform-origin: 50% 100%; }
@keyframes wobble { 50% { transform: rotate(-4deg); } }

/* her plans */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); margin-top: 44px; }
.plan { display: grid; grid-template-rows: 132px auto 1fr; align-content: start; text-align: center; }
.plan .icon { display: grid; place-items: center; margin: 0; }
.plan .icon img { width: auto; height: auto; max-height: 120px; transform-origin: center; }
.plan p { color: #9b3f2c; font-weight: 600; }
/* the pictures are tiny: each is shown at a whole number of screen pixels to one of its own */
.plan img[src*='raft-sail'] { width: 92px; }
.plan img[src*='campfire'] { width: 104px; }
.plan img[src*='saucer'] { width: 144px; }
.plan img[src*='barrel'] { width: 84px; }
.plan img[src*='crab'] { width: 120px; }
.plan img[src*='bottle-ship'] { width: 120px; }

/* the watch faces */
.faces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 30px); margin-top: 44px; }
.faces img { width: 100%; border-radius: 50%; border: clamp(8px, 1.2vw, 14px) solid var(--line); box-shadow: 6px 6px 0 rgba(35, 29, 68, .35); background: #000; }
.knows { display: grid; gap: 10px; }
.knows li { padding-left: 22px; background: linear-gradient(var(--orange) 0 0) 0 .55em / 10px 10px no-repeat; }

/* the phone */
.phones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); margin-top: 44px; }
.phones img { width: 100%; border: 4px solid var(--line); box-shadow: 6px 6px 0 rgba(14, 12, 31, .45); }

/* the film */
.poster { position: relative; display: block; margin-top: 44px; border: 4px solid var(--line); box-shadow: 8px 8px 0 var(--night); transition: transform .12s, box-shadow .12s; }
.poster:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--night); }
.poster img { width: 100%; }
.play {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 96px; height: 96px; margin: -48px 0 0 -48px;
  background: var(--amber); color: var(--ink); border: 4px solid var(--line); box-shadow: 6px 6px 0 var(--line);
}
.play svg { width: 44px; height: 44px; }

/* get it */
.dancer { position: static; display: block; margin: 0 auto 12px; width: calc(132px * 2); height: calc(93px * 2); background: url(../assets/sprites/robin-dance.png) 0 0 / auto 100% no-repeat; animation: dance 1.1s steps(9) infinite; }
@keyframes dance { to { background-position-x: calc(-1188px * 2); } }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.facts li { padding: 8px 14px 6px; border: 4px solid var(--purple); font: 400 24px/1.2 var(--pixel); }
.indigo a:not(.btn), .purple a:not(.poster) { color: var(--amber); }

/* ---- Night, at the foot ---- */

.foot { position: relative; padding: 72px 0 56px; background: var(--night); color: var(--cream); text-align: center; overflow: hidden; }
.foot::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 32px;
  background: linear-gradient(var(--night) 0 4px, var(--indigo) 4px 12px, var(--night) 12px 16px, var(--indigo) 16px 20px, var(--night) 20px 28px, var(--indigo) 28px 32px);
}
.foot .wrap { position: relative; display: grid; justify-items: center; gap: 14px; }
.night-coco { position: static; width: 80px; height: 96px; background-image: url(../assets/sprites/coco-talk.png); filter: brightness(.8); }
.made { font: 400 24px/1.2 var(--pixel); opacity: .8; }
.hub {
  display: inline-flex; align-items: center; gap: .32em; padding: 12px 18px; background: var(--cream); color: #1a1714;
  font: 900 1.5rem/1 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  box-shadow: 6px 6px 0 var(--orange); transition: transform .1s, box-shadow .1s;
}
.hub:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--orange); }
.hub .b { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: #1a1714; color: var(--cream); letter-spacing: 0; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px; margin-top: 18px; font: 400 24px/1.2 var(--pixel); }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--amber); }
.small { font-size: .85rem; opacity: .7; max-width: 44em; }

/* ---- The privacy policy ---- */

.policy-page { background: var(--sand); }
.policy { padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 96px); }
.policy .bubble { padding: clamp(22px, 5vw, 56px); }
.policy h1 { font-size: clamp(36px, 6vw, 60px); text-shadow: none; }
.policy h2 { margin-top: 40px; font-size: clamp(24px, 3.4vw, 36px); text-align: left; }
.policy p, .policy ul { margin-top: 14px; max-width: 44em; }
.policy ul { padding-left: 1.3em; list-style: square; }
.policy li + li { margin-top: 6px; }
.policy .date { font: 400 24px/1.2 var(--pixel); color: #8a4a2e; }
.policy .short { padding: 16px 20px; background: var(--sand); border-left: 8px solid var(--orange); }
.policy a { color: #8a2f4f; }
.back { display: inline-block; margin-top: 36px; }

/* ---- The window a film plays in ---- */

.video { width: min(1120px, calc(100vw - 24px)); max-width: none; max-height: none; padding: 0; overflow: visible; background: var(--ink); color: var(--cream); border: 4px solid var(--cream); box-shadow: 8px 8px 0 var(--orange); }
.video::backdrop { background: rgba(14, 12, 31, .85); }
.video-bar { display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 16px; font: 400 24px/1.1 var(--pixel); }
.video-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.video-bar a { flex: none; color: var(--amber); }
.video-bar button { appearance: none; flex: none; width: 44px; height: 44px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.video-bar button:hover { background: var(--purple); }
.video-frame { aspect-ratio: 16 / 9; max-height: calc(100vh - 120px); margin: 0 auto; background: #000; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---- Small screens ---- */

@media (max-width: 900px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faces, .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .sandy .two { grid-template-columns: 1fr; }
  .big-coco { width: calc(23px * 6); height: calc(24px * 6); }
}
@media (max-width: 620px) {
  body { font-size: 17px; }
  .bar { font-size: 24px; }
  .bar-links.sections { display: none; }
  .scene { margin-top: calc(-14 * var(--u)); }
  .plans { grid-template-columns: 1fr; }
  .plan { grid-template-rows: auto; gap: 4px; }
  .video-bar a { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .robin, .cloud, .ship, .crab, .seagull, .big-coco, .dancer { animation: none; }
  .btn, .poster, .hub { transition: none; }
}
