/* Behind the Squares – webbplats. Färger, typsnitt och bakgrund som i appen (app/lib/theme.dart, background_art.dart). */
@font-face { font-family: "Archivo Black"; src: url("fonts/ArchivoBlack-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; src: url("fonts/BarlowCondensed-SemiBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; src: url("fonts/BarlowCondensed-Bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("fonts/PatrickHand-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  /* bakgrunden: tre färger som byts en gång i minuten (site.js), samma som i appen */
  --g1: #1C9DB5;
  --g2: #283C9C;
  --g3: #52E0C4;
  /* appens färger */
  --cream: #F5EEDF;
  --panel: rgba(245, 238, 223, .88);
  --ink: #091844;
  --muted: #577096;
  --line: #24365A;
  --clue-1: #FCEFC4;
  --clue-2: #F7E3A3;
  --clue-line: #8A7444;
  --sol: #F0E7FF;
  --sol-ink: #5A18DF;
  --good: #128451;
  --gold: #FFC928;
  --outline: #FFF9E9;
  --radius: 22px;
  --shadow: 0 10px 28px -8px rgba(12, 40, 87, .45);
  --display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --text: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--g2); }
body {
  margin: 0; color: var(--ink); font-family: var(--text); font-weight: 600; font-size: 20px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  background:
    url("img/squares.svg") center / cover fixed,
    radial-gradient(circle at 65% 72%, color-mix(in srgb, var(--g3) 55%, transparent), transparent 60%) fixed,
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .10), transparent 80%) fixed,
    linear-gradient(160deg, var(--g1), var(--g2)) fixed;
  min-height: 100vh;
}
/* iOS målar inte fasta bakgrunder; där rullar den med sidan */
@supports (-webkit-touch-callout: none) { body { background-attachment: scroll; } }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sol-ink); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(38px, 6.2vw, 66px); }
h2 { font-size: clamp(30px, 4.2vw, 44px); }
h3 { font-size: 22px; }
p { margin: 0 0 1em; }

/* rubriker direkt på bakgrunden: mörkblå text med ljus kant och skugga, som appens namn */
.outlined {
  color: var(--ink);
  -webkit-text-stroke: .14em var(--outline);
  paint-order: stroke fill;
  text-shadow: .05em .07em .1em rgba(12, 29, 61, .55);
}

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 16px; z-index: 10; }

