/* ============================================================
   Techwriter Software Inc — site stylesheet
   1. Tokens        4. Header
   2. Reset/base    5. Main + pages
   3. Backdrop      6. Footer
   ============================================================ */

/* -- 1. Tokens ---------------------------------------------- */

:root {
  --void: #000;
  --ink: #fff;

  /* Plate greys: the chrome sits well below the artwork in weight. */
  --plate: rgba(255, 255, 255, .46);
  --plate-dim: rgba(255, 255, 255, .28);
  --plate-bright: rgba(255, 255, 255, .88);

  /* Violet lifted from the corruption rim in starfield.js. */
  --rift: #ba8cff;
  --rule: rgba(255, 255, 255, .09);

  --serif: Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 4.5vw, 44px);
  --shell: 1140px;
  --header-h: clamp(58px, 8vh, 74px);
}

/* -- 2. Reset / base ---------------------------------------- */

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--void);
  color: var(--ink);
  font-family: var(--serif);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 1px solid var(--rift);
  outline-offset: 4px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--void);
  border: 1px solid var(--rift);
  font: 500 13px/1 var(--sans);
  text-decoration: none;
}

.skip-link:focus {
  left: var(--gutter);
  top: 12px;
}

/* -- 3. Backdrop -------------------------------------------- */
/* Both canvases are persistent chrome: they live in the shell and
   survive every page. The corruption bloom only renders where the
   page opts in with data-fx="full". */

#stars, #corruption {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

#stars { z-index: 0; }

#corruption {
  z-index: 1;
  display: none;
}

body[data-fx="full"] #corruption { display: block; }

/* Interior pages pull the field back so text stays legible. */
body:not([data-fx="full"]) #stars { opacity: .38; }

/* -- 4. Header ---------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.wordmark {
  font: 400 clamp(11px, 1.15vw, 13px)/1.2 var(--serif);
  text-transform: uppercase;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--plate);
  text-decoration: none;
  text-shadow: 0 0 18px rgba(120, 150, 255, .16);
  transition: color 220ms ease;
}

.wordmark:hover { color: var(--plate-bright); }

.site-nav {
  display: flex;
  gap: clamp(18px, 3vw, 34px);
}

.site-nav a {
  position: relative;
  padding-block: 6px;
  font: 400 clamp(12px, 1.05vw, 13.5px)/1 var(--sans);
  letter-spacing: .06em;
  color: var(--plate);
  text-decoration: none;
  transition: color 220ms ease;
}

.site-nav a:hover { color: var(--plate-bright); }

/* Current page carries a violet underscore — the only accent in the
   chrome, so it reads as position rather than decoration. */
.site-nav a[aria-current="page"] {
  color: var(--plate-bright);
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--rift);
  box-shadow: 0 0 10px rgba(186, 140, 255, .8);
}

