/* Little Worlds: its own small site inside verenaortlieb.com (static/littleworlds/).
   Everything it needs is in this folder: no requests to anywhere else.
   Paths are absolute (/littleworlds/...); moving to its own domain later is a
   find-and-replace of that prefix. */

@font-face {
  font-family: "Fraunces";
  src: url("/littleworlds/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/littleworlds/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* A winter evening. */
  --night: #0d1730;
  --night-2: #142446;
  --night-3: #1c3158;

  /* Text is white (the app's rule: text white or black, never coloured). */
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.8);
  --text-3: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.14);

  /* Brass and candlelight, for details only. */
  --brass: #c9a24a;
  --brass-hi: #e8c56a;
  --brass-lo: #7a5a24;
  --candle: #ffd27a;

  /* Paper tags, with black numbers. */
  --paper: #f0e6cc;
  --paper-ink: #1a1714;


  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(16px, 5vw, 40px);
  --measure: 64rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--night);
  background-image:
    radial-gradient(120% 60% at 50% 0%, var(--night-3) 0%, var(--night-2) 38%, var(--night) 75%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--text);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* No line at rest; a thin one only on hover and keyboard focus. */
a:hover,
a:focus-visible {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

:focus-visible {
  outline: 2px solid var(--candle);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--paper);
  color: var(--paper-ink);
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- The opening ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(82svh, 50rem);
  display: grid;
  place-items: center;
  padding: clamp(3.5rem, 10vh, 6rem) var(--gutter) clamp(3rem, 8vh, 5rem);
  text-align: center;
}

/* Light falling snow: two layers of soft flakes (3 to 5.5 px), drifting down. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: -320px 0 0 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: repeat;
  animation: snow 38s linear infinite;
}

.hero::before {
  background-image:
    radial-gradient(3.6px 3.6px at 20px 30px, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(3px 3px at 140px 110px, rgba(255, 255, 255, 0.6), transparent 70%),
    radial-gradient(4.2px 4.2px at 230px 200px, rgba(255, 255, 255, 0.55), transparent 70%),
    radial-gradient(3.2px 3.2px at 90px 260px, rgba(255, 255, 255, 0.5), transparent 70%),
    radial-gradient(3.8px 3.8px at 280px 60px, rgba(255, 255, 255, 0.45), transparent 70%);
  background-size: 320px 320px;
  opacity: 0.6;
}

.hero::after {
  background-image:
    radial-gradient(5.5px 5.5px at 60px 80px, rgba(255, 255, 255, 0.7), transparent 70%),
    radial-gradient(4.5px 4.5px at 200px 170px, rgba(255, 255, 255, 0.55), transparent 70%),
    radial-gradient(5px 5px at 120px 250px, rgba(255, 255, 255, 0.5), transparent 70%);
  background-size: 320px 320px;
  opacity: 0.5;
  animation-duration: 26s;
  animation-delay: -9s;
}

@keyframes snow {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-40px, 320px, 0);
  }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  max-width: 40rem;
}

.icon {
  position: relative;
  width: clamp(124px, 30vw, 172px);
  aspect-ratio: 1;
  margin-bottom: 0.4rem;
}

/* Candlelight round the icon. */
.icon::before {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 122, 0.26) 0%, rgba(255, 210, 122, 0.08) 40%, transparent 68%);
}

.icon img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}

/* The name on a small brass plate, like the plaques under the app's worlds. */
.plate {
  display: inline-block;
  padding: 0.35rem 1rem 0.4rem;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass) 55%, #a8832f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.35);
  color: var(--paper-ink);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.5rem, 8.5vw, 4.75rem);
  font-weight: 540;
  text-wrap: balance;
}

.lead {
  max-width: 32ch;
  color: var(--text-2);
  font-size: clamp(1.125rem, 2.6vw, 1.35rem);
  line-height: 1.5;
  text-wrap: balance;
}

