/* First We Feel Then We Fall — shared styles for redesign concepts */
@font-face { font-family: 'AGaramondPro'; src: url("../../fonts/AGaramondPro/AGaramondPro-Regular.woff2") format("woff2"), url("../../fonts/AGaramondPro/AGaramondPro-Regular.otf") format("opentype"); font-weight: normal; font-style: normal; font-display: swap; }
@font-face { font-family: 'AGaramondPro'; src: url("../../fonts/AGaramondPro/AGaramondPro-Italic.woff2") format("woff2"), url("../../fonts/AGaramondPro/AGaramondPro-Italic.otf") format("opentype"); font-weight: normal; font-style: italic; font-display: swap; }
@font-face { font-family: 'AGaramondPro'; src: url("../../fonts/AGaramondPro/AGaramondPro-Bold.woff2") format("woff2"), url("../../fonts/AGaramondPro/AGaramondPro-Bold.otf") format("opentype"); font-weight: bold; font-style: normal; font-display: swap; }
@font-face { font-family: 'classiq'; src: url("../../fonts/classiq/classiq_light.woff2") format("woff2"), url("../../fonts/classiq/classiq_light.otf") format("opentype"); font-weight: normal; font-style: normal; font-display: swap; }
@font-face { font-family: 'classiq'; src: url("../../fonts/classiq/classiq_light_italic.woff2") format("woff2"), url("../../fonts/classiq/classiq_light_italic.otf") format("opentype"); font-weight: normal; font-style: italic; font-display: swap; }

:root {
    --ink: #000;
    --paper: #e9e6df;
    --dim: #8a8680;
    --line: rgba(233, 230, 223, .18);
    --serif: "AGaramondPro", "Garamond", "Times New Roman", serif;
    --script: "classiq", "AGaramondPro", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--serif); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.tilted { font-family: var(--script); font-style: italic; }
.caps { text-transform: uppercase; letter-spacing: .14em; }
.sigil { font-size: 15px; letter-spacing: .32em; text-transform: uppercase; white-space: nowrap; }
.sigil i { font-style: normal; opacity: .5; margin: 0 .35em; }

