/* ============================================================================
   BASE  —  design tokens, reset, typography.
   The whole surface is painted with --background; --black is the ink that
   shows through the 2px grid gaps and outlines every headline.
   Swapping themes rewrites these four values and nothing else.
   ============================================================================ */

:root {
  /* palette — overwritten at runtime by theme.js */
  --background: rgb(150, 150, 150);
  --black: rgb(26, 26, 26);
  --primary: rgb(103, 110, 136);
  --secondary: rgb(109, 136, 103);
  --metal: rgb(71, 71, 71);

  --neon-off: rgb(0, 97, 0);
  --neon-on: rgb(0, 255, 0);

  /* metrics */
  --gutter: 10px;
  --sidebar-w: 250px;
  --head-h: 120px;
  --gap: 2px;
  --main-height: 100vh;
  --sidebar-width: 250px;

  /* type */
  --font-display: "Silkscreen", "Courier New", monospace;
  --font-tech: "Chakra Petch", "Silkscreen", sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  --scroll-velocity: 0;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  color: var(--black);
  background: var(--background);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.custom-cursor,
body.custom-cursor * {
  cursor: none;
}
body.native-cursor a,
body.native-cursor [data-pointer],
body.native-cursor button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 400;
}

h1 {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

h2 {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  line-height: 1;
}

h3 {
  font-family: var(--font-tech);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.05;
  margin: 0;
}

h4 {
  font-family: var(--font-tech);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.2;
  margin: 0;
  letter-spacing: 0.02em;
}

h5 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.55rem;
  line-height: 1.3;
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

h6 {
  display: inline-block;
  background: var(--black);
  color: var(--background);
  padding: 2px 10px;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
}

p {
  margin: 0 0 0.9em;
}
p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

ul {
  margin: 0 0 1em;
  padding: 0;
}
ul li {
  list-style-type: square;
  margin-left: 1.1em;
  padding-left: 0.4em;
  margin-bottom: 0.35em;
}

/* outlined text, used for links and titles that sit on top of imagery */
.outlined,
section a {
  text-shadow:
    -1px -1px 0 var(--black),
    1px -1px 0 var(--black),
    -1px 1px 0 var(--black),
    1px 1px 0 var(--black);
}

section a {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}
section a:hover {
  color: var(--primary);
}

::selection {
  color: var(--background);
  background: var(--black);
}
::-moz-selection {
  color: var(--background);
  background: var(--black);
}

/* scrollbars are hidden everywhere; the grid itself communicates position */
* {
  scrollbar-width: none;
}
*::-webkit-scrollbar {
  display: none !important;
  width: 0;
  height: 0;
}

button,
[data-pointer],
.cell {
  user-select: none;
  -webkit-user-select: none;
}

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

/* non-latin scripts get their own face once the webfont arrives */
body.lang-ur h1,
body.lang-ur h2,
body.lang-ur h3,
body.lang-ur h4,
body.lang-ur h5,
body.lang-ur .neon,
body.lang-ur .word {
  font-family: "Noto Nastaliq Urdu", var(--font-tech), serif;
  line-height: 2;
}
body.lang-ja h1,
body.lang-ja h2,
body.lang-ja h3,
body.lang-ja h4,
body.lang-ja h5,
body.lang-ja .neon,
body.lang-ja .word {
  font-family: "DotGothic16", var(--font-display), monospace;
}
body.lang-ur .name-native,
body.lang-ja .name-native {
  display: flex;
  align-items: center;
  color: var(--background);
  white-space: nowrap;
  height: 100%;
  font-size: 0.9rem;
  margin-right: 10px;
}
.name-native:empty {
  display: none;
}

[dir="rtl"] .align-right {
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