.soon {
  display: inline-flex;
  align-items: center;
  margin-top: 0.6rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.badge img {
  height: 54px;
  width: auto;
}



/* ---------- Dividers: a twisted cord ---------- */

.cord {
  height: 5px;
  border: 0;
  margin: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(118deg, var(--brass) 0 3px, var(--brass-lo) 3px 5px, #b08c3c 5px 7px);
  opacity: 0.8;
}

.section-cord {
  width: min(12rem, 50%);
  margin: 0 auto;
}

/* ---------- Sections ---------- */

main > section {
  padding-block: clamp(3.5rem, 9vw, 6rem);
}

.section-head {
  max-width: 38rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  margin-bottom: 0.9rem;
}

.section-head p {
  color: var(--text-2);
  text-wrap: balance;
}

/* ---------- The 24 tags ---------- */

.status {
  margin: -0.75rem 0 2rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: normal;
  color: var(--text);
}

.tags {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  row-gap: 1.25rem;
  max-width: 54rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .tags {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (min-width: 62rem) {
  .tags {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

.tags li {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 26px;
  min-height: 100px;
}

/* The cord the tags hang from: one piece per cell, so a row reads as one cord. */
.tags li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(118deg, var(--brass) 0 3px, var(--brass-lo) 3px 5px, #b08c3c 5px 7px);
  opacity: 0.75;
}

/* Each tag's own string. */
.tags li::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 1.5px;
  height: 25px;
  transform: translateX(-50%);
  background: rgba(240, 230, 204, 0.6);
}

.tag {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: end center;
  width: 44px;
  height: 58px;
  padding-bottom: 9px;
  transform-origin: 50% 6px;
  transform: rotate(var(--tilt, -3deg));
  color: var(--paper-ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 620;
  font-variant-numeric: lining-nums;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* The paper: a luggage tag with clipped top corners and a hole for the string. */
/* With the script, each row's cord is drawn as one hanging curve (an SVG laid
   over the list) and every tag hangs as far down as the cord is at its place. */
.tags {
  position: relative;
}

.tags.sagging {
  row-gap: calc(1.25rem + 22px);
}

.tags.sagging li::before {
  display: none;
}

.tags.sagging li::after {
  top: calc(9px + var(--dip, 0px));
}

.tags.sagging .tag {
  translate: 0 var(--dip, 0px);
}

.tags .cords {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.tags .cords .cord-base {
  fill: none;
  stroke: var(--brass);
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0.8;
}

/* The twist: short dark strokes along the cord. */
.tags .cords .cord-twist {
  fill: none;
  stroke: var(--brass-lo);
  stroke-width: 4;
  stroke-dasharray: 2 3;
  opacity: 0.8;
}

.tag::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 9px, var(--night) 0 3px, rgba(122, 90, 36, 0.6) 3.4px, transparent 4.4px),
    linear-gradient(180deg, #f6eed9 0%, var(--paper) 60%, #e3d5b3 100%);
  clip-path: polygon(24% 0, 76% 0, 100% 20%, 100% 100%, 0 100%, 0 20%);
}

.tags li:nth-child(2n) .tag { --tilt: 3deg; }
.tags li:nth-child(3n) .tag { --tilt: -1deg; }
.tags li:nth-child(5n) .tag { --tilt: 5deg; }
.tags li:nth-child(7n) .tag { --tilt: -5deg; }

/* The last present is a bit bigger. */
.tags li:last-child .tag {
  width: 52px;
  height: 68px;
  font-size: 1.3rem;
}

/* Opened: the paper fades. */
.tags li.is-opened .tag {
  opacity: 0.32;
  filter: saturate(0.4);
}

/* Today's: lit by a candle. */
.tags li.is-today .tag {
  filter: drop-shadow(0 0 10px rgba(255, 210, 122, 0.85)) drop-shadow(0 0 22px rgba(255, 210, 122, 0.45));
  animation: sway 5s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

/* Touched by the pointer, a tag swings on its string and settles back, like a nudge.
   Each tag has its own push, direction and time (set in script.js; these are the
   defaults without it). */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tags li:hover .tag {
    animation: swing var(--swing-time, 1.6s) ease-out;
  }
}

@keyframes swing {
  0% { transform: rotate(var(--tilt, -3deg)); }
  18% { transform: rotate(calc(var(--tilt, -3deg) + var(--swing, 12deg))); }
  40% { transform: rotate(calc(var(--tilt, -3deg) - var(--swing, 12deg) * 0.65)); }
  62% { transform: rotate(calc(var(--tilt, -3deg) + var(--swing, 12deg) * 0.33)); }
  82% { transform: rotate(calc(var(--tilt, -3deg) - var(--swing, 12deg) * 0.12)); }
  100% { transform: rotate(var(--tilt, -3deg)); }
}


/* ---------- Pictures (later) ---------- */

.media {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.media img,
.media video {
  width: 100%;
  height: auto;
}

/* ---------- Two side by side ---------- */

.pair {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 48rem) {
  .pair {
    grid-template-columns: 1fr 1fr;
  }
}

/* The small label above a card's heading. */
.card .overline {
  margin: 0 0 0.6rem;
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card {
  position: relative;
  padding: clamp(1.6rem, 4vw, 2.4rem);
  border: 1px solid rgba(232, 197, 106, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
}

.card h2 {
  font-size: clamp(1.6rem, 3.6vw, 2rem);
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-2);
}





/* ---------- Questions ---------- */

.faq {
  max-width: 42rem;
  margin: 0 auto;
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  display: block;
  padding: 1.15rem 2.5rem 1.15rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 540;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* A small brass plus that turns into a minus. */
.faq summary::before,
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--brass-hi);
  transition: transform 0.25s ease;
}

.faq summary::after {
  transform: rotate(90deg);
}

.faq details[open] summary::after {
  transform: rotate(0deg);
}

.faq details p {
  padding: 0 2.5rem 1.35rem 0;
  color: var(--text-2);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 0 0 3rem;
  color: var(--text-3);
  font-size: 0.95rem;
}

.site-footer .cord {
  margin-bottom: 2.25rem;
}

.footer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

/* Wide: one line, name left, maker and year in the middle, links right. */
@media (min-width: 48rem) {
  .footer-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
  }

  .footer-name {
    justify-self: start;
  }

  .footer-links {
    justify-self: end;
  }
}

.footer-name {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1rem;
  text-decoration: none;
}

.footer-name img {
  width: 34px;
  height: 34px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text-2);
}

.footer-small {
  margin: 0;
}

.footer-small a {
  color: var(--text-2);
}

/* ---------- The privacy page ---------- */

.page-head {
  padding: 2rem 0 0;
}

.page-head a {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.15rem;
  text-decoration: none;
}

.page-head img {
  width: 40px;
  height: 40px;
}

.prose {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 4.5rem) 0 clamp(3rem, 8vw, 5rem);
}

.prose h1 {
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  margin-bottom: 1.25rem;
}

.prose h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
}

.prose p,
.prose li {
  color: var(--text-2);
}

.prose p + p {
  margin-top: 1rem;
}

.prose ul {
  margin: 0;
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.6rem;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose .intro {
  color: var(--text);
  font-size: 1.2rem;
}

.prose .updated {
  margin-top: 3rem;
  color: var(--text-3);
  font-size: 0.95rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after,
  .tags li.is-today .tag {
    animation: none;
  }

  .tag,
  .faq summary::after {
    transition: none;
  }
}

.prose ul + p {
  margin-top: 1rem;
}
