/* Color and typography */
:root {
  --white: #e3ded2;   /* primary background */
  --black: #252120;   /* primary text       */
  --grey: #8c8c8c;    /* secondary text     */
  --green: #49e16f;   /* accent             */

  --mono: "Roboto Mono", monospace;
  --sans: "Roboto", sans-serif;
}


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

body {
  min-height: 100vh;
  font-family: var(--mono);
  color: var(--black);
  background-color: var(--white);
  overflow-x: hidden;
}

/* Texture overlay — fixed, multiply blend, all pages */
/* body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9997;
  background-image: url('./assets/textures/black-white-halftone-pattern-texture-background.jpg');
  background-size: 100vw 100vh;
  background-repeat: no-repeat;
  mix-blend-mode: multiply;
  opacity: 0.1;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
} */

a {
  color: inherit;
  text-decoration: none;
}


/* Background icons
 *  Two decorative corner icons set by JS based on the page.
 */
.bg-icon {
  position: fixed;
  width: 40vw;
  height: auto;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  image-rendering: -webkit-optimize-contrast; /* Safari */
  image-rendering: crisp-edges;               /* Firefox */
  image-rendering: pixelated;                 /* Chrome / Edge */
}

.bg-icon--tl {
  top: 8%;
  left: -10%;
}

.bg-icon--br {
  bottom: -5%;
  right: -10%;
}

/* About + index pages: bg icons sit above the drawing canvas */
[data-icon-set="stone"] .bg-icon,
[data-icon-set="tech"] .bg-icon {
  z-index: 13;
}


/* Page wrapper — padding-top pushes content below the fixed topbar */
.page {
  position: relative;
  z-index: 13;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-top: 5.1rem;
}


/* Shared container
 *  All full-width sections share this padding / max-width.
 */
.topbar,
.main,
.address-wrap,
.credits,
.footer {
  padding-left: 1.875rem;
  padding-right: 1.875rem;
  max-width: 111.5rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}


/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  background-color: var(--white);
}

.topbar__logo {
  display: block;
  flex-shrink: 0;
}

.topbar__logo-img {
  display: block;
  height: 2.6rem;
  width: auto;
}


/* Nav */
.topnav {
  display: flex;
  align-items: center;
}

.nav-item {
  margin: 0 0.875rem;
  padding: 0.35rem 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  white-space: nowrap;
  transition: color 120ms ease;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--black);
  outline: none;
}

/* Active page — black, not clickable */
.nav-item.is-active {
  color: var(--black);
  pointer-events: none;
}

.nav-insta {
  display: flex;
  align-items: center;
  margin-left: 0.875rem;
  color: var(--black);
}

.nav-insta__icon {
  display: block;
  width: 1rem;
  height: 1rem;
}


/* Circuit canvas
 *  Fixed behind everything. Only present on pages that
 *  include <canvas id="circuit-canvas">.
 */
#circuit-canvas {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}


/* Main layout — base used by all pages */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

/* Scrollable variant used on content pages */
.main--scroll {
  justify-content: flex-start;
  align-items: stretch;
  padding-top: 5rem;
  padding-bottom: 5rem;
  gap: 5rem;
}


/* Address block */
.address-wrap {
  padding: 2.5rem;
}

.address-block {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  line-height: 1.9;
  text-align: center;
}


/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

/* Language toggle button */
.nav__lang,
.footer__lang {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  transition: color 120ms ease;
}

.nav__lang {
  padding-left: 1rem;
}

@media (max-width: 768px) {
  .nav__lang {
    padding-left: 0;
  }
}

.nav__lang:hover,
.footer__lang:hover {
  color: var(--black);
}


/* Custom cursor
 *  Only active on mouse devices (JS adds .has-cursor).
 *  Two full-screen hairlines + a small square at the tip.
 *  Position is driven by --cx / --cy CSS custom properties.
 */
body.has-cursor,
body.has-cursor a,
body.has-cursor button {
  cursor: none;
}

.cur-h,
.cur-v {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(37, 33, 32, 0.28);
  pointer-events: none;
  z-index: 9998;
}

.cur-h {
  width: 100vw;
  height: 1px;
  transform: translateY(var(--cy, -100px));
}

.cur-v {
  width: 1px;
  height: 100vh;
  transform: translateX(var(--cx, -100px));
}

.cur-dot {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(var(--cx, -100px), var(--cy, -100px)) translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
}

/* Crosshair arms */
.cur-dot::before,
.cur-dot::after {
  content: "";
  position: absolute;
  background: var(--black);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.cur-dot::before {
  width: 14px;  /* horizontal arm */
  height: 2px;
}

.cur-dot::after {
  width: 2px;   /* vertical arm */
  height: 14px;
}

/* Green square: rotates to diamond over interactive elements */
.cur-square {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 25px;
  height: 25px;
  border: 1.5px solid var(--green);
  transform: translate(-50%, -50%);
  transition: transform 300ms ease;
}

.cur-dot.is-hovering .cur-square {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.4);
}


/* Hamburger button (hidden on desktop) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 1.4rem;
  height: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: var(--black);
  transition: transform 200ms ease, opacity 200ms ease;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Instagram icon next to hamburger (mobile only) */
.topbar__mobile-actions {
  display: none;
  align-items: center;
  gap: 1rem;
}

.topbar__insta-mobile img {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 11;
  background-color: var(--white);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav__item {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey);
}

.mobile-nav__item.is-active {
  color: var(--black);
  pointer-events: none;
}



/* Splash screen
 *  Covers the page on load, fades out after the glitch.
 *  Timing is controlled in app.js
 */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hidden SVG filter definitions
   No overflow:hidden — that prevents Chrome/Firefox from allocating
   a rendering context for the filter primitives inside. */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Logo wrapper */
.splash__wrap {
  position: relative;
  width: clamp(250px, 100vw, 500px);
  will-change: transform;
}

.splash__logo {
  display: block;
  width: 100%;
  height: auto;
  will-change: filter;
}

/* RGB channel ghosts */
.splash__ch-r,
.splash__ch-b {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity, clip-path;
}

.splash__ch-r {
  filter: url(#to-red);
  mix-blend-mode: multiply;
}

.splash__ch-b {
  filter: url(#to-blue);
  mix-blend-mode: multiply;
}


@media (prefers-reduced-motion: reduce) {
  .splash {
    display: none;
  }
}


/* Mobile — shared */
@media (max-width: 768px) {

  .splash__wrap {
    width: clamp(180px, 65vw, 320px);
  }

  /* Fixed background icon at low opacity */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: var(--mobile-bg-icon);
    background-size: 85vw auto;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.1;
    pointer-events: none;
  }

  #circuit-canvas {
    display: none !important;
  }

  .bg-icon {
    display: none !important;
  }

  .topbar__logo {
    margin: 0 auto 0 0;
  }

  .topbar__logo-img {
    height: 1.8rem;
  }

  .topnav {
    display: none;
  }

  .topbar__mobile-actions {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .page {
    padding-top: 4rem;
  }

  .address-wrap {
    padding: 1.5rem;
  }

  .address-block {
    font-size: 0.55rem;
  }
}
