/* site.css: konbini-rush.letomo.app, Konbini Rush's sneak peek.
   Colours, ink outlines and type follow the game (src/objects/global.ts).
   The page runs through one day: morning street, daytime, afternoon,
   night, and the next morning. The Japanese faces and the hand font are
   declared per page in page.html, cut to that page's letters. */

/* Fredoka is a variable face: one file covers every weight used here */
@font-face { font-family: "Fredoka"; font-weight: 500 700; font-display: swap; src: url("/fonts/fredoka.woff2") format("woff2"); }

:root {
  --ink: #2f2a4d;
  --ink-soft: #5c5686;
  --ink-mute: #7b74a2;
  --line-soft: #9a93b8;
  --cream: #fff6ec;
  --warm: #fff0e4;
  --blush: #ffb8cd;
  --rose: #ff6f91;
  --rose-deep: #e8446f;
  --mint: #6fd9c2;
  --amber-soft: #ffe7b3;
  --amber: #ffc24b;
  --label: #ffe08a;
  --sky-high: #9ed6f2;
  --sky-mid: #d2ebf8;
  --sky-low: #ffdfe8;
  --pole: #8d87ab;
  --night: #3d3470;
  --night-soft: #d9d3f5;
  --font: "Fredoka", "M PLUS Rounded 1c", system-ui, sans-serif;
  --hand: "Konbini Hand", "Fredoka", "M PLUS Rounded 1c", system-ui, sans-serif;
  --edge: 3px solid var(--ink);
  /* a pen stroke under a picked-out word: climbs a little, tapers */
  --pen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath d='M3 10.6C52 9 122 6.2 196 3.2c2.2-.1 2.6 3 .5 3.4C124 10.4 56 13.4 4.4 14.6 1.6 14.7 1 10.8 3 10.6z' fill='%23ffc24b'/%3E%3C/svg%3E");
  --pen-rose: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath d='M3 10.6C52 9 122 6.2 196 3.2c2.2-.1 2.6 3 .5 3.4C124 10.4 56 13.4 4.4 14.6 1.6 14.7 1 10.8 3 10.6z' fill='%23ff6f91'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 500 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
html:lang(ja) body { line-height: 1.85; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--rose-deep); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ── type ─────────────────────────────────────────────────────────── */

h1 {
  margin: 22px 0 18px;
  font-weight: 700;
  font-size: clamp(2.8rem, 1.7rem + 4.6vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h2 {
  margin: 18px 0 14px;
  font-weight: 700;
  font-size: clamp(2.15rem, 1.5rem + 2.7vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
html:lang(ja) h1 {
  font-weight: 800;
  font-size: clamp(2.2rem, 1.35rem + 3.4vw, 3.9rem);
  line-height: 1.24;
  letter-spacing: 0.01em;
  word-break: auto-phrase;
}
html:lang(ja) h2 {
  font-weight: 800;
  font-size: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  line-height: 1.32;
  word-break: auto-phrase;
}
h1 em, h2 em {
  font-style: normal;
  color: var(--rose-deep);
  padding-bottom: 0.08em;
  background: var(--pen) no-repeat 0 100% / 100% 0.3em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lead {
  max-width: 34em;
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.55;
  text-wrap: pretty;
}
html:lang(ja) .lead { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); line-height: 1.9; }
/* Japanese lines break between phrases, not inside a word (Chrome; others break as usual) */
html:lang(ja) :is(.lead, .note, .label, .chip, .step p, .card p, .cta-note, .closer-copy p) { word-break: auto-phrase; }

/* a pre-heading: the game's tilted pill */
.pill {
  display: inline-block;
  padding: 0.42em 1em 0.38em;
  border: var(--edge);
  border-radius: 999px;
  background: var(--rose-deep);
  color: #fff;
  font-weight: 700;
  font-size: 1.17rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 3px 4px 0 rgb(47 42 77 / 0.2);
  transform: rotate(-2deg);
}
html:lang(ja) .pill { letter-spacing: 0.05em; }
.pill-mint { background: var(--mint); color: var(--ink); }
.pill-amber { background: var(--amber); color: var(--ink); }

/* a heading on a shelf label: yellow, punched, slightly crooked */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.36em 0.9em 0.36em 0.6em;
  border: var(--edge);
  border-radius: 10px;
  background: var(--label);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.15;
  box-shadow: 3px 4px 0 rgb(47 42 77 / 0.16);
  transform: rotate(-1.5deg);
}
.label::before {
  content: "";
  flex: none;
  width: 0.5em;
  height: 0.5em;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
}

/* ── the phone every screen sits in ───────────────────────────────── */

.phone {
  position: relative;
  padding: 9px;
  border-radius: 15% / 7%;
  background: var(--ink);
  box-shadow: 0 30px 44px -24px rgb(47 42 77 / 0.6);
}
.phone::after {
  content: "";
  position: absolute;
  top: 24%;
  right: -4px;
  width: 5px;
  height: 9%;
  border-radius: 0 4px 4px 0;
  background: var(--ink);
}
.screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 720 / 1560;
  border-radius: 12.5% / 5.8%;
  background: var(--sky-mid);
}
.screen > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── header ───────────────────────────────────────────────────────── */

.top { position: absolute; inset: 0 0 auto; z-index: 10; padding: 18px 0; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}
.brand img { width: 40px; height: 40px; border: 2.5px solid var(--ink); border-radius: 11px; }
.langs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.6);
}
.langs a {
  padding: 3px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}
.langs a[aria-current] { background: var(--ink); color: #fff; }
.langs a:not([aria-current]):hover { color: var(--ink); background: rgb(255 255 255 / 0.8); }

/* ── morning: the hero ────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-top: 108px;
  background: linear-gradient(180deg, var(--sky-high) 0%, var(--sky-mid) 58%, var(--sky-low) 100%);
}
.cloud { position: absolute; z-index: -2; }
.cloud-a { display: none; }
.cloud-b { top: 150px; right: -48px; width: 130px; }
.street { position: absolute; z-index: -1; inset: auto 0 0; width: 100%; height: 170px; }

.hero-in { display: grid; gap: 30px; padding-bottom: 56px; }
.hero-copy { display: grid; justify-items: center; text-align: center; }
.hero-copy .lead { margin-inline: auto; }
.cta { display: grid; justify-items: center; gap: 2px; margin-top: 22px; }
.play { display: inline-block; width: 200px; border-radius: 10px; transition: translate 0.2s ease; }
.play img { width: 100%; height: auto; }
.play:hover { translate: 0 -2px; }
.cta-note { color: var(--ink-mute); font-weight: 600; font-size: 0.95rem; }

.hero-art { position: relative; display: grid; justify-items: center; padding-top: 28px; }
.phone-hero { width: min(72vw, 318px); transform: rotate(3deg); }
.grow > img { opacity: 0; transition: opacity 0.9s ease; }
.grow > img.on { opacity: 1; }

/* the utility pole: it stands just right of the phone, its wires run off both edges */
.pole {
  position: absolute;
  z-index: -1;
  top: 0;
  left: calc(50% + min(36vw, 159px) + 6px);
  width: 14px;
  height: 2400px;
  border-radius: 6px;
  background: var(--pole);
}
.pole::before, .pole::after { content: ""; position: absolute; height: 10px; border-radius: 5px; background: var(--pole); }
.pole::before { top: 26px; left: -48px; width: 110px; }
.pole::after { top: 51px; left: -36px; width: 86px; height: 9px; }
.wire { position: absolute; top: 18px; width: 100vw; max-width: none; height: 60px; overflow: visible; }
.wire path { fill: none; stroke: var(--pole); stroke-width: 3; vector-effect: non-scaling-stroke; }
.wire-l { right: 50%; }
.wire-r { left: 50%; }

/* the sticky note left for a new manager */
.note {
  position: absolute;
  left: max(-6px, calc(50% - min(36vw, 159px) - 64px));
  bottom: 3%;
  width: 160px;
  padding: 22px 12px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 3px;
  background: #fff3a3;
  color: var(--ink);
  font: 400 0.95rem/1.3 var(--hand);
  box-shadow: 4px 8px 0 rgb(47 42 77 / 0.14);
  transform: rotate(-6deg);
}
.note::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 13px;
  background: #ffe36e;
  border-bottom: 2px solid rgb(47 42 77 / 0.1);
}
.note span { display: block; text-wrap: balance; }
.note span + span { margin-top: 4px; }

@media (min-width: 900px) {
  .hero { padding-top: 96px; }
  .hero-in { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); align-items: center; gap: 40px; padding-bottom: 64px; }
  .hero-copy { justify-items: start; text-align: left; }
  .hero-copy .lead { margin-inline: 0; }
  .cta { justify-items: start; }
  .hero-art { padding-top: 34px; }
  .phone-hero { width: min(26vw, 330px); }
  .pole { left: calc(50% + min(13vw, 165px) + 10px); }
  .note { left: calc(50% - min(13vw, 165px) - 128px); bottom: 13%; width: 214px; padding: 28px 18px 18px; font-size: 1.17rem; }
  .cloud-a { display: block; top: 118px; left: 2%; width: 200px; }
  .cloud-b { top: 84px; right: 5%; width: 160px; }
  .street { height: 210px; }
}

