/* IronBit Games — site styles */

@font-face {
  font-family: "Chakra Petch";
  src: url("/assets/fonts/chakra-petch-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("/assets/fonts/chakra-petch-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --black: #000000;      /* logo ground */
  --white: #FFFFFF;      /* the beam */
  --red: #FA1B2C;        /* the cross, "BIT" */
  --text: #E4E5E3;       /* body copy, slightly off the beam white */
  --steel: #8E9398;      /* secondary text */
  --plate: #1C1E20;      /* hairlines, surfaces */

  --display: "Chakra Petch", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 5vw, 48px);
  color-scheme: dark;
}

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

html {
  background: var(--black);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--black);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Brushed-steel grain + faint scanlines over everything, never intercepting input */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: .5;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .015' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
a:hover { color: var(--white); text-decoration-color: var(--red); }
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Footer (shared) ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter) max(1.25rem, env(safe-area-inset-bottom));
  font: 600 .8125rem/1.4 var(--display);
  letter-spacing: .04em;
  color: var(--steel);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); }

/* ---------- Home ---------- */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem var(--gutter) 1rem;
  text-align: center;
  /* a single work lamp hanging over the beam */
  background: radial-gradient(ellipse 60% 55% at 50% 38%, rgba(255,255,255,.06), transparent 70%);
}

.mark {
  display: block;
  height: min(44svh, 400px, 80vw);
  width: auto;
  overflow: visible;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mark .beam  { fill: var(--white); }
.mark .pupil { fill: var(--black); }
.mark .glint { fill: var(--white); }
.mark .cross { stroke: var(--red); stroke-width: 26; }
.mark .bits  { fill: var(--black); }

.mark .eye {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .12s ease-out;
}
.mark .pupil, .mark .glint { transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.mark .eye.is-blinking { transform: scaleY(.08); }

.bit .one, .bit .zero { display: none; }
.bit.is-1 .one, .bit.is-0 .zero { display: inline; }

.wordmark {
  margin: clamp(1.5rem, 5svh, 2.75rem) 0 0;
  line-height: 0;
}
.wordmark svg {
  display: block;
  width: min(360px, 72vw);
  height: auto;
  fill: var(--white);
}
.wordmark .red { fill: var(--red); }

.tagline {
  margin: 1.1rem 0 0;
  font: 600 clamp(.9375rem, 2.4vw, 1.0625rem)/1.3 var(--display);
  letter-spacing: .14em;
  color: var(--steel);
}

.contact {
  margin: 2.25rem 0 0;
  font: 600 1rem/1 var(--display);
  letter-spacing: .03em;
}
.contact a { text-decoration: none; color: var(--text); }
.contact a:hover { color: var(--white); }
.contact::before {
  content: ">";
  color: var(--red);
  margin-right: .6em;
}
.cursor {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: .25em;
  vertical-align: -.2em;
  background: var(--red);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Entrance: the beam is lowered into place, then the name is stamped out letter by letter */
@media (prefers-reduced-motion: no-preference) {
  .home .mark {
    animation: lower 1.25s both;
    transform-origin: 50% 100%;
  }
  .home .wordmark path { animation: stamp .01s steps(1) both; }
  .home .wordmark path:nth-child(1) { animation-delay: 1.15s; }
  .home .wordmark path:nth-child(2) { animation-delay: 1.23s; }
  .home .wordmark path:nth-child(3) { animation-delay: 1.31s; }
  .home .wordmark path:nth-child(4) { animation-delay: 1.39s; }
  .home .wordmark path:nth-child(5) { animation-delay: 1.55s; }
  .home .wordmark path:nth-child(6) { animation-delay: 1.63s; }
  .home .wordmark path:nth-child(7) { animation-delay: 1.71s; }
  .home .tagline, .home .contact { animation: appear .6s ease-out both; }
  .home .tagline { animation-delay: 1.9s; }
  .home .contact { animation-delay: 2.1s; }
}
@keyframes lower {
  0%   { transform: translateY(-60svh); animation-timing-function: cubic-bezier(.55,0,.7,.2); }
  72%  { transform: translateY(0) scale(1, 1); animation-timing-function: ease-out; }
  80%  { transform: translateY(0) scale(1.03, .95); animation-timing-function: cubic-bezier(.3,1.6,.5,1); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes stamp { from { opacity: 0; } to { opacity: 1; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Document pages (Terms of Use) ---------- */

.doc-header {
  display: flex;
  align-items: center;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--plate);
}
.doc-header a {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font: 700 1rem/1 var(--display);
  letter-spacing: .06em;
  color: var(--white);
}
.doc-header svg { height: 2rem; width: auto; }
.doc-header .beam  { fill: var(--white); }
.doc-header .pupil { fill: var(--black); }
.doc-header .glint { fill: var(--white); }
.doc-header .cross { stroke: var(--red); stroke-width: 26; }
.doc-header .bits  { fill: var(--black); }

.doc {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) var(--gutter) 4rem;
}
.doc h1 {
  margin: 0;
  font: 700 clamp(2.25rem, 7vw, 3.25rem)/1.05 var(--display);
  color: var(--white);
}
.doc .effective {
  margin: .75rem 0 2.5rem;
  color: var(--steel);
}
.doc h2 {
  margin: 2.75rem 0 .75rem;
  font: 700 1.25rem/1.3 var(--display);
  color: var(--white);
  scroll-margin-top: 1.5rem;
}
.doc h2 .n {
  color: var(--red);
  margin-right: .5em;
}
.doc p, .doc ul { margin: 0 0 1rem; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin-bottom: .4rem; }
.doc li::marker { color: var(--red); }
.doc strong { color: var(--white); font-weight: 600; }
.doc .lead { font-size: 1.1875rem; color: var(--white); }

.doc-toc {
  margin: 0 0 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--plate);
  border-bottom: 1px solid var(--plate);
  columns: 2 16rem;
  column-gap: 2rem;
  font-size: .9375rem;
}
.doc-toc ol { margin: 0; padding-left: 1.6rem; }
.doc-toc li { break-inside: avoid; margin-bottom: .3rem; }
.doc-toc li::marker { color: var(--steel); font-family: var(--display); }
.doc-toc a { text-decoration: none; color: var(--text); }
.doc-toc a:hover { color: var(--white); text-decoration: underline; text-decoration-color: var(--red); }

/* ---------- 404 ---------- */

.lost .mark { height: min(32svh, 280px, 60vw); cursor: default; }
.lost h1 {
  margin: 2rem 0 .5rem;
  font: 700 clamp(1.5rem, 5vw, 2rem)/1.2 var(--display);
  color: var(--white);
}
.lost p { margin: 0; color: var(--steel); }
.lost p a { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  .mark .eye, .mark .pupil, .mark .glint { transition: none; }
}
