/* Unusual Context: an evidence board in a quiet archive. The board, paper, ink, grain and the slap-down come from the
   brand kit (brand/web/uc-paper.css, with the marks drawn by uc-marks.js); this file lays the pages out. Colors and fonts
   are tokens from brand/tokens.css. Two accents only: red marker and yellow highlighter. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--uc-off-white);
  font: 500 1.0625rem/1.6 var(--uc-font-display);
}

/* ---- the board under its lamp, as the engine renders it (engine/src/gfx/shaders.ts CORK_FRAG and POST_FRAG) ----
   The kit's .uc-board follows the engine too, but its vignette is body::after, which .uc-grain also takes on the same
   body, so it never shows; this board keeps lamp and vignette together, under the cards, on the 560 px cork.
   The engine dims the cork's own color: texture x (.26 + .34 x lamp) x a warm tint (1, .92, .82),
   the lamp falling off over 79% of the frame's long side, then a .3 vignette. The lamp hangs over the screen, as it
   does over the videos' frame, while the cork scrolls under it. */
.uc-board {
  background: #af733f url(/brand/assets/textures/cork.jpg);
  background-size: 560px;
}
.uc-board::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 100% at 50% 50%, #fff 23.3%, #f9f9f9 35%, #d9d9d9 46.7%, #b8b8b8 58.3%, #b3b3b3 70%),
    radial-gradient(circle 79vmax at 50% 42%, #998d7e, #908576 20%, #7a7164 40%, #615950 60%, #4b453e 80%, #423d36);
  background-blend-mode: multiply;
  mix-blend-mode: multiply;
}

::selection { background: var(--uc-highlight); color: var(--uc-ink); }
:focus-visible { outline: 3px solid var(--uc-highlight); outline-offset: 3px; }

a { color: inherit; text-decoration-color: var(--uc-marker); text-decoration-thickness: .08em; text-underline-offset: .2em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

main { max-width: 68rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }

/* ---- the top bar ---- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  max-width: 72rem;
  margin-inline: auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}
.top nav { display: flex; gap: .8rem; }
/* paper tabs stuck to the board just below the top of the screen. The page you are on is underlined in red marker; a
   tab you point at comes down a little to meet you (pointer devices only: a phone keeps hover on a tapped tab) */
.tab {
  display: block;
  margin-top: 1.1rem;
  padding: .7rem 1rem .65rem;
  font-size: .95rem;
  text-decoration: none;
}
.tab .uc-typed { letter-spacing: .1em; }
@media (hover: hover) {
  .tab:hover { translate: 0 .2rem; }
}
.tab[aria-current="page"] .uc-typed { text-decoration: underline .16em var(--uc-marker); text-underline-offset: .35em; }
@media (prefers-reduced-motion: no-preference) {
  .tab { transition: translate .18s ease-out; }
}
.top-home { position: relative; margin-top: 1.25rem; font-size: .9rem; padding: .4rem .6rem; text-decoration: none;
  -webkit-tap-highlight-color: transparent; }
/* pressed, the small wordmark sinks into the board: a touch smaller and lower, its strips' shadows pulled in close */
.top-home .wordmark { transition: transform .08s ease-out; }
.top-home .strip { transition: box-shadow .08s ease-out; }
.top-home:active .wordmark { transform: translateY(1px) scale(.97); }
.top-home:active .strip { box-shadow: .1rem .2rem .35rem rgb(18 10 4 / .45), .03rem .06rem .1rem rgb(18 10 4 / .35); }
@media (max-width: 30rem) {
  .top nav { gap: .4rem; }
  .tab { margin-top: .9rem; padding: .55rem .6rem .5rem; font-size: .8rem; }
  .top-home { margin-top: 1rem; font-size: .66rem; padding-inline: .3rem; }
}
@media (max-width: 22rem) {
  .top { gap: .6rem; }
  .tab { padding-inline: .5rem; font-size: .74rem; }
  .top-home { font-size: .55rem; }
}

/* ---- the wordmark, to the channel banner's measurements (stories/_brand/make_shots.py) ----
   Each strip is 5.62 x 2.03 em (Courier at .6 em a letter, not letterspaced), .47 em apart, CONTEXT .06 em lower. The
   typed line box is 1.49 em, which makes the highlighter's band 1.19 em tall, as in the banner. */

.wordmark { position: relative; display: inline-flex; align-items: center; gap: .47em; color: var(--uc-ink); }
.wordmark .strip { padding: .27em .71em; }
.wordmark .strip + .strip { margin-top: .12em; }
.wordmark .uc-typed { display: block; line-height: 1.49; letter-spacing: 0; }
/* the box the red circle is drawn round, the banner's radii: 3.251 em across from the CONTEXT strip's center (.44 em
   past each side) and .971 em up and down (just inside its edges, where the banner's safe band flattened it) */
.wordmark .ring {
  position: absolute;
  top: .164em;
  bottom: .044em;
  right: -.441em;
  width: 6.502em;
  pointer-events: none;
}

/* ---- home ---- */

.hero { --mark: clamp(1.45rem, 6.2vw, 3.6rem); text-align: center; padding: clamp(2rem, 7vw, 4.5rem) 0 0; overflow-x: clip; }
.hero-mark { display: flex; justify-content: center; margin: 0; font-size: var(--mark); font-weight: inherit; }
/* the subtitle at the banner's size (Courier at .574 of the wordmark's, not letterspaced), typed in ink on its own
   paper strip, a third piece of the logo; a little lower than the banner sets it, to clear the strip's padding */
.tagline { display: flex; justify-content: center; margin: calc(var(--mark) * .5) 0 0; font-size: calc(var(--mark) * .574);
  line-height: 1.258; }   /* a flex row: no line box around the strip, so its height doesn't depend on which font has loaded */
.tagline-strip { display: inline-block; padding: .32em .8em .26em; }
.tagline .uc-typed { letter-spacing: 0; line-height: inherit; }

/* ---- paper pieces ---- */

.card { padding: clamp(1.25rem, 4vw, 2.25rem); }
.card p:not(.uc-card-head) { max-width: 62ch; }
.card a { text-decoration-color: var(--uc-red-rule); }

.intro { max-width: 40rem; margin: clamp(2.5rem, 6vw, 3.5rem) auto 0; }
.intro p { margin: 0; font-size: clamp(1.1rem, 2.4vw, 1.3rem); line-height: 1.5; }

/* a section's typed tag, stuck to the board */
.label { display: inline-block; margin: 0 0 2rem; padding: .6em .85em .55em; font: inherit; font-size: .85rem; }
.label .uc-typed { letter-spacing: .12em; }

.videos, .elsewhere { text-align: center; }
.videos { margin-top: clamp(3rem, 8vw, 5rem); }

/* ---- videos as pinned polaroids ---- */

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 20rem));
  gap: 3rem 2.25rem;
  justify-content: center;
  margin: 0;
  padding: .5rem 0 0;
  text-align: left;
  list-style: none;
}
.polaroid { width: 100%; max-width: 21rem; padding: .7rem .7rem 1rem; }
/* the middle of each row sits a little lower; set per card (--drop) rather than by its place in the list, so lifting
   a card off the board (site.js) never renumbers and moves the others */
