/* ============================================================
   hagBOT.tech — design tokens
   ============================================================ */
:root {
  --ink:        #000000;   /* page background, outside the monitor */
  --screen:     #060606;   /* inner screen background */
  --screen-2:   #111111;   /* card / tile background */
  --pink:       #e31c9c;
  --pink-dim:   #9c1170;
  --green:      #39ff14;
  --green-dim:  #1f8f0c;
  --cream:      #ffffff;
  --yellow:     #ffd84d;
  --orange:     #ff7a1a;
  --muted:      #b7a9c2;
  --line:       #333333;

  --font-display: 'Press Start 2P', 'Courier New', monospace;
  --font-body:    'VT323', 'Courier New', monospace;

  --radius: 0;
  --gap: clamp(1rem, 2vw, 1.75rem);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
}

img { image-rendering: pixelated; }

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

/* ============================================================
   Outer shell + monitor frame (signature element)
   ============================================================ */
.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
}

.monitor {
  position: relative;
  width: 100%;
  max-width: 1180px;
}

.monitor-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at 50% 30%, rgba(227,28,156,0.25), transparent 60%);
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}

.browser-frame {
  position: relative;
  z-index: 1;
  border: 3px solid var(--line);
  background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
  box-shadow:
    0 0 0 1px rgba(227,28,156,0.25),
    0 30px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(180deg, #262626, #141414);
  border-bottom: 2px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--muted);
}
.title-bar-dots { display: flex; gap: 0.4rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-pink   { background: var(--pink); }
.dot-yellow { background: var(--yellow); }
.dot-green  { background: var(--green); }
.title-bar-label {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.title-bar-nav { display: flex; gap: 0.6rem; color: var(--muted); opacity: 0.7; }

.address-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0.75rem;
  padding: 0.35rem 0.6rem;
  background: #0a0a0a;
  border: 1px solid var(--line);
  font-size: 1rem;
  color: var(--green);
}
.address-lock { opacity: 0.8; }
.address-text { flex: 1; }
.address-go {
  font-family: var(--font-display);
  font-size: 0.55rem;
  background: var(--pink);
  color: var(--ink);
  padding: 0.3rem 0.5rem;
}

/* loading bar plays once on page load */
.loading-bar {
  position: relative;
  height: 26px;
  margin: 0 0.75rem 0.75rem;
  background: #0a0a0a;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: opacity 0.4s ease, height 0.4s ease, margin 0.4s ease;
}
.loading-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: repeating-linear-gradient(45deg, var(--green), var(--green) 8px, var(--green-dim) 8px, var(--green-dim) 16px);
  animation: fillUp 1.1s ease forwards;
}
.loading-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.55rem;
  line-height: 26px;
  text-align: center;
  color: var(--ink);
  mix-blend-mode: difference;
}
@keyframes fillUp { from { width: 0%; } to { width: 100%; } }
.loading-bar.is-done {
  opacity: 0;
  height: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
}

/* ============================================================
   Screen (actual page content)
   ============================================================ */
.screen {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(227,28,156,0.10), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(57,255,20,0.08), transparent 55%),
    var(--screen);
  min-height: 70vh;
  overflow: hidden;
}

.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.16) 0px,
    rgba(0,0,0,0.16) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* marquee ticker */
.marquee-wrap {
  background: var(--pink);
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 2px solid var(--line);
}
.marquee {
  display: inline-block;
  padding: 0.35rem 0;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  animation: scrollLeft 32s linear infinite;
}
.marquee span { padding-right: 2rem; }
@keyframes scrollLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* header / nav */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 3vw, 2.5rem) 0.5rem;
  position: relative;
  z-index: 6;
}
.brand {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
}
.brand-hag { color: var(--cream); }
.brand-bot { color: var(--pink); }

.site-nav { display: flex; gap: clamp(1rem, 2vw, 2rem); font-size: 1.3rem; }
.site-nav a { color: var(--muted); border-bottom: 2px solid transparent; padding-bottom: 2px; transition: color .15s, border-color .15s; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--green); border-color: var(--green); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--cream); display: block; }

/* hero */
.hero { padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2.5rem); position: relative; z-index: 6; }
.hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}
.portrait-tag {
  position: absolute;
  bottom: 6px; right: 6px;
  background: var(--pink);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.55rem;
  padding: 0.2rem 0.4rem;
}

.portrait-frame {
  position: relative;
  width: clamp(140px, 22vw, 220px);
  border: 3px solid var(--green);
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--pink);
  overflow: hidden;
  justify-self: start;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}
