/* ── RESET & ROOT */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0D0F0B;
  --surface:    #151A12;
  --surface2:   #1C2318;
  --green:      #80FF00;
  --green-dim:  #5DB800;
  --border:     #2A3525;
  --muted:      #819274;
  --text:       #E8EAE3;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  cursor: none;
  overflow-x: hidden;
}

::selection { background: var(--green); color: var(--bg); }
a, button, input, select, textarea { accent-color: var(--green); }
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 12000;
  padding: 0.75rem 1rem;
  color: var(--bg);
  background: var(--green);
  font: 0.72rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.18s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ── CURSOR */
.cursor {
  position: fixed; width: 8px; height: 8px;
  background: var(--green); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: transform 0.1s ease, width 0.2s, height 0.2s;
}
.cursor-ring {
  position: fixed; width: 32px; height: 32px;
  border: 1px solid rgba(127,255,0,0.4); border-radius: 50%;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}
.cursor.hover { width: 14px; height: 14px; }
.cursor-ring.hover { width: 48px; height: 48px; border-color: rgba(127,255,0,0.7); }

/* ── NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 3rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
nav.scrolled { background: var(--surface); border-bottom-color: var(--border); }
.nav-logo { text-decoration: none; }
.nav-logo-mark {
  display: inline-grid;
}
.nav-logo-layer {
  grid-area: 1 / 1;
  height: 9rem;
  width: auto;
  display: block;
}
.nav-logo-layer--top {
  /* Top ~65%: printer + ZD — colourised to brand green #80FF00 */
  -webkit-clip-path: inset(0 0 35% 0);
  clip-path: inset(0 0 35% 0);
  filter: brightness(0) saturate(100%) invert(74%) sepia(100%) saturate(2000%) hue-rotate(52deg) brightness(1.05);
}
.nav-logo-layer--bottom {
  /* Bottom ~35%: white */
  -webkit-clip-path: inset(65% 0 0 0);
  clip-path: inset(65% 0 0 0);
  filter: brightness(0) invert(1);
}
.nav-links { list-style: none; display: flex; gap: 2.5rem; }
.nav-links a {
  text-decoration: none; color: var(--muted);
  font-family: var(--font-mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--green); }
.nav-cta {
  background: var(--green); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  padding: 0.6rem 1.5rem; text-decoration: none;
  font-weight: 500; transition: background 0.2s;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.nav-cta:hover { background: var(--green-dim); }
.nav-cta-current { background: var(--bg); color: var(--green); border: 1px solid var(--green); }
.nav-toggle { display: none; }
/* When nav-open, hide the hamburger bars (they animate to X via transforms
   below) and conversely keep the standalone X char hidden. We use the
   bars-as-X pattern so the redundant ".nav-toggle-x" element is hidden
   permanently. */
.nav-toggle-x { display: none; }

/* ── MESSAGES */
.site-messages {
  position: fixed; bottom: 2rem; right: 2rem;
  z-index: 500; display: flex; flex-direction: column; gap: 0.5rem;
  max-width: 400px;
}
.site-message {
  background: var(--surface); border: 1px solid var(--border);
  padding: 1rem 1.25rem; font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text); display: flex; justify-content: space-between; gap: 1rem;
  align-items: flex-start;
}
.site-message-success { border-color: var(--green); }
.site-message-error { border-color: #ff4444; }
.message-close {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 0;
  transition: color 0.2s;
}
.message-close:hover { color: var(--text); }

/* ── FOOTER */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 4rem 3rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: start;
  max-width: 100%;
}
.footer-brand-col { min-width: 0; }
.footer-brand p { color: var(--muted); font-size: 0.85rem; max-width: 28ch; line-height: 1.7; }
.footer-col-title {
  font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--green); text-transform: uppercase; letter-spacing: 0.2em;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col ul li, .footer-col ul a {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--muted); text-decoration: none; letter-spacing: 0.08em;
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--green); }
.footer-bottom {
  grid-column: 1 / -1; padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.footer-bottom p { font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted); letter-spacing: 0.1em; }