.board .polaroid { margin-top: var(--drop, 0); }
/* a video sits tilted like every piece and squares up once you click into its player (site.js marks it .watching;
   that click is what starts it playing), so it is straight while you watch: captions and controls level, edges crisp.
   It tilts back when you click back on the page. Keyboard focus inside it does the same. (The rotation itself is
   overridden: each card's --tilt is inline, which a stylesheet can't beat.) */
.polaroid:focus-within, .polaroid.watching { transform: rotate(0deg); }
@media (prefers-reduced-motion: no-preference) {
  .polaroid { transition: transform .2s ease-out; }
}
/* while tilted: a graphics card can leave a rotated layer's own edges jagged, so the paper's edge is drawn inside its
   paint (a transparent outline), and a thin ring of paper is drawn over the video's edge the same way */
.polaroid { outline: 1px solid transparent; }
.frame { position: relative; aspect-ratio: 9 / 16; background: var(--uc-ink); }
.frame::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 2px var(--uc-paper-polaroid);
  pointer-events: none;
}
.frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.polaroid-title {
  display: block;
  margin: .9rem .2rem .45rem;
  color: var(--uc-ink);
  font: 700 .95rem/1.3 var(--uc-font-typed);
  text-transform: uppercase;
  letter-spacing: .03em;
  text-decoration: none;
}
.polaroid-title:hover { text-decoration: underline; text-decoration-color: var(--uc-marker); }
.polaroid-credits {
  display: inline-block;
  margin: 0 .2rem;
  color: var(--uc-ink-soft);
  font: 400 .85rem/1.3 var(--uc-font-typed);
  text-decoration-color: var(--uc-red-rule);
}
.more { margin-top: 2.5rem; text-align: center; font-family: var(--uc-font-typed); }

.empty { max-width: 32rem; margin-inline: auto; text-align: left; }
.empty p { margin: 0; }

/* ---- follow along: a tag for each platform ---- */

