/* Tillypatch website: the landing page and the legal pages. */

@font-face {
  font-family: 'Fredoka';
  src: url('fonts/Fredoka.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --sky: #7ec8f2;
  --sky-light: #c9ecfb;
  --cream: #fff8e1;
  --paper: #fffdf6;
  --grass: #7cb342;
  --grass-dark: #558b2f;
  --leaf: #33691e;
  --wood: #8d6e4a;
  --wood-dark: #6d4c33;
  --tomato: #d84b3c;
  --sun: #ffd54f;
  --ink: #3e2723;
  --muted: #6d5f55;
  --line: #eadfc8;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(62, 39, 35, 0.12);
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --round: 'Fredoka', var(--body);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--grass-dark);
}

/* Only the chosen language shows; without a script, Hungarian. */
html[data-lang='hu'] [lang]:not([lang='hu']),
html[data-lang='en'] [lang]:not([lang='en']),
html[data-lang='de'] [lang]:not([lang='de']),
html[data-lang='fr'] [lang]:not([lang='fr']) {
  display: none !important;
}

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

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 246, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.top .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.wordmark {
  font: 700 28px/1 var(--round);
  letter-spacing: 0.01em;
  -webkit-text-stroke: 0;
  paint-order: stroke fill;
}

.wordmark .a {
  color: var(--tomato);
}

