/* Yomzi website. Colours, font and shapes follow the app's PixelTheme. */

@font-face {
  font-family: "Jersey 15";
  src: url("fonts/Jersey15-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #262A5E;
  --ink-soft: #5D6192;
  --outline: #262A5E;
  --shadow: #262A5E;
  --page: #FBF3DF;
  --paper: #FFFBF0;
  --butter: #FFD84D;
  --butter-light: #FFEB94;
  --butter-dark: #E5A823;
  --on-butter: #262A5E;
  --lilac: #D3D4FA;
  --lilac-dark: #A9ABEA;
  --coral: #F26B5E;
  --sign: #3D4291;
  --dpad: #262A5E;
  --good: #74C656;
  --sky-top: #7DBBF7;
  --pixel: "Jersey 15", ui-monospace, monospace;
  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  --fill: var(--paper);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ECE6FF;
    --ink-soft: #A9A8D6;
    --outline: #0B0C1F;
    --shadow: #07081A;
    --page: #16182F;
    --paper: #282B55;
    --butter: #F6C93B;
    --butter-light: #FFE27A;
    --butter-dark: #C98F1C;
    --lilac: #3D4180;
    --lilac-dark: #5A5FB0;
    --coral: #E2574B;
    --sign: #34387A;
    --dpad: #3D4291;
    --good: #66BF5E;
    --sky-top: #14163A;
  }
}

* { box-sizing: border-box; }

html { background: var(--page); }

body {
  margin: 0;
  font-family: var(--rounded);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--butter-dark); }

img { max-width: 100%; }

.pixel-font { font-family: var(--pixel); font-weight: 400; letter-spacing: 0.01em; }

h1, h2, h3 {
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Pixel panel: notched corners, outline, hard shadow ---------- */

.panel {
  position: relative;
  isolation: isolate;
  --fill: var(--paper);
}
.panel::before {
  /* Outline and shadow: the notched shape unioned with itself moved 4px down-right. */
  content: "";
  position: absolute;
  inset: 0 -4px -4px 0;
  background: var(--outline);
  z-index: -1;
  clip-path: polygon(
    4px 0, calc(100% - 8px) 0, calc(100% - 8px) 2px, calc(100% - 6px) 2px, calc(100% - 6px) 4px,
    calc(100% - 4px) 4px, calc(100% - 4px) 6px, calc(100% - 2px) 6px, calc(100% - 2px) 8px, 100% 8px,
    100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px),
    calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%,
    8px 100%, 8px calc(100% - 2px), 6px calc(100% - 2px), 6px calc(100% - 4px), 4px calc(100% - 4px),
    4px calc(100% - 6px), 2px calc(100% - 6px), 2px calc(100% - 8px), 0 calc(100% - 8px),
    0 4px, 2px 4px, 2px 2px, 4px 2px);
}
.panel::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--fill);
  z-index: -1;
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px),
    calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px),
    0 calc(100% - 2px), 0 2px, 2px 2px);
}
.panel.flat::before { inset: 0; }
.panel.lilac { --fill: var(--lilac); }
.panel.butter { --fill: var(--butter); color: var(--on-butter); }
.panel.sign { --fill: var(--sign); color: #fff; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  font-family: var(--pixel);
  font-size: 25px;
  line-height: 1.1;
  text-align: center;
  color: var(--on-butter);
  text-decoration: none;
  --fill: var(--butter);
  cursor: pointer;
  border: 0;
  background: none;
}
.button.secondary { --fill: var(--paper); color: var(--ink); }
.button:hover { --fill: var(--butter-light); }
.button.secondary:hover { --fill: var(--lilac); }
.button:active { transform: translate(4px, 4px); }
.button:active::before { inset: 0; }
.button.small { min-height: 36px; padding: 0 12px; font-size: 20px; }
.button .icon { width: 22px; height: auto; flex: none; }

/* ---------- Scenery header ---------- */

.scenery {
  position: relative;
  background: var(--sky-top);
  border-bottom: 2px solid var(--outline);
  overflow: hidden;
}
.scenery canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.scenery > :not(canvas) { position: relative; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--outline); }
.brand span { font-family: var(--pixel); font-size: 28px; color: #fff; text-shadow: 2px 2px 0 var(--outline); }
.topbar nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* The app's outlined title: the text drawn around itself, plus a hard shadow. */
.outlined {
  font-family: var(--pixel);
  color: var(--butter);
  text-shadow:
    -2px -2px 0 var(--outline), 0 -2px 0 var(--outline), 2px -2px 0 var(--outline),
    -2px 0 0 var(--outline), 2px 0 0 var(--outline),
    -2px 2px 0 var(--outline), 0 2px 0 var(--outline), 2px 2px 0 var(--outline),
    4px 2px 0 var(--outline), 4px 4px 0 var(--outline), 2px 4px 0 var(--outline), 0 4px 0 var(--outline),
    -2px 4px 0 var(--outline), 4px 6px 0 var(--outline), 2px 6px 0 var(--outline), 0 6px 0 var(--outline),
    6px 4px 0 var(--outline), 6px 6px 0 var(--outline), 6px 2px 0 var(--outline);
}

.page-title {
  text-align: center;
  padding: 40px 0 48px;
}
.page-title h1 { font-size: clamp(44px, 8vw, 64px); }
.page-title p {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  font-weight: 700;
  font-size: 15px;
}

/* ---------- Sections ---------- */

section { padding: 72px 0; }
section + section { border-top: 2px dashed var(--lilac-dark); }

.section-head {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: clamp(30px, 4.4vw, 40px);
  padding: 6px 14px 4px;
  background: var(--lilac);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px),
    calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px),
    0 4px, 2px 4px, 2px 2px, 4px 2px);
  white-space: nowrap;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 4px;
  min-width: 24px;
  background-image: repeating-linear-gradient(90deg, var(--lilac-dark) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(90deg, transparent 0 2px, var(--lilac-dark) 2px 4px);
  background-size: 100% 2px;
  background-position: 0 0, 0 2px;
  background-repeat: no-repeat;
}
.lede { font-size: 19px; color: var(--ink-soft); max-width: 640px; }

