/* --ink is not black. it is a room with the lights off and the modem still on.
   protect · monitor · nurture. pick a load-bearing color and hold it steady. */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14100d;
  --red: #c21f2a;
  --bone: #f1e7d6;
  --navy: #1b2440;
  --line: rgba(241, 231, 214, 0.22);
  --dur: 420ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--ink);
  color: var(--bone);
  overflow-x: hidden;
}

body {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.serif {
  font-family: Georgia, 'Times New Roman', serif;
}

/* ---------- corner chrome, shared across pages ---------- */

.chrome {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.topleft {
  position: absolute;
  top: 22px;
  left: 24px;
  pointer-events: auto;
  max-width: 60vw;
}

.wordmark {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--bone);
}

.wordmark .wm-title {
  display: block;
  text-decoration: none;
  color: var(--bone);
  opacity: 0.82;
  transition: opacity var(--dur) ease;
}
.wordmark .wm-title:hover { opacity: 1; }

.wordmark .wm-sub {
  display: block;
  opacity: 0.55;
  font-size: 10px;
  margin-top: 2px;
}

.wordmark .wm-sub a {
  text-decoration: none;
  color: var(--bone);
  border-bottom: 1px solid transparent;
  transition: opacity var(--dur) ease, border-color var(--dur) ease;
}
.wordmark .wm-sub a:hover {
  opacity: 1;
  border-color: var(--line);
}

.nav {
  display: block;
  margin-top: 58px;
}

.nav a {
  font-size: 11px;
  text-decoration: none;
  color: var(--bone);
  opacity: 0.6;
  border-bottom: 1px solid transparent;
  transition: opacity var(--dur) ease, border-color var(--dur) ease;
  padding-bottom: 2px;
}

.nav a:hover, .nav a.active {
  opacity: 1;
  border-color: var(--line);
}

.info-tab {
  background: none;
  border: none;
  color: var(--bone);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity var(--dur) ease;
  padding: 0;
}
.info-tab:hover { opacity: 1; }

.left-nav {
  position: absolute;
  bottom: 22px;
  left: 24px;
  display: flex;
  gap: 18px;
  pointer-events: auto;
  flex-wrap: wrap;
  max-width: 70vw;
}

.info-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 16, 13, 0.94);
  display: flex;
  align-items: flex-end;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) ease;
}

.info-panel.open {
  opacity: 1;
  visibility: visible;
}

.info-inner {
  width: 100%;
  padding: 28px 24px 32px;
  border-top: 1px solid var(--line);
  max-width: 620px;
}

.info-inner .title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0 0 14px;
  color: var(--bone);
}

.info-inner p {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(241, 231, 214, 0.85);
}

.info-inner .meta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  font-size: 11px;
  color: rgba(241, 231, 214, 0.65);
}

.info-inner .meta b {
  display: block;
  color: var(--bone);
  font-weight: 500;
  margin-bottom: 3px;
  letter-spacing: 0.03em;
}

.info-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--bone);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  opacity: 0.6;
  cursor: pointer;
}
.info-close:hover { opacity: 1; }

@media (min-width: 640px) {
  .info-panel { align-items: center; justify-content: center; }
  .info-inner { border: 1px solid var(--line); border-radius: 2px; }
}

/* ---------- concept + merch panels: pattern backdrop, readable black box ---------- */

.pattern-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-image:
    linear-gradient(rgba(20, 16, 13, 0.62), rgba(20, 16, 13, 0.62)),
    url('../assets/pattern.jpg');
  background-repeat: no-repeat, repeat;
  background-size: cover, 300px 300px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) ease;
  padding: 0;
}

.pattern-panel.open {
  opacity: 1;
  visibility: visible;
}

.pattern-box {
  width: 100%;
  max-width: 680px;
  max-height: 86vh;
  overflow-y: auto;
  background: rgba(20, 16, 13, 0.94);
  border-top: 1px solid var(--line);
  padding: 30px 24px 36px;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .pattern-panel { align-items: center; }
  .pattern-box { border: 1px solid var(--line); border-radius: 2px; margin: 24px; }
}

.pattern-box .title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0 0 6px;
  color: var(--bone);
}

.pattern-box .subtitle {
  font-size: 11px;
  opacity: 0.6;
  margin: 0 0 22px;
  letter-spacing: 0.02em;
}

.pattern-box h3 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone);
  opacity: 0.7;
  margin: 26px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pattern-box h3:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 20px;
}

.pattern-box p {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(241, 231, 214, 0.85);
}

.pattern-box p a {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color var(--dur) ease, opacity var(--dur) ease;
}

.pattern-box p a:hover {
  border-color: var(--bone);
}

.pattern-box .credit {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  opacity: 0.55;
  line-height: 1.7;
}

/* ---------- merch ---------- */

.merch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 8px;
}

@media (min-width: 560px) {
  .merch-grid { grid-template-columns: 1fr 1fr; }
}

.merch-item {
  background: rgba(241, 231, 214, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.merch-canvas-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 300px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ink);
}

.merch-canvas-wrap.round {
  border-radius: 50%;
}

.merch-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.merch-item h3 {
  margin: 0 0 4px !important;
  padding: 0 !important;
  border: none !important;
  font-size: 13px !important;
  letter-spacing: 0.08em !important;
}

.merch-item p {
  text-align: left;
  font-size: 11.5px;
}

.buy-btn {
  display: inline-block;
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--bone);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  transition: opacity var(--dur) ease, transform var(--dur) ease;
}

.buy-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.pattern-box.merch-box {
  max-width: 920px;
}

/* ---------- index (pattern landing) ---------- */

.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.liquid-fallback-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: driftbg 40s linear infinite;
}

@keyframes driftbg {
  from { object-position: 0% 0%; }
  to { object-position: 100% 100%; }
}

.enter-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.45;
  pointer-events: none;
  z-index: 40;
}

@media (max-width: 640px) {
  .enter-hint { display: none; }
}

/* ---------- seal page ---------- */

.seal-stage {
  position: fixed;
  inset: 0;
  background: var(--ink);
}

.seal-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- gallery ---------- */

.gsection {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  scroll-snap-align: start;
  overflow: hidden;
  background: var(--ink);
}

.gsection-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(42px) brightness(0.5) saturate(1.15);
  transform: scale(1.18);
  z-index: 0;
}

.scroller {
  height: 100vh;
  height: 100svh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

.gsection canvas, .gsection video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  touch-action: pan-y;
  position: relative;
  z-index: 1;
}

.gcaption {
  position: absolute;
  bottom: 22px;
  right: 24px;
  font-size: 10px;
  letter-spacing: 0.03em;
  opacity: 0.5;
  z-index: 20;
  text-align: right;
}

.gindex {
  position: absolute;
  top: 22px;
  right: 24px;
  font-size: 10px;
  opacity: 0.5;
  z-index: 20;
}

.scroll-cue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  opacity: 0.4;
  z-index: 20;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 4px); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; }
  .liquid-fallback-img { animation: none; }
}