.wordmark .b {
  color: var(--grass-dark);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 600 16px/1 var(--round);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-play {
  background: var(--grass-dark);
  color: #fff;
  box-shadow: 0 4px 0 var(--leaf);
}

.btn-play:hover {
  box-shadow: 0 5px 0 var(--leaf);
}

.btn-store {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn-store small {
  font: 500 12px/1 var(--round);
  color: var(--muted);
}

.btn-store.soon {
  cursor: default;
}

.btn-store.soon:hover {
  transform: none;
}

.lang {
  display: inline-flex;
  border: 2px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.lang button {
  border: 0;
  background: none;
  font: 600 13px/1 var(--round);
  color: var(--muted);
  padding: 9px 10px;
  min-width: 38px;
  min-height: 38px;
  cursor: pointer;
}

.lang-pick {
  display: none;
  appearance: none;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' stroke='%23558b2f' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    right 10px center / 10px no-repeat;
  font: 600 14px/1 var(--round);
  color: var(--grass-dark);
  padding: 0 28px 0 12px;
  min-height: 40px;
  cursor: pointer;
}

html[data-lang='hu'] .lang [data-set='hu'],
html[data-lang='en'] .lang [data-set='en'],
html[data-lang='de'] .lang [data-set='de'],
html[data-lang='fr'] .lang [data-set='fr'] {
  background: var(--grass);
  color: #fff;
}

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

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-light) 45%, #fff4d6 78%, var(--paper) 100%);
  padding: 56px 0 120px;
}

.hero::after {
  /* Rolling hills along the bottom. */
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background:
    radial-gradient(120% 140px at 20% 140px, #8cc65a 70%, transparent 71%),
    radial-gradient(110% 150px at 85% 150px, #a5d67a 70%, transparent 71%),
    linear-gradient(transparent 70%, var(--paper) 70%);
}

.sun {
  position: absolute;
  top: 34px;
  right: 7%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 22px rgba(255, 224, 130, 0.35);
}

.cloud {
  position: absolute;
  width: 150px;
  height: 46px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.92);
  animation: drift 60s linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud::before {
  width: 64px;
  height: 64px;
  left: 26px;
  top: -30px;
}

.cloud::after {
  width: 50px;
  height: 50px;
  left: 74px;
  top: -20px;
}

.cloud.c1 {
  top: 70px;
  left: -10%;
}

.cloud.c2 {
  top: 170px;
  left: 40%;
  transform: scale(0.7);
  animation-duration: 85s;
  animation-delay: -30s;
}

@keyframes drift {
  from {
    translate: -20vw 0;
  }
  to {
    translate: 120vw 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloud {
    animation: none;
  }
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font: 700 clamp(38px, 5.2vw, 62px) / 1.05 var(--round);
  color: var(--leaf);
  margin: 0 0 18px;
}

.hero p.lead {
  font-size: 19px;
  margin: 0 0 26px;
  max-width: 34em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cta .btn {
  min-height: 52px;
  font-size: 18px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
  font: 500 15px/1.3 var(--round);
  color: var(--leaf);
}

.badges li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.screen {
  border-radius: 26px;
  padding: 10px;
  background: #2f3a2a;
  box-shadow:
    0 24px 50px rgba(30, 50, 20, 0.35),
    inset 0 0 0 2px #4a5843;
  rotate: 1.5deg;
}

.screen img {
  border-radius: 18px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

/* ------------------------------------------------------------ sections */

section {
  padding: 72px 0;
}

.kicker {
  font: 600 15px/1 var(--round);
  color: var(--grass-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

h2 {
  font: 700 clamp(30px, 3.6vw, 42px) / 1.15 var(--round);
  color: var(--leaf);
  margin: 0 0 14px;
}

.intro {
  max-width: 40em;
  color: var(--muted);
  margin: 0 0 36px;
}

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card .art {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--cream);
  margin-bottom: 14px;
}

.card .art svg {
  width: 44px;
  height: 44px;
}

.card h3 {
  font: 600 20px/1.2 var(--round);
  margin: 0 0 6px;
  color: var(--ink);
}

.card p {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
}

.gallery-band {
  background: linear-gradient(180deg, var(--paper), #eef7e3 30%, #eef7e3 70%, var(--paper));
}

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 620px);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 4px 22px;
  overscroll-behavior-x: contain;
}

.gallery figure {
  margin: 0;
  scroll-snap-align: start;
}

.gallery img {
  border-radius: 18px;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  background: #dfe9d3;
}

.gallery figcaption {
  font: 500 16px/1.3 var(--round);
  color: var(--leaf);
  margin-top: 10px;
}

.perks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.perk {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.perk svg {
  width: 40px;
  height: 40px;
  flex: none;
}

.perk h3 {
  font: 600 19px/1.25 var(--round);
  margin: 2px 0 4px;
}

.perk p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.download {
  background: var(--grass-dark);
  color: #fff;
  border-radius: 32px;
  padding: 44px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  box-shadow: var(--shadow);
}

.download img {
  width: 132px;
  height: 132px;
  border-radius: 30px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.download h2 {
  color: #fff;
}

.download p {
  margin: 0 0 20px;
  opacity: 0.92;
}

.download .btn-play {
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 4px 0 #c9a227;
}

.faq {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 28px;
  /* Each question its own height: opening one leaves its neighbour shut. */
  align-items: start;
}

.faq details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
}

.faq summary {
  font: 600 18px/1.3 var(--round);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::after {
  content: '+';
  color: var(--grass-dark);
  font-size: 22px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: '–';
}

.faq p {
  margin: 10px 0 0;
  color: var(--muted);
}

/* ------------------------------------------------------------ footer */

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 44px;
  color: var(--muted);
  font-size: 15px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ legal pages */

.doc {
  padding: 48px 0 72px;
}

.doc article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 56px);
  box-shadow: var(--shadow);
  max-width: 860px;
  margin-inline: auto;
}

.doc h1 {
  font: 700 clamp(30px, 4vw, 42px) / 1.15 var(--round);
  color: var(--leaf);
  margin: 0 0 6px;
}

.doc h2 {
  font-size: clamp(22px, 2.6vw, 26px);
  margin: 34px 0 10px;
}

.doc h3 {
  font: 600 19px/1.3 var(--round);
  margin: 22px 0 6px;
}

.doc .meta {
  color: var(--muted);
  margin: 0 0 22px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.doc th {
  background: var(--cream);
  font-weight: 600;
}

.doc li {
  margin: 4px 0;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 15px/1 var(--round);
  text-decoration: none;
  margin-bottom: 18px;
}

/* ------------------------------------------------------------ narrow screens */

@media (max-width: 980px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .perks {
    grid-template-columns: 1fr;
  }

  .faq {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .top .wrap {
    min-height: 60px;
    gap: 8px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .wordmark {
    font-size: 22px;
  }

  /* The store buttons shrink to their icons; "Play" stays a word. */
  .top .btn-store {
    width: 44px;
    padding: 0;
  }

  .top .btn-store .label {
    display: none;
  }

  .top .btn-play {
    padding: 0 14px;
  }

  .lang button {
    min-width: 32px;
    padding: 8px 6px;
  }

  /* No room for four language buttons and the store buttons up here: the
     store buttons are in the page anyway, and a drop-down takes the
     languages. */
  .top .btn-store,
  .top .lang {
    display: none;
  }

  .top .lang-pick {
    display: inline-block;
  }

  .hero {
    padding: 36px 0 100px;
  }

  .sun {
    width: 64px;
    height: 64px;
    top: 18px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  section {
    padding: 52px 0;
  }

  .download {
    grid-template-columns: 1fr;
    padding: 28px 22px;
    text-align: center;
    justify-items: center;
  }

  .download .cta {
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .wordmark {
    display: none;
  }

  .top .btn-play .label-long {
    display: none;
  }
}

@media (min-width: 421px) {
  .top .btn-play .label-short {
    display: none;
  }
}

/* A store button says "soon" until its link is set in site.js. */
.btn-store:not(.soon) .when-soon {
  display: none;
}

@media (min-width: 721px) {
  .top .btn-store .label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.05;
  }
}
