/* ============================================================================
   Direction: REMY-DIRECT — Web 1.0 retro, ASCII parallax, button bevels.
   File: direction-remy-direct.css   v0.1   2026-05-01
   Layer ON TOP of base.css. Tokens are NOT redefined here — only component
   recipes are overridden. Source: 2026-05-01-aiwithremy-site-teardown.md.

   Free-font swap: VT323 / Pixelify Sans replace paid PP Neue Bit.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=VT323&family=Pixelify+Sans:wght@400;500;600;700&display=swap");

/* ---- Hero typography (pixel display) ---------------------------------- */
.hero-headline,
.remy .display,
[data-direction="remy"] .display {
  font-family: "Pixelify Sans", "VT323", "Courier New", monospace;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--text);
}

.remy-mono,
[data-direction="remy"] .mono {
  font-family: "VT323", "Courier New", monospace;
  letter-spacing: 0.02em;
}

/* ---- Bevel button (Web 1.0 raised) ----------------------------------- */
.btn-bevel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: inset -2px -2px 0 0 #E3E3E3;
  cursor: pointer;
  transition: box-shadow var(--motion-fast) var(--ease-standard);
}

.btn-bevel:hover {
  background: var(--surface);
}

.btn-bevel:active {
  box-shadow: inset 2px 2px 0 0 #E3E3E3;
}

.btn-bevel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-theme="dark"] .btn-bevel {
  box-shadow: inset -2px -2px 0 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .btn-bevel:active {
  box-shadow: inset 2px 2px 0 0 rgba(255, 255, 255, 0.08);
}

/* ---- ASCII scene (parallax background) -------------------------------- */
.ascii-scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ascii-scene__canvas {
  position: relative;
  width: 100%;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.1em;
  white-space: pre;
  user-select: none;
  color: var(--text-muted);
}

.ascii-sun {
  position: absolute;
  top: 2%;
  right: 3%;
}

.ascii-cloud {
  position: absolute;
  animation: cloudDrift 30s steps(60) infinite;
}

.ascii-cloud--1 { top:  6%; left:  2%; animation-duration: 50s; animation-delay:   0s; }
.ascii-cloud--2 { top: 24%; left: 12%; animation-duration: 55s; animation-delay: -12s; }
.ascii-cloud--3 { top: 35%; right:12%; animation-duration: 45s; animation-delay: -25s; }
.ascii-cloud--4 { top: 48%; left:  5%; animation-duration: 48s; animation-delay:  -8s; }
.ascii-cloud--5 { top: 58%; right: 6%; animation-duration: 52s; animation-delay: -18s; }

@keyframes cloudDrift {
  0%   { transform: translateX(0);    }
  100% { transform: translateX(80px); }
}

.ascii-plane {
  position: absolute;
  top: 38vh;
  left: -420px;
  animation: planeFly 22s steps(110) infinite;
}

@keyframes planeFly {
  0%   { left: -420px;             opacity: 0; }
  2%   {                            opacity: 1; }
  96%  {                            opacity: 1; }
  100% { left: calc(100% + 100px); opacity: 0; }
}

.ascii-terminal__cursor {
  display: inline-block;
  animation: cursorBlink 1s steps(1) infinite;
}

@keyframes cursorBlink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* D20: ASCII scene visibility on mobile is now controlled in
   animations.css (kept visible, sized down). The blanket hide
   that previously lived here is removed. */

/* ---- Mac window chrome (VSL container) ------------------------------- */
.mac-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

.mac-window__titlebar {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mac-window__dots {
  display: flex;
  gap: 6px;
}

.mac-window__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
  border: 1px solid var(--border-strong);
}

.mac-window__content {
  aspect-ratio: 16 / 9;
  background: var(--bg);
}

/* Email-window variant ------------------------------------------------- */
.email-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.email-window__titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.email-window__fields {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.email-window__fields > div {
  padding: 2px 0;
}

.email-window__body {
  padding: 16px;
  font-size: var(--text-md);
  line-height: var(--lh-md);
  color: var(--text);
}

/* ---- Page-end dither (two inline-SVG patterns + mask) ---------------- */
.page-end__dither {
  height: 100px;
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect x='0' y='0' width='1' height='1' fill='%23AAAAAA'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect x='2' y='2' width='1' height='1' fill='%23AAAAAA'/%3E%3C/svg%3E");
  background-size: 4px 4px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
          mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
}

[data-theme="dark"] .page-end__dither {
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect x='0' y='0' width='1' height='1' fill='%23555555'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect x='2' y='2' width='1' height='1' fill='%23555555'/%3E%3C/svg%3E");
}

/* ---- Newsletter signup (hero form) ----------------------------------- */
.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
}

.newsletter-form input[type="email"] {
  flex: 1;
  border-color: var(--border-strong);
}

.newsletter-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 12px;
}