.elsewhere { margin-top: clamp(3.5rem, 8vw, 5rem); }
/* sized so all five platforms fit one row on a desktop screen */
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.1rem 1rem; margin: 0; padding: 0; list-style: none; }
.tag { display: inline-block; padding: .72rem .95rem .68rem .8rem; text-decoration: none; }
.tag .uc-typed { display: flex; align-items: center; gap: .6rem; font-size: .95rem; letter-spacing: .1em; }
.tag .icon { flex: none; width: 1.4rem; height: 1.4rem; fill: currentColor; }
.tag-text { display: flex; flex-direction: column; gap: .3rem; text-align: left; }
.tag small { color: var(--uc-ink-soft); font: 400 .85rem/1 var(--uc-font-typed); text-transform: none; letter-spacing: 0; }
.tag:hover small { text-decoration: underline; text-decoration-color: var(--uc-marker); }

/* ---- a video's sources and credits ---- */

.dossier {
  display: grid;
  grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
  margin-top: 1.5rem;
}
.dossier-video { position: sticky; top: 1.5rem; }
.sheet h1 { margin: .5em 0 .25em; font: 800 clamp(1.55rem, 3.6vw, 2.35rem)/1.12 var(--uc-font-display); text-wrap: balance; }
/* the handwritten aside sits at the right end of the sheet's header rule */
.sheet .aside {
  position: absolute;
  top: clamp(.75rem, 3.3vw, 1.6rem);
  right: clamp(1.25rem, 4vw, 2.25rem);
  font-size: 1.4rem;
  transform: rotate(-4deg);
  white-space: nowrap;
}
.dateline { margin: 0 0 1.25rem; color: var(--uc-ink-soft); font: 400 .9rem/1.4 var(--uc-font-typed); }
.hook { font-size: 1.15rem; }
.transparency { color: var(--uc-ink-soft); font: 400 .9rem/1.5 var(--uc-font-typed); }
.credits { margin-top: 2.25rem; }
.credits .uc-card-head { font-size: .8rem; }
.credits .note { margin: -.35rem 0 .35rem; color: var(--uc-ink-soft); font: 400 .85rem/1.4 var(--uc-font-typed); }
.credits ul { margin: 0; padding: 0; list-style: none; font: 400 .95rem/1.45 var(--uc-font-typed); }
.credits li { padding: .6rem 0; border-bottom: 1px solid rgb(55 48 48 / .14); }
.credits li:last-child { border-bottom: 0; }
.credits a { color: var(--uc-ink); }
.where {
  display: block;
  overflow: hidden;
  color: var(--uc-ink-soft);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 47.5rem) {
  .dossier { grid-template-columns: minmax(0, 1fr); }
  /* not sticky in one column. Relative, not static, because the kit's pin() makes a static piece relative, and then
     the sticky offset (top) would push the polaroid down onto the sheet */
  .dossier-video { position: relative; top: auto; max-width: 19rem; margin-inline: auto; }
}

/* ---- contact ---- */

