/* Cascadia Code, self-hosted (fonts/, SIL Open Font License — see fonts/OFL.txt).
   It used to be pulled from a CDN with a version number that doesn't exist, so the
   request failed and visitors without the font installed saw a generic monospace.
   Subsets (latin, cyrillic) are separate files; the browser downloads only the
   ones a page's text actually needs. Weights: 400 (text) and 700 (the "new" badge). */
@font-face{
  font-family:'Cascadia Code'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/cascadia-code-latin-400-normal.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:'Cascadia Code'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../fonts/cascadia-code-latin-700-normal.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:'Cascadia Code'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/cascadia-code-cyrillic-400-normal.woff2') format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face{
  font-family:'Cascadia Code'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../fonts/cascadia-code-cyrillic-700-normal.woff2') format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

:root{
  --bg: #f3f0e9;
  --ink: #1c1c1a;
  --ring: #ffffff;
  --ring-hover: #888;
  --card-bg: #dfe3e0;
  --teal: #34c9b3;
}

*{box-sizing:border-box;}
html,body{
  margin:0; padding:0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Cascadia Code', monospace;
  overflow-x: hidden;
}

/* Everything is designed at a fixed 1920x1080 baseline, then scaled
   uniformly to fit the real viewport width, so all proportions stay
   locked regardless of screen size. */
#header-stage{
  position: fixed; top:0; left:0;
  width: 1920px;
  transform-origin: top left;
  z-index: 20;
}
#scale-outer{
  position: relative;
  overflow: hidden;
}
#stage{
  position: absolute; top:0; left:0;
  width: 1920px;
  transform-origin: top left;
}
#filter-bar-stage{
  position: fixed; top:0; left:0;
  width: 1920px;
  transform-origin: top left;
  z-index: 15;
}

header{
  display:grid; grid-template-columns: 1fr auto 1fr; align-items:center;
  padding: 36px 48px;
  background: var(--bg);
  transition: padding .3s ease;
}
header.shrink{
  padding: 14px 48px;
}
/* Used by js/layout.js to measure the header's un-transitioned height in
   both shrink states (nav/.logo/.socials each animate their own property
   independently of header's own padding transition, so all must be paused
   together for an accurate synchronous measurement). */
header.measuring, header.measuring *{
  transition: none !important;
}
header nav{ display:flex; gap:80px; font-size:40pt; letter-spacing:.02em; transition: font-size .3s ease; justify-self:start;}
header.shrink nav{ font-size: 18pt; }
header nav a{ color:var(--ink); text-decoration:none; }
header .logo{
  justify-self: center;
  font-size: 130pt;
  transition: font-size .3s ease;
  display: flex;
  align-items: center;
}
header.shrink .logo{
  font-size: 68pt;
}
header .logo img{
  height: 1em;
  width: auto;
  display: block;
}
header .socials{ display:flex; gap:40px; justify-self:end; transition: gap .3s ease; }
header .socials a{
  width:60px; height:60px;
  display:flex; align-items:center; justify-content:center;
  transition: width .3s ease, height .3s ease;
}
header .socials a img{ width:100%; height:100%; object-fit:contain; }
header.shrink .socials a{
  width:44px; height:44px;
}
/* gap shrinks in the same proportion as the icons (60px -> 44px): 40 * 44/60 */
header.shrink .socials{ gap:29px; }

.hamburger{
  display: none;
  width: 40px; height: 40px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--bg);
  justify-self: end;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.hamburger span{
  display:block; width: 18px; height: 1.5px; background: var(--ink);
}

.mobile-drawer{
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: min(78vw, 320px);
  height: 100%;
  background: var(--bg);
  border-left: 1.5px solid var(--ink);
  z-index: 40;
  padding: 100px 32px 32px;
  flex-direction: column;
  gap: 26px;
  transform: translateX(100%);
  visibility: hidden; /* shut: its links must not be reachable by keyboard / screen reader */
  transition: transform .35s ease, visibility 0s linear .35s;
}
.mobile-drawer.open{
  transform: translateX(0);
  visibility: visible;
  transition: transform .35s ease, visibility 0s;
}
/* Same size and style as the hamburger, sitting where the hamburger is — the panel
   covers it while open, so this is what closes the menu. */
.drawer-close{
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  padding: 0;
}
.drawer-close span{
  position: absolute; top: 50%; left: 50%;
  width: 20px; height: 1.5px;
  background: var(--ink);
}
.drawer-close span:first-child{ transform: translate(-50%,-50%) rotate(45deg); }
.drawer-close span:last-child{ transform: translate(-50%,-50%) rotate(-45deg); }
.drawer-close:active{ background: var(--ink); }
.drawer-close:active span{ background: var(--bg); }
.drawer-backdrop{
  display: none;
  position: fixed; inset: 0;
  background: rgba(28,28,26,.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  z-index: 35; /* above the header (20) and filter bar (15), below the panel (40) */
  touch-action: none;
}
.drawer-backdrop.open{ opacity: 1; pointer-events: auto; }
/* page behind the open menu / modal does not scroll */
html.drawer-open, html.modal-open{ overflow: hidden; }
.mobile-drawer a{
  color: var(--ink); text-decoration:none; font-size: 20px;
  font-family:'Cascadia Code', monospace;
}
.mobile-drawer-socials{ display:flex; gap:14px; margin-top: 12px; }
.mobile-drawer-socials a{
  width:34px; height:34px;
  display:flex; align-items:center; justify-content:center;
}
.mobile-drawer-socials a img{ width:100%; height:100%; object-fit:contain; }

main{
  padding: 0 0 80px;
}

footer{
  text-align:center; font-size:12px; color:#8a8a82; padding: 60px 24px 80px;
  font-family:'Cascadia Code', monospace;
}
footer p{ margin: 6px 0; }
footer .footer-brand{ color: var(--ink); font-size:14px; }
footer a{ color:#8a8a82; text-decoration:none; border-bottom:1px solid transparent; }
footer a:hover{ border-bottom-color:#8a8a82; }

@media (max-width: 820px){
  #header-stage{
    position: fixed; width: 100%; transform: none !important;
  }
  #filter-bar-stage{
    position: fixed; width: 100%; transform: none !important;
  }
  header{
    grid-template-columns: auto 1fr auto;
    padding: 16px 20px;
  }
  header.shrink{ padding: 10px 20px; }
  header nav{ display: none; }
  header .logo{ font-size: 68px; justify-self: start; }
  header.shrink .logo{ font-size: 44px; }
  header .socials{ display: none; }
  .hamburger{ display: flex; }

  .mobile-drawer{ display: flex; }
  .drawer-backdrop{ display: block; }

  #scale-outer{
    margin-top: 96px !important;
    height: auto !important;
    overflow: visible;
    overflow-y: visible;
  }
  #stage{
    position: static; width: 100%; transform: none !important;
    overflow-y: visible;
  }

  main{ padding: 20px 0 40px; }

  html, body{
    scroll-snap-type: y mandatory;
    overflow-y: visible;
  }
  /* snap cards to the middle of the part of the screen below the floating
     header + filters (--sticky-top is set by js/layout.js) */
  html{ scroll-padding-top: var(--sticky-top, 0px); }
}

/* Text for search engines / screen readers that shouldn't be visible
   (the <h1> that build_seo.py writes into every page). */
.visually-hidden{
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
