/* Whyarium Play, the home page: the channel's own brand (the deep-sea ink, the facet ground, the one mint accent,
   Fraunces for display, Inter for text, JetBrains Mono for labels). Each film's card is a window into that film's
   own world, framed by Whyarium's. */
@font-face { font-family: Fraunces; src: url(../fonts/Fraunces.woff2) format('woff2'); font-weight: 500 900; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/Inter.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(../fonts/JetBrainsMono.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --ink: #0B0D12; --ink2: #11151C; --mint: #4FE3A1; --white: #FFFFFF; --teal: #29908F; --deep: #2B6F73;
  --slate-teal: #2C535A; --slate: #2B3641;
  --fg: #F2F4F5; --fg2: rgba(226, 233, 236, .72); --fg3: rgba(226, 233, 236, .5); --rule: rgba(255, 255, 255, .09);
  --gut: 20px; --max: 1240px;
  --display: Fraunces, Georgia, serif; --text: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1); --spring: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gut: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ink); color: var(--fg); font: 400 16px/1.5 var(--text); -webkit-font-smoothing: antialiased;
  overflow-x: clip; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 4px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ the brush under "Why" (the brand's one stroke) */
.why { position: relative; display: inline-block; z-index: 0; }
.brush { position: absolute; z-index: -1; left: -.13em; right: -.035em; bottom: -.013em; height: .2975em;
  background: url(../assets/brush.png) left center / 100% 100% no-repeat; pointer-events: none; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(430px, 70svh, 560px); display: flex; flex-direction: column; }
@media (min-width: 720px) { .hero { min-height: clamp(480px, 68svh, 660px); } }
.bar { order: 0; } .whale-wrap { order: 1; } .hero-in { order: 2; }
.facets { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; touch-action: pan-y; }
.hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 13, 18, 0) 55%, rgba(11, 13, 18, .72) 86%, var(--ink) 100%),
    linear-gradient(90deg, rgba(11, 13, 18, .45) 0%, rgba(11, 13, 18, 0) 62%); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  max-width: calc(var(--max) + 2 * var(--gut)); margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) var(--gut) 0; height: 64px; }
.mark { font: 900 30px/1 var(--display); color: var(--white); display: inline-flex; align-items: flex-end; padding: 6px 4px 6px 0; }
.mark i { width: .23em; height: .23em; border-radius: 50%; background: var(--mint); margin: 0 0 .02em .02em; }
.channel { font: 600 13px/1 var(--text); letter-spacing: .01em; color: var(--fg2); display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 0 10px 10px; transition: color .2s; }
.channel .yt, .foot-link .yt { width: 20px; height: 14px; stroke: none; flex: none; }
.channel { gap: 8px; }
.channel:hover { color: var(--white); }

.hero-in { position: relative; margin-top: auto; padding: 0 var(--gut) clamp(26px, 5svh, 56px); max-width: calc(var(--max) + 2 * var(--gut));
  width: 100%; margin-inline: auto; }
.kicker { font: 500 clamp(12px, .55vw + 9.5px, 19px)/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--mint);
  margin-bottom: clamp(12px, 1.2vw, 20px); }   /* grows with the wordmark */
.wordmark { font: 900 min(clamp(64px, 17.5vw, 152px), 22svh)/.9 var(--display); letter-spacing: -.012em; color: var(--white); margin-left: -.03em;
  padding-top: .06em; padding-bottom: .16em; }   /* room for the ascenders and the y's tail inside its own box */
@media (min-width: 720px) { .wordmark { font-size: min(clamp(64px, 11vw, 152px), 22svh); } }
.lede { font: 650 clamp(21px, 2.1vw + 12px, 34px)/1.18 var(--display); color: var(--white); margin-top: clamp(4px, 1svh, 12px);
  max-width: 19em; text-wrap: balance; }
.sub { font: 400 clamp(15px, .5vw + 13px, 18px)/1.45 var(--text); color: var(--fg2); margin-top: 8px; max-width: 30em; text-wrap: pretty; }
.cue { display: inline-flex; align-items: center; gap: 10px; margin-top: clamp(18px, 3svh, 30px);
  font: 600 15px/1 var(--text); color: var(--ink); background: var(--mint); border-radius: 999px; padding: 13px 18px 13px 20px;
  box-shadow: 0 6px 24px -8px rgba(79, 227, 161, .55); transition: transform .25s var(--spring), box-shadow .25s; }
.cue svg { width: 16px; height: 16px; stroke-width: 2; }
.cue:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(79, 227, 161, .7); }
.cue:active { transform: translateY(0) scale(.97); }