.portrait-frame:hover, .portrait-frame:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--green);
}
.portrait {
  width: 100%; display: block;
  transition: opacity .3s ease;
}
.portrait.is-fading { opacity: 0; }
.portrait-expand {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(10,8,12,0.75);
  color: var(--green);
  font-family: var(--font-display);
  font-size: 0.5rem;
  padding: 0.25rem 0.4rem;
  opacity: 0;
  transition: opacity .15s ease;
}
.portrait-frame:hover .portrait-expand,
.portrait-frame:focus-visible .portrait-expand { opacity: 1; }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(5,4,6,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  /* visibility (not just opacity) so the close button leaves the tab order when shut */
  visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
  cursor: pointer;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
  transition: opacity .2s ease, visibility 0s;
}
.lightbox img {
  max-width: min(90vw, 640px);
  max-height: 72vh;
  width: auto;
  border: 3px solid var(--green);
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--pink);
  image-rendering: pixelated;
  cursor: default;
}
.lightbox-caption {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--muted);
}
.lightbox-close {
  position: absolute;
  top: 1.25rem; right: 1.5rem;
  background: none;
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 1.5rem;
  line-height: 1;
  width: 40px; height: 40px;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(57,255,20,0.15); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--green);
  margin: 0 0 0.6rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 3rem);
  color: var(--yellow);
  margin: 0 0 0.35rem;
  line-height: 1.15;
  text-shadow: 3px 3px 0 var(--pink-dim);
}
.hero-title .dim { color: var(--cream); }
.hero-sub {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--muted);
  margin: 0 0 1rem;
}
.hero-bio {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.5;
  max-width: 60ch;
  color: var(--cream);
  margin: 0 0 1.5rem;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.btn {
  font-family: var(--font-display);
  font-size: 0.65rem;
  padding: 0.85rem 1.1rem;
  display: inline-block;
  border: 2px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }
.btn-primary { background: var(--pink); color: var(--ink); box-shadow: 3px 3px 0 var(--pink-dim); }
.btn-primary:hover { box-shadow: 5px 5px 0 var(--pink-dim); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-ghost:hover { background: rgba(57,255,20,0.1); }

/* section titles */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--cream);
  margin: 0 0 0.35rem;
}
.section-title span { color: var(--green); }
.section-sub { color: var(--muted); font-size: 1.15rem; margin: 0 0 1.25rem; }

/* directory */
.directory { padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2.5rem); position: relative; z-index: 6; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--gap);
}

.tile {
  position: relative;
  background: var(--screen-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tile:hover, .tile:focus-visible {
  border-color: var(--pink);
  transform: translateY(-3px);
  box-shadow: 0 8px 0 rgba(0,0,0,0.35), 0 0 0 2px var(--pink) inset;
}
.tile-icon { width: 48px; height: 48px; image-rendering: pixelated; margin-bottom: 0.25rem; }
.tile-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--cream);
  line-height: 1.4;
}
.tile-desc { font-size: 1.1rem; color: var(--muted); line-height: 1.35; }

.tile-status {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  font-family: var(--font-display);
  font-size: 0.5rem;
  padding: 0.25rem 0.4rem;
}
.tile-status.live { background: var(--green); color: var(--ink); }
.tile-status.soon { background: var(--orange); color: var(--ink); }

.tile.is-disabled { opacity: 0.65; cursor: not-allowed; }
.tile.is-disabled:hover { transform: none; border-color: var(--line); box-shadow: none; }

/* webring */
.webring { padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2.5rem) 0.5rem; position: relative; z-index: 6; }
.webring-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--screen-2);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.ring-btn {
  font-family: var(--font-display);
  font-size: 0.6rem;
  background: var(--ink);
  color: var(--green);
  border: 2px solid var(--green);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ring-btn:hover, .ring-btn:focus-visible { background: var(--green); color: var(--ink); }
.ring-mid { text-align: center; flex: 1; min-width: 200px; }
.ring-badge { display: block; color: var(--yellow); font-size: 1.2rem; }
.ring-note { display: block; color: var(--muted); font-size: 1rem; }

/* footer */
.site-footer { padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2.5rem) 2rem; position: relative; z-index: 6; }
.hagmoji-strip-wrap {
  overflow: hidden;
  margin-bottom: 1.25rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.hagmoji-strip {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  opacity: 0.9;
  animation: scrollLeft 26s linear infinite;
}
.hagmoji-strip img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: 1.05rem;
  color: var(--muted);
}
.hit-counter {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--green);
  background: #0a0a0a;
  border: 1px solid var(--line);
  padding: 0.4rem 0.6rem;
}
.blink-tag {
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--pink);
  animation: blink 1.4s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

/* toast (for the disabled tile) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--pink);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.6rem;
  padding: 0.75rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* portal / cave easter egg */
