/* ---- Cosy Villages ---------------------------------------------------------------
   One warm page with a path to each village. Cream paper and sepia ink to sit
   between the three: snowy Christmas, always-spring meadow and the old almanac.
   No outside fonts or scripts: everything is in this folder. */
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-italic.woff2") format("woff2"); font-style: italic; font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dmsans-normal.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }

:root {
  --page: #f4ead6;
  --paper: #fffaf0;
  --ink: #3a2e22;
  --sepia: #6b5233;
  --soft: #7a6a55;
  --rule: #d8c6a4;
  --twine: #a58861;
  --berry: #a3283a;
  --pine: #1f4a36;
  --gold: #c9a24a;
  --primrose: #e7c440;
  --meadow: #6f8a2a;
  --scarf: #6d84a8;
  --russet: #a9562a;
  --head: "Fraunces", Georgia, serif;
  --body: "DM Sans", "Trebuchet MS", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--body); color: var(--ink); font-size: 17px; line-height: 1.6;
  background: var(--page) radial-gradient(rgba(107, 82, 51, .07) 1px, transparent 1.4px) 0 0 / 18px 18px;
  min-height: 100vh; overflow-x: hidden;
}
a { color: inherit; }

/* ---- the sign at the top, hung on twine with felt bunting ---- */
.top { position: relative; text-align: center; padding: 92px 20px 28px; max-width: 760px; margin: 0 auto; }
.bunting { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 70px; }
.top { max-width: none; }
.flags { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; top: 0; height: 70px; }
.flags li {
  position: absolute; width: 30px; height: 36px; margin-left: -15px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: var(--berry) radial-gradient(rgba(255,255,255,.16) 1px, transparent 1.5px) 0 0 / 5px 5px;
  filter: drop-shadow(0 2px 1px rgba(60, 40, 20, .2));
  transform-origin: 50% 0; animation: flutter 5s ease-in-out infinite;
}
.flags li:nth-child(1)  { left: 5%;  top: 11px; }
.flags li:nth-child(2)  { left: 15%; top: 21px; background-color: var(--primrose); animation-delay: -1s; }
.flags li:nth-child(3)  { left: 25%; top: 27px; background-color: var(--meadow); animation-delay: -2s; }
.flags li:nth-child(4)  { left: 35%; top: 29px; background-color: var(--scarf); animation-delay: -3s; }
.flags li:nth-child(5)  { left: 45%; top: 27px; background-color: #e8d9b9; animation-delay: -4s; }
.flags li:nth-child(6)  { left: 55%; top: 22px; animation-delay: -1.5s; }
.flags li:nth-child(7)  { left: 65%; top: 17px; background-color: var(--primrose); animation-delay: -2.5s; }
.flags li:nth-child(8)  { left: 75%; top: 13px; background-color: var(--meadow); animation-delay: -3.5s; }
.flags li:nth-child(9)  { left: 85%; top: 9px;  background-color: var(--scarf); animation-delay: -.5s; }
.flags li:nth-child(10) { left: 95%; top: 6px;  background-color: #e8d9b9; animation-delay: -4.5s; }
@keyframes flutter { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.kicker { font-family: var(--hand); font-size: 1.6rem; color: var(--russet); margin: 0; line-height: 1; }
h1 {
  font-family: var(--head); font-weight: 600; color: var(--sepia);
  font-size: clamp(2.6rem, 9vw, 4.6rem); line-height: 1.02; margin: .08em 0 .1em; letter-spacing: -.01em;
}
.orn { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px auto 14px; }
.orn span { width: 64px; height: 1px; background: var(--rule); }
.orn i { width: 8px; height: 8px; transform: rotate(45deg); border: 1.5px solid var(--twine); }
.lede { font-family: var(--head); font-style: italic; font-size: clamp(1.08rem, 2.6vw, 1.3rem); color: var(--soft); max-width: 34em; margin: 0 auto; line-height: 1.5; }

/* ---- the three villages ---- */
.villages {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px;
  max-width: 1180px; margin: 18px auto 0; padding: 0 24px;
}
.village {
  background: var(--paper); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 2px 4px rgba(70, 50, 25, .08), 0 14px 30px -12px rgba(70, 50, 25, .3);
  border: 1px solid #eadcc0;
  transition: transform .35s ease, box-shadow .35s ease;
}
.village:hover { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 4px 8px rgba(70, 50, 25, .1), 0 22px 40px -14px rgba(70, 50, 25, .38); }

.scene { position: relative; display: block; height: 250px; overflow: hidden; }
.scene .hill { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 84px; }
.art { position: absolute; bottom: 10px; height: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); transition: transform .4s ease; }
.village:hover .art { transform: translateY(-3px); }

/* Ember & Twinkle: a starry night over the snow, with Santa waving */
.ember .scene { background: linear-gradient(#141a3a 0%, #2b2a5c 55%, #5a4a86 100%); }
.ember .stars {
  position: absolute; inset: 0;
  background:
    radial-gradient(1.4px 1.4px at 12% 14%, #fff8d8 50%, transparent 52%),
    radial-gradient(1px 1px at 30% 30%, #fff 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 52% 10%, #ffe9a8 50%, transparent 52%),
    radial-gradient(1px 1px at 68% 26%, #fff 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 86% 12%, #fff8d8 50%, transparent 52%),
    radial-gradient(1px 1px at 92% 38%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 6% 44%, #fff 50%, transparent 52%),
    radial-gradient(60px 40px at 50% 100%, rgba(255, 190, 110, .25), transparent 70%);
}
.ember .snow {
  position: absolute; inset: -250px 0 0 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,.9) 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 70px 90px, rgba(255,255,255,.75) 50%, transparent 52%),
    radial-gradient(2.4px 2.4px at 120px 50px, rgba(255,255,255,.9) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 160px 140px, rgba(255,255,255,.7) 50%, transparent 52%);
  background-size: 190px 170px;
  animation: snow 14s linear infinite;
}
.ember .snow-2 { background-size: 240px 210px; opacity: .6; animation-duration: 22s; }
@keyframes snow { from { transform: translateY(0); } to { transform: translateY(250px); } }
.ember-twinkle { width: 62%; max-width: 230px; left: 4%; }
.santa { width: 40%; max-width: 150px; right: 4%; bottom: 8px; }

/* Primrose & Puddle: a soft spring sky over the meadow */
.primrose .scene { background: linear-gradient(#abc5df 0%, #d6ebf6 60%, #eef8fb 100%); }
.primrose .cloud { position: absolute; background: #fff; border-radius: 40px; opacity: .9; }
.primrose .cloud::before, .primrose .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.primrose .c1 { width: 90px; height: 24px; top: 34px; left: 10%; }
.primrose .c1::before { width: 40px; height: 40px; left: 14px; top: -20px; }
.primrose .c1::after { width: 30px; height: 30px; left: 44px; top: -12px; }
.primrose .c2 { width: 70px; height: 20px; top: 70px; right: 12%; opacity: .75; }
.primrose .c2::before { width: 30px; height: 30px; left: 12px; top: -14px; }
.primrose .c2::after { width: 22px; height: 22px; left: 36px; top: -8px; }
.primrose .flowers {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px;
  background:
    radial-gradient(4px 4px at 8% 40%, #f6d34a 60%, transparent 64%),
    radial-gradient(3px 3px at 22% 70%, #fff 60%, transparent 64%),
    radial-gradient(4px 4px at 46% 55%, #f3a6c0 60%, transparent 64%),
    radial-gradient(3px 3px at 60% 80%, #f6d34a 60%, transparent 64%),
    radial-gradient(4px 4px at 76% 45%, #fff 60%, transparent 64%),
    radial-gradient(4px 4px at 92% 70%, #f6d34a 60%, transparent 64%);
}
.primrose-bun { height: 190px; width: auto; left: 22%; }
.puddle-bun { height: 186px; width: auto; right: 20%; }

/* Sorrel & Moss: an old almanac page with the moon drawn in ink */
.sorrel .scene {
  background:
    radial-gradient(rgba(107, 82, 51, .09) 1px, transparent 1.4px) 0 0 / 14px 14px,
    radial-gradient(ellipse at 50% 40%, #fbf3e2, #efe0c2 85%);
}
.sorrel .moon { position: absolute; top: 22px; right: 14%; width: 54px; height: 54px; }
.sorrel-moss { height: 196px; width: auto; left: 50%; margin-left: -94px; }
.village:hover .sorrel-moss { transform: translateY(-3px); }

/* the words under each picture */
.words { padding: 20px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.season { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
h2 { font-family: var(--head); font-weight: 600; font-size: 1.7rem; line-height: 1.1; margin: .15em 0 .4em; }
h2 a { text-decoration: none; }
.ember h2 { color: var(--berry); }
.primrose h2 { color: #5f7a1f; }
.sorrel h2 { color: var(--sepia); }
.words p { margin: 0 0 .8em; }
.note { font-family: var(--hand); font-size: 1.4rem; line-height: 1.1; color: var(--russet); margin-top: auto !important; }
.go {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .45em;
  padding: .7em 1.2em; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .98rem;
  color: #fff; background: var(--berry);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 0 6px 14px -6px rgba(0, 0, 0, .4);
  transition: transform .2s ease, filter .2s ease;
}
.go span { transition: transform .2s ease; }
.go:hover { filter: brightness(1.07); }
.go:hover span { transform: translateX(3px); }
.go:focus-visible, h2 a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.primrose .go { background: #6e8a24; }
.sorrel .go { background: var(--sepia); }

/* ---- footer ---- */
.foot { text-align: center; padding: 44px 20px 48px; color: var(--soft); }
.foot p { margin: 0 0 .3em; }
.foot .small { font-size: .85rem; opacity: .8; }

/* ---- smaller screens ---- */
@media (max-width: 960px) {
  .villages { grid-template-columns: 1fr; max-width: 560px; gap: 24px; padding: 0 16px; }
}
@media (max-width: 520px) {
  .top { padding-top: 80px; }
  .flags li { width: 22px; height: 28px; margin-left: -11px; }
  .scene { height: 220px; }
  .words { padding: 18px 18px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