.whale-wrap { position: relative; z-index: -1; pointer-events: none; align-self: flex-end;
  width: clamp(120px, 36vw, 190px); margin: 2px 6px 6px 0; }   /* room for the snout's nod and the bob */   /* on a phone the whale has its own place above the words */
@media (min-width: 720px) {
  .whale-wrap { position: absolute; margin: 0; bottom: 30%; right: max(var(--gut), calc(50% - 640px)); width: min(clamp(220px, 26vw, 440px), 52svh); }
}
/* a phone held sideways: the hero is the screen, the whale keeps to the top right, the supporting line steps aside */
@media (min-width: 600px) and (max-height: 520px) {
  .hero { min-height: 100svh; }
  .sub { display: none; }
  .whale-wrap { position: absolute; margin: 0; top: 70px; bottom: auto; right: var(--gut); width: min(28vw, 40svh); }
  .cue { margin-top: 14px; }
}
.whale { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 60% 50%; animation: bob 9s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-1.5%, 3.5%) rotate(-2deg); }
}

/* arrival: facets turn over along the diagonal (in the canvas); then the type, the brush, the whale */
.anim .hero-in > *, .anim .bar { opacity: 0; transform: translateY(14px); }
.anim .hero .brush { clip-path: inset(0 100% 0 0); }
.anim .whale-wrap { opacity: 0; transform: translateX(28%); }
.anim.ready .bar { animation: rise .7s var(--ease) .15s both; }
.anim.ready .kicker { animation: rise .7s var(--ease) .35s both; }
.anim.ready .wordmark { animation: rise .8s var(--ease) .45s both; }
.anim.ready .hero .brush { animation: wipe .5s cubic-bezier(.6, 0, .3, 1) 1.05s both; }
.anim.ready .lede { animation: rise .7s var(--ease) .75s both; }
.anim.ready .sub { animation: rise .7s var(--ease) .85s both; }
.anim.ready .cue { animation: rise .7s var(--ease) 1s both; }
.anim.ready .whale-wrap { animation: swim 2.6s cubic-bezier(.2, .7, .2, 1) .5s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes swim { from { opacity: 0; transform: translateX(28%); } 30% { opacity: 1; } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .whale { animation: none; } }

/* ------------------------------------------------------------------ the films */
main { max-width: calc(var(--max) + 2 * var(--gut)); margin: 0 auto; padding: clamp(18px, 4svh, 40px) var(--gut) 0; outline: none; }
.films-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px;
  padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.films-head h2 { font: 500 12px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--fg2); white-space: nowrap; }
/* search and sort: two small icons on the heading's line; search opens out only when tapped */
.tools { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none;
  color: var(--fg2); cursor: pointer; transition: color .2s, background .2s; }
.icon svg { width: 18px; height: 18px; }
.icon:hover, .icon[aria-expanded="true"] { color: var(--white); background: rgba(255, 255, 255, .08); }
.icon:active { transform: scale(.94); }
.find { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 999px;
  transition: background .25s, box-shadow .25s; }
.find input { width: 0; height: 44px; padding: 0; border: 0; outline: none; background: none; color: var(--fg); opacity: 0;
  font: 400 16px/1 var(--text); -webkit-appearance: none; appearance: none; min-width: 0;
  transition: width .35s var(--ease), opacity .2s, padding .35s var(--ease); }
