/* GingerHamlet – gingerhamlet.com
   Ilme sovelluksesta (app/lib/theme.dart, ilme "H"): leivinpaperin värit, kuorrutteenpunaiset otsikot,
   pyöreäkulmaiset paperikortit kovalla alavarjolla, pisterengas kuvien ympärillä. Ei ulkoisia fontteja,
   skriptikirjastoja, evästeitä eikä analytiikkaa. */

@font-face {
  font-family: "Shrikhand";
  src: url("fonts/shrikhand.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("fonts/karla.woff") format("woff");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --parchment: #f5ecdd;   /* tausta */
  --paper: #fffaf1;       /* kortit */
  --ink: #3a2414;         /* teksti */
  --icing-red: #b5352b;   /* otsikot ja päätoiminto */
  --muted: #6e5640;       /* toissijainen teksti */
  --edge: #e2d0b3;        /* kortin alareunan varjo */
  --ring: #dcc8a6;        /* pisterengas */
  --track: #e9dcc6;
  --gingerbread: #cc8c4d;
  --wrap: 68rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--icing-red); text-underline-offset: 0.18em; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--icing-red); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-left: 1.25rem; padding-right: 1.25rem; }

h1, h2, .brand {
  font-family: "Shrikhand", Georgia, serif;
  font-weight: 400;
  color: var(--icing-red);
  line-height: 1.04;
  margin: 0;
}
h1 { font-size: clamp(2.05rem, 8.6vw, 4.4rem); letter-spacing: 0.005em; overflow-wrap: break-word; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.125rem; font-weight: 800; margin: 0 0 0.35rem; }
p { margin: 0 0 1rem; }
.lead { font-size: clamp(1.125rem, 2.2vw, 1.35rem); color: var(--muted); max-width: 34rem; }

/* Yläpalkki */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.brand { font-size: 1.6rem; text-decoration: none; display: inline-flex; align-items: center; gap: 0.6rem; }
.brand img { width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; box-shadow: 0 2px 0 var(--edge); }
.top nav, footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.top nav a, footer nav a { color: var(--ink); font-weight: 700; text-decoration: none; padding: 0.3rem 0; }
.top nav a:hover, footer nav a:hover, .top nav a[aria-current="page"] { color: var(--icing-red); }

/* Pääkuva */
.hero { display: grid; gap: 1.5rem; align-items: center; padding-top: 1rem; padding-bottom: 2.5rem; }
.hero-art { position: relative; margin: 0 auto; width: min(100%, 40rem); aspect-ratio: 1 / 1; display: grid; place-items: center; }
.hero-art::before {             /* paperilautanen ja pisterengas kuten luettelon kortissa */
  content: "";
  position: absolute; inset: 5%;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 6px 0 var(--edge);
}
.hero-art::after {
  content: "";
  position: absolute; inset: 0.5%;
  border-radius: 50%;
  border: 5px dotted var(--ring);
}
.hero-art img { position: relative; z-index: 1; width: 90%; filter: drop-shadow(0 10px 8px rgba(90, 55, 25, 0.18)); }
@media (min-width: 56rem) {
  .hero { grid-template-columns: 1fr 1.1fr; padding-top: 2rem; padding-bottom: 4rem; }
}

