/* ---------------------------------------------------------------
   etyper — preview site, monochrome dot-raster flavour.
   Visual brief:
   - Pure black on pure white. No accent colour.
   - Perfect DOS VGA 437 throughout. One face, one weight.
   - The only background texture is a fine dot raster, rendered
     in CSS as a single tiled radial-gradient. No scanlines, no
     status bars, no chrome — just the column.
   --------------------------------------------------------------- */

@font-face {
  font-family: "Perfect DOS VGA";
  src: url("fonts/PerfectDOSVGA437.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* ---------------------------------------------------------------
   Pixel font candidates:
   * BODY ("--font-pixel") — used for spec block, signup form, hint:
       1. Departure Mono   — rounded pixel mono, currently active. SIL OFL.
       2. Pixeloid Mono    — softly-rounded pixel mono, on standby. SIL OFL.
       3. VT323            — DEC VT terminal-flavour pixel mono, on standby. SIL OFL.
       4. Perfect DOS VGA  — original face, still in fallback chain.
   * DISPLAY ("--font-display") — used for the hero title only:
       Curved Pixel — by Leandro Rodrigo, distributed via Behance with
       the note "Use for free. Thanks! ;)". Free but NOT a formal OFL
       licence — confirm with the author before any high-stakes
       commercial use. Falls back to --font-pixel if it fails to load.

   To swap a candidate, reorder the family names in either variable.
   --------------------------------------------------------------- */

/* Curved Pixel — currently active. */
@font-face {
  font-family: "Curved Pixel";
  src: url("fonts/CurvedPixel.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* Pixeloid Mono — currently active. */
@font-face {
  font-family: "Pixeloid Mono";
  src: url("fonts/PixeloidMono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* Departure Mono — kept in the project for easy swap. */
@font-face {
  font-family: "Departure Mono";
  src: url("fonts/DepartureMono-Regular.woff2") format("woff2"),
       url("fonts/DepartureMono-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* VT323 — kept in the project for easy swap. */
@font-face {
  font-family: "VT323";
  src: url("fonts/VT323-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --c-bg:   #ffffff;
  --c-fg:   #000000;
  --c-dim:  #6f6f6f;          /* secondary / hint text */

  /* Cross raster. Bigger --dot-cell = sparser raster.
     The mark is now a small "+" instead of a dot; --dot-alpha
     is bumped slightly because crosses cover more pixels than
     a single-pixel dot at the same perceptual weight. */
  --dot-cell:  40px;
  --dot-alpha: 0.22;

  --col-w: 40rem;
  --gutter: 1.25rem;

  --font-pixel: "Departure Mono", "Pixeloid Mono", "VT323", "Perfect DOS VGA", ui-monospace, "Cascadia Mono", "Consolas", monospace;
  --font-display: "Curved Pixel", var(--font-pixel);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  /* Pixel fonts hate sub-pixel AA — kill it on every surface. */
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  text-rendering: geometricPrecision;
  font-size: 16px;
}

body {
  font-family: var(--font-pixel);
  font-weight: 400;
  color: var(--c-fg);
  background-color: var(--c-bg);
  line-height: 1.25;
  min-height: 100vh;
  letter-spacing: 0;
  image-rendering: pixelated;

  /* Cross raster:
     A small "+" stamped at each cell origin, drawn as an inline
     SVG so the arms stay crisp on any DPI. The viewBox now matches
     --dot-cell (40x40) so the cross size stays fixed in pixels even
     as the spacing widens; arms are 1-unit-thick, 5 units long. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><g fill='%23000' fill-opacity='0.22'><rect x='2' y='0' width='1' height='5'/><rect x='0' y='2' width='5' height='1'/></g></svg>");
  background-size: var(--dot-cell) var(--dot-cell);
  background-position: 0 0;
}

/* ---------- Layout ---------- */

main {
  position: relative;
  max-width: var(--col-w);
  margin: 0 auto;
  padding: 4rem var(--gutter) 3rem;
}

/* ---------- Hero ---------- */

.hero { text-align: center; }

.hero__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 4rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--c-fg);
  font-weight: 400;        /* pixel font has one weight */
}
.hero__title-text {
  /* inline-block + relative makes the span exactly ETYPER-wide so
     the parent h1's text-align: center centers ETYPER itself; the
     caret then hangs off the right edge via absolute positioning
     without contributing to layout width. */
  color: var(--c-fg);
  display: inline-block;
  position: relative;
}
.hero__caret {
  /* Full-cell DOS block cursor, blinks once per second on a
     hard step (no easing) the way a real BIOS cursor did.
     Absolutely positioned just past ETYPER so it cannot push
     the title off-centre. */
  color: var(--c-fg);
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 0.05em;
  animation: blink 1s steps(1) infinite;
}

.hero__lede {
  margin: 0 0 2rem;
  color: var(--c-fg);
  /* Matched to .specs__box so the subtitle and the spec sheet
     read at the same visual weight; uses the body --font-pixel
     so only the ETYPER header gets the Curved Pixel display face. */
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  /* All-caps so the lede stays in rhythm with ETYPER above and
     the spec block below. The slight letter-spacing bump gives
     the caps a touch more breathing room. */
  text-transform: uppercase;
}

.hero__figure {
  /* No card chrome — the figure is just a centred container that
     stacks the four views. Aspect-ratio matches the cropped canvas
     they share (1400 × 1450) so the layout box does not jump as
     views cycle. The dot raster on <body> sits behind the figure;
     each .hero__shot composites *over* the raster (no blend mode),
     so the device reads as a foreground object instead of being
     punched through by the dotted texture. */
  margin: 0 auto;
  position: relative;
  width: 100%;
  max-width: 640px;
  padding: 0;
  background: transparent;
  aspect-ratio: 640 / 600;
}

/* Cycle stack: all four views are layered in the same box; the
   active one is opaque and centred, the rest sit horizontally
   blurred and translated slightly to the right so they read as
   "off-screen" frames in a sideways pass. JS swaps `.is-current`
   on a fixed cadence; the transitions below shape the swipe.
     – Reveal pace: ~5 s per view (see script.js HERO_INTERVAL_MS)
     – Cross-fade window: 600 ms.
     – Blur direction: pure X (#etyper-blur-sideways in index.html
       uses feGaussianBlur stdDeviation="55 0"). */
.hero__shot {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: url(#etyper-blur-sideways);
  transform: translateX(40px);
  transition: opacity 600ms ease, transform 600ms ease, filter 600ms ease;
  will-change: opacity, transform, filter;
}
.hero__shot.is-current {
  opacity: 1;
  filter: none;
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .hero__shot {
    transition: none;
  }
}

/* ---------- Specs box (ASCII art) ---------- */

.specs { margin: 2.5rem 0; display: flex; justify-content: center; }
.specs__box {
  margin: 0;
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 1.15rem;
  color: var(--c-fg);
  background: transparent;
  white-space: pre;
  line-height: 1.2;
  letter-spacing: 0;
}

/* ---------- Signup ---------- */

.signup {
  margin: 2rem auto 0;
  max-width: 28rem;
}
.signup__label {
  display: block;
  color: var(--c-fg);
  margin-bottom: 0.4rem;
  /* Matches the .hero__features font-size and letter-spacing so the
     label and the feature list above read at the same visual weight. */
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.signup__row {
  display: flex;
  gap: 0.4rem;
}
.signup__input {
  flex: 1 1 auto;
  font: inherit;
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--c-fg);
  background: var(--c-bg);
  border: 2px solid var(--c-fg);
  border-radius: 0;
  padding: 0.35rem 0.5rem;
  outline: none;
  -webkit-appearance: none;
  caret-color: var(--c-fg);
  letter-spacing: 0;
}
.signup__input::placeholder { color: var(--c-dim); }
.signup__input:focus { /* keep border solid, no glow */ }

.signup__button {
  font: inherit;
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--c-bg);
  background: var(--c-fg);
  border: 2px solid var(--c-fg);
  border-radius: 0;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  letter-spacing: 0;
}
.signup__button:hover {
  /* Classic mono hover: invert. */
  color: var(--c-fg);
  background: var(--c-bg);
}
.signup__button:active { transform: translate(1px, 1px); }
.signup__hint {
  margin: 0.7rem 0 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--c-dim);
}
.signup__hint--ok    { color: var(--c-fg); }
.signup__hint--error { color: var(--c-fg); text-decoration: underline; }

/* ---------- Animations ---------- */

@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero__caret { animation: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 32rem) {
  :root { --gutter: 0.75rem; }
  .signup__row { flex-direction: column; }
  .specs__box,
  .hero__lede { font-size: 0.95rem; }
}
