/* Getsafe site styles. The site is one page: the wordmark, then the
   products, then the company details. The top bar and the footer stay in
   view the whole way down. */

:root {
  color-scheme: dark;
  --ink: #0a0c0f;
  --line: #262c35;
  --text: #eef1f5;
  --muted: #8e97a6;
  --brass: #c9a961;
  /* The terminal look: its typeface, its neon tones and its window chrome. */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --cyan: #35e0ff;
  --green: #39ff88;
  --amber: #ffb224;
  --pane: rgb(9 12 16 / 0.9);
  --pane-line: rgb(150 190 255 / 0.18);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  background: var(--ink);
  color: var(--text);
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Quiet text actions: the links and buttons in the top bar and footer. */
.action {
  padding: 0.5rem 0.125rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 0.375rem);
  background-size: 0 1px;
}

.action:hover,
.action:focus-visible {
  color: var(--text);
  background-size: 100% 1px;
}

/* Top bar: wordmark on the left, contact on the right. It has no edge; the
   page fades out underneath it. */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem 1.5rem;
  background: linear-gradient(var(--ink) 50%, transparent);
}

.wordmark {
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* Footer: always in view, with the way to each section and to contact. */
.site-footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--line);
  /* Nearly opaque instead of a backdrop blur: blurring the moving scene
     behind the footer would cost a full re-blur on every frame. */
  background: rgb(10 12 15 / 0.96);
}

.site-footer nav {
  display: flex;
  gap: 1.75rem;
}

/* Terminal windows floating in 3D space behind the whole page, built by
   backdrop.js, which also sets the perspective (the camera distance) and
   dims the scene as the page scrolls. It fills the viewport and stays put.
   It is contained, so nothing in it can make the page lay out again. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

/* Fades the top and bottom edges into the page. A gradient in the page
   color on top looks the same as a mask, but a mask over a moving scene has
   to be applied to the whole screen on every frame. */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    var(--ink),
    transparent 12%,
    transparent 90%,
    var(--ink)
  );
}

/* The whole scene. backdrop.js turns it to move the camera. */
.backdrop-scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* One terminal window. Its size, depth, blur and opacity are set inline. */
.backdrop-pane {
  position: absolute;
  top: 50%;
  left: 50%;
  box-sizing: content-box;
  border: 1px solid rgb(150 190 255 / 0.16);
  border-radius: 10px;
  background: rgb(9 12 16 / 0.78);
}

.backdrop-pane-near {
  background: rgb(9 12 16 / 0.3);
}

/* Every section fills at least one screen, with room for the two bars.
   svh, not dvh: dvh changes while a phone's address bar slides away, which
   would lay the page out again in the middle of a scroll. */
main > section {
  display: grid;
  min-height: 100svh;
  padding: 5.5rem 1.5rem 6rem;
}

/* First screen: the wordmark in the middle. */
.hero {
  place-items: center;
  height: 100svh;
  container-type: size;
}

