/* Frost & Fika — shared styles. Self-hosted, no web fonts, no external assets. */

:root {
  --paper:   #fbf7f1;
  --panel:   #f4ece1;
  --ink:     #2a2420;
  --muted:   #6c6158;
  --rule:    #e2d7c8;
  --accent:  #96542e;
  --accent-soft: rgba(150, 84, 46, .12);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 64rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #15120f;
    --panel:  #1d1813;
    --ink:    #e9e0d4;
    --muted:  #a2958a;
    --rule:   #302922;
    --accent: #d8a877;
    --accent-soft: rgba(216, 168, 119, .14);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.14rem);
  line-height: 1.68;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 38rem; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--panel); color: var(--ink);
  padding: .6rem 1rem; font-family: var(--sans); font-size: .9rem; z-index: 3;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ---- site header / nav ---- */
.site-head {
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(to bottom, var(--panel), var(--paper));
}
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem;
  padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand svg { width: 2rem; height: 2rem; color: var(--accent); flex: none; }
.brand b { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
.site-nav { display: flex; flex-wrap: wrap; gap: .3rem .5rem; font-family: var(--sans); }
.site-nav a {
  text-decoration: none; color: var(--ink); font-size: .9rem; line-height: 1.3;
  border: 1px solid var(--rule); border-radius: 999px; padding: .35rem .8rem; background: var(--paper);
}
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a[aria-current="page"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
}

/* ---- hero ---- */
.hero { position: relative; border-bottom: 1px solid var(--rule); overflow: hidden; }
.hero video, .hero img.bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; opacity: .9;
}
.hero .veil { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(10,8,6,.30), rgba(10,8,6,.55)); }
.hero .wrap { position: relative; z-index: 2; padding-top: clamp(3rem, 12vw, 7rem); padding-bottom: clamp(3rem, 12vw, 7rem); }
.hero h1 { color: #f6efe4; font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.4rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 .6rem; font-weight: 600; max-width: 20ch; }
.hero p { color: #efe5d6; max-width: 40ch; margin: 0; font-size: 1.05em; }
.hero .kicker { font-family: var(--sans); text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: #e7c9a6; margin: 0 0 1rem; }

/* ---- generic sections ---- */
main { padding: clamp(2rem, 6vw, 3.5rem) 0; }
.lead { font-size: 1.12em; color: var(--muted); }
.section { padding-bottom: clamp(2rem, 5vw, 3rem); margin-bottom: clamp(2rem, 5vw, 3rem); border-bottom: 1px solid var(--rule); }
.section:last-child { border-bottom: 0; margin-bottom: 0; }
.eyebrow { font-family: var(--sans); font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 .7rem; }
h1, h2, h3 { letter-spacing: -0.01em; font-weight: 600; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); line-height: 1.2; margin: 0 0 .6rem; }
h3 { font-size: 1.2rem; margin: 0 0 .3rem; }
.meta { font-family: var(--sans); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---- episode / media cards ---- */
.episode { margin: 0 0 clamp(2rem, 5vw, 3rem); }
.episode video, .episode .frame { width: 100%; border-radius: 8px; background: #000; border: 1px solid var(--rule); }
.episode audio { width: 100%; margin: .4rem 0 .8rem; }
.episode h3 { margin-top: 1rem; }
.downloads { font-family: var(--sans); font-size: .82rem; display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .5rem; color: var(--muted); }
.downloads a { white-space: nowrap; }

/* ---- gallery grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.grid figure { margin: 0; }
.grid a { display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); background: var(--panel); }
.grid img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transition: transform .25s ease; }
.grid a:hover img, .grid a:focus-visible img { transform: scale(1.03); }
.grid figcaption { font-family: var(--sans); font-size: .72rem; color: var(--muted); margin-top: .3rem; line-height: 1.35; }

.banner { width: 100%; border-radius: 8px; border: 1px solid var(--rule); margin: 1.2rem 0; }

/* ---- lists ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.card { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--panel); }
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.card .body { padding: .9rem 1rem 1.1rem; }
.card h3 { font-size: 1.08rem; }
.card p { margin: .3rem 0 0; font-size: .95em; color: var(--muted); }

/* ---- credits table ---- */
.credits { font-family: var(--sans); font-size: .82rem; line-height: 1.5; }
.credits li { margin-bottom: .5rem; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--rule); background: var(--panel); padding: 2rem 0 2.75rem; font-family: var(--sans); font-size: .82rem; line-height: 1.6; color: var(--muted); }
footer a { color: var(--muted); }
footer .cols { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; }
footer p { margin: 0 0 .5rem; }

.backlink { font-family: var(--sans); font-size: .82rem; }

/* ---- language switcher ---- */
.langswitch { display: flex; gap: .3rem; align-items: center; font-family: var(--sans); font-size: .82rem; }
.langswitch a, .langswitch span {
  text-decoration: none; padding: .32rem .62rem; border-radius: 999px; line-height: 1.3;
  border: 1px solid var(--rule);
}
.langswitch a { color: var(--muted); background: var(--paper); }
.langswitch a:hover, .langswitch a:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.langswitch span[aria-current="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
