/* craftums.com: the app's paper-sticker look (docs/ART_STYLE.md).
   Colours are the app's own (app/lib/craftlings_colors.dart and the
   island painter); the font is the app's Fredoka, served from here. */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka-Regular.woff2") format("woff2"),
       url("../fonts/Fredoka-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka-SemiBold.woff2") format("woff2"),
       url("../fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka-Bold.woff2") format("woff2"),
       url("../fonts/Fredoka-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --sky: #B9E6F1;
  --horizon: #EAF7F3;
  --sea: #5CC4D8;
  --deep-sea: #3FA7C9;
  --shallows: #94DED9;
  --sand: #F5DEA6;
  --wet-sand: #E9C98A;
  --grass: #8FCB66;
  --grass-light: #A4D877;
  --grass-dark: #79B955;
  --background: #F4F1E7;
  --paper: #FFFCF3;
  --card: #FFFEFA;
  --paper-lip: #DCCBA8;
  --outline: #4A3A31;
  --brown: #49382F;
  --brown-muted: #70584A;
  --ink: #2D4542;
  --ink-muted: #62716C;
  --teal: #159D90;
  --sun: #FFCB45;
  --sun-lip: #E29B1E;
  --sea-button: #7AD3E4;
  --sea-lip: #3E9DB5;
  --coral: #FFA184;
  --coral-lip: #D9674A;
  --grass-button: #A7DA7C;
  --grass-lip: #6BA84A;
  --rim: #FFFFFF;
  --line: 3px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink);
  /* The app's outdoor backdrop: sky fading to a pale horizon. */
  background: var(--horizon) linear-gradient(180deg, var(--sky) 0, var(--horizon) 620px) no-repeat;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--brown); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #9C3F26; }

:focus-visible {
  outline: 4px solid #17637A;
  outline-offset: 3px;
  border-radius: 8px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--sun);
  border: var(--line) solid var(--outline);
  border-radius: 16px;
  color: var(--outline);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

/* --- Titles: chunky UPPERCASE, like the app's GameText ------------------ */

h1, h2, h3 {
  font-weight: 700;
  color: var(--brown);
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
h3 {
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
p { margin: 0 0 0.9em; }
strong { font-weight: 600; color: var(--brown); }

.label {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown-muted);
  margin-bottom: 0.3em;
}

/* --- The top bar -------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--brown);
  text-decoration: none;
  text-transform: uppercase;
}
.brand img { width: 40px; height: 40px; }

.langs {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.langs a,
.langs span {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  min-height: 44px;
  padding: 0 10px;
  border: var(--line) solid var(--outline);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 4px 0 var(--paper-lip);
  color: var(--brown);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.langs a:hover { background: var(--horizon); color: var(--brown); }
.langs [aria-current] { background: var(--sun); box-shadow: 0 4px 0 var(--sun-lip); }

/* --- Paper: sheets and cards with an ink outline sitting on a lip -------- */

.sheet {
  position: relative;
  background: var(--paper);
  border: var(--line) solid var(--outline);
  border-radius: 28px;
  padding: clamp(22px, 4vw, 44px);
  box-shadow: 0 0 0 7px var(--rim), 0 16px 0 -2px rgba(74, 58, 49, 0.14);
}

.card {
  position: relative;
  background: var(--card);
  border: var(--line) solid var(--outline);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 9px;
  /* The shallow darker lip under a card, like the app's chunky buttons:
     lip colour, then the ink outline around it. */
  box-shadow: 0 9px 0 -3px var(--paper-lip), 0 9px 0 0 var(--outline);
}
.tilt-l { transform: rotate(-1.4deg); }
.tilt-r { transform: rotate(1.2deg); }

/* --- Chunky buttons ------------------------------------------------------ */

.chunky {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 22px;
  border: var(--line) solid var(--outline);
  border-radius: 22px;
  background: var(--sun);
  color: var(--outline);
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 8px;
  box-shadow: 0 8px 0 -3px var(--sun-lip), 0 8px 0 0 var(--outline);
}
a.chunky:hover, a.chunky:active {
  color: var(--outline);
  transform: translateY(4px);
  box-shadow: 0 4px 0 -3px var(--sun-lip), 0 4px 0 0 var(--outline);
}

/* --- The hero ------------------------------------------------------------ */

.hero {
  position: relative;
  padding-block: 8px 0;
}
.hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}
.hero h1 { margin: 0; }
.hero h1 img { display: block; width: min(100%, 560px); }
.tagline {
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.2rem);
  font-weight: 700;
  color: var(--brown);
  line-height: 1.15;
  margin: 12px 0 10px;
}
.lede {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 34em;
}

