/* AntTube: an ant-themed video site. Colours: soil browns, amber and leaf green. */
:root {
  --bg: #fbf7f0;
  --panel: #fff;
  --ink: #2b1d12;
  --muted: #7a6656;
  --line: #e9dfd2;
  --hover: #f2eadf;
  --amber: #d98c1f;
  --leaf: #3f8a3a;
  --soil: #5a3a22;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17110c;
    --panel: #211912;
    --ink: #f3e9dc;
    --muted: #b39d89;
    --line: #3a2c20;
    --hover: #2c2117;
    --soil: #c9a27e;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  height: 56px; padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-left { display: flex; align-items: center; }
.i { width: 22px; height: 22px; flex: none; }
.icon-btn { display: grid; place-items: center; border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
.brand { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.brand svg { width: 34px; height: 34px; }
.brand .tube {
  padding: 1px 9px 2px;
  border: 2.5px solid var(--soil);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  color: var(--soil);
}
.brand .ant { color: var(--amber); }
.search { display: flex; max-width: 560px; width: 100%; justify-self: center; }
.search input {
  flex: 1; min-width: 0; height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-right: 0; border-radius: 20px 0 0 20px;
  background: var(--panel); color: var(--ink); font: inherit; -webkit-appearance: none; appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: 2px solid var(--amber); outline-offset: -2px; }
.search-go {
  display: grid; place-items: center;
  width: 64px; height: 40px; border: 1px solid var(--line); border-radius: 0 20px 20px 0;
  background: var(--hover); cursor: pointer;
}
.search-close, .search-open { display: none; }
.top-right { display: flex; gap: 8px; align-items: center; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-weight: 700; white-space: nowrap;
}
.pill-btn .i { width: 18px; height: 18px; }
.pill-btn:hover { background: var(--hover); }
.pill-btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill-btn.primary.joined { background: var(--hover); color: var(--ink); border-color: var(--line); }
.tabbar { display: none; }

/* Layout */
.layout { display: grid; grid-template-columns: 220px 1fr; }
.side { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 12px; }
.side a {
  display: flex; align-items: center; gap: 18px; height: 40px; padding: 0 12px; border-radius: 10px;
}
.side a:hover { background: var(--hover); }
.side a.on { background: var(--hover); font-weight: 700; }
.side .i { width: 22px; height: 22px; }
.side a.on .i { stroke-width: 2.4; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.side small { display: block; padding: 0 12px; color: var(--muted); }
body.side-closed .layout { grid-template-columns: 1fr; }
body.side-closed .side { display: none; }
main { padding: 24px; min-width: 0; }

/* Category chips */
.chips { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 8px; background: var(--hover); font-weight: 600; }
.chip.on { background: var(--ink); color: var(--bg); }

/* Video grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 16px; }
.card .thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: #4a3020 url("ant-pattern.svg") center / 80px;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.card:hover .thumb img { transform: scale(1.04); }
/* On hover, a file of ants walks along the bottom of the picture. */
.card .thumb::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38px; pointer-events: none;
  background:
    url("ant-walk.svg") repeat-x 0 calc(100% - 5px) / 52px 16px,
    linear-gradient(transparent, rgba(20, 12, 6, .7));
  opacity: 0; transition: opacity .2s;
}
.card:hover .thumb::after, .card:focus-visible .thumb::after { opacity: 1; animation: walk 1.4s linear infinite; }
@keyframes walk { to { background-position: 52px calc(100% - 5px), 0 0; } }
.card:hover .dur { opacity: 0; }
.dur { transition: opacity .2s; }
.dur {
  position: absolute; right: 8px; bottom: 8px; padding: 1px 5px; border-radius: 4px;
  background: rgba(0,0,0,.8); color: #fff; font-size: 12px; font-weight: 700;
}
.badge {
  position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: 4px;
  background: rgba(0,0,0,.75); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.meta { display: grid; grid-template-columns: 36px 1fr; gap: 12px; margin-top: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--amber); display: grid; place-items: center; }
.avatar svg { width: 26px; height: 26px; }
.meta h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.meta p { margin: 0; color: var(--muted); }
.empty { padding: 60px 0; text-align: center; color: var(--muted); font-size: 16px; }

/* Watch page */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; max-width: 1750px; margin: 0 auto; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.locked {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff;
  background: #000 center / cover;
}
.locked::before { content: ""; position: absolute; inset: 0; background: rgba(20,12,6,.72); }
.locked form { position: relative; display: grid; gap: 12px; justify-items: center; padding: 20px; }
.locked h2 { margin: 0; }
.locked input { width: 260px; height: 40px; padding: 0 14px; border-radius: 20px; border: 0; font: inherit; }
.locked .err { color: #ffb36b; min-height: 1.4em; margin: 0; }
.w-title { margin: 14px 0 10px; font-size: 20px; line-height: 1.3; }
.w-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.w-row .chan { display: flex; align-items: center; gap: 12px; margin-right: 12px; }
.w-row .chan b { display: block; }
.w-row .chan small { color: var(--muted); }
.w-row .spacer { flex: 1; }
.desc { margin-top: 14px; padding: 12px; border-radius: var(--radius); background: var(--hover); white-space: pre-wrap; }
.desc b { display: block; margin-bottom: 4px; }
.next { display: grid; gap: 10px; align-content: start; }
.next h4 { margin: 0 0 4px; }
.next a { display: grid; grid-template-columns: 168px 1fr; gap: 8px; }
.next .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #4a3020 url("ant-pattern.svg") center / 50px; }
.next .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.next b { display: block; font-size: 14px; line-height: 1.3; }
.next small { color: var(--muted); }
.trail { height: 16px; margin-top: 8px; background: url("ant-walk.svg") repeat-x 0 0 / 52px 16px; animation: trail 1.4s linear infinite; opacity: .7; }
@keyframes trail { to { background-position: 52px 0; } }

/* Admin and notices */
.notice { max-width: 420px; margin: 60px auto; text-align: center; }
.notice form { display: grid; gap: 12px; margin-top: 18px; }
.notice input { height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; }
.toast {
  position: fixed; left: 24px; bottom: 24px; padding: 12px 18px; border-radius: 8px;
  background: var(--ink); color: var(--bg); opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

.watch > * { min-width: 0; }
@media (max-width: 1000px) {
  .watch { grid-template-columns: minmax(0, 1fr); }
}

/* Keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.card:focus-visible { outline-offset: 4px; border-radius: var(--radius); }
.vis-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.vis-note .i { width: 16px; height: 16px; }
.locked h2 { display: flex; align-items: center; gap: 8px; }

/* Glastonbury timeline */
.tl-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.tl-head h1 { margin: 0; font-size: 24px; }
.tl-head .chips { margin: 0; }
.year-jump { position: sticky; top: 56px; z-index: 5; display: flex; gap: 4px; overflow-x: auto; margin: 16px -24px 8px; padding: 8px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.year-jump a { padding: 4px 10px; border-radius: 6px; font-weight: 700; color: var(--muted); }
.year-jump a:hover { background: var(--hover); color: var(--ink); }
.year { padding: 20px 0 28px; border-bottom: 1px solid var(--line); scroll-margin-top: 110px; }
.year-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-size: 30px; letter-spacing: -1px; color: var(--soil); }
.year-title small { font-size: 14px; letter-spacing: 0; font-weight: 600; color: var(--muted); }
.year-gap { display: flex; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.year-gap b { font-size: 20px; color: var(--muted); }

/* Line-up card: as tall as a film thumbnail, two films wide */
.yc-cell { grid-column: span 2; container-type: inline-size; }
.yearcard {
  display: flex; height: calc((100cqw - 16px) / 2 * 9 / 16); border-radius: var(--radius); overflow: hidden; color: #f6ead8;
  background: url("ant-pattern.svg") center / 80px, linear-gradient(160deg, #3b2414, #1d120a 70%);
}
.yc-poster { flex: none; height: 100%; aspect-ratio: 5 / 7; background: #000; }
.yc-poster img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.yc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 10px 16px; }
.yc-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid rgba(240, 166, 58, .35); }
.yc-head b { text-transform: uppercase; letter-spacing: 3px; font-size: 11px; color: #f0a63a; }
.yc-year { font-size: 28px; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.yc-head small { font-size: 12px; color: #cdb59b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.yc-link { margin-left: auto; font-size: 12px; font-weight: 700; color: #f0a63a; white-space: nowrap; }
.yc-link:hover { text-decoration: underline; }
.yc-stages { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.yc-stage h5 { margin: 0 0 3px; text-transform: uppercase; letter-spacing: 2px; font-size: 10px; color: #f0a63a; }
.yc-stage ul { list-style: none; margin: 0; padding: 0; }
.yc-stage li { font-size: 14px; font-weight: 800; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yc-stage li span, .yc-legend span { display: inline-block; width: 32px; font-size: 10px; font-weight: 600; color: #cdb59b; text-transform: uppercase; }
.yc-stage p { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.35; }
.yc-legend { margin: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yc-legend span { width: auto; margin-right: 8px; letter-spacing: 1px; color: #f0a63a; }
/* One card wide (narrow screens, and the watch page's side column): Pyramid Stage only. */
@media (max-width: 900px) {
  .yc-cell { grid-column: auto; }
  .yearcard { height: auto; aspect-ratio: 16 / 9; }
}
.next .yc-cell { grid-column: auto; }
.next .yearcard { height: auto; aspect-ratio: 16 / 9; }
@container (max-width: 560px) {
  .yc-stages { grid-template-columns: 1fr; }
  .yc-other { display: none; }
  .yc-head b, .yc-head small { display: none; }
  .yc-text { gap: 6px; padding: 8px 12px; }
  .yc-stage li { font-size: 13px; }
  .yc-legend { white-space: normal; line-height: 1.3; }
}
.next .yc-cell { margin-bottom: 8px; }

/* Chapters on the watch page */
.now-chapter { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
.chapters { margin-top: 14px; }
.chapters h4 { margin: 0 0 8px; }
.ch-row { position: relative; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.ch {
  flex: 0 0 168px; display: grid; gap: 4px; align-content: start; padding: 6px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); scroll-snap-align: start;
}
.ch:hover { background: var(--hover); }
.ch.on { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.ch img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; display: block; background: #4a3020; }
.ch-time { font-size: 12px; font-weight: 700; color: var(--amber); }
.ch-title { font-size: 13px; font-weight: 700; line-height: 1.3; }

@media (prefers-reduced-motion: reduce) {
  .card .thumb img, .card:hover .thumb img { transform: none; }
  .card:hover .thumb::after, .trail { animation: none; }
}

/* Search results */
.results-title { margin: 8px 0 14px; font-size: 20px; }
.results-title:not(:first-of-type) { margin-top: 36px; }
.lineup-hits { margin: 0 0 18px; padding-left: 20px; color: var(--muted); }
.lineup-hits b { color: var(--ink); }


/* ---------------------------------------------------------------------------------------------
   Phones. AntTube works as an app here: a slim top bar that slides away while scrolling down,
   full-width pictures, a tab bar at the bottom, and a player that stays at the top of the screen.
   --------------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  html { -webkit-tap-highlight-color: transparent; }
  html, body { overflow-x: clip; }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  button, a { touch-action: manipulation; }

  /* Top bar */
  .top {
    grid-template-columns: 1fr auto; gap: 4px; height: 52px; padding: 0 6px 0 12px;
    padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top));
    border-bottom: 0;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.8) blur(18px); backdrop-filter: saturate(1.8) blur(18px);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  }
  body.top-hidden .top { transform: translateY(-100%); }
  .menu-btn { display: none; }
  .brand { margin-left: 0; font-size: 19px; }
  .brand svg { width: 28px; height: 28px; }
  .top-right .chip, #signout { display: none; }
  .search-open { display: grid; }
  .search { display: none; }
  body.searching .search {
    display: flex; align-items: center; gap: 6px; position: absolute; inset: env(safe-area-inset-top) 0 0; padding: 0 10px 0 4px;
    max-width: none; background: var(--bg);
  }
  .search-close { display: grid; }
  .search input { height: 38px; border-radius: 19px; border: 0; background: var(--hover); padding: 0 16px; font-size: 16px; }
  .search input:focus { outline: 2px solid var(--amber); }
  .search-go { display: none; }

  /* Tab bar */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.8) blur(18px); backdrop-filter: saturate(1.8) blur(18px);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; padding: 0; font-size: 10.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  }
  .tabbar .i { width: 24px; height: 24px; transition: transform .15s; }
  .tabbar .on { color: var(--ink); }
  .tabbar .on .i { stroke-width: 2.4; }
  .tabbar a:active .i, .tabbar button:active .i { transform: scale(.88); }

  /* Layout and lists */
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding: 0 0 20px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin: 0; padding: 8px 12px 14px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 7px 14px; font-size: 14px; }
  .grid { grid-template-columns: 1fr; gap: 22px; }
  .card .thumb { border-radius: 0; }
  .card .thumb::after { display: none; }
  .card:hover .thumb img { transform: none; }
  .card:hover .dur { opacity: 1; }
  .card:active .thumb img { opacity: .82; }
  .meta { padding: 0 12px; margin-top: 10px; grid-template-columns: 36px 1fr; }
  .meta h3 { font-size: 15px; font-weight: 700; }
  .meta p { font-size: 12.5px; }
  .empty { padding: 60px 24px; }

  /* Glastonbury timeline */
  .tl-head { padding: 0 12px; gap: 8px; flex-wrap: nowrap; }
  .tl-head h1 { flex: 1; min-width: 0; font-size: 19px; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tl-head .chips { padding: 0; gap: 4px; overflow: visible; }
  .tl-head .chip { padding: 5px 10px; font-size: 12.5px; }
  .year-jump { top: 0; margin: 12px 0 0; padding: 8px 8px; transition: top .28s; }
  body:not(.top-hidden) .year-jump { top: calc(52px + env(safe-area-inset-top)); }
  .year { padding: 18px 0 26px; }
  .year-title { padding: 0 12px; font-size: 26px; }
  .year-gap { padding: 14px 12px; }
  .yc-cell { padding: 0 12px; }
  .results-title { padding: 0 12px; font-size: 18px; }
  .lineup-hits { margin: 0 12px 18px; }

  /* Watch page: the top bar scrolls away and the player stays at the top of the screen. */
  body[data-page="watch"] .top { position: relative; transform: none; }
  body[data-page="watch"] main { padding: 0 0 24px; }
  .watch { gap: 18px; }
  .watch > section { display: flex; flex-direction: column; }
  .player { position: sticky; top: env(safe-area-inset-top); z-index: 6; border-radius: 0; order: 0; }
  .trail { display: none; }
  .w-title { order: 1; margin: 12px 12px 2px; font-size: 18px; font-weight: 700; line-height: 1.3; }
  .desc { order: 2; margin: 0 12px; padding: 0; background: none; color: var(--muted); font-size: 13px; }
  .desc b { display: inline; font-weight: 500; margin: 0 6px 0 0; }
  .vis-note { order: 3; margin: 6px 12px 0; }
  .w-row {
    order: 4; flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin-top: 14px; padding: 0 12px 2px; scrollbar-width: none;
  }
  .w-row::-webkit-scrollbar { display: none; }
  .w-row .chan { flex: none; margin-right: 2px; gap: 10px; }
  .w-row .chan .avatar { width: 32px; height: 32px; }
  .w-row .chan small { display: none; }
  .w-row .spacer { display: none; }
  .w-row .pill-btn { flex: none; height: 34px; border: 0; background: var(--hover); }
  .w-row .pill-btn.primary { background: var(--ink); }
  .w-row .pill-btn.primary.joined { background: var(--hover); }
  .pill-btn:active { transform: scale(.96); }
  .now-chapter { order: 5; margin: 14px 12px 0; font-size: 13px; }
  .chapters { order: 6; margin-top: 16px; }
  .chapters h4 { margin: 0 12px 8px; }
  .ch-row { padding: 0 12px 4px; scroll-padding: 0 12px; scrollbar-width: none; }
  .ch-row::-webkit-scrollbar { display: none; }
  .ch { flex-basis: 150px; border: 0; background: var(--hover); padding: 0 0 8px; overflow: hidden; }
  .ch img { border-radius: 0; }
  .ch-time, .ch-title { padding: 0 8px; }
  .ch.on { box-shadow: inset 0 0 0 2px var(--amber); }
  .next { gap: 20px; }
  .next > h4 { margin: 4px 12px 0; font-size: 16px; }
  .next a { display: block; }
  .next .thumb { border-radius: 0; }
  .next a > div:last-child { padding: 10px 12px 0; }
  .next b { font-size: 15px; }
  .locked input { width: min(260px, 80vw); }
  .notice { margin: 40px 16px; }
  .toast { left: 12px; right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); text-align: center; }
}