.newsletter-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%      { opacity: 0.6; transform: scale(0.85); }
}

/* ---- Hero badge ------------------------------------------------------- */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}

/* ---- Audio hook stubs (Web Audio API targets) ------------------------ */
/* JS hooks expect these audio elements somewhere in the DOM tree:
   <audio id="button-press"   src="/assets/audio/button-press.mp3"   preload="auto"></audio>
   <audio id="button-release" src="/assets/audio/button-release.mp3" preload="auto"></audio>
   <audio id="error-sound"    src="/assets/audio/error-sound.mp3"    preload="auto"></audio>
   Selectors that trigger them: .btn-bevel, .accordion-header, .btn--primary    */

.has-sound {
  /* sentinel marker — JS audio handler attaches mousedown/mouseup/keydown */
  cursor: pointer;
}

/* Accordion -------------------------------------------------------------- */
.accordion {
  border-top: 1px solid var(--border);
}

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.accordion-header[aria-expanded="true"] .accordion-icon::before { content: "[-]"; }
.accordion-header[aria-expanded="false"] .accordion-icon::before { content: "[+]"; }

.accordion-content {
  display: none;
  padding: 0 0 16px;
  color: var(--text-muted);
  font-size: var(--text-md);
  line-height: var(--lh-md);
}

.accordion-item.active .accordion-content {
  display: block;
}

/* ---- Hero stagger fade-in -------------------------------------------- */
.hero > * {
  opacity: 0;
  animation: heroFadeIn 400ms var(--ease-out) forwards;
}

.hero > *:nth-child(1) { animation-delay:  80ms; }
.hero > *:nth-child(2) { animation-delay: 160ms; }
.hero > *:nth-child(3) { animation-delay: 240ms; }
.hero > *:nth-child(4) { animation-delay: 320ms; }
.hero > *:nth-child(5) { animation-delay: 400ms; }

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ---- Print clipping safety (remy direction — pixel descenders) ------ */
@media print {
  .hero-headline,
  .remy .display,
  [data-direction="remy"] .display {
    line-height: 1.1 !important;
    padding-bottom: 0.1em;
  }
  /* Pixelify Sans / VT323 inline samples at 28px+ — descender pad */
  [style*="Pixelify Sans"],
  [style*="VT323"] {
    padding-bottom: 0.08em;
  }
}

/* ---- Mobile responsive collapse (remy direction) -------------------- */
@media (max-width: 640px) {
  /* D20: keep .ascii-scene visible on mobile (animations.css handles sizing). */
  /* Mac-window must not exceed viewport */
  .mac-window,
  .email-window {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .mac-window__content {
    max-width: 100%;
  }
  /* Newsletter form stack */
  .newsletter-form {
    flex-direction: column;
    max-width: 100%;
  }
  .hero-headline,
  .remy .display,
  [data-direction="remy"] .display {
    font-size: clamp(2rem, 9vw, 3rem);
  }
}