.grid { display: grid; gap: 22px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card { padding: 22px 22px 24px; }
.card h3 { font-size: 28px; margin-bottom: 8px; }
.card p { color: var(--ink-soft); }
.card .icon { height: 34px; width: auto; margin-bottom: 14px; }

.badge {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 17px;
  line-height: 1;
  padding: 4px 7px 3px;
  background: var(--lilac);
  border: 2px solid var(--outline);
}

/* ---------- Footer ---------- */

footer {
  margin-top: 24px;
  border-top: 2px solid var(--outline);
  background: var(--lilac);
  padding: 32px 0 40px;
  font-size: 15px;
  color: var(--ink);
}
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 700; }
footer .fine { margin-top: 16px; color: var(--ink-soft); font-size: 13px; max-width: 760px; }

/* ---------- Long-form pages (privacy, support) ---------- */

.prose { max-width: 720px; margin: 0 auto; padding: 48px 24px 24px; }
.prose h2 { font-size: 34px; margin: 44px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 25px; margin: 28px 0 8px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose .updated { color: var(--ink-soft); font-size: 15px; margin-bottom: 28px; }
.prose .callout { padding: 18px 20px 20px; margin: 20px 0 28px; }
.prose .callout p:last-child { margin-bottom: 0; }

details.faq { margin-bottom: 14px; }
details.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 44px 14px 18px;
  font-weight: 800;
  position: relative;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-52%);
  font-family: var(--pixel);
  font-size: 28px;
}
details.faq[open] summary::after { content: "–"; }
details.faq .answer { padding: 0 18px 16px; color: var(--ink-soft); }
details.faq .answer p + p { margin-top: 10px; }

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

@media (max-width: 600px) {
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .brand span { font-size: 24px; }
  .topbar nav .button { font-size: 18px; padding: 0 10px; min-height: 34px; }
}

/* ---------- Welcome demo ---------- */

.demo-frame { padding: 4px; --fill: var(--dpad); }
.demo-frame::after { inset: 0; }
.demo {
  position: relative;
  overflow: hidden;
  background: var(--lilac);
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px),
    calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px),
    0 calc(100% - 2px), 0 2px, 2px 2px);
  aspect-ratio: 1.2;
}
.demo-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 360px;
  height: 300px;
  transform-origin: 0 0;
  font-family: var(--rounded);
}
.demo-stage > * { position: absolute; left: 0; top: 0; }
.demo-village { width: 360px; height: 254px; object-fit: cover; object-position: bottom; image-rendering: pixelated; }
.demo-actor { height: 75.6px; image-rendering: pixelated; will-change: transform; }
.demo-box {
  top: auto;
  left: 6px;
  right: 6px;
  bottom: 10px;
  padding: 18px 12px 14px;
  color: var(--ink);
}
.demo-text { font-size: 17px; font-weight: 800; white-space: nowrap; line-height: 1.3; }
.demo-hidden { color: transparent; }
.demo-word { position: relative; }
.demo-word.tapped { background: var(--lilac); box-shadow: 2px 0 0 var(--lilac), -2px 0 0 var(--lilac); }
.demo-speaker { position: absolute; left: 10px; top: -10px; font-size: 15px; color: var(--ink); }
.demo-more {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 10px;
  height: 6px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 2px, 80% 2px, 80% 4px, 60% 4px, 60% 6px, 40% 6px, 40% 4px, 20% 4px, 20% 2px, 0 2px);
}
.demo-tap {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lilac-dark) 70%, transparent);
  pointer-events: none;
}
.demo-tap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(14px + 22px * var(--p, 0));
  height: calc(14px + 22px * var(--p, 0));
  transform: translate(-50%, -50%);
  border: 2px solid var(--lilac-dark);
  border-radius: 50%;
  opacity: calc(1 - var(--p, 0));
}
.demo-save .demo-tap { position: absolute; left: 50%; top: 50%; }
.demo-popup { width: 184px; color: var(--ink); }
.demo-popup-top { display: flex; align-items: baseline; gap: 6px; padding: 7px 10px; white-space: nowrap; }
.demo-popup-top strong { font-weight: 900; font-size: 17px; }
.demo-popup-top span { font-size: 13px; color: var(--ink-soft); }
.demo-save {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin: 0 2px 2px;
  padding: 0 8px;
  border-top: 2px solid var(--outline);
  font-family: var(--pixel);
  font-size: 20px;
}
.demo-save.saved { background: var(--butter); color: var(--on-butter); }
.demo-bookmark {
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%);
}
.demo-bookmark.filled { background: currentColor; }
.demo-tail {
  position: absolute;
  top: 100%;
  left: 20px;
  width: 14px;
  height: 10px;
  margin-top: -2px;
  background: var(--outline);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.demo-tail::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 8px;
  height: 5px;
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.demo-flyer { font-family: var(--rounded); font-weight: 800; font-size: 13px; padding: 2px 6px; }
.demo-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
  color: var(--ink);
}
.demo-toast.fresh { --fill: var(--butter); color: var(--on-butter); }
.demo-book { width: 14px; height: 16px; background: var(--outline); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, 3px 2px, 3px 100%, 5px 100%, 5px 2px); }

.demo-caption-wrap { text-align: center; margin-top: 16px; }