/* ── daytime: how a day goes ──────────────────────────────────────── */

.steps { padding: 100px 0 96px; }
.head { display: grid; justify-items: center; text-align: center; }
.head .lead { margin-inline: auto; text-wrap: balance; }

.step-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); margin-top: 60px; }
.step { display: grid; justify-items: center; align-content: start; text-align: center; }
.step .phone { width: min(100%, 252px); margin-bottom: 30px; }
.step:nth-child(1) .phone { transform: rotate(-2.5deg); }
.step:nth-child(2) .phone { transform: rotate(1.5deg); }
.step:nth-child(3) .phone { transform: rotate(-1deg); }
.step p { max-width: 21em; margin-top: 16px; color: var(--ink-soft); text-wrap: pretty; }

@media (max-width: 859px) {
  .step-row {
    display: flex;
    gap: 18px;
    margin: 44px -20px 0;
    padding: 12px 20px 26px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .step-row::-webkit-scrollbar { display: none; }
  .step { flex: 0 0 min(76vw, 300px); scroll-snap-align: center; }
}

/* ── afternoon: the extras ────────────────────────────────────────── */

.extras { padding: 100px 0 110px; background: var(--warm); }
.cards { display: grid; gap: 24px; margin-top: 52px; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 34px 30px 0;
  border: var(--edge);
  border-radius: 30px;
  box-shadow: 0 6px 0 rgb(47 42 77 / 0.12);
}
.card p { max-width: 30em; margin-top: 16px; color: var(--ink-soft); text-wrap: pretty; }
.card-truck { background: var(--amber-soft); }
.card-night { background: var(--night); color: #fff; }
.card-night p { color: var(--night-soft); }
.card-moon { position: absolute; top: 24px; right: 24px; width: 58px; }
.card-night .card-copy { padding-right: 56px; }
.card-phone { display: flex; justify-content: center; height: 330px; margin-top: 30px; }
.card-phone .phone { width: min(78%, 270px); height: max-content; transition: translate 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card-truck .phone { transform: rotate(-3deg); }
.card-night .phone { transform: rotate(3deg); }
.card:hover .card-phone .phone { translate: 0 -12px; }

.facts { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 8px; margin-top: 44px; }
.facts li { position: relative; padding: 2px 22px; color: var(--ink-soft); font-weight: 600; }
.facts li + li::before {
  content: "";
  position: absolute;
  top: 18%;
  left: -1px;
  width: 2.5px;
  height: 64%;
  border-radius: 2px;
  background: var(--line-soft);
  transform: rotate(14deg);
}
@media (min-width: 860px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .card-phone { height: 360px; }
}
@media (max-width: 520px) {
  .facts { flex-direction: column; align-items: center; }
  .facts li + li::before { display: none; }
}

/* ── night: the sneak peek ────────────────────────────────────────── */

.peek {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 104px 0 120px;
  background: var(--night);
  color: #fff;
}
.peek-sky { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; }
.moon { position: absolute; z-index: -1; top: 46px; right: 7%; width: 76px; }
.head-night .lead { color: var(--night-soft); }
.head-night h2 em { color: var(--amber); background-image: var(--pen-rose); }

.peek-stage { position: relative; width: min(330px, 78vw); margin: 64px auto 0; }
.phone-peek { transform: rotate(-2deg); }
.lens {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 46%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: grab;
  touch-action: none;
  transform: translate(-50%, -50%);
}
.lens:active { cursor: grabbing; }
.lens .glass {
  position: absolute;
  inset: 0;
  border: 7px solid var(--ink);
  border-radius: 50%;
  background-color: #fff6ec;
  background-repeat: no-repeat;
  box-shadow: 0 14px 26px -12px rgb(0 0 0 / 0.55);
}
.lens .handle {
  position: absolute;
  top: 50%;
  left: 41%;
  width: 18%;
  height: 60%;
  border: 4px solid var(--ink);
  border-radius: 10px;
  background: var(--rose);
  transform-origin: 50% 0;
  transform: rotate(-45deg) translateY(76%);
}
.lens.glide, .lens.glide .glass { transition-duration: 0.9s; transition-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
.lens.glide { transition-property: left, top; }
.lens.glide .glass { transition-property: background-position; }
.lens:focus-visible { outline: none; }
.lens:focus-visible .glass { outline: 3px solid var(--amber); outline-offset: 4px; }

.hint {
  position: absolute;
  top: -58px;
  left: 2%;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  color: var(--amber);
  font: 400 1.3rem/1 var(--hand);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.hint svg { flex: none; width: 46px; max-width: none; margin-bottom: -16px; transform: rotate(12deg); }
.peek-stage.touched .hint { opacity: 0; }

.chips { display: grid; justify-items: center; gap: 12px; margin-top: 36px; }
.chip {
  padding: 0.5em 1.1em;
  border: var(--edge);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.17rem;
  line-height: 1.2;
  box-shadow: 3px 4px 0 rgb(0 0 0 / 0.25);
}
.chip-mint { background: var(--mint); transform: rotate(-2deg); }
.chip-amber { background: var(--amber); transform: rotate(1.5deg); }
.chip-rose { background: var(--rose-deep); color: #fff; transform: rotate(-1deg); }

@media (min-width: 900px) {
  .moon { top: 84px; right: 12%; width: 104px; }
  .hint { top: 47%; left: auto; right: calc(100% + 18px); align-items: center; }
  .hint svg { margin: 0; transform: rotate(-10deg); }
  .chips { position: absolute; inset: 0; display: block; margin: 0; pointer-events: none; }
  .chip { position: absolute; white-space: nowrap; }
  .chip-mint { top: 64%; right: calc(100% + 10px); }
  .chip-amber { top: 14%; left: calc(100% + 6px); }
  .chip-rose { bottom: 5%; left: calc(100% - 40px); }
}

/* ── the next morning: come back ──────────────────────────────────── */

.closer { padding: 104px 0 116px; background: linear-gradient(180deg, var(--sky-low) 0%, var(--sky-mid) 100%); }
.closer-in { display: grid; justify-items: center; gap: 52px; text-align: center; }
.closer-copy { display: grid; justify-items: center; }
.closer-copy h2 { margin-top: 0; }
.closer-copy .play { margin-top: 26px; }

/* the receipt printer, like the one at the end of a day */
.printer { width: min(340px, 100%); }
.slot { position: relative; z-index: 2; height: 30px; border-radius: 15px; background: var(--ink); }
.slot::after { content: ""; position: absolute; inset: 13px 18px auto; height: 5px; border-radius: 3px; background: #57507e; }
.paper { margin: -14px 16px 0; padding-bottom: 14px; overflow: hidden; filter: drop-shadow(0 8px 10px rgb(47 42 77 / 0.16)); }
.receipt {
  --z: 14px;
  padding: 34px 26px 40px;
  background: #fff;
  text-align: center;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--z) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--z) 100%;
}
.js .receipt { transform: translateY(-100%); }
.js .printed .receipt { animation: print 2.1s steps(12, end) forwards; }
@keyframes print { to { transform: none; } }
.r-shop { font-weight: 700; font-size: 1.35rem; letter-spacing: 0.12em; }
html:lang(ja) .r-shop { letter-spacing: 0.06em; }
.r-sub { margin-top: 2px; color: var(--ink-mute); font-weight: 600; }
.receipt dl { display: grid; gap: 8px; margin-top: 18px; padding: 14px 0; border-block: 2px dashed var(--line-soft); }
.receipt dl div { display: flex; justify-content: space-between; gap: 16px; text-align: left; }
.receipt dt { color: var(--ink-soft); }
.receipt dd { font-weight: 700; text-align: right; }
.r-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 14px; font-weight: 700; font-size: 1.25rem; }
.r-total span:last-child { color: var(--rose-deep); }
.r-stars { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.r-stars svg { width: 40px; }
.r-stars svg:nth-child(2) { transform: translateY(-8px) scale(1.12); }
.r-thanks { margin-top: 22px; color: var(--ink-mute); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.14em; }
html:lang(ja) .r-thanks { letter-spacing: 0.04em; }

@media (min-width: 900px) {
  .closer-in { grid-template-columns: 380px minmax(0, 1fr); align-items: center; justify-items: start; gap: 80px; text-align: left; }
  .closer-copy { justify-items: start; }
}

/* ── footer ───────────────────────────────────────────────────────── */

.foot { padding: 52px 0 44px; background: var(--ink); color: #c9c3e6; }
.foot-in { display: grid; justify-items: center; gap: 22px; text-align: center; }
.foot-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.foot-brand img { width: 44px; height: 44px; border: 2.5px solid #fff; border-radius: 12px; }
.foot-brand strong { font-weight: 700; font-size: 1.15rem; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.foot-links a { color: #fff; font-weight: 600; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-small { color: var(--line-soft); font-size: 0.85rem; }
@media (min-width: 900px) {
  .foot-in { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; }
  .foot-links { justify-self: end; }
  .foot-small { grid-column: 1 / -1; }
}

/* ── the 404 page ─────────────────────────────────────────────────── */

.lost {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, var(--sky-high), var(--sky-mid) 60%, var(--sky-low));
  text-align: center;
}
.lost-in { display: grid; justify-items: center; gap: 10px; }
.lost .shelf { width: 220px; margin-bottom: 18px; }
.lost h1 { margin: 0; font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.4rem); }
.lost .ja { font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 700; font-size: 1.25rem; }
.lost p { color: var(--ink-soft); }
.lost-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.lost-links a {
  padding: 0.55em 1.3em;
  border: var(--edge);
  border-radius: 999px;
  background: var(--rose-deep);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
}
.lost-links a + a { background: #fff; color: var(--ink); }

/* ── coming into view ─────────────────────────────────────────────── */

.js [data-reveal] { opacity: 0; translate: 0 18px; transition: opacity 0.7s ease, translate 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.js [data-reveal].shown { opacity: 1; translate: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; translate: none; transition: none; }
  .js .receipt { transform: none; }
  .js .printed .receipt { animation: none; }
  .grow > img, .card-phone .phone, .play { transition: none; }
}
