/* Copyright © 2026 Wayne Davies. Free software under the GNU General Public License, version 3 or later. */
/* See LICENSE for the full text. */
/* SPDX-License-Identifier: GPL-3.0-or-later */

/* Keepr's product page. The app's light theme (src/styles.css), on the web. */

:root {
  --ground: #ffffff;
  --side: #f5f5f7;
  --line: #e5e5ea;
  --line2: #d1d1d6;
  --ink: #1d1d1f;
  --ink2: #57575c;
  --ink3: #6e6e73;
  --accent: #0f7a5c;
  --accent-ink: #ffffff;
  --accent-soft: #e4f3ed;
  --accent-text: #0b5c45;
  --amber: #9a5800;
  --amber-soft: #fff3de;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.28), 0 10px 30px -10px rgba(0, 0, 0, 0.12);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: 48px;
  color-scheme: light;
}

/* JetBrains Mono, served from fonts/ (SIL Open Font License, fonts/OFL.txt). */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/jetbrains-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-500.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 17px/1.5 var(--sans);
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
code,
kbd {
  font-family: var(--mono);
  font-size: 0.88em;
}
kbd {
  display: inline-block;
  padding: 0 7px;
  line-height: 1.6;
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--ground);
}

.wrap {
  width: min(1120px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ground);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus {
  left: 8px;
}

/* Type scale: a display face for titles, tight, as in the app's own splash. */
h1,
h2,
h3 {
  font-family: var(--display);
  margin: 0;
}
h1 {
  font-weight: 650;
  font-size: clamp(46px, 7.4vw, 88px);
  line-height: 1;
  letter-spacing: -0.035em;
}
h2 {
  font-weight: 650;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}
h3 {
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.022em;
}
p {
  margin: 0;
}
.text p,
.step p,
.facts p {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--ink2);
  line-height: 1.5;
}
.text h2 + p,
.step h3 + p,
.facts h3 + p {
  margin-top: 18px;
}
.text p + p {
  margin-top: 14px;
}
.lede {
  font-size: clamp(19px, 1.9vw, 23px);
  line-height: 1.4;
  color: var(--ink2);
  letter-spacing: -0.015em;
}
.n {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.92em;
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition:
    background 0.2s,
    transform 0.2s var(--ease);
}
.btn:hover {
  background: var(--accent-text);
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}
.more {
  font-size: 17px;
  font-weight: 500;
}
.more::after {
  content: " ›";
}
.actions {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: center;
  margin-top: 34px;
  flex-wrap: wrap;
}
.fine {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink3);
  letter-spacing: 0;
}

/* Top bar: thin, translucent, hairline below. */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: 52px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 650;
  font-size: 19px;
  letter-spacing: -0.03em;
}
.brand:hover {
  text-decoration: none;
}
.links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}
.links a {
  color: var(--ink2);
}
.links a:hover {
  color: var(--ink);
  text-decoration: none;
}
.links .pill {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}
.links .pill:hover {
  background: var(--accent-text);
  color: var(--accent-ink);
}

/* Hero */
.hero {
  padding-top: 148px;
  text-align: center;
  overflow: hidden;
}
.hero h1 {
  animation: rise 0.9s var(--ease) both;
}
.hero .lede {
  max-width: 34em;
  margin: 30px auto 0;
  animation: rise 0.9s 0.1s var(--ease) both;
}
.hero .actions,
.hero .fine {
  animation: rise 0.9s 0.18s var(--ease) both;
}
.shotwrap {
  margin-top: 72px;
  padding-bottom: 96px;
}
.shot {
  width: 100%;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.18)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}
.hero-shot {
  animation: settle 1.3s 0.25s var(--ease) both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.965);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Where a screenshot is still loading: a slow sweep of light grey. */
