/* ═══════════════════════════════════════════════════════════
   GLITCH//BREW — Neural Coffee Lab
   Cyberpunk glitch-tech design system
   ═══════════════════════════════════════════════════════════ */

:root {
  --void:      #05060a;
  --void-2:    #0a0c14;
  --panel:     #0e111c;
  --line:      rgba(0, 255, 240, 0.14);
  --line-soft: rgba(255, 255, 255, 0.06);

  --cyan:   #00fff0;
  --magenta:#ff2e97;
  --acid:   #b6ff3c;
  --violet: #7b5bff;

  --ink:    #e7ecf5;
  --muted:  #7f8aa3;
  --dim:    #4a536b;

  --mono: 'Share Tech Mono', ui-monospace, monospace;
  --tech: 'Chakra Petch', sans-serif;
  --grot: 'Space Grotesk', sans-serif;

  --glow-cyan: 0 0 24px rgba(0, 255, 240, 0.35);
  --glow-mag:  0 0 24px rgba(255, 46, 151, 0.35);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─────────── RESET ─────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--grot);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

@media (hover: none) { body { cursor: auto; } }

::selection { background: var(--magenta); color: #000; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ═══════════════════ FX OVERLAYS ═══════════════════ */
.fx-scanlines,
.fx-noise,
.fx-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
}

.fx-scanlines {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0.22) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}

.fx-noise {
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseShift 0.5s steps(3) infinite;
}

@keyframes noiseShift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-4%, 2%); }
  66%  { transform: translate(3%, -3%); }
  100% { transform: translate(0, 0); }
}

.fx-vignette {
  background: radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
  z-index: 8000;
}

/* ─────────── CUSTOM CURSOR ─────────── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: width 0.2s, height 0.2s, background 0.2s, border-color 0.2s;
}
.cursor.is-hot {
  width: 52px; height: 52px;
  background: rgba(255, 46, 151, 0.12);
  border-color: var(--magenta);
}
@media (hover: none) { .cursor { display: none; } }

/* ═══════════════════ BOOT / PRELOADER ═══════════════════ */
.boot {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--void);
  display: grid;
  place-items: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.boot.is-done { opacity: 0; visibility: hidden; }

.boot__inner {
  width: min(560px, 86vw);
  font-family: var(--mono);
}
.boot__log {
  font-size: 0.78rem;
  line-height: 1.9;
  color: var(--acid);
  white-space: pre-wrap;
  min-height: 220px;
  text-shadow: 0 0 8px rgba(182, 255, 60, 0.4);
}
.boot__log .ok { color: var(--cyan); }
.boot__log .warn { color: var(--magenta); }
.boot__bar {
  height: 3px;
  background: var(--line-soft);
  margin-top: 14px;
  overflow: hidden;
}
.boot__bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
}
.boot__pct {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 8px;
  text-align: right;
}

/* ═══════════════════ NAV ═══════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 7500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 60px);
  background: linear-gradient(180deg, rgba(5, 6, 10, 0.9), rgba(5, 6, 10, 0));
  backdrop-filter: blur(2px);
  transition: transform 0.4s var(--ease);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__brand {
  font-family: var(--tech);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 1.05rem;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 36px);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 1px;
}
.nav__links a { color: var(--muted); transition: color 0.2s; position: relative; }
.nav__links a:hover { color: var(--ink); }
.nav__cta {
  color: var(--void) !important;
  background: var(--cyan);
  padding: 8px 16px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  font-weight: bold;
  box-shadow: var(--glow-cyan);
}
.nav__cta:hover { background: var(--acid); }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav__burger span {
  width: 26px; height: 2px;
  background: var(--cyan);
  transition: 0.3s;
}

/* ═══════════════════ HERO ═══════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px clamp(20px, 5vw, 60px) 60px;
  overflow: hidden;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(120% 90% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.5;
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}
/* readability scrim so text stays legible over the 3D core */
.hero__content::before {
  content: '';
  position: absolute;
  inset: -40px -60px -40px -80px;
  z-index: -1;
  background: radial-gradient(
    80% 120% at 20% 50%,
    rgba(5, 6, 10, 0.92) 0%,
    rgba(5, 6, 10, 0.72) 42%,
    rgba(5, 6, 10, 0) 78%
  );
  pointer-events: none;
}
.hero__tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--acid);
  margin-bottom: 24px;
}
.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.hero__title {
  font-family: var(--tech);
  font-weight: 700;
  font-size: clamp(3rem, 13vw, 10rem);
  line-height: 0.92;
  letter-spacing: -2px;
  margin-bottom: 28px;
  text-transform: uppercase;
}
.hero__slash { color: var(--magenta); }

