:root {
  --bg: #f6f3ec;
  --card: #fdfcf9;
  --text: #1b1a18;
  --muted: #6a665e;
  --line: #e0dbd0;
  --soft: #efebe2;
  --accent: #c8321e;
  --cool: #2171b5;
  --on-accent: #fff;
  --shadow: 0 1px 2px rgb(40 30 10 / 0.05), 0 8px 24px rgb(40 30 10 / 0.05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --foot-bg: #1c1b19;
  --foot-text: #f1eee8;
  --foot-muted: #a8a399;
  --foot-line: #3a3733;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413;
    --card: #1d1c1a;
    --text: #eceae5;
    --muted: #a19c93;
    --line: #34312d;
    --soft: #262422;
    --accent: #ff6f57;
    --cool: #6baed6;
    --on-accent: #1b1a18;
    --shadow: none;
    --foot-bg: #0d0c0b;
    --foot-line: #2a2825;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  max-width: 72rem;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.55 var(--sans);
}

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { font: 700 2.8rem/1.1 var(--serif); margin: 2.5rem 0 1rem; }
h2 { font: 700 1.75rem/1.2 var(--serif); margin: 2.25rem 0 0.6rem; }
p { margin: 0 0 0.9rem; }
.label { display: block; font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 0.5rem; }
.small { color: var(--muted); font-size: 0.9rem; }

/* the head of the page */

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 2rem;
  padding: 0.6rem 0 0.7rem;
  border-bottom: 1px solid var(--line);
}
.mark { display: inline-flex; align-items: center; gap: 0.55rem; font: 700 1.6rem/1 var(--serif); letter-spacing: -0.01em; text-decoration: none; }
.mark-icon { width: 1.5rem; height: 1.5rem; flex: none; }
nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
nav a { text-decoration: none; color: var(--muted); padding: 0.3rem 0; border-bottom: 2px solid transparent; }
nav a:hover { color: var(--text); }
nav a.on { color: var(--text); border-bottom-color: var(--accent); }
.site-nav { margin-left: auto; }

/* buttons and fields */

