/* Tilo World. The colours, the font and the pictures are the app's own (app/lib/core/theme.dart). */
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --cream: #fff6e5;
  --paper: #fdebc8;
  --card: #fffaf0;
  --wood: #b9824a;
  --wood-dark: #7a4e26;
  --wood-light: #e6cfa6;
  --fox: #f07a1e;
  --teal: #2e8c8a;
  --teal-deep: #1e6b69;
  --leaf: #6bae3c;
  --sky: #7cc8f2;
  --ink: #3b2a1a;
  --ink-soft: #6b5440;
  --star: #ffc22e;
  --wide: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 500 18px/1.6 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal-deep); font-weight: 800; text-underline-offset: 3px; }
a:hover { color: var(--fox); }
h1, h2, h3 { line-height: 1.15; font-weight: 900; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0.6em 0; }
:focus-visible { outline: 4px solid var(--fox); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--card); padding: 8px 14px; border-radius: 12px; }
.small { font-size: 0.85rem; }

/* Header: a wooden shelf that stays in reach while the page scrolls. */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px 28px;
  padding: 8px max(16px, calc(50% - var(--wide) / 2));
  background: rgba(255, 246, 229, 0.94);
  border-bottom: 4px solid var(--wood-light);
  backdrop-filter: blur(8px);
}
.brand { flex: none; line-height: 0; }
.brand img { height: 44px; width: auto; }
.top nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a {
  flex: none; padding: 8px 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 800; white-space: nowrap;
}
.top nav a:hover { background: var(--paper); }
.top nav a[aria-current] { background: var(--teal-deep); color: #fff; }

/* Buttons: planks, as in the app. */
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 18px;
  font: inherit; font-weight: 900; font-size: 1.1rem; text-decoration: none; text-align: center;
  cursor: pointer; border: 3px solid; transition: transform 0.12s, box-shadow 0.12s;
}
.btn-wood {
  color: #fff8ea; border-color: var(--wood-dark);
  background:
    repeating-linear-gradient(92deg, rgba(122, 78, 38, 0.14) 0 2px, transparent 2px 13px),
    linear-gradient(#cf9a61, #b17a43);
  box-shadow: 0 6px 0 var(--wood-dark), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 2px 0 rgba(90, 55, 20, 0.6);
}
.btn-teal {
  color: #fff; border-color: #134d4b; background: linear-gradient(#2c8a88, var(--teal-deep));
  box-shadow: 0 6px 0 #134d4b, inset 0 2px 0 rgba(255, 255, 255, 0.3);
}
.btn-wood:hover, .btn-teal:hover { color: #fff; transform: translateY(-2px); }
.btn-wood:active, .btn-teal:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--wood-dark); }
.btn-soon {
  color: var(--ink); background: var(--paper); border: 3px dashed var(--wood); cursor: default;
}
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.actions.center { justify-content: center; }

.paper {
  background: var(--card); border: 3px solid var(--wood-light); border-radius: 26px;
  box-shadow: 0 7px 0 #ecd9b4; padding: 24px;
}