/* The starters, standing about like stickers on the table. */
.friends {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 3 / 2;
  margin: 0 auto;
}
.friends img {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.12));
}
.friends .puppy { width: 44%; left: 2%; top: 26%; transform: rotate(-5deg); }
.friends .fox { width: 44%; left: 44%; top: 42%; transform: rotate(4deg); }
.friends .rocket { width: 19%; left: 72%; top: 0; transform: rotate(9deg); }
.friends .car { width: 42%; left: 28%; top: 0; transform: rotate(-2deg); }
.friends figcaption {
  position: absolute;
  right: 0;
  bottom: -6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brown-muted);
}

@media (prefers-reduced-motion: no-preference) {
  .friends .rocket { animation: bob 3.2s ease-in-out infinite; }
  @keyframes bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
  }
}

.clouds { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.clouds img { position: absolute; opacity: 0.9; }
.clouds .c1 { width: 150px; left: 53%; top: 4px; }
.clouds .c2 { width: 130px; right: 3%; top: 20px; }
.clouds .c3 { width: 90px; left: 50%; top: 360px; opacity: 0.7; }

/* --- Stores ------------------------------------------------------------- */

.stores { margin: 22px 0 6px; }
.stores .soon {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px 12px 14px;
  border: var(--line) dashed var(--outline);
  border-radius: 22px;
  background: var(--card);
  color: var(--brown);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
  max-width: 100%;
}
.stores .soon img { width: 52px; height: 52px; flex: none; }
.stores .soon b { display: block; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.stores .badges { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.stores .badges img { height: 56px; width: auto; }

/* --- The island band between the hero and the rest ----------------------- */

.shore {
  height: 84px;
  margin-top: 6px;
  /* Sea, a line of foam, wet sand, sand: the island's beach from the side. */
  background: linear-gradient(180deg,
    var(--deep-sea) 0 22%, var(--sea) 22% 50%, var(--shallows) 50% 62%,
    #FFFFFF 62% 68%, var(--wet-sand) 68% 80%, var(--sand) 80% 100%);
}
.land {
  background: var(--sand);
  padding-block: 12px 64px;
}
.meadow {
  background: var(--grass-light);
  padding-block: 64px;
  border-top: 10px solid var(--grass);
}

section { scroll-margin-top: 16px; }

/* --- How it works ------------------------------------------------------- */

.steps {
  display: grid;
  gap: 34px 26px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; text-align: center; padding-top: 30px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  top: -24px;
  left: 50%;
  translate: -50% 0;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  background: var(--sun);
  border: var(--line) solid var(--outline);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--rim);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--outline);
}
.steps img { width: 150px; height: 150px; object-fit: contain; margin: 4px auto 10px; display: block; }
.steps h3 { margin-bottom: 0.3em; }
.steps p { margin: 0; }

/* --- Modes --------------------------------------------------------------- */

.mode {
  display: grid;
  gap: 24px;
  align-items: center;
  margin-top: 56px;
}
.mode:first-of-type { margin-top: 36px; }
.shot {
  margin: 0;
  background: var(--outline);
  border: var(--line) solid var(--outline);
  border-radius: 26px;
  padding: 8px;
  box-shadow: 0 0 0 7px var(--rim), 0 14px 0 -2px rgba(74, 58, 49, 0.18);
}
.shot img { display: block; width: 100%; border-radius: 18px; }
.mode .tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 14px;
  border: var(--line) solid var(--outline);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}
.tag.sea { background: var(--sea-button); }
.tag.coral { background: var(--coral); }
.tag.grass { background: var(--grass-button); }
.tag.sun { background: var(--sun); }

.tools { display: flex; gap: 10px; margin: 4px 0 0; }
.tools img { width: 72px; height: 72px; }
.tools img:nth-child(2) { transform: rotate(8deg); }

.words {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 4px;
  padding: 0;
  list-style: none;
}
.words li {
  width: 108px;
  text-align: center;
  padding: 8px 8px 6px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brown);
}
.words img { width: 84px; height: 84px; display: block; margin: 0 auto 2px; }

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 22px 18px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.games li { padding: 10px 10px 12px; text-align: center; }
.games img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 8px;
  border: var(--line) solid var(--outline);
  border-radius: 14px;
}
.games .mini img { aspect-ratio: 1; width: 64%; margin-inline: auto; border: 0; border-radius: 0; }
.aside-art {
  display: block;
  width: min(100%, 300px);
  margin: 6px 0 14px;
  border: var(--line) solid var(--outline);
  border-radius: 14px;
  box-shadow: 0 0 0 5px var(--rim);
}
.shot.howto { max-width: 720px; margin: 44px auto 0; }
.caption { text-align: center; margin: 18px 0 0; font-weight: 600; color: var(--brown-muted); }
.games b {
  display: block;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brown);
}
.games span { display: block; font-size: 0.98rem; line-height: 1.35; color: var(--ink); }

/* --- Promise list ---------------------------------------------------------- */

