/**
 * ============================================================================
 * WEBSTYLES.CSS - Main Site Stylesheet (Optimized)
 * ============================================================================
 * @author Vu Nguyen
 * ============================================================================
 */

@charset "UTF-8";

/* =============================================================================
   CSS VARIABLES
   ============================================================================= */

:root {
  --color-text: #828282;
  --color-text-dark: #505050;
  --color-accent: #0e0e7b;
  --color-accent-hover: #003087;
  --font-base: 'Helvetica Neue', Helvetica, sans-serif;
  --font-size-base: 18px;
  --font-size-small: 14px;
  --line-height: 1.3em;
  --content-width: 572px; /* ~3 extra characters of 24px body text per side over 500px */
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: #fff;
  font-family: var(--font-base);
}

/* =============================================================================
   LAYOUT
   ============================================================================= */

.site-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  padding-bottom: max(2rem, 25vh); /* room below the text for the page-load graph */
  text-align: center;
  position: relative;
  z-index: 1; /* text and links sit above the graph */
}

.intro {
  text-align: justify;
  text-justify: inter-word;
  margin: 1.5rem 0;
}

.intro p { display: block; }

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */

p, ul {
  font: 300 var(--font-size-base)/var(--line-height) var(--font-base);
  color: var(--color-text);
  margin: 0;
}

h1, h2 {
  display: inline;
  font-family: var(--font-base);
  margin: 0;
}

h1 {
  font-weight: 700;
  font-stretch: condensed;
  font-size: 30px;
  color: var(--color-accent);
}

h2 {
  font-weight: 300;
  -webkit-text-stroke: 0.25px currentColor; /* between Light (300) and Regular (400) */
  font-size: 24px;
  line-height: 1.2em;
  color: var(--color-text);
}

/* =============================================================================
   LINKS
   ============================================================================= */

a {
  color: var(--color-text-dark);
  text-decoration: underline;
}

a:hover { text-decoration: none; }

/* Hidden link: reads exactly like the surrounding text */
a.hidden-link {
  color: inherit;
  text-decoration: none;
}

/* =============================================================================
   NAVIGATION
   ============================================================================= */

.nav-links {
  margin-bottom: 1rem;
}

.nav-links a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: var(--font-size-small);
}

.nav-links a:hover {
  color: var(--color-accent-hover);
}

.nav-sep {
  color: var(--color-text);
  font-size: var(--font-size-small);
  margin: 0 0.25rem;
}

/* =============================================================================
   CONTACT
   ============================================================================= */

.contact-line {
  font-size: var(--font-size-small);
  color: var(--color-text);
}

.contact-line a {
  color: var(--color-accent);
  text-decoration: none;
}

.contact-line a:hover {
  color: var(--color-accent-hover);
}

/* =============================================================================
   BROWNIAN MOTION
   ============================================================================= */

/* The whole window is the plane: clicks anywhere launch a batch */
html {
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Positioned on the page, not the window, so drawn paths scroll with the text;
   drawn behind the text */
#brownian-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

/* Axes fade out when idle */
#brownian-overlay .bm-axes {
  transition: opacity 0.4s ease;
}

#brownian-overlay.is-idle .bm-axes {
  opacity: 0;
  transition-duration: 2s;
}

#brownian-overlay .bm-fading {
  opacity: 0;
  transition: opacity 1.2s ease;
}

/* Pinned to the bottom of the window, whatever the scroll position */
.brownian-hint {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 11;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 10px;
  color: #aaa;
  cursor: inherit;
  transition: opacity 0.8s ease;
}

.brownian-hint:focus-visible {
  outline: 1px dotted #aaa;
  outline-offset: 4px;
}

.brownian-hint.is-hidden {
  opacity: 0;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 600px) {
  :root {
    --font-size-base: 19px;
    --font-size-small: 14px;
  }
  
  .site-container { padding: 1rem 0.5rem max(1rem, 25vh); }
  h1 { font-size: 26px; }
  h2 { font-size: 21px; }
}