/* Sections */
.band { padding: clamp(48px, 7vw, 88px) max(16px, calc(50% - var(--wide) / 2)); }
.band > h2, .world h2 { display: flex; align-items: center; gap: 14px; }
.band > h2::before {
  /* the gem on Tilo's scarf */
  content: ""; flex: none; width: 18px; height: 18px; background: var(--teal);
  transform: rotate(45deg); border-radius: 4px; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.18);
}
.band > h2 + :not(.sub) { margin-top: 28px; }
.sub { font-size: 1.15rem; color: var(--ink-soft); max-width: 46rem; margin-bottom: 28px; }
.more { margin-top: 28px; font-size: 1.1rem; }
.more a::after { content: " →"; }
.paperband { background: var(--paper); }
.sky { background: linear-gradient(#56b1f4, #a9dcfb 70%, var(--cream)); }
.band.sky h2 { color: #fff; text-shadow: 0 2px 0 rgba(30, 80, 130, 0.55); }
.band.sky .sub { color: #0f3557; font-weight: 700; }
.band.sky h2::before { background: #fff; }

/* Home: the village, as the app's home screen stacks it. */
.hero { position: relative; overflow: hidden; height: 700px; background: linear-gradient(#3d9ff3, #9ad5fb 62%, #fde9c2 88%); }
.scene img { position: absolute; max-width: none; }
.scene .clouds { top: 20px; left: 56%; width: 560px; animation: drift 70s ease-in-out infinite alternate; }
.scene .clouds.two { top: 40px; left: 2%; width: 420px; opacity: 0.9; animation-duration: 95s; animation-direction: alternate-reverse; }
.scene .hills { bottom: 190px; left: 50%; width: max(100%, 1250px); transform: translateX(-50%); opacity: 0.95; }
.scene .town { bottom: 150px; right: max(1vw, calc(50% - 660px)); width: 560px; }
.scene .meadow { top: calc(100% - 560px); left: 50%; width: max(104%, 1300px); transform: translateX(-50%); }
.hero .tilo img { position: absolute; bottom: 14px; left: calc(50% - 70px); height: 390px; width: auto; filter: drop-shadow(0 10px 8px rgba(40, 60, 20, 0.35)); }
.hero-card { position: absolute; top: 64px; left: max(24px, calc(50% - var(--wide) / 2)); width: min(500px, 42vw); padding: 30px 32px 34px; }
.eyebrow { display: inline-block; margin: 0 0 12px; padding: 4px 14px; border-radius: 999px; background: var(--teal-deep); color: #fff; font-weight: 800; font-size: 0.95rem; }
.lead { font-size: 1.2rem; }
@keyframes drift { from { transform: translateX(-40px); } to { transform: translateX(60px); } }

@media (max-width: 1099px) {
  .hero { height: auto; padding: 330px 16px 40px; }
  .scene { position: absolute; inset: 0 0 auto 0; height: 430px; overflow: hidden; }
  .scene .clouds { left: 40%; width: 360px; top: 16px; }
  .scene .clouds.two { width: 260px; top: 90px; }
  .scene .hills { bottom: 110px; width: max(120%, 760px); }
  .scene .town { bottom: 60px; right: -70px; width: 360px; }
  .scene .meadow { top: 300px; width: max(110%, 760px); }
  .hero .tilo img { bottom: auto; top: 70px; left: 6%; height: 290px; }
  .hero-card { position: relative; top: 0; left: 0; width: auto; max-width: 640px; margin: 0 auto; padding: 24px; }
}

/* Three promises */
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.trust article { text-align: center; }
.trust img { width: 96px; height: 96px; transition: transform 0.2s; }
.trust article:hover img { transform: rotate(-6deg) scale(1.08); }
.trust h3 { margin: 8px 0; }
.trust p { margin: 0; color: var(--ink-soft); }

/* The six islands float, as on the app's worlds screen. */
.islands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 12px; }
.island { display: grid; justify-items: center; text-decoration: none; color: #fff; }
.island img { height: clamp(140px, 22vw, 230px); width: auto; animation: bob 5s ease-in-out infinite alternate; }
.island:nth-child(2n) img { animation-delay: -1.7s; }
.island:nth-child(3n) img { animation-delay: -3.1s; }
.island .label {
  margin-top: -14px; padding: 6px 18px; border-radius: 999px; background: var(--card); color: var(--ink);
  border: 3px solid var(--wood); font-weight: 900; font-size: 1.1rem; position: relative; text-align: center;
}
.island small { margin-top: 6px; font-weight: 800; color: #173f63; }
.island:hover .label { background: var(--star); }
@keyframes bob { from { transform: translateY(-7px); } to { transform: translateY(7px); } }
@media (max-width: 640px) { .islands { grid-template-columns: repeat(2, 1fr); } }

.stats { list-style: none; margin: 44px 0 0; padding: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; background: var(--card); border: 3px solid var(--wood-light); border-radius: 26px; text-align: center; }
.stats li { font-weight: 800; color: var(--ink-soft); line-height: 1.2; }
.stats b { display: block; font-size: 2.3rem; font-weight: 900; color: var(--teal-deep); }

/* Word cards: tap, and Tilo says the word. */
.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px; }
.word {
  display: grid; justify-items: center; gap: 0; padding: 10px 6px 12px; cursor: pointer;
  font: inherit; color: var(--ink); background: var(--card);
  border: 3px solid var(--wood-light); border-radius: 22px; box-shadow: 0 5px 0 #ecd9b4;
  transition: transform 0.15s, border-color 0.15s;
}
.word img, .word .blob { width: 96px; height: 96px; }
.word .blob { background: var(--paint); border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; border: 3px solid rgba(0, 0, 0, 0.12); transform: scale(0.82); }
.word b { font-size: 1.15rem; font-weight: 900; }
.word small { color: var(--ink-soft); font-weight: 700; line-height: 1.2; }
.word:hover { transform: translateY(-3px) rotate(-1.5deg); border-color: var(--wood); }
.word.playing { border-color: var(--teal); background: #e6f6f3; animation: pop 0.45s; }
@keyframes pop { 40% { transform: scale(1.1) rotate(2deg); } }

/* Phone screens */
.phones { display: flex; gap: 22px; overflow-x: auto; padding: 6px 4px 18px; scroll-snap-type: x mandatory; }
.phone { flex: none; margin: 0; width: 236px; scroll-snap-align: center; text-align: center; }
.phone img { display: block; width: 100%; border: 8px solid var(--ink); border-radius: 34px; box-shadow: 0 10px 0 rgba(59, 42, 26, 0.18); }
.phone figcaption { margin-top: 14px; font-weight: 900; }

/* Books */
.shelf { display: flex; gap: 18px; overflow-x: auto; padding: 14px 6px 26px; }
.shelf a { flex: none; width: 170px; transition: transform 0.2s; }
.shelf a:nth-child(odd) { transform: rotate(-2.5deg); }
.shelf a:nth-child(even) { transform: rotate(2deg); }
.shelf a:hover { transform: rotate(0) scale(1.05); }
.shelf img, .book img { display: block; border-radius: 14px; border: 4px solid var(--card); box-shadow: 0 8px 0 rgba(59, 42, 26, 0.16); }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 30px 22px; }
.book { position: relative; }
.book h3 { margin-top: 14px; font-size: 1.1rem; }
.book p { margin: 2px 0 0; color: var(--ink-soft); }
.book .tag { position: absolute; top: 10px; left: 10px; }
.tag { padding: 2px 12px; border-radius: 999px; background: var(--leaf); color: #fff; font-weight: 900; font-size: 0.85rem; white-space: nowrap; }
.friends { display: flex; flex-wrap: wrap; gap: 14px 26px; justify-content: center; }
.friends figure { margin: 0; text-align: center; font-weight: 900; }
.friends img { height: 120px; width: auto; display: block; transition: transform 0.2s; }
.friends figure:hover img { transform: translateY(-6px) rotate(4deg); }

.song { display: flex; gap: 26px; align-items: center; margin-top: 30px; }
.song > img { flex: none; width: 170px; height: auto; }
.lyrics, .titles { list-style: none; padding: 0; margin: 18px 0 0; }
.lyrics li, .titles li { padding: 6px 0; font-weight: 800; }
.lyrics small, .titles small { display: block; color: var(--ink-soft); font-weight: 600; }
.titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 28px; margin-top: 30px; }
@media (max-width: 640px) { .song { flex-direction: column; text-align: center; } .song > img { width: 130px; } }

/* Price */
.price { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.price .plus { border-color: var(--teal); box-shadow: 0 7px 0 #a9d3cf; }
.big { font-size: 2rem; font-weight: 900; color: var(--teal-deep); margin: 4px 0 10px; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding: 5px 0 5px 34px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 5px; width: 24px; height: 24px; border-radius: 50%; background: var(--leaf); color: #fff; font-weight: 900; font-size: 0.9rem; line-height: 24px; text-align: center; }
.ticks.wide { margin-top: 34px; font-size: 1.08rem; }

/* Questions */
.faq { display: grid; gap: 12px; max-width: 52rem; }
.faq details, .unit { background: var(--card); border: 3px solid var(--wood-light); border-radius: 20px; }
.faq summary, .unit summary { cursor: pointer; padding: 16px 20px; font-weight: 900; font-size: 1.1rem; }
.faq p { margin: 0; padding: 0 20px 18px; }
details[open] > summary { color: var(--teal-deep); }

/* Inner pages */
.pagehead { padding: clamp(40px, 6vw, 72px) max(16px, calc(50% - var(--wide) / 2)) clamp(36px, 5vw, 60px); color: #fff; }
.pagehead.sky { background: linear-gradient(#2f8de4, #5fb3f3); border-bottom: 4px solid var(--wood-light); }
.pagehead .lead { font-weight: 700; }
.pagehead h1, .pagehead .lead { text-shadow: 0 2px 0 rgba(30, 80, 130, 0.55); max-width: 46rem; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.jump a { padding: 6px 18px; border-radius: 999px; background: var(--card); color: var(--ink); border: 3px solid var(--wood); text-decoration: none; font-weight: 900; }
.jump a:hover { background: var(--star); }

.world { margin-bottom: 72px; }
.world-head { display: flex; gap: 24px; align-items: center; margin-bottom: 22px; }
.world-head img { flex: none; height: 150px; width: auto; }
.world-head p { margin: 6px 0 0; max-width: 40rem; }
.meta { font-weight: 900; color: var(--teal-deep); }
.unit { margin-bottom: 12px; }
.unit summary { display: flex; align-items: center; gap: 12px; }
.unit .t { flex: 1; }
.unit .t small { display: block; color: var(--ink-soft); font-weight: 700; font-size: 0.9rem; }
.peek { display: flex; gap: 2px; }
.peek img, .peek .blob { width: 40px; height: 40px; }
.peek .blob { background: var(--paint); border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.12); transform: scale(0.7); }
@media (max-width: 720px) { .peek { display: none; } }
.unit .n { color: var(--ink-soft); font-weight: 800; font-size: 0.95rem; white-space: nowrap; }
.unit .words { padding: 4px 16px 18px; }
@media (max-width: 640px) { .world-head { flex-direction: column; align-items: flex-start; } .world-head img { height: 120px; } }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; margin-bottom: 44px; text-align: center; }
.how img { height: 110px; width: auto; }
.how p { margin: 6px 0 0; color: var(--ink-soft); }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
.game { display: flex; gap: 20px; align-items: center; padding: 18px; }
.game img { flex: none; width: 124px; border: 5px solid var(--ink); border-radius: 20px; }
.game h2 { font-size: 1.35rem; }
.game p { margin: 8px 0 0; font-size: 1rem; }

.split { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
.feature { flex: 1 1 380px; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.feature b { display: block; font-weight: 900; font-size: 1.15rem; }

.policy { max-width: calc(46rem + 32px); margin: 0 auto; padding-inline: 16px; }
.policy section + section { margin-top: 64px; padding-top: 40px; border-top: 4px solid var(--wood-light); }
.policy h3 { margin-top: 1.8em; }
.policy table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.policy th, .policy td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 2px solid var(--wood-light); }
.policy th { background: var(--paper); }

/* Footer: Tilo holds the sign. */
.foot { position: relative; margin-top: 170px; padding: 44px max(16px, calc(50% - var(--wide) / 2)) 36px; background: var(--teal-deep); color: #e9f6f4; }
.foot-tilo { position: absolute; right: max(16px, calc(50% - var(--wide) / 2)); bottom: 100%; margin-bottom: -18px; width: 104px; }
.foot-brand { font-size: 1.5rem; font-weight: 900; color: #fff; margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 18px 0; }
.foot a { color: #fff; }
.foot a[aria-current] { text-decoration-color: var(--star); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
