/* MagickMirror -- magickmirror.net
 *
 * Brand: the dark side of the glass. John Dee's scrying mirror was Aztec
 * obsidian, and that is the ground here: a near-black with a green cast, the
 * colour volcanic glass actually is. The ink is silvered sage, after the tin
 * and silver that backed a mirror before aluminium, tinted cool by the iron in
 * the glass. Garnet is the one warm note and it is reserved for the SOURCE
 * side of the product -- the host PC, doing the work in the other room. Cool
 * is the reflection, warm is the source; garnet never decorates.
 *
 * The page is dark throughout except one band, "What it never does", which is
 * silvered. That is the commitments section, and it is the part of the glass
 * that is clear.
 *
 * Nothing here is inherited from RetroBakery. The app still carries that
 * project's warm terracotta palette and its Fraunces/Lora pairing; this site
 * is deliberately its own thing.
 */

/* ---------------------------------------------------------------- tokens - */

:root {
  --obsidian: #0e1413;
  --obsidian-raised: #161d1b;
  --obsidian-line: #2f3936;

  --silver: #e4e9e2;
  --silver-bright: #f2f5f0;
  --silver-muted: #97a19a;
  --silver-dim: #6c7671;

  /* Garnet reads at 2.2:1 on obsidian, which is fine behind light text on a
     fill and unreadable as text itself. `--garnet-text` is the tint that
     carries the same colour up to a legible contrast for links and marks. */
  --garnet: #8c2b38;
  --garnet-deep: #6e1f2a;
  /* Desaturated rather than simply lightened: a clean tint of garnet reads as
     candy pink at small sizes, which is the wrong register for this page. */
  --garnet-text: #bd838a;

  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --text: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --step-4: clamp(2.1rem, 1.4rem + 3vw, 3.5rem);
  --step-5: clamp(2.8rem, 1.4rem + 6vw, 6.5rem);

  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --page: 68rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--obsidian);
}

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--silver);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The glass: a soft sheen where a window would fall on it, a darker pool in
   the opposite corner, and the broad diagonal band a large pane always shows.
   Fixed, so content moves across a stationary surface the way it moves across
   a mirror. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(70rem 45rem at 80% -12%, rgb(228 233 226 / 0.1), transparent 62%),
    radial-gradient(55rem 55rem at 2% 108%, rgb(0 0 0 / 0.55), transparent 60%),
    linear-gradient(
      104deg,
      transparent 34%,
      rgb(228 233 226 / 0.05) 47%,
      rgb(228 233 226 / 0.02) 56%,
      transparent 68%
    );
}

body > * {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--silver-bright);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--garnet-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--silver-bright);
}

:focus-visible {
  outline: 2px solid var(--garnet-text);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(100% - calc(var(--gutter) * 2), var(--page));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
  z-index: 10;
  background: var(--obsidian-raised);
  color: var(--silver-bright);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--silver-dim);
}

/* -------------------------------------------------------------- masthead - */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: var(--step-2);
  color: var(--silver-bright);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.mark:hover {
  color: var(--silver-bright);
}

.mark svg {
  display: block;
  width: 1.45em;
  height: 1.45em;
  flex: none;
}

.mark b {
  font-weight: 600;
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: var(--step--1);
}

.masthead nav a {
  color: var(--silver-muted);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--silver-bright);
  text-decoration: underline;
}

.masthead nav .lede {
  color: var(--garnet-text);
}

/* ------------------------------------------------------------------ hero - */

.hero {
  padding-block: clamp(3rem, 9vw, 7rem) 0;
}