.contact { max-width: 36rem; margin: clamp(1.5rem, 5vw, 3rem) auto 0; }
.contact-form { display: grid; gap: .35rem; margin-top: 1.5rem; }
.contact-form label {
  margin-top: .9rem;
  font: 700 .8rem/1.2 var(--uc-font-typed);
  text-transform: uppercase;
  letter-spacing: .1em;
  filter: url(#uc-ink);
}
.optional { color: var(--uc-ink-soft); font-weight: 400; text-transform: none; letter-spacing: 0; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: .6rem .65rem;
  color: var(--uc-ink);
  background: rgb(250 245 233 / .65);
  border: 0;
  border-bottom: 1.5px solid var(--uc-ink-soft);
  border-radius: 0;
  font: 400 1rem/1.5 var(--uc-font-typed);
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 3px solid var(--uc-highlight); outline-offset: 1px; }
.contact-form button {
  justify-self: start;
  margin-top: 1.4rem;
  padding: .95rem 1.35rem .9rem;
  color: var(--uc-off-white);
  background: var(--uc-ink);
  border: 0;
  box-shadow: .15rem .3rem .6rem rgb(20 12 6 / .35);
  font: 700 .9rem/1 var(--uc-font-typed);
  text-transform: uppercase;
  letter-spacing: .12em;
  cursor: pointer;
}
.contact-form button:disabled { opacity: .6; cursor: progress; }
.trap { display: none; }
.status { min-height: 1.5em; margin: .75rem 0 0; font: 400 .95rem/1.45 var(--uc-font-typed); filter: url(#uc-ink); }
.status.is-error { color: var(--uc-marker-dark); }
.alt { margin: 1.5rem 0 0; font-size: .95rem; }

/* the stamp lands once a message has gone through. Centered, with a start scale small enough that even the first
   frame of the slap stays on the card at 320px wide */
.stamp {
  position: absolute;
  left: 0;
  right: 0;
  width: fit-content;
  margin-inline: auto;
  top: 40%;
  padding: .16em .38em .1em;
  color: var(--uc-marker-dark);
  border: .085em solid currentColor;
  outline: .035em solid currentColor;
  outline-offset: -.2em;
  font: 800 clamp(2.4rem, 9vw, 3.6rem)/1 var(--uc-font-label);
  text-transform: uppercase;
  letter-spacing: .05em;
  mix-blend-mode: multiply;
  filter: url(#uc-marker);
  opacity: 0;
  transform: rotate(-9deg);
  pointer-events: none;
}
.contact.is-sent .stamp { opacity: .86; }
@media (prefers-reduced-motion: no-preference) {
  .contact.is-sent .stamp { animation: stamp .22s cubic-bezier(.4, 0, .7, 1) both; }
}
@keyframes stamp {
  from { opacity: 0; transform: rotate(-13deg) scale(1.35); }
  75% { opacity: .9; transform: rotate(-9deg) scale(.96); }
  to { opacity: .86; transform: rotate(-9deg) scale(1); }
}

/* ---- footer ---- */

.foot { margin: clamp(4rem, 10vw, 6rem) auto 0; padding: 0 clamp(1rem, 4vw, 2.5rem) 3rem; }
/* the last card on the board */
.foot-card { max-width: 22rem; margin-inline: auto; padding: 1.4rem 1.5rem 1.15rem; }
.foot-card .uc-card-head { margin-bottom: .85rem; }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.foot-row p { margin: 0; font: 500 1rem/1 var(--uc-font-display); }
.foot-icons { display: flex; gap: .55rem; margin: 0 -.3rem 0 0; padding: 0; list-style: none; }
.foot-icons a { display: block; padding: .3rem; color: var(--uc-ink); filter: url(#uc-ink); }
.foot-icons a:hover { color: var(--uc-marker-dark); }
.foot-icons .icon { display: block; width: 1.35rem; height: 1.35rem; fill: currentColor; }

/* body copy on paper: the lighter ink site.js adds (typed labels keep the kit's full ink) */
.ink-light { filter: url(#uc-ink-light); }

/* ---- not found ---- */

.lost { max-width: 34rem; margin: clamp(1.5rem, 5vw, 3rem) auto 0; }
.lost .aside {
  position: absolute;
  top: clamp(.75rem, 3.3vw, 1.6rem);
  right: clamp(1.25rem, 4vw, 2.25rem);
  font-size: 1.5rem;
  transform: rotate(-6deg);
}
.lost-home {
  color: var(--uc-ink);
  font: 700 .9rem/1.3 var(--uc-font-typed);
  text-transform: uppercase;
  letter-spacing: .1em;
  text-decoration-color: var(--uc-marker);
  text-decoration-thickness: .12em;
}
.lost-videos { margin: .5rem 0 0; padding: 0; list-style: none; font: 400 .95rem/1.45 var(--uc-font-typed); }
.lost-videos li { padding: .45rem 0; border-bottom: 1px solid rgb(55 48 48 / .14); }
.lost-videos li:last-child { border-bottom: 0; }
.lost-videos a { color: var(--uc-ink); text-decoration-color: var(--uc-red-rule); }

/* two things to find (site.js): the wordmark lands again when tapped, and a pin can be pulled */
.hero .wordmark { cursor: pointer; }
.uc-pin { cursor: grab; touch-action: none; }   /* a finger on a pin drags the pin, not the page */
.holding-pin, .holding-pin * { cursor: grabbing !important; }

/* nothing shows until the page's fonts are in (html.uc-fonts, from each page's head script, with a 2 s safety net):
   laid out in fallback fonts and then reflowed, text and cards would jump in front of the reader. The board, its lamp
   and grain show at once. Without JavaScript (no html.js) nothing is hidden. */
html.js:not(.uc-fonts) body > * { visibility: hidden; }
/* the home page's landing: only the wordmark's two strips slap down, then its marks draw on, once the page shows.
   Once a visit (and again on a reload): back on the home page in the same session the strips are simply in place
   (html.uc-landed). */
html.js:not(.uc-fonts) .uc-slap { animation-play-state: paused; }
html.uc-landed .uc-slap { animation: none; }
/* pins are simply there: the kit pops a pin in after its card lands, and no pinned card lands now */
.uc-pin { animation: none; }