.find input::placeholder { color: var(--fg3); }
.find input::-webkit-search-cancel-button, .find input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.find .clear { width: 0; height: 36px; opacity: 0; overflow: hidden; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: none; color: var(--fg2); cursor: pointer; padding: 0; flex: none; transition: width .35s var(--ease), opacity .2s; }
.clear svg { width: 14px; height: 14px; stroke-width: 2; }
.clear:hover { color: var(--white); background: rgba(255, 255, 255, .08); }
.find.open { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.find.open:focus-within { box-shadow: inset 0 0 0 1.5px var(--mint); }
.find.open .open-find { color: var(--mint); background: none; cursor: default; }
.find.open input { width: 220px; opacity: 1; padding: 0 2px 0 0; }
.find.open .clear { width: 36px; opacity: 1; margin-right: 4px; }
/* on a phone the open field takes the heading's place on the same line, and gives it back when closed */
@media (max-width: 719px) {
  .films-head.searching h2 { display: none; }
  .films-head.searching .tools { flex: 1; }
  .films-head.searching .find { flex: 1; }
  .find.open input { width: 100%; flex: 1; }
}
.sorter { position: relative; flex: none; }
.sort svg { color: var(--fg2); }
.sort .arr { transform-origin: 4px 8px; transition: transform .3s var(--spring); color: var(--mint); stroke: var(--mint); }
.sort.up .arr { transform: rotate(180deg); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 176px; padding: 6px; border-radius: 14px;
  background: #161B23; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 18px 40px -12px rgba(0, 0, 0, .8);
  display: grid; gap: 2px; transform-origin: top right; animation: pop .18s var(--ease); }
.menu[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.menu button { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 44px; padding: 0 12px;
  border: 0; border-radius: 9px; background: none; color: var(--fg); font: 500 15px/1 var(--text); text-align: left; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: rgba(255, 255, 255, .07); outline: none; }
.menu button::after { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.menu button[aria-checked="true"] { color: var(--white); }
.menu button[aria-checked="true"]::after { background: var(--mint); box-shadow: 0 0 0 3px rgba(79, 227, 161, .22); }
.status { font: 400 12px/1 var(--mono); letter-spacing: .06em; color: var(--fg3); min-height: 12px; margin: 12px 0 clamp(14px, 2.4vw, 22px); }
.none { color: var(--fg2); padding: 8px 0 20px; }
.none[hidden] { display: none; }
.none button { font: 600 15px/1 var(--text); color: var(--mint); background: none; border: 0; padding: 10px 2px; cursor: pointer; }
.nojs { color: var(--fg2); padding: 20px 0; }

.grid { list-style: none; display: grid; gap: clamp(36px, 5vw, 44px) clamp(20px, 3vw, 40px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } .grid.two { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px) and (max-width: 1099px) { .grid { grid-template-columns: repeat(2, 1fr); } }

.card { position: relative; display: flex; flex-direction: column; }
.card[hidden] { display: none; }
.win { position: relative; aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: var(--ground, var(--slate));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 18px 40px -22px rgba(0, 0, 0, .9);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease); transform: translateZ(0); }
.win img, .win video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .9s var(--ease), opacity .5s; }
.win video { opacity: 0; }
.win video.on { opacity: 1; }
.badge { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px;
  font: 600 12px/1 var(--text); letter-spacing: .02em; color: var(--white); padding: 8px 11px 8px 9px; border-radius: 999px;
  background: rgba(11, 13, 18, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(79, 227, 161, .22); }

.plate { padding-top: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.meta { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.name { font-size: 15px; line-height: 1; white-space: nowrap; }
.date { font: 400 11.5px/1 var(--mono); letter-spacing: .06em; color: var(--fg3); white-space: nowrap; }
.q { font: 700 clamp(22px, 1vw + 17px, 28px)/1.16 var(--display); color: var(--white); text-wrap: balance; margin-top: 2px; }
.go::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
.go:focus-visible { outline: none; }
.card:has(.go:focus-visible) .win { box-shadow: 0 0 0 2px var(--mint), 0 18px 40px -22px rgba(0, 0, 0, .9); }
.line { color: var(--fg2); font-size: 15.5px; line-height: 1.5; text-wrap: pretty; max-width: 34em; }
.acts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin-top: auto; padding-top: 8px; }
.play { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1 var(--text); color: var(--mint); padding: 10px 0; }
.play svg { width: 16px; height: 16px; stroke-width: 2; transition: transform .3s var(--spring); }
.parts { font: 400 12px/1 var(--mono); color: var(--fg3); letter-spacing: .04em; }
.watch { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font: 500 14px/1 var(--text);
  color: var(--fg2); padding: 10px 0; transition: color .2s; }
.watch svg { width: 11px; height: 11px; }
.watch:hover { color: var(--white); }
.watch[hidden] { display: none; }

@media (hover: hover) {
  .card:hover .win { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(79, 227, 161, .55), 0 26px 50px -24px rgba(0, 0, 0, .95); }
  .card:hover .win video, .card:hover .win img { transform: scale(1.025); }
  .card:hover .play svg { transform: translateX(4px); }
}
.card:active .win { transform: scale(.985); transition-duration: .15s; }

/* cards arrive as they scroll in */
.anim .card { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.anim .card.seen { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ footer */
.js:not(.films-in) .foot { display: none; }   /* it appears with the cards, so it never jumps down past them */
.foot { width: calc(100% - 2 * var(--gut)); max-width: var(--max); margin: clamp(72px, 12vw, 128px) auto 0;
  padding: 40px 0 max(44px, env(safe-area-inset-bottom)); border-top: 1px solid var(--rule);
  display: grid; justify-items: center; text-align: center; gap: 6px; }
.foot-whale { width: 96px; margin-bottom: 10px; opacity: .95; }
.foot-whale > * { display: block; width: 100%; height: auto; overflow: visible; }
.foot-word { font: 900 30px/1 var(--display); color: var(--white); }
.foot-tag { font: 800 19px/1.3 var(--display); color: var(--fg); margin-top: 4px; }
.foot-link { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--text); color: var(--mint); padding: 12px 4px; margin-top: 4px; }
.foot-link svg { width: 11px; height: 11px; }