/* On the splash the chrome dissolves into the void. */
body[data-page="home"] .site-header {
  position: absolute;
  inset: 0 0 auto;
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* -- 5. Main + pages ---------------------------------------- */

.site-main {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* 5a. Splash --------------------------------------------- */

.splash {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 2vh) var(--gutter) 4vh;
}

.composition {
  width: min(760px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero {
  width: min(500px, 70vw);
  max-height: 52vh;
  height: auto;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
  opacity: .78;
  filter: saturate(.95) brightness(.96);
}

.release {
  margin: 1.2vh 0 3.8vh;
  color: rgba(255, 255, 255, .36);
  font: 700 clamp(22px, 2.6vw, 31px)/1 var(--serif);
  letter-spacing: -.02em;
}

.brand-row {
  width: min(620px, 82vw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 5vw, 62px);
  align-items: center;
  justify-items: center;
}

.brand-row img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: contain;
  mix-blend-mode: screen;
  opacity: .78;
  filter: saturate(.82) brightness(.92);
}

.brand-row .reality { max-width: 165px; }
.brand-row .techwriter { max-width: 170px; }
.brand-row .byline { max-width: 220px; }

/* Load sequence: chrome, artwork, colophon. */
@keyframes plate-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

body[data-page="home"] .site-header { animation: plate-in 900ms cubic-bezier(.22,.61,.36,1) 120ms both; }
body[data-page="home"] .composition { animation: plate-in 1100ms cubic-bezier(.22,.61,.36,1) 260ms both; }
body[data-page="home"] .site-footer { animation: plate-in 900ms cubic-bezier(.22,.61,.36,1) 620ms both; }

/* 5b. Interior pages ------------------------------------- */

.page-head {
  padding: clamp(56px, 11vh, 108px) 0 clamp(28px, 5vh, 48px);
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  margin: 0 0 14px;
  font: 400 11.5px/1 var(--sans);
  text-transform: uppercase;
  letter-spacing: .26em;
  color: var(--rift);
}

.page-head h1 {
  margin: 0;
  max-width: 18ch;
  font: 400 clamp(34px, 5.4vw, 62px)/1.06 var(--serif);
  letter-spacing: -.02em;
}

.page-head .standfirst {
  margin: 20px 0 0;
  max-width: 56ch;
  font: 400 clamp(16px, 1.5vw, 19px)/1.6 var(--serif);
  color: rgba(255, 255, 255, .62);
}

.prose {
  padding: clamp(32px, 6vh, 64px) 0 clamp(56px, 10vh, 100px);
  max-width: 68ch;
}

.prose h2 {
  margin: 2.2em 0 .6em;
  font: 400 clamp(20px, 2.2vw, 27px)/1.2 var(--serif);
  letter-spacing: -.01em;
}

.prose h2:first-child { margin-top: 0; }

.prose p,
.prose li {
  font: 400 clamp(15.5px, 1.35vw, 17px)/1.75 var(--serif);
  color: rgba(255, 255, 255, .74);
}

.prose p { margin: 0 0 1.2em; }

.prose ul {
  margin: 0 0 1.4em;
  padding-left: 1.1em;
}

.prose li { margin-bottom: .5em; }

.prose li::marker { color: var(--rift); }

.prose a {
  color: var(--ink);
  text-decoration-color: var(--rift);
  text-underline-offset: 4px;
}

/* -- 6. Footer ---------------------------------------------- */

.site-footer {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  padding-block: clamp(20px, 3vh, 30px);
  border-top: 1px solid var(--rule);
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.site-footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
}

.colophon {
  margin: 0;
  font: 400 clamp(11px, 1vw, 12.5px)/1.5 var(--sans);
  letter-spacing: .04em;
  color: var(--plate-dim);
}

.footer-nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 28px);
  flex-wrap: wrap;
}

.footer-nav a {
  font: 400 clamp(11px, 1vw, 12.5px)/1.5 var(--sans);
  letter-spacing: .04em;
  color: var(--plate-dim);
  text-decoration: none;
  transition: color 220ms ease;
}

.footer-nav a:hover { color: var(--plate-bright); }

/* The splash keeps its title-card symmetry. */
body[data-page="home"] .site-footer {
  border-top-color: transparent;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-page="home"] .site-footer .shell {
  justify-content: center;
  text-align: center;
}

body[data-page="home"] .footer-nav { display: none; }

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

@media (max-width: 700px) {
  .wordmark {
    letter-spacing: .2em;
    text-indent: .2em;
  }

  .site-header .shell {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-block: 12px;
  }

  .site-nav { gap: 20px; }

  .composition { width: 94vw; }
  .hero { width: min(520px, 84vw); }

  .brand-row {
    width: 88vw;
    gap: 18px;
  }

  .brand-row img { height: 72px; }
  .release { margin-bottom: 3vh; }

  .site-footer .shell {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  body[data-page="home"] .site-header,
  body[data-page="home"] .composition,
  body[data-page="home"] .site-footer {
    animation: none;
  }
}