/* ── COMMON SECTIONS */
.section-tag {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--green); text-transform: uppercase; letter-spacing: 0.25em;
  margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem;
}
.section-tag::before { content: ''; display: block; width: 2rem; height: 1px; background: var(--green); }
.section-h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 0.92; margin-bottom: 1.5rem;
}

/* ── BUTTONS */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--green); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.18em;
  padding: 0.85rem 2rem; text-decoration: none; border: none;
  cursor: pointer; font-weight: 500; transition: background 0.2s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.btn-primary:hover { background: var(--green-dim); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  padding: 0.8rem 1.75rem; text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }

/* ── GRID TEXTURE */
.grid-texture {
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── SCROLL REVEAL (used by base.js on any page) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* The first screen is the shopfront sign: it must remain complete if JS is
   delayed, blocked, or fails. Scroll reveals are reserved for below-the-fold
   enhancement and never gate the page identity or primary action. */
.hero .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* ── PHOTO FRAMES (real photos, dark-theme treatment) */
.photo-frame {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: saturate(0.88) contrast(1.04);
}
.photo-frame::after {
  /* pull the photo into the page's colour world */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,15,11,0.18) 0%, transparent 35%, rgba(13,15,11,0.42) 100%);
  pointer-events: none;
}
.photo-caption {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--green); text-transform: uppercase; letter-spacing: 0.18em;
}

/* ── BRAND SWITCH LINK (ZDPrinting <-> ZDnD in nav) */
.nav-links a.nav-brand-switch {
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  color: var(--muted);
  font-size: 0.62rem;
  transition: border-color 0.2s, color 0.2s;
}
.nav-links a.nav-brand-switch:hover { border-color: var(--green); color: var(--green); }

/* ── REDUCED MOTION: kill the decorative movement, keep the content */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .marquee-track { animation: none !important; }
  .hero-accent-shape, .hero-accent-shape-2 { animation: none !important; }
  .cs-dot { animation: none !important; }
  .cursor, .cursor-ring { display: none !important; }
}

/* ── Global mobile-safety: prevent horizontal page scroll from any rogue
   wide content (oversized tables, embedded iframes, etc.) ────────────── */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe { max-width: 100%; height: auto; }