.hero__sub {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 40px;
}
.hero__sub em { color: var(--cyan); font-style: normal; }

.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__marquee {
  position: absolute;
  bottom: 88px; left: 0; right: 0;
  z-index: 2;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  background: rgba(5, 6, 10, 0.4);
}
.hero__track {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 3px;
  color: var(--muted);
  width: max-content;
  animation: marquee 22s linear infinite;
}
.hero__track span:nth-child(even) { color: var(--magenta); }
@keyframes marquee { to { transform: translateX(-50%); } }

.hero__scroll {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 3px;
  color: var(--muted);
}
.hero__scrollline {
  width: 1px; height: 40px;
  background: linear-gradient(var(--cyan), transparent);
  animation: scrollPulse 1.8s var(--ease) infinite;
}
@keyframes scrollPulse {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ═══════════════════ BUTTONS ═══════════════════ */
.btn {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  padding: 14px 28px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  position: relative;
  overflow: hidden;
  transition: color 0.3s, box-shadow 0.3s;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cyan);
  transform: translateX(-101%);
  transition: transform 0.35s var(--ease);
  z-index: -1;
}
.btn:hover { color: var(--void); box-shadow: var(--glow-cyan); }
.btn:hover::before { transform: translateX(0); }

.btn--primary { background: rgba(0, 255, 240, 0.06); }
.btn--ghost { border-color: var(--magenta); color: var(--magenta); }
.btn--ghost::before { background: var(--magenta); }
.btn--ghost:hover { color: var(--void); box-shadow: var(--glow-mag); }
.btn--lg { padding: 20px 48px; font-size: 1rem; }

/* ═══════════════════ STATS ═══════════════════ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 40px 24px;
  text-align: center;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat__num {
  font-family: var(--tech);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  line-height: 1;
}
.stat__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 10px;
}

/* ═══════════════════ SECTION HEADS ═══════════════════ */
.section-head {
  max-width: 720px;
  margin: 0 auto clamp(48px, 8vw, 90px);
  text-align: center;
  padding: 0 20px;
}
.section-head__idx {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 4px;
  color: var(--magenta);
}
.section-head__title {
  font-family: var(--tech);
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 5rem);
  letter-spacing: -1px;
  margin: 12px 0 18px;
  text-transform: uppercase;
}
.section-head__desc { color: var(--muted); font-size: 1.05rem; }

section { padding: clamp(80px, 12vw, 160px) 0; }

/* ═══════════════════ BREWS ═══════════════════ */
.brews { padding-top: clamp(80px, 12vw, 160px); }
.brew-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  max-width: 1280px;
  margin: 0 auto;
}
.brew {
  background: var(--void-2);
  padding: 40px 32px 32px;
  position: relative;
  transition: background 0.3s, transform 0.3s var(--ease);
  transform-style: preserve-3d;
  overflow: hidden;
}
.brew::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 2px;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  transition: width 0.4s var(--ease);
}
.brew:hover { background: var(--panel); }
.brew:hover::after { width: 100%; }
.brew__id {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 2px;
}
.brew__glyph {
  font-size: 2.6rem;
  color: var(--magenta);
  margin: 16px 0 20px;
  text-shadow: var(--glow-mag);
  transition: transform 0.4s var(--ease);
}
.brew:hover .brew__glyph { transform: rotate(90deg) scale(1.1); color: var(--cyan); text-shadow: var(--glow-cyan); }
.brew__name {
  font-family: var(--tech);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.brew__desc { color: var(--muted); font-size: 0.94rem; margin-bottom: 28px; }
.brew__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}
.brew__price {
  font-family: var(--tech);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--acid);
}
.brew__meta { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 1px; }

/* ═══════════════════ LAB ═══════════════════ */
.lab { background: var(--void-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lab__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  max-width: 1280px;
  margin: 0 auto;
  border: 1px solid var(--line);
}
.lab-step {
  background: var(--void);
  padding: 44px 28px;
  position: relative;
  transition: background 0.3s;
}
.lab-step:hover { background: var(--panel); }
.lab-step__num {
  font-family: var(--tech);
  font-weight: 700;
  font-size: 3rem;
  color: transparent;
  -webkit-text-stroke: 1px var(--violet);
  line-height: 1;
  margin-bottom: 20px;
}
.lab-step:hover .lab-step__num { color: var(--violet); }
.lab-step__title {
  font-family: var(--tech);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--cyan);
  margin-bottom: 12px;
}
.lab-step__desc { color: var(--muted); font-size: 0.92rem; }

