/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles — EquiBurst 2026
   ========================================================================== */

/* --- Reset & base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  cursor: crosshair;
}

/* ─── Canvas ─────────────────────────────────────────────────────────── */
#burst-canvas {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ─── Ripple canvas ──────────────────────────────────────────────────── */
#ripple-canvas {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ─── Intro splash ───────────────────────────────────────────────────── */
#intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #000;
  pointer-events: none;

  animation: introOut 0.7s 2.2s cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes introOut {
  to { opacity: 0; visibility: hidden; }
}

#intro-title {
  font-family: 'Space Mono', monospace;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 6rem);
  letter-spacing: -0.03em;
  color: #fff;
  animation: introTitleIn 1.1s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes introTitleIn {
  from { opacity: 0; transform: translateY(30px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

#intro-sub {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
  font-size: clamp(0.62rem, 1.8vw, 0.88rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  animation: introSubIn 1s 0.8s ease both;
}

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

/* ─── Impact counter ─────────────────────────────────────────────────── */
#counter {
  position: fixed;
  bottom: 1.6rem;
  right: 1.8rem;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  pointer-events: none;
  user-select: none;
  animation: taglinePulse 1.6s 1s ease both;
}

#counter-num {
  font-family: 'Space Mono', monospace;
  font-style: italic;
  font-size: clamp(1.5rem, 3.5vw, 2.6rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
  transition: color 0.4s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#counter-num.bump {
  color: rgba(255, 255, 255, 0.75);
  transform: scale(1.18);
}

#counter-label {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
  font-size: clamp(0.5rem, 1vw, 0.65rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.18);
}

/* ─── Full-screen colour flash ───────────────────────────────────────── */
#screen-flash {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;

  /* colour & gradient injected by JS */
  background: transparent;
  opacity: 0;

  /* Flash in fast, breathe out slowly */
  transition: opacity 0.08s ease-out;
}

#screen-flash.flashing {
  opacity: 1;
  transition: opacity 0.08s ease-out;
}

#screen-flash.fading {
  opacity: 0;
  transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Film-grain overlay ─────────────────────────────────────────────── */
#grain {
  position: fixed;
  inset: -30%;          /* oversized so it can be shifted without edge gaps */
  width: 160%;
  height: 160%;
  z-index: 6;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  animation: grainShift 0.12s steps(1) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0,    0);   }
  10%  { transform: translate(-3%,  2%);  }
  20%  { transform: translate(2%,  -3%);  }
  30%  { transform: translate(-4%,  1%);  }
  40%  { transform: translate(3%,   3%);  }
  50%  { transform: translate(-1%, -2%);  }
  60%  { transform: translate(4%,  -1%);  }
  70%  { transform: translate(-2%,  4%);  }
  80%  { transform: translate(1%,  -4%);  }
  90%  { transform: translate(-3%, -3%);  }
  100% { transform: translate(0,    0);   }
}

/* ─── Quote overlay — glassmorphism card ────────────────────────────── */
#quote-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 2rem clamp(1.5rem, 8vw, 12rem);
  pointer-events: none;
  user-select: none;

  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#quote-overlay.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#quote-overlay.fading {
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  transition: opacity 1.1s ease-in,
              transform 1.1s ease-in;
}

/* Inner card with glass effect */
#quote-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: clamp(1.4rem, 4vw, 2.8rem) clamp(1.8rem, 6vw, 4.5rem);
  border-radius: 20px;
  max-width: min(780px, 90vw);

  /* Glass */
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#quote-text {
  font-family: 'Space Mono', monospace;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 2.6vw, 2rem);
  line-height: 1.65;
  text-align: center;
  color: #fff;
  /* colour tint injected via JS */
}

#quote-text::before { content: '\201C'; margin-right: 0.05em; }
#quote-text::after  { content: '\201D'; margin-left:  0.05em; }

#quote-author {
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-weight: 300;
  font-size: clamp(0.62rem, 1.3vw, 0.82rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Thin decorative rule under the quote */
#quote-rule {
  width: 40px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.4;
  /* colour set via JS to match palette */
}

/* ─── Corner tagline ─────────────────────────────────────────────────── */
#tagline {
  position: fixed;
  bottom: 1.6rem;
  left: 1.8rem;
  z-index: 30;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
  font-size: clamp(0.55rem, 1.2vw, 0.72rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  user-select: none;
}

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

#tagline { animation: taglinePulse 1.6s 1s ease both; }

/* ─── Idle aurora (very subtle ambient glow before first click) ──────── */
#aurora {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  background: radial-gradient(ellipse 120% 60% at 50% 110%,
    hsl(270 60% 40%) 0%,
    hsl(210 80% 30%) 40%,
    transparent 70%);
  animation: auroraDrift 12s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  0%   { transform: scaleX(1)   scaleY(1)   translateY(0);   filter: hue-rotate(0deg);   }
  50%  { transform: scaleX(1.1) scaleY(1.05) translateY(-2%); filter: hue-rotate(30deg); }
  100% { transform: scaleX(0.9) scaleY(1.1) translateY(2%);  filter: hue-rotate(-30deg); }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   EquiBurst UI — About · Share · Toast · Reduced Motion
   ========================================================================== */

/* ─── Shared button base ─────────────────────────────────────────────── */
#about-btn,
#share-btn {
  position: fixed;
  top: 1.6rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.5);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  animation: taglinePulse 1.6s 1.2s ease both;
}

#about-btn:hover,
#share-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
}

#about-btn {
  right: 1.8rem;
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  font-style: italic;
  font-family: 'Space Mono', monospace;
}

#share-btn {
  left: 1.8rem;
  padding: 0.45rem 1rem;
}

#share-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ─── About modal backdrop ───────────────────────────────────────────── */
#about-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#about-modal.open {
  opacity: 1;
  visibility: visible;
}

/* ─── About glass card ───────────────────────────────────────────────── */
#about-card {
  position: relative;
  max-width: 520px;
  width: 100%;
  padding: clamp(2rem, 5vw, 3rem);
  border-radius: 24px;
  background: rgba(12, 12, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);

  transform: translateY(20px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#about-modal.open #about-card {
  transform: translateY(0) scale(1);
}

#about-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#about-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

#about-title {
  font-family: 'Space Mono', monospace;
  font-style: italic;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

#about-tagline-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 1.4rem;
}

#about-body {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.6rem;
}

#about-tech {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.8rem;
  padding: 1.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

#about-tech li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

#about-tech span {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  min-width: 90px;
}

#about-credit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.06em;
}

#about-credit strong {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

/* ─── Share toast ────────────────────────────────────────────────────── */
#share-toast {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 50;
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Accessibility: reduce motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #grain        { animation: none; opacity: 0.03; }
  #aurora       { animation: none; }
  #intro        { animation: none; opacity: 0; visibility: hidden; }
  #quote-overlay,
  #about-modal  { transition: opacity 0.2s ease; }
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