/* ── RESPONSIVE (mobile only — desktop unchanged) */
@media (max-width: 900px) {
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none !important; }

  nav { padding: 0.75rem 1rem; align-items: center; }
  /* Keep the open menu in the viewport on Mobile Safari, which can clip
     fixed descendants of a backdrop-filtered navigation element. */
  nav.nav-open {
    top: 0 !important;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: flex-start;
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1000;
  }
  nav.nav-open .nav-logo,
  nav.nav-open .nav-toggle { position: relative; z-index: 101; }
  .nav-logo-mark .nav-logo-layer { height: 5rem; }
  .nav-logo {
    min-height: 44px; min-width: 44px;
    display: inline-flex; align-items: center;
  }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px;
    background: none; border: none; color: var(--text);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle-bar {
    display: block; width: 22px; height: 2px; background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
  }
  nav.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  nav.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  nav.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .nav-links {
    display: none;
    position: absolute; inset: 0; min-height: 100%;
    background: var(--surface); flex-direction: column;
    justify-content: center; align-items: center; gap: 0;
    padding: 5rem 1.5rem 2rem; list-style: none;
    z-index: 99; overflow-y: auto;
  }
  nav.nav-open .nav-links { display: flex; }
  .nav-links a {
    min-height: 48px; min-width: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.9rem; padding: 0.75rem 1rem;
  }
  .nav-cta {
    min-height: 48px; padding: 0.75rem 1.5rem;
    margin-top: 1rem; font-size: 0.8rem;
  }
  .site-messages {
    left: 1rem; right: 1rem; bottom: 1rem; max-width: none;
  }
  .message-close { cursor: pointer; min-width: 44px; min-height: 44px; }
  /* Tablet: 2-column footer keeps scroll reasonable. Mobile (<=600px)
     drops to a single column further below. */
  footer { grid-template-columns: 1fr 1fr; padding: 3rem 1.5rem 2rem; gap: 1.75rem 2rem; }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-col ul a, .footer-links a {
    min-height: 44px; display: inline-flex; align-items: center;
    padding: 0.25rem 0;
  }
}
@media (max-width: 600px) {
  .nav-logo-mark .nav-logo-layer { height: 4rem; }
  .section-h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
  .btn-primary, .btn-outline {
    min-height: 48px; padding: 0.85rem 1.25rem;
    width: 100%; justify-content: center;
  }
  /* Single column on actual phones. */
  footer { grid-template-columns: 1fr; padding: 2.5rem 1rem 2rem; gap: 1.25rem; }
  .footer-brand-col { grid-column: auto; }
  .footer-brand { font-size: 1.6rem; }
  /* Make sure the logo + toggle + CTA fit on tight screens. */
  nav { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .nav-cta { padding: 0.65rem 1rem; font-size: 0.72rem; }
  .nav-logo-mark .nav-logo-layer { height: 3.5rem; }
}
@media (max-width: 360px) {
  /* Smallest phones: drop the CTA text size further so logo + toggle + CTA
     all fit without wrapping. */
  .nav-cta { padding: 0.55rem 0.75rem; font-size: 0.65rem; letter-spacing: 0.1em; }
  .nav-logo-mark .nav-logo-layer { height: 3rem; }
}

/* ── FOOTER BRAND TEXT */
.footer-brand-col p { color: var(--muted); font-size: 0.85rem; line-height: 1.7; margin-top: 0.5rem; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--green);
  text-decoration: none;
}
.footer-brand span { color: var(--text); }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { font-family: var(--font-body); font-size: 0.9rem; color: var(--text); text-decoration: none; opacity: 0.7; transition: opacity 0.2s, color 0.2s; }
.footer-links a:hover { opacity: 1; color: var(--green); }
.footer-links li { font-family: var(--font-body); font-size: 0.9rem; color: var(--muted); }
.footer-privacy-settings {
  appearance: none; padding: 0; border: 0; background: transparent;
  color: var(--text); opacity: 0.7; font: inherit; cursor: pointer;
  transition: opacity 0.2s, color 0.2s;
}
.footer-privacy-settings:hover, .footer-privacy-settings:focus-visible { opacity: 1; color: var(--green); }

/* ── OPTIONAL ANALYTICS CONSENT */
.analytics-consent {
  position: fixed; right: 1.25rem; bottom: 1.25rem; left: 1.25rem; z-index: 8000;
  max-width: 780px; margin: 0 auto; padding: 1.1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  background: var(--surface); border: 1px solid var(--green);
}
.analytics-consent[hidden] { display: none; }
.analytics-consent strong {
  display: block; margin-bottom: 0.25rem; color: var(--green);
  font-family: var(--font-mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.analytics-consent p { max-width: 54ch; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.analytics-consent-actions { display: flex; align-items: center; flex-shrink: 0; gap: 0.6rem; }
.analytics-consent-actions .btn-primary,
.analytics-consent-actions .btn-outline { padding: 0.65rem 0.9rem; white-space: nowrap; }
.analytics-consent-actions a { color: var(--muted); font-family: var(--font-mono); font-size: 0.62rem; }
@media (max-width: 720px) {
  .analytics-consent { align-items: stretch; flex-direction: column; }
  .analytics-consent-actions { align-items: stretch; flex-wrap: wrap; }
  .analytics-consent-actions .btn-primary,
  .analytics-consent-actions .btn-outline { flex: 1 1 auto; justify-content: center; }
}
