/* Academy of Robotics. One page of paper and one of night, one type family, one ink.
   The paper (#e9ecef) is the default and always where a visit starts; the night (#0d1013) is the reader's choice, from the
   small half-moon in the header, and carries one accent: the gold of our AI's orb. Hairlines, square corners, no shadows. */
@font-face { font-family: 'AoR Sans'; src: url(../fonts/sans.otf) format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'AoR Sans'; src: url(../fonts/sans-medium.otf) format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }

@property --bg { syntax: '<color>'; inherits: true; initial-value: #e9ecef; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #0f1317; }

:root {
  --font: 'AoR Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, 'Liberation Mono', monospace;
  --ease: cubic-bezier(.22,.8,.24,1); --expo: cubic-bezier(.16,1,.3,1); --io: cubic-bezier(.65,0,.35,1);
  --gut: clamp(20px, 4.4vw, 72px); --hh: 76px;
  --fs-hero: clamp(34px, 4.6vw, 80px); --fs-h1: clamp(44px, 6.2vw, 104px); --fs-h2: clamp(28px, 3vw, 48px); --fs-h3: clamp(20px, 1.7vw, 26px);
  --fs-lede: clamp(17px, 1.3vw, 20px); --fs-body: 16px; --fs-small: 14px; --fs-label: 11px;
  --gold: #e9c47a; --gold2: #c6a35c;
  color-scheme: light;
  --bg: #e9ecef; --bg2: #e1e5e8; --ink: #0f1317; --ink2: #2b3137; --muted: #5d636a; --dim: #7b8188; --head2: #80868b;
  --line: rgba(15,19,23,.13); --line2: rgba(15,19,23,.24); --line3: rgba(15,19,23,.5); --wash: rgba(15,19,23,.045);
  --veil: rgba(233,236,239,.72); --accent: var(--ink);
}
[data-theme=dark] {
  color-scheme: dark;
  --bg: #0d1013; --bg2: #14181c; --ink: #e9ecef; --ink2: #c3c8cd; --muted: #979b9f; --dim: #7e8388; --head2: #80868b;
  --line: rgba(233,236,239,.13); --line2: rgba(233,236,239,.24); --line3: rgba(233,236,239,.5); --wash: rgba(233,236,239,.05);
  --veil: rgba(13,16,19,.74); --accent: var(--gold);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-color: rgba(127,133,139,.5) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-synthesis: none; overflow-x: hidden; }
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--ink); color: var(--bg); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -.03em; text-wrap: balance; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 300; background: var(--ink); color: var(--bg); padding: 12px 18px; transition: top .15s; }
.skip:focus { top: 16px; }
.mono, .label { font: 400 var(--fs-label)/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lnk { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line3); text-decoration-thickness: 1px; text-underline-offset: 6px; transition: text-decoration-color .25s; }
.lnk:hover { text-decoration-color: var(--accent); }
.arrow { display: inline-block; transition: transform .45s var(--ease); }
.arrow.tri svg { display: inline-block; width: .82em; height: .82em; vertical-align: -.06em; }
a:hover .arrow, button:hover .arrow { transform: translateX(4px); }

/* the theme changes as a circle opening from the half-moon (a view transition), and simply where there is none */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-fade, html.theme-fade * { transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease) !important; }

/* ------------------------------------------------------------------ header */
.hdr { position: fixed; inset: 0 0 auto 0; height: var(--hh); z-index: 60; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gut); pointer-events: none; }
.hdr > * { pointer-events: auto; }
body:not([data-page=welcome]) .hdr { background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1); pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; letter-spacing: -.005em; white-space: nowrap; }
@media (max-width: 480px) { .brand { gap: 9px; font-size: 13.5px; } .brand svg { width: 28px; height: 28px; } .hbtn { padding: 0 8px; min-width: 36px; } .hdr-r { gap: 0; } }
.brand svg { width: 32px; height: 32px; color: var(--ink); }
.hdr-r { display: flex; align-items: center; gap: 6px; }
.hbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 40px; min-width: 40px; padding: 0 12px; font-size: 14px; color: var(--ink); transition: opacity .3s; }
.hbtn:hover { opacity: .72; }
.hbtn svg { width: 18px; height: 18px; flex: none; }
/* the half-moon: night on one side, paper on the other; it turns half a circle with the page */
.moon { width: 40px; }
.moon i { display: block; width: 18px; height: 18px; border-radius: 50%; border: 1.25px solid var(--ink); background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); transition: transform .9s var(--expo); }
[data-theme=dark] .moon i { transform: rotate(180deg); }
.moon:hover i { transform: rotate(-20deg); } [data-theme=dark] .moon:hover i { transform: rotate(160deg); }
@keyframes pulse { 50% { opacity: .2; } }
.menu-btn .bars { display: inline-flex; flex-direction: column; gap: 5px; width: 18px; }
.menu-btn .bars i { display: block; height: 1.25px; background: currentColor; transition: transform .5s var(--expo); }
.menu-open .menu-btn .bars i:first-child { transform: translateY(3.2px) rotate(45deg); }
.menu-open .menu-btn .bars i:last-child { transform: translateY(-3.2px) rotate(-45deg); }
.menu-btn .t { min-width: 3.2em; text-align: left; }

