/* ==========================================================================
   BRO THE CAT — $BROTHECAT
   Pure black. White display type. Green machine text.
   ========================================================================== */

:root {
  --bg:        #000000;
  --panel:     #050505;
  --line:      rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.05);
  --fg:        #ffffff;
  --fg-mid:    #b4b4b4;
  --fg-dim:    #6e6e6e;
  --acid:      #00ff6a;
  --acid-soft: rgba(0, 255, 106, 0.55);
  --acid-glow: rgba(0, 255, 106, 0.14);

  --display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --nav-h:  64px;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Class-level `display` beats the UA rule for [hidden], and app.js hides the
   unset social links that way. Keep the attribute authoritative. */
[hidden] { display: none !important; }

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

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

::selection { background: var(--acid); color: #000; }

/* ---------- Shared type ---------- */

.h2 {
  margin: 0 0 1.25rem;
  font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 3.4vw, 3.75rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.h3 {
  margin: 0.75rem 0 1.25rem;
  font-weight: 600;
  font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

/* Machine text: lowercase green mono, the counterpoint to the caps. */
.term {
  margin: 0;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--acid);
  text-transform: lowercase;
}
.term--dim { color: var(--acid-soft); }

.wrap {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { width: min(720px, 100%); }

.section { padding-block: clamp(5rem, 12vw, 9.5rem); }

/* ---------- Motion ----------
   One reveal system for the whole page. An element declares a direction with
   data-anim and an optional delay with --d; app.js adds .in when it enters
   the viewport (or, in the hero, when the intro finishes). */

[data-anim] {
  opacity: 0;
  transition:
    opacity 0.7s var(--ease),
    transform 0.85s var(--ease),
    clip-path 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}

[data-anim="up"]    { transform: translateY(30px); }
[data-anim="left"]  { transform: translateX(-46px); }
[data-anim="right"] { transform: translateX(46px); }
[data-anim="zoom"]  { transform: scale(0.94); }
[data-anim="wipe"]  { opacity: 1; clip-path: inset(0 100% 0 0); }

[data-anim].in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}

/* Typed lines are emptied before they run — hold their line box so nothing
   below them jumps when the text arrives. */
[data-type] { min-height: 1.7em; }

/* The vision frames settle out of a slow push-in as they slide into place. */
.vision__art.in img { animation: settle 1.4s var(--ease) both; }
@keyframes settle {
  from { scale: 1.06; }
  to   { scale: 1; }
}

/* ---------- Intro ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  gap: 1.25rem;
  justify-items: center;
  background: #000;
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
.intro.out {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.intro__bar {
  width: min(240px, 50vw);
  height: 1px;
  background: var(--line);
}
.intro__bar::after {
  content: "";
  display: block;
  width: 0;
  height: 100%;
  background: var(--acid);
  animation: load 1.5s var(--ease) forwards;
}
@keyframes load { to { width: 100%; } }

/* ---------- Buttons ---------- */

.btn {
  --btn-pad: 0.9rem 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: var(--btn-pad);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn--sm { --btn-pad: 0.55rem 1.05rem; font-size: 0.75rem; }
.btn--block { display: flex; width: 100%; }

.btn--buy {
  background: var(--acid);
  border-color: var(--acid);
  color: #000;
}
.btn--buy:hover { background: #fff; border-color: #fff; }

.btn--ghost { background: transparent; color: var(--fg); }
.btn--ghost:hover { border-color: var(--fg); background: rgba(255, 255, 255, 0.05); }

/* Pre-launch: the buy button is inert until CONFIG.buyUrl is filled in. */
.btn.is-locked {
  background: transparent;
  border-color: var(--acid-soft);
  color: var(--acid);
  cursor: default;
}
.btn.is-locked:hover { background: var(--acid-glow); border-color: var(--acid-soft); color: var(--acid); }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  transition:
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.5s var(--ease);
}
.nav.ready { transform: none; }
/* Out of the way while reading down the page, back on the way up. */
.nav.ready.away { transform: translateY(-100%); }
.nav.scrolled {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand { display: inline-flex; align-items: center; gap: 0.65rem; }
.brand__mark {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.15);
}
.brand__name {
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}
.nav__links a { color: var(--fg-mid); transition: color 0.2s var(--ease); }
.nav__links a:hover { color: var(--fg); }

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.icon-btn:hover { color: var(--fg); border-color: var(--fg); }

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0 7px;
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
}
.nav__burger span { height: 1px; background: var(--fg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 3rem) 0 clamp(3rem, 8vw, 6rem);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* Wrapper exists so the scroll parallax can move the footage without moving
   the veil. Bled past the edges so the translate never exposes the page. */
.hero__media {
  position: absolute;
  inset: -10% 0;
  will-change: transform;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The source is a bright, neon meme montage. Only lightly pulled toward the
     palette — it has to read as footage, not as texture. */
  filter: grayscale(0.15) saturate(0.95) contrast(1.1) brightness(0.95);
}

/* The type sits left, so the veil is heaviest on the left and thins out to the
   right, where the footage stays visible. */
.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0, transparent 150px),
    linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 34%, rgba(0, 0, 0, 0.06) 66%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(to top, #000 2%, rgba(0, 0, 0, 0.3) 38%, transparent 100%),
    radial-gradient(140% 110% at 50% 40%, transparent 45%, rgba(0, 0, 0, 0.8) 100%);
}

.hero__scan {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.045) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero__title {
  margin: 0.75rem 0 1.5rem;
  font-weight: 700;
  font-size: clamp(4.5rem, 15vw, 12.5rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

/* Each word rides up out of its own clipped band. */
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title i {
  display: block;
  font-style: normal;
  transform: translateY(105%);
  transition: transform 1.05s var(--ease);
  transition-delay: var(--d, 0ms);
}
.hero.in .hero__title i { transform: none; }

.hero__desc {
  max-width: 42ch;
  margin: 0 0 2.25rem;
  color: var(--fg-mid);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.75;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero__down {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(3rem, 8vw, 6rem);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.hero__down .term { writing-mode: vertical-rl; }
.hero__down-line {
  width: 1px;
  height: 64px;
  background: linear-gradient(to bottom, var(--acid), transparent);
}

/* The one scripted motion on the page: the boot log types itself in. */
#bootLog { min-height: 1.7em; }
#bootLog::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 0.15em;
  translate: 0 0.15em;
  background: var(--acid);
  animation: caret 1s steps(1, end) infinite;
}
#bootLog.done::after { display: none; }

@keyframes caret { 50% { opacity: 0; } }

/* ---------- Visions ---------- */

.visions .wrap {
  display: grid;
  gap: clamp(4rem, 9vw, 7rem);
}

.vision {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
/* Alternate which side the frame sits on, so the three read as a sequence
   rather than three copies of the same block. */
.vision:nth-child(even) .vision__art { order: 2; }

.vision__art { margin: 0; }
.vision__art img {
  width: 100%;
  height: auto; /* the captions live inside the images — never crop them */
  border: 1px solid var(--line);
}

.vision__copy p {
  max-width: 52ch;
  margin: 0 0 1.1rem;
  color: var(--fg-mid);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.8;
}
.vision__copy .term { margin-bottom: 0; }
.vision__copy .term--dim { margin-top: 1.75rem; }

/* ---------- Signal ---------- */

.signal__grid {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}

.signal__log dl { margin: 1.5rem 0 0; }
.signal__log dl > div {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line-soft);
}
.signal__log dt { font-size: 0.7rem; }
.signal__log dd {
  margin: 0.35rem 0 0;
  color: var(--fg-mid);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}
.signal__log dd.on { color: var(--fg); }

.signal__body p {
  max-width: 62ch;
  margin: 0 0 1.25rem;
  color: var(--fg-mid);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.8;
}
.signal__body .term { margin-top: 2rem; }

/* ---------- Archive ---------- */

.archive__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.archive__head .h2 { margin: 0; }

.archive__grid {
  display: grid;
  /* 190px lands on 5 columns at full width — two clean rows of the ten frames. */
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.frame {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  background: var(--panel);
  border: 0;
  cursor: pointer;
  overflow: hidden;
}
.frame img {
  width: 100%;
  height: auto; /* beats the height attribute, so aspect-ratio can take over */
  aspect-ratio: 1;
  object-fit: cover;
  transition: scale 0.5s var(--ease);
}
.frame:hover img,
.frame:focus-visible img { scale: 1.03; }

/* The frames are full colour, so the id label needs its own ground to sit on
   — half of them land on a bright background otherwise. */
.frame::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  pointer-events: none;
}

.frame__id {
  position: absolute;
  left: 0.75rem;
  bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--acid);
  text-shadow: 0 1px 6px #000;
}

/* ---------- Token ---------- */

.token__panel {
  padding: clamp(2rem, 5vw, 3.5rem);
  background: var(--panel);
  border: 1px solid var(--line);
}
.token__panel .h2 { margin: 0.5rem 0 2rem; }

.ca {
  display: flex;
  align-items: stretch;
  gap: 1px;
  margin-bottom: 1rem;
  background: var(--line);
  border: 1px solid var(--line);
}
.ca__value {
  flex: 1;
  min-width: 0;
  padding: 0.9rem 1rem;
  background: #000;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg);
  overflow-x: auto;
  white-space: nowrap;
}
.ca__copy {
  padding-inline: 1.1rem;
  background: #000;
  border: 0;
  color: var(--acid);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.ca__copy:hover { background: var(--acid-glow); }

.token__warn { margin-bottom: 2rem; }

.token__note {
  margin: 1rem 0 0;
  color: var(--fg-dim);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-align: center;
}

/* ---------- Footer ---------- */

.footer {
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer__links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}
.footer__links a { color: var(--fg-dim); transition: color 0.2s var(--ease); }
.footer__links a:hover { color: var(--fg); }
.footer__note { flex-basis: 100%; color: var(--fg-dim); }

/* ---------- Lightbox ---------- */

.lightbox {
  width: min(760px, 92vw);
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--fg);
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lightbox img { width: 100%; }
.lightbox .term { margin-top: 0.75rem; }
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .signal__grid { grid-template-columns: 1fr; }
  .vision { grid-template-columns: 1fr; gap: 1.75rem; }
  .vision:nth-child(even) .vision__art { order: 0; }
}

@media (max-width: 720px) {
  .nav__burger { display: flex; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open .nav__links { display: flex; }
  .nav.open { background: rgba(0, 0, 0, 0.95); }
  .nav__links a { padding: 0.85rem 0; border-top: 1px solid var(--line-soft); }
  .nav__actions .icon-btn { display: none; }
  .hero__down { display: none; }
  .hero__cta .btn { flex: 1 1 100%; }

  /* Narrow screens put the type over the whole frame, so the left-to-right
     ramp no longer protects it — go back to an even dim. */
  .hero__veil {
    background:
      linear-gradient(to top, #000 3%, rgba(0, 0, 0, 0.62) 50%, rgba(0, 0, 0, 0.45) 100%),
      radial-gradient(140% 110% at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Everything lands in its final state, immediately. */
  [data-anim], .hero__title i {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .intro { display: none !important; }
  .nav { transform: none !important; }
  .hero__media { transform: none !important; }
}