.promises {
  display: grid;
  gap: 14px 28px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.promises li {
  position: relative;
  padding-left: 50px;
  min-height: 38px;
  font-weight: 600;
}
.promises li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border: var(--line) solid var(--outline);
  border-radius: 50%;
  background: var(--grass-button);
  box-shadow: 0 0 0 4px var(--rim);
}
.promises li::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 7px;
  width: 9px;
  height: 15px;
  border: solid var(--outline);
  border-width: 0 4px 4px 0;
  transform: rotate(45deg);
}
.promises small { display: block; font-weight: 400; font-size: 1rem; color: var(--ink-muted); }

/* --- FAQ ----------------------------------------------------------------------- */

.faq-title { margin-top: 44px; }
.faq { display: grid; gap: 18px; margin-top: 18px; }
.faq details { padding: 0; }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 56px 16px 20px;
  min-height: 56px;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--brown);
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: var(--line) solid var(--outline);
  border-radius: 50%;
  background: var(--sun);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 20px 18px; }
.faq details > div p:last-child { margin-bottom: 0; }

/* --- Where it came from: a note pinned to the sheet ----------------------- */

.origin {
  max-width: 760px;
  margin: 70px auto 0;
  text-align: center;
  background: #FFF6D6;
  padding: 34px 28px 28px;
}
.origin .quote {
  margin: 0;
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--brown);
}
.origin img { width: 110px; margin: 0 auto 8px; display: block; }

/* --- Footer: grass and a path ------------------------------------------------- */

.foot {
  background: var(--grass);
  border-top: 10px solid var(--grass-dark);
  padding-block: 34px 44px;
  color: var(--outline);
}
.foot .wrap { display: grid; gap: 18px; }
.foot a { color: var(--outline); font-weight: 600; }
.foot a:hover { color: var(--outline); text-decoration-thickness: 3px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; }
.foot p { margin: 0; font-size: 1rem; }

/* --- The privacy page --------------------------------------------------------- */

.doc { padding-block: 10px 64px; }
.doc .sheet { max-width: 860px; margin-inline: auto; }
.doc h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.doc h2 { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.75rem); margin-top: 1.6em; }
.doc h3 { font-size: 1.2rem; margin-top: 1.2em; }
.doc ul { padding-left: 1.3em; }
.doc li { margin-bottom: 0.4em; }
.doc .meta { color: var(--ink-muted); font-weight: 600; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 1rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border: 2px solid var(--cardborder, #E7DDC9); }
.doc th { background: var(--background); color: var(--brown); font-weight: 600; }
.doc .toc { background: var(--card); border: 2px solid #E7DDC9; border-radius: 18px; padding: 14px 20px; }
.doc .toc ol { margin: 6px 0 0; padding-left: 1.3em; columns: 2 16em; }
.doc .summary { margin: 20px 0 28px; }
.doc .summary h2 { margin-top: 0; }
.placeholder { background: #FFE6A8; padding: 0 4px; border-radius: 4px; }
.table-scroll { overflow-x: auto; }

/* --- The help page ------------------------------------------------------------ */

.doc .contact { display: grid; grid-template-columns: 110px 1fr; gap: 20px; align-items: center; }
.doc .contact img { width: 110px; transform: rotate(-5deg); }
.doc .contact p:last-child { margin-bottom: 0; }

/* --- Wider screens ---------------------------------------------------------- */

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .promises { grid-template-columns: 1fr 1fr; }
  .foot .wrap { grid-template-columns: 1fr auto; align-items: end; }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .mode { grid-template-columns: 1.25fr 1fr; gap: 44px; }
  .mode.flip > .shot { order: 2; }
  .mode.flip { grid-template-columns: 1fr 1.25fr; }
}

@media (max-width: 480px) {
  body { font-size: 1.0625rem; }
  .tilt-l, .tilt-r { transform: none; }
  .langs a, .langs span { min-width: 44px; padding: 0 8px; }
  .brand span { display: none; }
  .clouds .c1 { display: none; }
  .games { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
  .games li { padding: 8px 8px 10px; }
  .games span { font-size: 0.92rem; }
  .words { gap: 10px; }
  .words li { width: 96px; }
  .words img { width: 72px; height: 72px; }
  .doc .contact { grid-template-columns: 1fr; }
  .doc .contact img { width: 84px; }
}

@media print {
  body { background: #fff; }
  .clouds, .friends, .shore, .langs, .skip { display: none; }
  .sheet, .card { box-shadow: none; }
}

/* --- The not-found page ------------------------------------------------------- */

.lost { text-align: center; }
.lost img { width: 110px; transform: rotate(14deg); margin-bottom: 8px; }

/* The publisher, small and quiet under the footer's own lines. */
.foot .by { font-size: 0.85rem; opacity: 0.7; margin-top: 0.4rem; }