/* ------------------------------------------------------------------ the menu: a full sheet */
.sheet { position: fixed; inset: 0; z-index: 55; background: var(--bg); color: var(--ink); display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 var(--gut); padding: calc(var(--hh) + 4vh) var(--gut) 36px; overflow: auto; visibility: hidden; opacity: 0; transition: opacity .5s var(--ease), visibility 0s .5s; }
.menu-open .sheet { visibility: visible; opacity: 1; transition: opacity .45s var(--ease); }
.sheet .s-four { display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); padding-right: var(--gut); }
.sheet .s-four a { display: grid; grid-template-columns: 3.2em 1fr 120px; align-items: center; gap: 12px; padding: 1.4vh 0; border-bottom: 1px solid var(--line); }
.sheet .s-four a:first-child { border-top: 1px solid var(--line); }
.sheet .s-four b { font: 400 var(--fs-label) var(--mono); letter-spacing: .08em; color: var(--muted); }
.sheet .s-four span { font-size: clamp(30px, 4.2vw, 64px); line-height: 1.05; letter-spacing: -.04em; transition: transform .6s var(--expo); }
.sheet .s-four img { width: 120px; height: 64px; object-fit: contain; opacity: .82; transition: opacity .4s, transform .6s var(--expo); }
[data-theme=dark] .sheet .s-four img, [data-theme=dark] .thumb-art { filter: invert(1) hue-rotate(180deg) brightness(1.15); }
.sheet .s-four a:hover span { transform: translateX(10px); }
.sheet .s-four a:hover img { opacity: 1; transform: scale(1.08); }
.sheet .s-pages { display: flex; flex-direction: column; justify-content: center; }
.sheet .s-pages a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 1.5vh 0; border-bottom: 1px solid var(--line); }
.sheet .s-pages a span { font-size: clamp(22px, 2.2vw, 34px); letter-spacing: -.03em; }
.sheet .s-pages a small { font-size: 13px; color: var(--muted); text-align: right; }
.sheet .s-pages a:hover span { color: var(--accent); }
.sheet .s-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; margin-top: 3vh; border-top: 1px solid var(--line); }
.sheet .s-foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.sheet .s-foot a, .sheet .s-foot button { font-size: 14px; color: var(--ink2); }
.sheet .s-foot a:hover, .sheet .s-foot button:hover { color: var(--ink); }
.sheet .talk { display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px; border: 1px solid var(--line3); }
.sheet .talk svg { width: 16px; height: 16px; }
.sheet .stag { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .8s var(--expo); }
.menu-open .sheet .stag { opacity: 1; transform: none; }
@media (max-width: 860px) {
  .sheet { grid-template-columns: 1fr; padding-top: calc(var(--hh) + 12px); align-content: start; }
  .sheet .s-four { border-right: 0; padding-right: 0; }
  .sheet .s-four a { grid-template-columns: 2.6em 1fr 84px; }
  .sheet .s-four img { width: 84px; height: 44px; }
  .sheet .s-pages { margin-top: 24px; }
}

/* ------------------------------------------------------------------ modals: the film player */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: max(16px, 3vh) var(--gut); visibility: hidden; opacity: 0; transition: opacity .4s var(--ease), visibility 0s .4s; }
.modal.open { visibility: visible; opacity: 1; transition: opacity .35s var(--ease); }
.modal .veil { position: absolute; inset: 0; background: var(--veil); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); }
.modal .card { position: relative; width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line2); transform: translateY(14px) scale(.985); transition: transform .6s var(--expo); }
.modal.open .card { transform: none; }
.modal .x { position: absolute; top: 10px; right: 10px; z-index: 3; width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink); }
.modal .x svg { width: 18px; height: 18px; }
.modal .x:hover { opacity: .7; }

/* the player: the picture, and under it only play, the slider and the volume */
.player { position: relative; display: flex; flex-direction: column; }
.player .pic { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.player video, .player iframe, .player .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border: 0; background: #000; }
.player .poster { object-fit: cover; transition: opacity .5s; }
.player .poster.lines { object-fit: contain; background: var(--bg2); padding: 6%; }
[data-theme=dark] .player .poster.lines { filter: invert(1) hue-rotate(180deg); background: #e9ecef; }
.player .big { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; transition: opacity .4s; }
.player .big i { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: rgba(0,0,0,.18); transition: transform .5s var(--expo); }
.player .big:hover i { transform: scale(1.06); }
.player .big svg { width: 22px; height: 22px; }
.player.playing .big, .player.playing .poster { opacity: 0; pointer-events: none; }
.player .soon { position: absolute; inset: auto 0 0 0; padding: 18px 22px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; background: linear-gradient(transparent, rgba(0,0,0,.04)); }
.player .bar { display: grid; grid-template-columns: 40px 1fr 40px 96px; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.player .bar button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink); }
.player .bar svg { width: 18px; height: 18px; }
.player.yt .bar { display: none; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; --p: 0%; }
.range::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--ink) var(--p), var(--line2) var(--p)); }
.range::-moz-range-track { height: 2px; background: var(--line2); }
.range::-moz-range-progress { height: 2px; background: var(--ink); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border-radius: 50%; background: var(--ink); border: 0; transition: transform .2s; }
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 0; }
.range:hover::-webkit-slider-thumb { transform: scale(1.3); }
[data-theme=dark] .range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--gold) var(--p), var(--line2) var(--p)); }
[data-theme=dark] .range::-moz-range-progress { background: var(--gold); }
.player .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.player .meta h3 { font-size: var(--fs-h3); }
.player .meta p { margin: 0; font-size: 13px; color: var(--muted); text-align: right; max-width: 52ch; }
@media (max-width: 640px) { .player .meta { flex-direction: column; } .player .meta p { text-align: left; } .player .bar { grid-template-columns: 40px 1fr 40px; } .player .bar .vol { display: none; } }

/* ------------------------------------------------------------------ reduced motion: everything simply there */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* a film this host won't frame */
.player .offsite-note { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.player .offsite-note p { max-width: 34ch; margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.player .offsite-note a { font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.player.offsite .big { display: none; }
.hbtn:focus-visible, .moon:focus-visible { outline-width: 1.5px; outline-offset: 3px; border-radius: 999px; }