.hero h1 {
  position: relative;
  isolation: isolate;
  font-size: clamp(2.25rem, 12.5cqmin, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

/* A dark halo behind the wordmark. It scales with the type but never gets
   smaller than a couple of text lines, so the terminal running behind it
   never makes the letters hard to read. */
.hero h1::before {
  content: "";
  position: absolute;
  inset: min(-0.55em, -2rem) min(-0.6em, -2.25rem);
  z-index: -1;
  background: radial-gradient(closest-side, var(--ink) 55%, transparent);
}

/* The sections below the first screen: a heading, then their windows. */
.products,
.about {
  place-content: center;
  justify-items: center;
  gap: 1.25rem;
  text-align: center;
}

.products h2,
.about h2 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* A terminal window made of real HTML, so its text can be read, selected
   and followed. Same chrome as the windows backdrop.js draws. */
.window {
  border: 1px solid var(--pane-line);
  border-radius: 10px;
  background: var(--pane);
  text-align: left;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgb(150 190 255 / 0.1);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

/* The three window dots. */
.window-bar::before {
  content: "";
  flex: none;
  width: 0.56rem;
  height: 0.56rem;
  margin-right: 1.9rem;
  border-radius: 50%;
  background: rgb(159 180 204 / 0.28);
  box-shadow:
    0.95rem 0 rgb(159 180 204 / 0.28),
    1.9rem 0 rgb(159 180 204 / 0.28);
}

.window-body {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1.5rem;
}

.window a {
  color: var(--text);
  text-decoration-color: rgb(238 241 245 / 0.35);
  text-underline-offset: 0.2em;
}

.window a:hover {
  text-decoration-color: currentColor;
}

/* A command and what it printed. */
.session {
  display: grid;
  gap: 0.625rem;
  align-content: start;
}

/* The command line. It is decoration; the lines under it carry the
   content. */
.prompt {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.875rem;
  white-space: nowrap;
}

.prompt::before {
  content: "$ ";
}

/* Products: three windows side by side. */
.products {
  overflow-x: clip;
}

/* The campaign label. */
.offer {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  max-width: 100%;
  padding: 0.5rem 0.875rem;
  border: 1px solid rgb(255 178 36 / 0.45);
  border-radius: 6px;
  background: rgb(255 178 36 / 0.07);
  font-size: 0.9375rem;
}

.offer strong {
  color: var(--amber);
  font-family: var(--mono);
  font-weight: 600;
}

/* Time left on the offer, counted down by offer.js. The digits keep their
   width, so the label does not jitter as they change. */
.countdown {
  color: var(--amber);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* When the offer has ended, offer.js hides it and the discounted prices. */
.offer-ended .offer,
.offer-ended .offer-price {
  display: none;
}

.product-row {
  display: grid;
  gap: 1.5rem;
  width: min(72rem, 100%);
  margin-top: 1rem;
}

/* The body fills the window, so the price sits at the bottom of each. */
.product {
  display: flex;
  flex-direction: column;
}

.product .window-body {
  flex: 1;
  grid-template-rows: auto auto 1fr auto;
}

.product h3 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* What the test gives you, as the terminal's output. */
.output {
  display: grid;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.875rem;
}

.output li {
  display: grid;
  grid-template-columns: 3.5ch 1fr;
}

.output li::before {
  content: "[+]";
  content: "[+]" / "";
  color: var(--green);
}

.depth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

/* How deep the test goes, as one to three lit segments. */
.meter {
  display: inline-flex;
  gap: 3px;
}

.meter i {
  width: 1.25rem;
  height: 0.5rem;
  border-radius: 1px;
  background: rgb(150 190 255 / 0.16);
}

.meter[data-level="1"] i:nth-child(-n + 1),
.meter[data-level="2"] i:nth-child(-n + 2),
.meter[data-level="3"] i {
  background: var(--cyan);
}

.buy {
  display: grid;
  gap: 0.25rem;
  justify-items: start;
  padding-top: 1rem;
  border-top: 1px solid rgb(150 190 255 / 0.1);
}

.price {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.offer-price {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.choose {
  min-height: 2.75rem;
  margin-top: 0.75rem;
  padding: 0 1.125rem;
  border: 1px solid rgb(150 190 255 / 0.32);
  border-radius: 4px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.choose:hover {
  border-color: var(--text);
}

/* On a wide screen the outer windows swing in towards the middle one, like
   the terminals in the backdrop lean towards the wordmark. The one being
   pointed at or focused turns to face the reader. */
@media (min-width: 60rem) {
  .product-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    perspective: 1600px;
  }

  .product:first-child {
    transform: rotateY(9deg);
    transform-origin: right center;
  }

  .product:last-child {
    transform: rotateY(-9deg);
    transform-origin: left center;
  }

  .product-row .product:hover,
  .product-row .product:focus-within {
    transform: none;
  }
}

/* About: one window with the company details. */
.about .window {
  width: min(34rem, calc(100vw - 3rem));
  margin-top: 1rem;
}

.facts {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9375rem;
}

.facts div {
  display: grid;
  grid-template-columns: 11.5ch 1fr;
  gap: 1rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The notice that confirms the email address was copied. It sits just
   above the footer and is announced to screen readers. */
.notice {
  position: fixed;
  inset: auto 1rem 5.25rem;
  z-index: 3;
  width: fit-content;
  margin-inline: auto;
  padding: 0.625rem 1rem;
  border: 1px solid rgb(57 255 136 / 0.45);
  border-radius: 6px;
  background: var(--pane);
  font-family: var(--mono);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
  translate: 0 0.5rem;
  opacity: 0;
  visibility: hidden;
}

.notice::before {
  content: "[+] ";
  color: var(--green);
}

.notice.is-shown {
  translate: 0 0;
  opacity: 1;
  visibility: visible;
}

/* Copying was blocked, so the notice only gives the address. */
.notice.is-failed {
  border-color: rgb(255 178 36 / 0.45);
}

.notice.is-failed::before {
  content: "[!] ";
  color: var(--amber);
}

/* The button that was just used, while the notice is up. */
.action.is-copied,
.choose.is-copied,
.window a.is-copied {
  color: var(--green);
}

.choose.is-copied {
  border-color: rgb(57 255 136 / 0.6);
}

@media (max-width: 30rem) {
  .site-footer {
    justify-content: center;
  }

  /* Small enough for the notice to stay on one line on a phone. */
  .notice {
    font-size: 0.8125rem;
  }

  /* On a narrow screen each label sits above its value, so the email
     address stays on one line. */
  .facts {
    gap: 0.75rem;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* The footer links glide to their section. */
  html {
    scroll-behavior: smooth;
  }

  .action {
    transition: color 0.15s, background-size 0.2s;
  }

  .product {
    transition: transform 0.35s cubic-bezier(0.3, 0, 0.2, 1);
  }

  .notice {
    transition:
      opacity 0.18s,
      translate 0.18s,
      visibility 0.18s;
  }
}