button, .button, input, select {
  font: inherit;
  color: inherit;
  min-height: 2.6rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
}
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; cursor: pointer; text-decoration: none; line-height: 1.6; font-weight: 500; transition: border-color 0.15s, background 0.15s; }
button:hover, .button:hover { border-color: var(--muted); }
button:disabled { cursor: default; opacity: 0.5; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.primary:hover { border-color: var(--text); }
.wide { width: 100%; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#notice {
  position: sticky;
  top: 0.75rem;
  z-index: 3;
  margin: 1rem 0 0;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
}
#notice code { font-size: 0.9em; }

.figure { margin: 1rem 0 0.3rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.figure strong { font: 700 2.8rem/1.05 var(--serif); letter-spacing: -0.02em; color: var(--accent); margin-right: 0.15rem; }
.figure strong.cool { color: var(--cool); }

/* the start */

.hero { padding: 4.5rem 0 2.5rem; text-align: center; }
.hero-name { font: 700 clamp(3.2rem, 10vw, 6rem)/1 var(--serif); letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
.hero-line { font: italic clamp(1.25rem, 2.6vw, 1.75rem)/1.4 var(--serif); max-width: 34ch; margin: 1.4rem auto 2.2rem; text-wrap: balance; }
.hero .small { max-width: 38rem; margin: 0 auto; }

/* a row of stripes, drawn by app.js */
.band { display: flex; overflow: hidden; }
.band span { flex: 1 1 0; }
.hero-band { height: 5.5rem; max-width: 44rem; margin: 0 auto 1.6rem; border-radius: 0.6rem; box-shadow: var(--shadow); }

/* finding and ordering */

.tools {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0.8rem 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1 1 18rem; max-width: 26rem; }
.search .icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding-left: 2.5rem; }
.sort { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.sort .label { margin: 0; }

/* the gallery: a section a continent */

.continent { padding-top: 0.5rem; }
.continent h2 { display: flex; align-items: baseline; gap: 0.7rem; margin: 2.5rem 0 1rem; }
.continent h2 .small { font: 400 0.95rem var(--sans); }

.movies {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 1.4rem 1rem;
}
.movie { display: block; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; text-align: left; font-weight: 400; line-height: 1.35; }
.movie:hover { border: 0; }
.movie .still {
  display: block;
  position: relative;
  aspect-ratio: 9 / 16;
  margin-bottom: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: hidden;
  background: var(--soft);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.movie .still .band { position: absolute; inset: 0; }
.movie img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.movie .play {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  opacity: 0;
  transition: opacity 0.15s;
}
.movie .play svg { width: 0.9rem; height: 0.9rem; fill: currentColor; margin-left: 0.1rem; }
.movie:hover .still, .movie:focus-visible .still { transform: translateY(-3px) rotate(-0.6deg); box-shadow: 0 2px 4px rgb(40 30 10 / 0.08), 0 14px 30px rgb(40 30 10 / 0.12); }
.movie:hover .play, .movie:focus-visible .play { opacity: 1; }
.movie:focus-visible { outline: none; }
.movie:focus-visible .still { outline: 2px solid var(--accent); outline-offset: 2px; }
.movie strong { display: block; font: 600 1.02rem/1.25 var(--serif); }
.movie .where { display: block; color: var(--muted); font-size: 0.85rem; }
.movie .warming { display: block; margin-top: 0.15rem; font-size: 0.85rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.movie .warming.cool { color: var(--cool); }
.empty { text-align: center; padding: 3rem 0; }

/* how it is made */

.narrow { max-width: 38rem; margin: 5rem auto 0; }
.narrow h2 { margin-top: 0; }
.steps { padding-left: 1.3rem; margin: 0; }
.steps li { margin: 0 0 0.9rem; padding-left: 0.3rem; }
.steps li::marker { font: 700 1rem var(--serif); color: var(--accent); }

/* one movie, over the page */

dialog {
  width: min(60rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.25);
  overflow: auto;
}
dialog::backdrop { background: rgb(20 18 15 / 0.72); }
.player { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.player video { display: block; height: min(46rem, calc(100dvh - 4rem)); aspect-ratio: 9 / 16; background: #000; }
.player-side { position: relative; padding: 2rem 1.75rem 1.5rem; display: flex; flex-direction: column; }
.player-side h2 { font-size: 2.2rem; margin: 0 2.5rem 0.2rem 0; }
.player-side .label { margin-top: 0.4rem; }
.close { position: absolute; top: 1rem; right: 1rem; width: 2.4rem; height: 2.4rem; min-height: 0; padding: 0; border-radius: 50%; }
.player-band { height: 3rem; margin-top: 1rem; border-radius: 0.4rem; }
.player-ends { display: flex; justify-content: space-between; margin: 0.35rem 0 1.5rem; font-variant-numeric: tabular-nums; }
.player-get { display: grid; gap: 0.6rem; margin-top: auto; }
.player-step { justify-content: space-between; margin: 0.4rem 0 0; }
.player-step button { flex: 1 1 0; }

/* the foot of the page: a dark band across the whole width */

.site-footer {
  display: block;
  margin: 6rem 0 -4rem;
  padding: 3rem 0 1.5rem;
  background: var(--foot-bg);
  box-shadow: 0 0 0 100vmax var(--foot-bg);
  clip-path: inset(0 -100vmax);
  color: var(--foot-muted);
  font-size: 0.92rem;
}
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 2.5rem; }
.footer-brand .mark { color: var(--foot-text); text-decoration: none; }
.footer-brand p { margin: 0.8rem 0 0; max-width: 22rem; line-height: 1.5; }
.footer-head { margin: 0 0 0.7rem; color: var(--foot-text); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.footer-col { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0.45rem; }
.footer-col a { color: var(--foot-muted); text-decoration: none; border: 0; padding: 0; }
.footer-col a:hover { color: var(--foot-text); text-decoration: underline; }
.footer-sisters a { display: flex; flex-direction: column; gap: 0.05rem; margin-bottom: 0.4rem; }
.footer-sisters strong { color: var(--foot-text); font-weight: 600; }
.footer-bottom { margin: 2.5rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--foot-line); font-size: 0.8rem; }

/* on a narrow screen everything is one column */

@media (max-width: 56rem) {
  body { padding: 0 1rem 3rem; }
  .site-nav { margin-left: 0; gap: 0.1rem 1rem; font-size: 0.92rem; }
  .hero { padding: 3rem 0 2rem; }
  .sort { margin-left: 0; }
  .movies { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 1.2rem 0.75rem; }
  .player { grid-template-columns: minmax(0, 1fr); }
  .player video { width: 100%; height: auto; max-height: 70dvh; }
  .player-side { padding: 1.4rem 1.25rem 1.25rem; }
  .close { position: fixed; top: 1.6rem; right: 1.6rem; z-index: 1; background: var(--card); }
  .site-footer { margin-bottom: -3rem; }
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 30rem) { .footer-inner { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .movie .still { transition: none; } .movie:hover .still { transform: none; } }