/* Painikkeet */
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0.5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.6rem 1.4rem;
  border-radius: 999px; border: 0;
  background: var(--icing-red); color: var(--paper);
  font: inherit; font-weight: 800; text-decoration: none;
  box-shadow: 0 4px 0 #8c261f;
}
.btn:hover { background: #a22e25; }
.btn.soon { background: var(--track); color: var(--muted); box-shadow: 0 4px 0 var(--edge); cursor: default; }
.note { color: var(--muted); font-size: 0.95rem; }

/* Kuorrutekoukero osioiden väliin */
.icing { display: block; width: min(22rem, 70%); height: 1.5rem; margin: 0 auto 0.5rem; color: #fffcf5; filter: drop-shadow(0 2px 0 rgba(138, 106, 72, 0.35)); }

/* Osiot ja kortit */
section { padding: 2.75rem 0; }
.section-head { max-width: 40rem; margin-bottom: 1.75rem; }
.section-head p { color: var(--muted); margin-top: 0.75rem; }
.cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card {
  background: var(--paper);
  border-radius: 1.5rem;
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: 0 5px 0 var(--edge);
}
.card p { margin: 0; color: var(--muted); }
.card .num {
  display: inline-grid; place-items: center;
  width: 2.2rem; height: 2.2rem; margin-bottom: 0.7rem;
  border-radius: 50%; background: var(--icing-red); color: var(--paper);
  font-family: "Shrikhand", Georgia, serif; font-size: 1.1rem;
}

/* Kaksi palstaa: teksti ja kuva */
.split { display: grid; gap: 2rem; align-items: center; }
.split .art { display: grid; place-items: center; }
.sheets { position: relative; width: min(100%, 22rem); aspect-ratio: 1 / 1.25; }
.sheets .sheet { position: absolute; width: 78%; }
.sheets .sheet:first-child { left: 0; top: 0; transform: rotate(-5deg); }
.sheets .sheet:last-child { right: 0; bottom: 0; transform: rotate(3deg); }
.sheet {
  width: min(100%, 19rem);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 5px 0 var(--edge), 0 0 0 1px var(--edge);
  transform: rotate(-2.5deg);
}
@media (min-width: 52rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split.flip .art { order: -1; }
}
ul.ticks { list-style: none; padding: 0; margin: 1rem 0 0; }
ul.ticks li { position: relative; padding-left: 1.7rem; margin-bottom: 0.55rem; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.42em;
  width: 0.8rem; height: 0.8rem; border-radius: 50%;
  background: var(--gingerbread); box-shadow: inset 0 0 0 2.5px #fffaee;
}

/* Valokuvamainen pääkuva pyöreässä kehyksessä (kuten luettelon kortti) */
.hero-art.photo::before { inset: 3.5%; background: #2a170d; box-shadow: 0 8px 0 var(--edge); }
.hero-art.photo img { width: 93%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; filter: none; }

/* Tarina ja lähikuvat */
.story p { margin-top: 0.9rem; max-width: 34rem; }
.rules-head { font-family: "Karla", system-ui, sans-serif; font-weight: 800; font-size: 1.25rem; margin-top: 1.6rem; color: var(--ink); }
ol.rules { margin: 0.8rem 0 0; padding: 0; list-style: none; counter-reset: saanto; max-width: 30rem; }
ol.rules li { counter-increment: saanto; position: relative; padding: 0.55rem 0.9rem 0.55rem 3rem; margin-bottom: 0.5rem; background: var(--paper); border-radius: 0.9rem; box-shadow: 0 3px 0 var(--edge); font-weight: 700; }
ol.rules li::before { content: counter(saanto); position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--icing-red); color: var(--paper); display: grid; place-items: center; font-family: "Shrikhand", Georgia, serif; font-weight: 400; font-size: 0.95rem; }
.shot { width: min(100%, 26rem); aspect-ratio: 1 / 1; object-fit: cover; border-radius: 1.6rem; box-shadow: 0 6px 0 var(--edge); }

/* Kylä lukuina */
.facts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.fact { background: var(--paper); border-radius: 1.1rem; box-shadow: 0 4px 0 var(--edge); padding: 1.1rem 1.3rem; text-align: center; }
.fact strong { display: block; font-family: "Shrikhand", Georgia, serif; font-weight: 400; font-size: 2.4rem; line-height: 1.1; color: var(--icing-red); }
.fact span { color: var(--muted); }
.smaller { max-width: 40rem; margin: 1.4rem auto 0; text-align: center; font-size: 1.1rem; }

/* Jaa oma kylä: tunnisteet pelkkänä tekstinä, ei upotuksia eikä seurantaa */
.share { text-align: center; }
.share p { color: var(--muted); max-width: 36rem; margin: 0.8rem auto 0; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.tags span { font-family: "Shrikhand", Georgia, serif; font-size: clamp(1.3rem, 4.5vw, 1.9rem); color: var(--icing-red); background: var(--paper); border-radius: 999px; padding: 0.35rem 1.2rem 0.45rem; box-shadow: 0 4px 0 var(--edge); }

/* Mallisto sovelluksessa */
.catalogue { background: var(--paper); border-radius: 1.6rem; box-shadow: 0 6px 0 var(--edge); padding: 2rem 1.5rem 2.2rem; text-align: center; }
.catalogue p { color: var(--muted); max-width: 38rem; margin: 0.8rem auto 0; }
.catalogue .cta { justify-content: center; }

/* Tekstisivut */
.page-head { padding: 1.5rem 0 0.5rem; }
.page-head p { color: var(--muted); margin-top: 0.75rem; max-width: 38rem; }
.prose { max-width: 42rem; }
.prose h2 { font-family: "Karla", system-ui, sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--ink); margin: 2rem 0 0.5rem; line-height: 1.25; }
.prose .updated { color: var(--muted); font-size: 0.95rem; }
details { background: var(--paper); border-radius: 1.1rem; box-shadow: 0 4px 0 var(--edge); padding: 0.9rem 1.2rem; margin-bottom: 0.8rem; }
summary { font-weight: 800; cursor: pointer; }
details p { margin: 0.6rem 0 0.2rem; color: var(--muted); }

/* Alatunniste */
footer { margin-top: 3rem; padding: 2.25rem 0 3rem; border-top: 5px dotted var(--ring); color: var(--muted); font-size: 0.98rem; }
footer .made { color: var(--ink); font-weight: 700; }
footer p { margin: 0.5rem 0; }
.legal-note { font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