/* film grain over everything */
.grain::after {
    content: ""; position: fixed; inset: -50%; z-index: 9990; pointer-events: none; opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 1s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-4%)} 60%{transform:translate(-4%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* sound + concept switch (top-right utility) */
.fw-util { position: fixed; top: 18px; right: 22px; z-index: 9000; display: flex; gap: 18px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.fw-util button { all: unset; cursor: pointer; opacity: .75; }
.fw-util button:hover, .fw-util button[aria-pressed="true"] { opacity: 1; }
.fw-util .eq { display: inline-flex; gap: 2px; height: 10px; align-items: flex-end; margin-right: 6px; }
.fw-util .eq b { width: 2px; background: currentColor; height: 3px; }
.fw-util [aria-pressed="true"] .eq b { animation: eq .9s ease-in-out infinite; }
.fw-util [aria-pressed="true"] .eq b:nth-child(2) { animation-delay: .2s; }
.fw-util [aria-pressed="true"] .eq b:nth-child(3) { animation-delay: .4s; }
.fw-util .fw-switch { display: flex; gap: 10px; }
.fw-util .fw-switch a { opacity: .45; }
.fw-util .fw-switch a:hover { opacity: .9; }
.fw-util .fw-switch a[aria-current] { opacity: 1; border-bottom: 1px solid currentColor; }
@keyframes eq { 0%,100%{height:3px} 50%{height:10px} }

/* ---------- MOVIE overlay: tiles grid -> multichannel player ---------- */
#fw-movie { position: fixed; inset: 0; z-index: 9200; background: #000; display: none; }
#fw-movie.open { display: block; }
#fw-movie .mv-top { position: absolute; top: 0; left: 0; right: 0; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; z-index: 5; }
#fw-movie .mv-top button { all: unset; cursor: pointer; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
#fw-movie .mv-top button:hover { opacity: 1; }
#fw-movie .mv-top .mv-home { font-size: 15px; letter-spacing: .32em; opacity: .9; }
#fw-movie .mv-top .mv-home:hover { opacity: 1; color: #c8302a; }
#fw-movie .mv-grid { position: absolute; inset: 64px 0 0; overflow-y: auto; padding: 24px 4vw 60px; }
#fw-movie .mv-hint { text-align: center; color: var(--dim); font-size: 17px; margin: 0 0 22px; }
#fw-movie .mv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fw-tile { position: relative; aspect-ratio: 450/200; background: #111 center/cover no-repeat; cursor: pointer; overflow: hidden; outline: 1px solid var(--line); outline-offset: -1px; }
.fw-tile img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) brightness(.8); transition: filter .3s; }
.fw-tile:hover img, .fw-tile:focus-visible img { filter: none; }
.fw-tile .n { position: absolute; left: 8px; bottom: 6px; font-size: 13px; letter-spacing: .1em; text-shadow: 0 0 6px #000; }
.fw-tile.seen::after { content: ""; position: absolute; right: 8px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--paper); opacity: .7; }

#fw-movie .mv-stage { position: absolute; inset: 0; display: none; background: #000; }
#fw-movie.playing .mv-stage { display: block; }
#fw-movie.playing .mv-grid { display: none; }
#fw-movie .mv-tracks { position: absolute; inset: 64px 0 120px; }
#fw-movie .mv-track { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; pointer-events: none; }
#fw-movie .mv-track.active { opacity: 1; }
/* a clip served from the site sits in exactly the box a YouTube iframe gets, so it scales the same */
#fw-movie .mv-track video.mv-local { position: absolute; left: 0; top: -90px; width: 100%; height: calc(100% + 180px); clip-path: inset(90px 0 90px 0); object-fit: contain; background: #000; }
#fw-movie.text-on .mv-track video.mv-local { height: calc(100% + 90px); clip-path: inset(90px 0 0 0); }
/* the player is 90px taller top and bottom; those letterbox bands (with YouTube's title and logo) are clipped away */
#fw-movie .mv-track iframe { position: absolute; left: 0; top: -90px; width: 100%; height: calc(100% + 180px); border: 0; clip-path: inset(90px 0 90px 0); }
/* with Text on, YouTube draws the subtitles in the bottom band: clip only the title band at the top */
#fw-movie.text-on .mv-track iframe { height: calc(100% + 90px); clip-path: inset(90px 0 0 0); }
#fw-movie .mv-shield { position: absolute; inset: 64px 0 120px; z-index: 3; cursor: pointer; touch-action: none; }
#fw-movie.playing { touch-action: none; overscroll-behavior: none; }
#fw-movie.playing .mv-lines { touch-action: manipulation; }
#fw-movie .mv-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-style: italic; z-index: 2; }
#fw-movie .mv-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; padding: 12px 24px; z-index: 4; display: flex; gap: 24px; align-items: center; }
#fw-movie .mv-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
#fw-movie .mv-line { position: relative; height: 13px; cursor: pointer; }
#fw-movie .mv-line:hover::before { background: rgba(233,230,223,.6); }
#fw-movie .mv-line::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: rgba(233,230,223,.32); }
#fw-movie .mv-line i.bar { position: absolute; top: 4px; height: 1px; background: var(--paper); opacity: .85; }
#fw-movie .mv-line.active::before { background: rgba(233,230,223,.4); }
#fw-movie .mv-line.active i.bar:last-child { top: 2px; height: 5px; opacity: 1; }
#fw-movie .mv-opts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
#fw-movie .mv-opts button { all: unset; cursor: pointer; opacity: .5; }
#fw-movie .mv-opts button[aria-pressed="true"] { opacity: 1; }
#fw-movie .mv-keys { color: var(--dim); font-size: 13px; letter-spacing: .08em; }
#fw-movie .mv-title { font-size: 15px; letter-spacing: .2em; text-transform: uppercase; }

/* lightbox */
#fw-lightbox { position: fixed; inset: 0; z-index: 9500; background: rgba(0,0,0,.94); display: none; cursor: zoom-out; }
#fw-lightbox.open { display: block; }
#fw-lightbox img { position: absolute; top: 50%; left: 50%; max-width: 92vw; max-height: 88vh; transform: translate(-50%,-50%); }
#fw-lightbox button { all: unset; position: absolute; cursor: pointer; color: var(--paper, #eee); transition: color .2s; }
#fw-lightbox button:hover { color: var(--red, #c33); }
#fw-lightbox .lb-prev, #fw-lightbox .lb-next { top: 50%; transform: translateY(-50%); font-size: 64px; line-height: 1; padding: 20px 26px; display: none; }
#fw-lightbox.multi .lb-prev, #fw-lightbox.multi .lb-next { display: block; }
#fw-lightbox .lb-prev { left: 1vw; } #fw-lightbox .lb-next { right: 1vw; }
#fw-lightbox .lb-close { top: 18px; right: 24px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; }
#fw-lightbox p { position: absolute; left: 0; right: 0; bottom: 3vh; text-align: center; color: var(--dim); font-size: 15px; }

@media (prefers-reduced-motion: reduce) { .grain::after { animation: none; } }

/* phones: tap for sound, and the timelines full width under the film */
#fw-movie .mv-tap { all: unset; display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; padding: 10px 18px; border: 1px solid var(--red, #c33); background: rgba(0,0,0,.7); color: var(--paper, #eee); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
#fw-movie.needs-tap .mv-tap { display: block; }
@media (max-width: 700px) {
  #fw-movie .mv-tracks { inset: 80px 0 170px; }
  #fw-movie .mv-shield { inset: 80px 0 170px; }
  #fw-movie .mv-bottom { height: 170px; flex-direction: column-reverse; align-items: stretch; gap: 10px; padding: 10px 16px 18px; }
  #fw-movie .mv-lines { flex: none; gap: 4px; }
  #fw-movie .mv-line { height: 22px; }
  #fw-movie .mv-line::before, #fw-movie .mv-line i.bar { top: 10px; }
  #fw-movie .mv-line.active i.bar:last-child { top: 8px; height: 5px; }
  #fw-movie .mv-keys { display: none; }
  #fw-movie .mv-top { flex-wrap: wrap; height: auto; padding: 12px 16px 0; row-gap: 10px; }
  #fw-movie .mv-top button { white-space: nowrap; font-size: 11px; }
  #fw-movie .mv-top .mv-home { order: -1; flex-basis: 100%; text-align: center; font-size: 11px; letter-spacing: .22em; }
  #fw-movie .mv-meta { font-size: 11px; }
}

/* no subtitles since the YouTube channel closed: Text is hidden until VTT files are added */
#fw-movie .mv-opts [data-o="text"] { display: none; }
