/* Base: reset, page overlays, shared type, the pixel arrows, the block arrivals, motion rules.
   Rebuild 01: the page's own stylesheet (css/home.css, from the kit) now lays out the page, so what it replaces left
   this file: the nav, the section frame, the buttons and cards, the card glow, the footer, the vignette (the prototype
   has none) and the smooth scroll (a cut with the stinger jumps). */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

html{
  background:var(--ink);
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body{
  background:transparent;                /* the page colour is on html, so the heat field shows between them */
  color:var(--paper);
  font-family:var(--f-body);
  font-weight:400;
  font-size:16px;
  line-height:1.6;
  overflow-x:hidden;
  cursor:crosshair;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-synthesis:none;
}
img,canvas,svg,video{display:block;max-width:100%}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
a{color:inherit}

::selection{background:var(--red-glow);color:var(--paper)}
::-webkit-scrollbar{width:4px;height:4px}
::-webkit-scrollbar-track{background:var(--ink)}
::-webkit-scrollbar-thumb{background:var(--line)}
::-webkit-scrollbar-thumb:hover{background:var(--red)}

:focus-visible{outline:2px solid var(--red);outline-offset:3px}

/* ===== page overlays: the heat field, scanlines, grain ===== */
/* the heat field (js/field.js): the page background, behind all content. Segments stay transparent,
   panels, the bar and the dialog keep their solid surfaces. Whole 16 px cells, scaled with hard edges. */
#field{position:fixed;left:0;top:0;z-index:-1;max-width:none;pointer-events:none;image-rendering:crisp-edges;image-rendering:pixelated}
.scanlines,.grain{position:fixed;inset:0;pointer-events:none}
.scanlines{background:var(--scan);z-index:9998}
.grain{
  z-index:9996;
  opacity:.055;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size:200px 200px;
  animation:grain-shift .14s steps(1) infinite;
}
@keyframes grain-shift{
  0%{background-position:0 0}11%{background-position:-32px -18px}22%{background-position:18px -34px}
  33%{background-position:-28px 22px}44%{background-position:24px 12px}55%{background-position:-12px -28px}
  66%{background-position:30px -14px}77%{background-position:-20px 30px}88%{background-position:14px -22px}
}

/* ===== shared type ===== */
.label{
  font-family:var(--f-label);
  font-weight:600;
  font-size:var(--label-size);
  line-height:1.5;
  letter-spacing:var(--label-track);
  text-transform:uppercase;
}
.px{font-family:var(--f-pixel);font-weight:400;letter-spacing:0;line-height:1.5}
.hl{
  font-family:var(--f-head);
  text-transform:uppercase;
  letter-spacing:var(--hl-track);
  line-height:var(--hl-lead);
}
.hl i{display:block;font-style:normal;font-weight:300}
.hl b{display:block;font-weight:800}
.tag{
  display:inline-block;
  background:var(--red);
  color:var(--on-red);
  font-family:var(--f-pixel);
  font-size:var(--px-8);
  line-height:1;
  padding:6px 8px 5px;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.seal{display:block;width:var(--s,36px);height:var(--s,36px)}
.seal img{width:100%;height:100%}
.inline-link{color:var(--paper);text-decoration:none;border-bottom:1px solid var(--red-dark)}
.inline-link:hover{color:var(--red-text)}

/* ===== pixel arrows =====
   The arrow glyphs of the live page are not in Geist, Chakra Petch or Press Start 2P as served,
   so the browser borrowed a system face. They are drawn here on an 8 x 8 grid instead, in the text colour. */
.ico{
  display:inline-block;flex:0 0 auto;
  width:8px;height:8px;margin-left:.55em;vertical-align:.06em;
  background:currentColor;
  -webkit-mask:var(--ico) center / contain no-repeat;
  mask:var(--ico) center / contain no-repeat;
}
.ico.mid{margin:0 .55em}
.ico-e,.ico-w{--ico:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 8 8%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%274%27 y=%270%27 width=%271%27 height=%271%27/%3E%3Crect x=%274%27 y=%271%27 width=%272%27 height=%271%27/%3E%3Crect x=%274%27 y=%272%27 width=%273%27 height=%271%27/%3E%3Crect x=%270%27 y=%273%27 width=%278%27 height=%271%27/%3E%3Crect x=%270%27 y=%274%27 width=%278%27 height=%271%27/%3E%3Crect x=%274%27 y=%275%27 width=%273%27 height=%271%27/%3E%3Crect x=%274%27 y=%276%27 width=%272%27 height=%271%27/%3E%3Crect x=%274%27 y=%277%27 width=%271%27 height=%271%27/%3E%3C/svg%3E")}
.ico-w{transform:scaleX(-1)}
.ico-ne{--ico:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 8 8%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%272%27 y=%270%27 width=%276%27 height=%271%27/%3E%3Crect x=%272%27 y=%271%27 width=%276%27 height=%271%27/%3E%3Crect x=%274%27 y=%272%27 width=%274%27 height=%271%27/%3E%3Crect x=%273%27 y=%273%27 width=%272%27 height=%271%27/%3E%3Crect x=%276%27 y=%273%27 width=%272%27 height=%271%27/%3E%3Crect x=%272%27 y=%274%27 width=%272%27 height=%271%27/%3E%3Crect x=%276%27 y=%274%27 width=%272%27 height=%271%27/%3E%3Crect x=%271%27 y=%275%27 width=%272%27 height=%271%27/%3E%3Crect x=%276%27 y=%275%27 width=%272%27 height=%271%27/%3E%3Crect x=%270%27 y=%276%27 width=%272%27 height=%271%27/%3E%3Crect x=%270%27 y=%277%27 width=%271%27 height=%271%27/%3E%3C/svg%3E")}

/* ===== arrivals: a block arrives in three hard steps of opacity, no slide (revision 1, one motion rule) ===== */
.fade-in{opacity:0}
.fade-in.visible{opacity:1;animation:step-in .24s steps(3,end) both}
@keyframes step-in{from{opacity:0}to{opacity:1}}
/* .shown: reduced motion is on or has been on while the page is open (site.js), or focus came in. Shown for good */
.no-js .fade-in,.fade-in.shown{opacity:1;animation:none}
/* Blocks with a solid surface (panels, screens, films, the photo wall, the stage, the road, the card) are never
   see-through over the field (revision 2). They wait hidden, then cut in whole, piece by piece, 70 ms apart: each
   piece after the first holds at nothing for its turn, then shows at once. The hold is an animation of opacity, so a
   waiting piece keeps its place in the tab order and in what a screen reader reads, and every piece keeps its own
   transitions. A block that is .shown (focus came in, reduced motion, the first Tab) holds nothing back. */
.fade-in.solid.visible{opacity:1;animation:none}
@keyframes solid-wait{from,to{opacity:0}}
.fade-in.solid.visible:not(.shown) > :nth-child(2){animation:solid-wait 70ms}
.fade-in.solid.visible:not(.shown) > :nth-child(3){animation:solid-wait 140ms}
.fade-in.solid.visible:not(.shown) > :nth-child(4){animation:solid-wait 210ms}
.fade-in.solid.visible:not(.shown) > :nth-child(5){animation:solid-wait 280ms}
.fade-in.solid.visible:not(.shown) > :nth-child(n+6){animation:solid-wait 350ms}

/* ===== placeholders: TODO(Pedro) marks show with ?todo in the address ===== */
.show-todo [data-todo]{outline:1px dashed var(--annot);outline-offset:3px}

/* ===== print: every block shows, whatever has scrolled into view ===== */
@media print{
  .fade-in,.reveal,.fade-in.solid > *{opacity:1 !important}   /* opacity only: taking the animations away would replay them back on screen */
  #field,.grain,.scanlines{display:none !important}
}

/* ===== motion off ===== */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    transition-delay:0s !important;
  }
  .grain{animation:none}
  .fade-in,.fade-in.visible{opacity:1;animation:none}   /* site.js marks them .shown too, so switching back off restarts nothing */
  .fade-in.solid > *{animation:none !important}
}