.hero h1 {
  font-size: var(--step-5);
  line-height: 0.95;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

/* The reflection: the one bold element on the page, and the reason the brand
   exists. The headline is what is on the PC; what sits under the glass edge is
   the same thing arriving somewhere else, dimmer and a beat behind.
   Decorative, so it is hidden from assistive tech.

   The clip lives on the outer box and the flip on the inner one.
   `transform-origin` stays at `center`, which maps the inner box's bottom edge
   onto its top edge, so the headline's LAST line is what lands under the glass
   -- which is what a mirror returns. An origin of `top` reflects the element
   clean out of the container and renders nothing; `bottom` would return the
   first line, the one furthest from the glass. The `em` height resolves
   against the display size, not the inherited body size. */
.reflection {
  font-size: var(--step-5);
  line-height: 0.95;
  height: 0.58em;
  overflow: hidden;
  margin-top: 0.03em;
  opacity: 0.34;
  filter: blur(0.7px);
  -webkit-mask-image: linear-gradient(to bottom, #000 6%, transparent 84%);
  mask-image: linear-gradient(to bottom, #000 6%, transparent 84%);
}

.reflection-inner {
  transform: scaleY(-1);
}

.reflection h1 {
  color: var(--silver);
}

/* The edge of the glass. */
.hero-edge {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--obsidian-line) 10%,
    rgb(228 233 226 / 0.45) 50%,
    var(--obsidian-line) 90%,
    transparent
  );
  margin-block: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 3.5vw, 2.5rem);
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.hero-body p {
  font-size: var(--step-1);
  color: var(--silver);
  max-width: 46ch;
}

.hero-actions {
  margin-top: 1.75rem;
}

.hero-aside {
  font-size: var(--step--1);
  color: var(--silver-muted);
  border-left: 1px solid var(--obsidian-line);
  padding-left: clamp(1rem, 2vw, 1.5rem);
  line-height: 1.6;
}

.hero-aside strong {
  display: block;
  font-weight: 500;
  color: var(--silver-bright);
}

.btn {
  display: inline-block;
  font-family: var(--text);
  font-size: var(--step-0);
  font-weight: 500;
  padding: 0.7rem 1.4rem;
  border-radius: 3px;
  text-decoration: none;
  border: 1px solid var(--silver-dim);
  color: var(--silver-bright);
  background: rgb(228 233 226 / 0.04);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn:hover {
  color: var(--silver-bright);
  border-color: var(--silver-muted);
  background: rgb(228 233 226 / 0.1);
}

/* --------------------------------------------------------------- section - */

.band {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

.band-head {
  max-width: var(--measure);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.band-head h2 {
  font-size: var(--step-4);
  line-height: 1.05;
}

.band-head p {
  margin-top: 1rem;
  color: var(--silver-muted);
  font-size: var(--step-1);
  max-width: 54ch;
}

/* ----------------------------------------------------------------- steps - */

/* The app is literally a three-step flow in fixed order, so the numbering is
   the content rather than an ornament. A ruled ledger rather than three cards:
   the steps are a sequence you move down, not a menu you choose from. */
.steps {
  border-top: 1px solid var(--obsidian-line);
}

.step {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--obsidian-line);
  align-items: baseline;
}

.step-n {
  font-family: var(--display);
  font-size: var(--step-3);
  color: var(--garnet-text);
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.step h3 {
  font-size: var(--step-3);
  line-height: 1.1;
}

.step-note {
  color: var(--silver-muted);
  font-size: var(--step-0);
}

.step-note em {
  font-style: normal;
  color: var(--silver-bright);
}

/* --------------------------------------------------------------- feature - */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.feature-copy h2 {
  font-size: var(--step-4);
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.feature-copy p + p {
  margin-top: 1rem;
}

.feature-copy p {
  color: var(--silver-muted);
  max-width: 48ch;
}

/* The launcher diagram: two lifelines, the storefront's and MagickMirror's.
   The whole point of the feature is that one of them ends early, so the
   drawing is the argument. */
.lifelines {
  display: grid;
  gap: 1.75rem;
  margin: 0;
  font-size: var(--step--1);
}

.lane-label {
  color: var(--silver-muted);
  margin-bottom: 0.5rem;
}

.track {
  position: relative;
  height: 2.4rem;
  background: rgb(228 233 226 / 0.05);
  border: 1px solid var(--obsidian-line);
  border-radius: 2px;
}

.fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-inline: 0.75rem;
  overflow: hidden;
  white-space: nowrap;
}

.fill-dead {
  width: 38%;
  background: #313b37;
  color: var(--silver-muted);
}

.fill-live {
  right: 0;
  background: var(--garnet);
  color: var(--silver-bright);
}

/* Named for the track, not `.mark` -- that is the masthead wordmark, and the
   collision absolutely positioned the logo into a 1px garnet line. */
.track-cut {
  position: absolute;
  top: -0.5rem;
  bottom: -0.5rem;
  left: 38%;
  width: 1px;
  background: var(--garnet-text);
}

.lane-note {
  margin-top: 0.75rem;
  color: var(--silver-muted);
}

.lane-note-dead {
  color: var(--garnet-text);
}

/* ----------------------------------------------------------------- never - */

/* The one silvered band on the page: the part of the glass that is clear.
   Every line here is asserted by the privacy statement that ships with the
   app. If that statement changes, these change with it -- the site must not
   out-promise it. */
.never {
  background: var(--silver);
  color: var(--obsidian);
}

.never h2,
.never h3 {
  color: var(--obsidian);
}

.never .band-head p {
  color: #4e5852;
}

/* Six items, so the column count is pinned rather than auto-fit: auto-fit
   lands on four across at this width and leaves two dead cells showing the
   divider colour. */
.never-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgb(14 20 19 / 0.18);
  border: 1px solid rgb(14 20 19 / 0.18);
}

.never-list li {
  background: var(--silver);
  padding: 1.5rem;
}

.never-list h3 {
  font-size: var(--step-2);
  margin-bottom: 0.4rem;
}

.never-list p {
  font-size: var(--step--1);
  color: #4e5852;
}

/* ------------------------------------------------------------- what/need - */

.needs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  border-top: 1px solid var(--obsidian-line);
  padding-top: 2rem;
}

.need h3 {
  font-size: var(--step-2);
  margin-bottom: 0.4rem;
}

.need p {
  color: var(--silver-muted);
  font-size: var(--step--1);
}

/* ------------------------------------------------------------------ beta - */

.beta {
  text-align: center;
  padding-block: clamp(4rem, 10vw, 7rem);
}

.beta h2 {
  font-size: var(--step-4);
  line-height: 1.05;
  margin-inline: auto;
  max-width: 20ch;
}

.beta p {
  margin: 1.25rem auto 0;
  color: var(--silver-muted);
  max-width: 50ch;
  font-size: var(--step-1);
}

.beta .beta-note {
  margin-top: 1.25rem;
  font-size: var(--step--1);
}

/* ----------------------------------------------------------------- prose - */

/* The privacy statement, generated from privacy.md by scripts/render-privacy.py.
   Narrower than the rest of the site: this is the one page people read top to
   bottom rather than scan, and it gets extra leading for reading on a dark
   ground. */
.prose {
  max-width: 40rem;
  padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 8vw, 5rem);
  line-height: 1.75;
}

.prose h1 {
  font-size: var(--step-4);
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.prose h2 {
  font-size: var(--step-3);
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  font-family: var(--text);
  font-size: var(--step-1);
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1rem;
  color: var(--silver-muted);
}

.prose ul {
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  color: var(--silver-muted);
}

.prose li {
  margin-bottom: 0.6rem;
}

.prose strong {
  font-weight: 500;
  color: var(--silver-bright);
}

.prose code {
  font-size: 0.9em;
  background: rgb(228 233 226 / 0.07);
  border: 1px solid var(--obsidian-line);
  border-radius: 2px;
  padding: 0.05em 0.3em;
}

.prose .rule {
  border: 0;
  border-top: 1px solid var(--obsidian-line);
  margin: 2.5rem 0;
}

.prose em {
  color: var(--silver-dim);
}

/* ---------------------------------------------------------------- footer - */

.footer {
  border-top: 1px solid var(--obsidian-line);
  padding-block: 2rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--step--1);
  color: var(--silver-muted);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* ------------------------------------------------------------ responsive - */

@media (max-width: 54rem) {
  .hero-body,
  .feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-aside {
    border-left: 0;
    border-top: 1px solid var(--obsidian-line);
    padding-left: 0;
    padding-top: 1rem;
  }

  .step {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .step-note {
    grid-column: 2;
  }

  /* Two across rather than three: the pinned three-column grid crushes each
     commitment to about one word per line at phone width. */
  .never-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 34rem) {
  .never-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 30rem) {
  .masthead nav .hide-xs {
    display: none;
  }
}

/* The one orchestrated moment: the mirror silvers in on load. Nothing else on
   the page moves on its own. */
@media (prefers-reduced-motion: no-preference) {
  .reflection {
    animation: silver 1.6s 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  /* The flip lives on `.reflection-inner`, so this animates opacity and the
     clip height only -- animating `transform` here would cancel the flip. */
  @keyframes silver {
    from {
      opacity: 0;
      height: 0;
    }
  }
}