/* appens paneler: varm, ljus yta med 80–90 % täckning över bakgrunden */
.panel {
  background: var(--panel);
  border: 1px solid #BAC5D4;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* färgade rutor med ikon, som numren i appens lista */
.tile {
  display: inline-grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 14px; color: #fff;
  background: linear-gradient(#B185FF, #6435B5);
  box-shadow: 0 4px 10px -3px rgba(6, 28, 80, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
  border: 1.5px solid rgba(255, 255, 255, .7);
}
.tile svg { width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(6, 28, 80, .3)); }
.t1, .f-clock, .k-proverb, .k-film { background: linear-gradient(#FFD23E, #F07812); }
.t2, .f-image, .k-saying, .k-music { background: linear-gradient(#66D9FF, #0475DD); }
.t3, .f-help, .k-bible, .k-person { background: linear-gradient(#8DE19B, #1C956C); }
.f-book, .k-quote, .k-place { background: linear-gradient(#B185FF, #6435B5); }
.f-calendar, .k-fairytale { background: linear-gradient(#FF9AB8, #D63378); }
.f-phone, .k-book { background: linear-gradient(#FFD23E, #F07812); }

/* sidhuvud */
.top { position: sticky; top: 0; z-index: 5; background: var(--panel); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid #BAC5D4; box-shadow: 0 4px 18px -10px rgba(12, 40, 87, .5); }
.top-in { display: flex; align-items: center; gap: 24px; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 56px; width: 56px; }
.brand-name { font-family: var(--display); font-size: 30px; line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; }
.nav a:hover { color: var(--sol-ink); }
.langs { display: flex; gap: 6px; }
.langs a { font-weight: 700; font-size: 16px; text-decoration: none; padding: 4px 11px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink); text-transform: uppercase; background: #fff; }
.langs a[aria-current="true"] { background: linear-gradient(#9346FF, #4710D8); border-color: #4710D8; color: #fff; }

/* hjälte */
.hero { padding: 24px 0 32px; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.kicker { display: inline-block; background: linear-gradient(var(--clue-1), var(--clue-2)); border: 1px solid var(--clue-line); border-radius: 999px; padding: 4px 16px; font-weight: 700; font-size: 17px; margin-bottom: 18px; box-shadow: 0 3px 8px -3px rgba(26, 18, 6, .4); }
.lead-panel { padding: 24px 26px 18px; }
.lead { font-size: 22px; max-width: 36ch; }
.lead-panel .lead { max-width: none; }
.lead.light { color: #fff; text-shadow: 0 1px 4px rgba(6, 20, 60, .6); max-width: 60ch; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 12px; }
/* knappar som appens: lila med ljus överkant */
.store { display: inline-flex; flex-direction: column; justify-content: center; min-width: 170px; padding: 10px 22px; border-radius: 16px; background: linear-gradient(#9346FF, #4710D8); color: #fff; font-family: var(--display); font-size: 20px; line-height: 1.1; box-shadow: 0 5px 10px -3px rgba(67, 12, 191, .55), inset 0 1px 0 rgba(255, 255, 255, .35); }
.store small { font-family: var(--text); font-weight: 600; font-size: 14px; opacity: .85; }
.store[aria-disabled] { opacity: .9; }
a.store { text-decoration: none; }
/* Officiella butiksmärken: oförändrade, lika höga, fri yta runt om (Apples och Googles riktlinjer) */
.badge { display: inline-flex; align-items: center; line-height: 0; }
.badge img { height: var(--badge-h, 52px); width: auto; display: block; }
.trademarks { font-size: 13px; opacity: .75; margin-top: 6px; }
.note { color: var(--muted); font-size: 17px; margin: 0; }

.hero-art { position: relative; display: grid; place-items: center; padding: 30px 0 40px; }
.board { margin: 0; width: min(390px, 82vw); padding: 7px; background: var(--line); border-radius: 10px; transform: rotate(3deg); box-shadow: 0 30px 50px -18px rgba(6, 18, 60, .7); }
.board img { border-radius: 4px; }
/* öppningsrutan i appen: vad du letar efter */
.question { position: absolute; left: -10px; bottom: 6px; width: min(270px, 70vw); transform: rotate(-3deg); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 14px 16px; background: #FFFDF6; border: 1px solid #BAC5D4; border-radius: 20px; box-shadow: var(--shadow); }
.q-label { grid-column: 1 / -1; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.q-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--sol); color: var(--sol-ink); }
.q-icon svg { width: 26px; height: 26px; }
.q-text { font-family: var(--display); font-size: 18px; line-height: 1.15; color: var(--sol-ink); }
.score { position: absolute; right: 0; top: 4px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border-radius: 999px; color: #fff; font-family: var(--display); font-size: 18px; background: linear-gradient(rgba(38, 63, 112, .95), rgba(21, 37, 71, .95)); border: 1.5px solid rgba(255, 255, 255, .6); box-shadow: 0 4px 10px rgba(12, 40, 87, .3); transform: rotate(4deg); }
.score svg { width: 26px; height: 26px; color: var(--gold); }

/* så spelar du */
.how { padding: 28px 0; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { padding: 26px 24px 10px; }
.step .tile { margin-bottom: 16px; }
.step h3 { display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(#FFFFFF, #FFFDF3); border: 1px solid #5E5547; font-family: var(--hand); font-size: 26px; color: var(--good); box-shadow: 1px 2px 3px rgba(26, 18, 6, .25); }
.step p { color: #22325A; }

/* lösningens sorter */
.kinds { padding: 12px 0; }
.kinds-in { padding: 34px 32px 28px; }
.chips { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.chip { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; background: #fff; border: 1px solid #BAC5D4; border-radius: 16px; padding: 8px 12px 8px 8px; box-shadow: 0 3px 8px -4px rgba(12, 40, 87, .35); }
.chip .tile { width: 44px; height: 44px; border-radius: 11px; }
.chip .tile svg { width: 24px; height: 24px; }

/* bilderna */
.gallery { padding: 32px 0 20px; }
.art { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.art figure { margin: 0; }
.art img { border-radius: 14px; border: 4px solid #FFFDF6; box-shadow: var(--shadow); aspect-ratio: 3 / 4; object-fit: cover; }
.art li:nth-child(odd) img { transform: rotate(-2deg); }
.art li:nth-child(even) img { transform: rotate(2deg) translateY(10px); }
.art figcaption { margin-top: 14px; text-align: center; font-weight: 700; font-size: 17px; color: #fff; text-shadow: 0 1px 4px rgba(6, 20, 60, .7); line-height: 1.2; }

/* funktioner */
.features { padding: 28px 0; }
.grid { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { padding: 24px; }
.card .tile { margin-bottom: 14px; }
.card p { color: #22325A; margin: 0; }

/* frågor */
.faq { padding: 28px 0 36px; }
details { margin: 12px 0; border-radius: 16px; }
summary { cursor: pointer; padding: 16px 20px; font-family: var(--display); font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 26px; line-height: .8; color: var(--sol-ink); }
details[open] summary::after { content: "–"; }
details p { padding: 0 20px 16px; margin: 0; color: #22325A; }

/* sidfot: som poängraden i appen */
.foot { background: linear-gradient(rgba(38, 63, 112, .96), rgba(21, 37, 71, .98)); color: #C9D4EA; padding: 36px 0; border-top: 1.5px solid rgba(255, 255, 255, .5); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.foot-in p { margin: 0; }
.foot a { color: #fff; }
.foot .langs a { background: transparent; border-color: #C9D4EA; color: #C9D4EA; }
.foot .langs a[aria-current="true"] { background: #C9D4EA; color: #152547; }
.foot img { height: 54px; width: auto; }

/* textsidor */
.doc { margin: 40px auto 64px; padding: 32px 36px 24px; }
.doc h1 { font-size: clamp(32px, 5vw, 48px); }
.doc h2 { font-size: 24px; margin-top: 1.4em; }

/* mobil */
@media (max-width: 980px) {
  .chips { grid-template-columns: repeat(2, 1fr); }
  .art { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero { padding-top: 14px; }
  /* mobil: bilden direkt under rubriken, texten och butiksknapparna efter */
  .hero-text { display: contents; }
  .hero-in { gap: 0; }
  .hero-in > .hero-text > .kicker { order: 1; justify-self: start; }
  .hero-in > .hero-text > h1 { order: 2; }
  .hero-art { order: 3; padding: 16px 0 28px; }
  .lead-panel { order: 4; margin-top: 22px; } /* luft mellan frågerutan och textrutan */
  .steps, .grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .top-in .langs { margin-left: auto; }
  .lead { max-width: none; }
  .question { left: 0; }
}
@media (max-width: 480px) {
  body { font-size: 19px; }
  .brand { gap: 9px; }
  .brand img { height: 42px; width: 42px; }
  .brand-name { font-size: 19px; }
  .store { min-width: 0; flex: 1; }
  .kinds-in, .lead-panel, .doc { padding-inline: 20px; }
  .chip { font-size: 18px; }
  .art { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .brand-name { font-size: 16px; }
  .top-in { gap: 12px; }
}
@media (max-width: 340px) {
  .brand img { height: 36px; width: 36px; }
  .brand-name { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