/* ═══════════════════ SIGNAL / MANIFESTO ═══════════════════ */
.signal { text-align: center; }
.signal__inner { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.signal__label {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 4px;
  color: var(--magenta);
  margin-bottom: 32px;
}
.signal__text {
  font-family: var(--tech);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.6vw, 2.8rem);
  line-height: 1.35;
  letter-spacing: -0.5px;
}
.signal__text .hl { color: var(--cyan); text-shadow: var(--glow-cyan); }
.signal__sig {
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 36px;
}

/* ═══════════════════ LINK / CTA ═══════════════════ */
.link__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 0 clamp(20px, 5vw, 40px);
}
.link-card {
  border: 1px solid var(--line);
  background: var(--void-2);
  padding: 36px 30px;
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
  transform-style: preserve-3d;
}
.link-card:hover { border-color: var(--cyan); background: var(--panel); }
.link-card__glyph {
  font-size: 2.4rem;
  color: var(--cyan);
  margin-bottom: 18px;
  text-shadow: var(--glow-cyan);
}
.link-card__title {
  font-family: var(--tech);
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.link-card__body { color: var(--muted); font-size: 0.96rem; margin-bottom: 18px; }
.link-card__meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--acid);
}
.link__cta { text-align: center; }

/* ═══════════════════ FOOTER ═══════════════════ */
.foot {
  border-top: 1px solid var(--line);
  padding: 50px clamp(20px, 5vw, 60px) 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.foot__line {
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}
.foot__line .glitch {
  font-family: var(--tech);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--cyan);
}
.foot__tag { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 3px; color: var(--muted); }
.foot__meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 1.5px;
  color: var(--dim);
  border-top: 1px solid var(--line-soft);
  padding-top: 20px;
}

/* ═══════════════════ GLITCH TEXT EFFECT ═══════════════════ */
.glitch { position: relative; display: inline-block; }
.glitch::before,
.glitch::after {
  content: attr(data-glitch);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  opacity: 0.9;
  pointer-events: none;
}
.glitch::before { color: var(--magenta); z-index: -1; }
.glitch::after { color: var(--cyan); z-index: -2; }
.glitch:hover::before { animation: glitchTop 0.4s steps(2) infinite; }
.glitch:hover::after { animation: glitchBot 0.4s steps(2) infinite; }
@keyframes glitchTop {
  0% { transform: translate(0); clip-path: inset(0 0 65% 0); }
  50% { transform: translate(-4px, -3px); clip-path: inset(0 0 55% 0); }
  100% { transform: translate(3px, 2px); clip-path: inset(0 0 70% 0); }
}
@keyframes glitchBot {
  0% { transform: translate(0); clip-path: inset(60% 0 0 0); }
  50% { transform: translate(4px, 3px); clip-path: inset(70% 0 0 0); }
  100% { transform: translate(-3px, -2px); clip-path: inset(55% 0 0 0); }
}

/* Continuous subtle glitch pulse on the hero title */
.hero__title.glitch::before { animation: glitchTop 3.5s steps(2) infinite; animation-play-state: paused; }
.hero__title.glitch { animation: heroShift 6s var(--ease) infinite; }
@keyframes heroShift {
  0%, 92%, 100% { transform: translate(0); }
  93% { transform: translate(-3px, 1px); }
  94% { transform: translate(3px, -1px); }
  95% { transform: translate(-2px, 0); }
  96% { transform: translate(0); }
}

/* ═══════════════════ SCROLL REVEAL ═══════════════════ */
[data-reveal] {
  opacity: 0;
  transform: translateY(38px);
  filter: blur(6px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .lab__steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .nav__links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 320px);
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    background: var(--void-2);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    font-size: 1.1rem;
    z-index: 7400;
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__burger { display: flex; z-index: 7600; }
  .nav.is-menu .nav__burger span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav.is-menu .nav__burger span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .lab__steps { grid-template-columns: 1fr; }
  .hero__marquee { bottom: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.1ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
}