.portal {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  position: relative;
  z-index: 6;
}
.portal-box {
  position: relative;
  background: #050604;
  border: 2px solid #123a17;
  border-radius: var(--radius);
  padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
  text-align: center;
  overflow: hidden;
}
.portal-ring {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 1px; height: 1px;
}
.portal-ring .ring {
  position: absolute;
  left: 50%; top: 50%;
  border: 1px solid rgba(57,255,20,0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ringPulse 3.2s ease-in-out infinite;
}
.ring.r1 { width: 140px; height: 140px; animation-delay: 0s; }
.ring.r2 { width: 260px; height: 260px; animation-delay: .5s; }
.ring.r3 { width: 400px; height: 400px; animation-delay: 1s; }
@keyframes ringPulse {
  0%, 100% { opacity: 0.15; transform: translate(-50%,-50%) scale(0.96); }
  50% { opacity: 0.55; transform: translate(-50%,-50%) scale(1.04); }
}
.portal-eyebrow {
  position: relative;
  font-size: 1.15rem;
  color: #6fae76;
  margin: 0 0 1rem;
}
.portal-link {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 2vw, 1.05rem);
  color: var(--green);
  text-shadow: 0 0 10px rgba(57,255,20,0.7);
  padding: 1rem 1.5rem;
  border: 2px solid var(--green);
  background: rgba(57,255,20,0.06);
  transition: background .2s ease, box-shadow .2s ease;
}
.portal-link:hover, .portal-link:focus-visible {
  background: rgba(57,255,20,0.15);
  box-shadow: 0 0 24px rgba(57,255,20,0.35);
}
.portal-link .chev { color: var(--cream); }
.portal-note {
  position: relative;
  color: #5c7a5f;
  font-size: 1rem;
  margin: 1rem 0 0;
}

/* cave transition overlay */
.cave-transition {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.cave-transition.is-active {
  opacity: 1;
  pointer-events: all;
}
.cave-transition canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cave-transition-text {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 3vw, 1.4rem);
  color: var(--green);
  text-shadow: 0 0 12px rgba(57,255,20,0.8);
  opacity: 0;
  transition: opacity .3s ease;
  white-space: nowrap;
}
.cave-transition.is-active .cave-transition-text { opacity: 1; }

/* ============================================================
   Shop page
   ============================================================ */
.shop-hero-text { max-width: 62ch; }

.shop { padding: clamp(1.5rem, 4vw, 2.5rem); position: relative; z-index: 6; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--gap);
}

.product {
  position: relative;
  background: var(--screen-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.product:not(.is-disabled):hover { border-color: var(--pink); transform: translateY(-3px); }
.product.is-disabled { opacity: 0.8; }

.product-featured { grid-column: span 2; flex-direction: row; align-items: stretch; }
.product-featured .product-image { width: 42%; object-fit: cover; }
.product-featured .product-body { flex: 1; }

.product-badge {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.5rem;
  padding: 0.25rem 0.45rem;
}
.product-badge.live { background: var(--green); color: var(--ink); }
.product-badge.soon { background: var(--orange); color: var(--ink); }

.product-image { width: 100%; display: block; }

.product-mock {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, #141414, #141414 10px, #1b1b1b 10px, #1b1b1b 20px);
}
.product-mock img { image-rendering: pixelated; }
.product-mock--sheet { gap: 0.6rem; flex-wrap: wrap; padding: 1rem; }
.product-mock--sheet img { width: 44px; height: 44px; }

.tote-shape, .tee-shape {
  width: 90px; height: 100px;
  background: #333333;
  border: 2px solid var(--muted);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.tote-shape::before {
  content: "";
  position: absolute; top: -18px; left: 18px;
  width: 54px; height: 20px;
  border: 2px solid var(--muted);
  border-bottom: none;
}
.tee-shape { clip-path: polygon(20% 0%, 35% 0%, 50% 12%, 65% 0%, 80% 0%, 100% 22%, 82% 34%, 78% 26%, 78% 100%, 22% 100%, 22% 26%, 18% 34%, 0% 22%); }
.tote-shape img, .tee-shape img { width: 34px; height: 34px; image-rendering: pixelated; }

.product-body { padding: 1.1rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; }
.product-name { font-family: var(--font-display); font-size: 0.75rem; color: var(--cream); margin: 0; line-height: 1.4; }
.product-desc { font-size: 1.1rem; color: var(--muted); line-height: 1.4; margin: 0; }
.product-meta { display: flex; align-items: center; gap: 0.75rem; }
.product-price { font-family: var(--font-display); font-size: 0.85rem; color: var(--yellow); }
.product-tag { font-size: 0.95rem; color: var(--muted); border: 1px solid var(--line); padding: 0.1rem 0.4rem; }
.product-ctas { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.25rem; }

@media (max-width: 760px) {
  .product-featured { grid-column: span 1; flex-direction: column; }
  .product-featured .product-image { width: 100%; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .hero-card { grid-template-columns: 1fr; }
  .portrait-frame { width: 150px; }
  .site-nav {
    position: absolute;
    top: 100%; right: 0;
    background: var(--screen-2);
    border: 1px solid var(--line);
    flex-direction: column;
    padding: 1rem 1.5rem;
    display: none;
    gap: 0.75rem;
    z-index: 20;
  }
  .site-nav.is-open { display: flex; }
  .nav-toggle { display: flex; }
  .webring-box { flex-direction: column; text-align: center; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .marquee { animation: none; }
  .hagmoji-strip { animation: none; }
  .blink-tag { animation: none; }
  .loading-fill { animation: none; width: 100%; }
  .btn:hover { transform: none; }
  .ring { animation: none; opacity: 0.25; }
}