[data-shimmer]:not(.loaded) {
  background: linear-gradient(100deg, var(--side) 30%, #ececf0 50%, var(--side) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.6s linear infinite;
}
.shotwrap[data-shimmer]:not(.loaded) {
  background-clip: content-box;
  border-radius: 12px;
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* Shared section rhythm */
section {
  padding: 112px 0;
}
.two {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.two .text {
  max-width: 30em;
}

/* Only what changed: a grid of pieces */
.dedup {
  background: var(--side);
}
.pieces {
  margin: 0;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 7px;
}
.tile {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--ground);
  border: 1px solid var(--line);
  transition:
    background 0.45s,
    border-color 0.45s,
    transform 0.45s var(--ease),
    opacity 0.6s;
}
.tile.stored {
  background: var(--accent-soft);
  border-color: #bfe3d2;
}
.tile.new {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.14);
}
.tiles.reset .tile {
  opacity: 0.25;
}
.pieces figcaption {
  margin-top: 22px;
  font-size: 16px;
  color: var(--ink2);
  min-height: 1.5em;
}

/* The tour: a window that moves its view as the text scrolls by */
.walk {
  padding: 96px 0 0;
}
.walk .grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
.cam {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 50%;
  translate: 0 -50%;
  aspect-ratio: 1400 / 875;
  overflow: hidden;
  border-radius: 12px;
  background: var(--ground);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(0, 0, 0, 0.06);
}
.cam .frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  transition:
    opacity 0.7s var(--ease),
    transform 1.2s var(--ease);
  will-change: transform, opacity;
}
/* Without the script, the first screen shows; with it, the step's own. */
.cam .frame:not(:first-child),
.js .cam .frame {
  opacity: 0;
}
.js .cam .frame.on {
  opacity: 1;
}
.steps {
  grid-column: 1;
  grid-row: 1;
}
.step {
  scroll-margin-top: 18vh;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  max-width: 24em;
  transition: opacity 0.5s;
}
.js .step {
  opacity: 0.3;
}
.js .step.on {
  opacity: 1;
}
.step:first-child {
  min-height: 70vh;
}
.step:last-child {
  min-height: 80vh;
}

/* Encryption: the same lines, plain and not */
.cipher {
  padding-top: 140px;
}
.plain-vs-cipher {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.doc {
  background: var(--side);
  border-radius: 14px;
  padding: 20px 22px 22px;
  min-width: 0;
}
.doc .label {
  display: block;
  font-size: 13px;
  color: var(--ink3);
  margin-bottom: 12px;
}
.doc pre {
  margin: 0;
  font: 500 14px/1.9 var(--mono);
  color: var(--ink);
  white-space: pre;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.doc.scrambled pre {
  color: var(--ink3);
  font-weight: 400;
}

/* Destinations: a typeset list, no boxes */
.where {
  padding-top: 60px;
}
.where h2,
.where .lede {
  text-align: center;
}
.where .lede {
  margin: 18px auto 0;
  max-width: 30em;
}
.dests {
  list-style: none;
  margin: 72px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.dests li {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dests strong {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.dests span {
  color: var(--ink2);
  font-size: 16px;
}

/* Menu bar: the top of a Mac screen, and the panel under its icon */
.menubar {
  background: var(--side);
}
.mac {
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.macbar {
  width: 100%;
  height: 30px;
  border-radius: 10px 10px 0 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-bottom: 0;
  font-size: 13px;
  color: var(--ink);
}
.macbar .glyph,
.macbar .kp {
  display: inline-flex;
  align-items: center;
}
.macbar .clock {
  font-weight: 500;
  letter-spacing: 0;
}
.mac .panel {
  width: min(360px, 100%);
  margin-top: 6px;
  margin-right: 110px;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.18)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
  transform-origin: 80% 0;
  transition:
    opacity 0.7s var(--ease),
    transform 0.9s var(--ease);
}
.js .mac .panel {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
}
.js .mac.on .panel {
  opacity: 1;
  transform: none;
}

/* Three quiet facts */
.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
.three h3 {
  font-size: 22px;
}

/* Download */
.download {
  text-align: center;
  padding: 80px 0 120px;
  border-top: 1px solid var(--line);
}
.download .mark {
  margin: 0 auto 28px;
}
.download .lede {
  margin: 18px auto 0;
}
.download .fine {
  max-width: 40em;
  margin-inline: auto;
}

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--ink3);
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.foot a {
  color: var(--ink3);
  margin-left: 18px;
}
.foot span:first-child a {
  margin-left: 0;
}

/* Smaller screens */
@media (max-width: 900px) {
  :root {
    --gutter: 24px;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .two .text {
    max-width: none;
  }
  .dests {
    grid-template-columns: 1fr 1fr;
  }
  .three {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .walk .grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .cam {
    grid-column: 1;
    grid-row: 1;
    top: 64px;
    translate: none;
    z-index: 2;
  }
  .steps {
    grid-column: 1;
    grid-row: 2;
    padding-top: 20px;
  }
  .step,
  .step:first-child,
  .step:last-child {
    min-height: 52vh;
    max-width: none;
  }
  .mac .panel {
    margin-right: 0;
  }
}
@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }
  section {
    padding: 80px 0;
  }
  .links a:not(.pill) {
    display: none;
  }
  .hero {
    padding-top: 116px;
  }
  .shotwrap {
    margin-top: 44px;
    padding-bottom: 56px;
  }
  .dests {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .plain-vs-cipher {
    grid-template-columns: 1fr;
  }
  .tiles {
    grid-template-columns: repeat(12, 1fr);
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-shimmer]:not(.loaded) {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
  .hero h1,
  .hero .lede,
  .hero .actions,
  .hero .fine,
  .hero-shot {
    animation: none;
  }
  .cam .frame,
  .tile,
  .mac .panel,
  .step,
  .btn {
    transition: none;
  }
}
