/*
 * The app's own palette, so the site and the thing it is about look like one
 * piece of work. Hand-written and flat on purpose: a marketing page that needs
 * a build step is a build step you maintain forever.
 */

:root {
  --bg: #090b0a;
  --surface: #0f1312;
  --surface-2: #141917;
  --surface-3: #1a201d;
  --line: #232b28;
  --line-2: #2e3733;
  --ink: #e3e9e5;
  --ink-2: #9daba3;
  --ink-3: #6d7b74;
  --ink-4: #4c5751;
  --acc: #adc551;
  --acc-2: #8ba33c;
  --acc-3: #46521f;
  --amber: #e2a63f;
  --danger: #d8563a;

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;

  /* A faint grid, like a reticle's own. Fixed, so the page moves over it. */
  background-image:
    linear-gradient(to right, rgba(173, 197, 81, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(173, 197, 81, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  background-attachment: fixed;
}

a {
  color: var(--acc);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Bar ---------------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.16em;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  border-radius: 3px;
}

.bar nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.bar nav a {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 8px;
  border-radius: 2px;
}
.bar nav a:hover {
  color: var(--ink);
  background: var(--surface-3);
  text-decoration: none;
}

@media (max-width: 560px) {
  .bar nav {
    display: none;
  }
  .brand {
    font-size: 12px;
    letter-spacing: 0.12em;
  }
}

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

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 72px;
}

section {
  padding: 56px 0 8px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-weight: 600;
}

h2 {
  margin: 0 0 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
}

p {
  margin: 0 0 14px;
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
  margin-bottom: 14px;
}

.lead {
  font-size: 16.5px;
  max-width: 54ch;
}

.fine {
  font-size: 12.5px;
  color: var(--ink-4);
}

.note {
  font-size: 13px;
  min-height: 1.6em;
  margin-top: 10px;
}
.note[data-tone='ok'] {
  color: var(--acc);
}
.note[data-tone='error'] {
  color: var(--danger);
}

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

/*
 * Narrow screens get the portrait photograph full bleed behind the words,
 * which is the shape it was taken in. Wide screens get their own crop in a
 * panel roughly its own proportions, because a 1.07:1 picture stretched
 * across a 2:1 band can only show a horizontal slice of itself — which is how
 * this started out as a photograph of a scope rather than of a rifle.
 */
.hero {
  position: relative;
  padding: 0;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero::before {
  background: url('range.jpg') 56% 26% / cover no-repeat;
  opacity: 0.62;
}
/* The scrim: opaque where the words are, clear where the range is. */
.hero::after {
  background:
    linear-gradient(
      96deg,
      var(--bg) 12%,
      color-mix(in srgb, var(--bg) 84%, transparent) 42%,
      color-mix(in srgb, var(--bg) 32%, transparent) 78%,
      color-mix(in srgb, var(--bg) 70%, transparent) 100%
    ),
    linear-gradient(to bottom, color-mix(in srgb, var(--bg) 55%, transparent) 0 12%, transparent 38%, var(--bg) 99%);
}

.hero-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 56px 16px 48px;
  display: grid;
  gap: 24px;
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  /*
   * The picture becomes a panel on the right, sized by its own width rather
   * than the viewport's, so the whole rifle and the range down to the berm
   * stay in frame. Its left edge is feathered rather than cut, so it reads as
   * part of the page instead of a photograph pasted onto it.
   */
  .hero {
    min-height: 660px;
    display: flex;
    align-items: center;
  }
  .hero::before {
    inset: 0 0 0 46%;
    background-image: url('range-wide.jpg');
    background-position: center 42%;
    opacity: 0.78;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 26%);
    mask-image: linear-gradient(to right, transparent, #000 26%);
  }
  .hero::after {
    background:
      linear-gradient(
        96deg,
        var(--bg) 26%,
        color-mix(in srgb, var(--bg) 70%, transparent) 48%,
        color-mix(in srgb, var(--bg) 18%, transparent) 72%,
        color-mix(in srgb, var(--bg) 55%, transparent) 100%
      ),
      linear-gradient(to bottom, color-mix(in srgb, var(--bg) 45%, transparent) 0 8%, transparent 32%, var(--bg) 99%);
  }

  .hero-inner {
    width: 100%;
    max-width: 1200px;
    padding: 72px 24px;
    grid-template-columns: minmax(0, 500px) 1fr;
    gap: 40px;
    align-items: start;
  }

}

.hero-text h1,
.hero-text .lead {
  text-shadow: 0 1px 18px rgba(9, 11, 10, 0.85);
}

.hero-art {
  margin: 0;
  justify-self: center;
  width: min(100%, 320px);
}
.hero-art svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-art .ring {
  fill: none;
  stroke: rgba(227, 233, 229, 0.3);
  stroke-width: 1.4;
}
.hero-art .los {
  stroke: rgba(227, 233, 229, 0.42);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
}
.hero-art .traj {
  fill: none;
  stroke: var(--acc);
  stroke-width: 3;
  stroke-linecap: round;
  /* Drawn on, once: the curve arriving is the whole idea of the thing. */
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: draw 2.4s cubic-bezier(0.22, 0.9, 0.3, 1) 0.35s forwards;
  filter: drop-shadow(0 0 8px rgba(173, 197, 81, 0.45));
}
.hero-art .pip {
  fill: var(--acc);
  opacity: 0;
  animation: fade 0.5s ease 0.35s forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fade {
  to {
    opacity: 1;
  }
}

/*
 * Between the photograph becoming a panel and there being room beside it for
 * a drawing, there is a stretch where the drawing has nowhere to go. The
 * photograph carries the hero on its own there.
 */
@media (min-width: 900px) and (max-width: 1099px) {
  .hero-art {
    display: none;
  }
}

@media (min-width: 1100px) {
  /*
   * The same reticle the phone gets — ring and all, drawn the same way round
   * — just moved off the rifle. It sits over the range instead, which is the
   * empty half of the frame, so the thing the photograph is of stays
   * uncovered and the drawing still has somewhere to be.
   */
  .hero-art {
    grid-column: 2;
    justify-self: start;
    align-self: center;
    width: min(46%, 300px);
    margin: -54px 0 0 14%;
  }
  /* Darker ground than the page behind it, so the lines hold over a
     photograph rather than dissolving into it. */
  .hero-art .ring {
    stroke: rgba(227, 233, 229, 0.3);
  }
  .hero-art .los {
    stroke: rgba(227, 233, 229, 0.5);
  }
  .hero-art .traj {
    filter: drop-shadow(0 0 10px rgba(9, 11, 10, 0.9))
      drop-shadow(0 0 7px rgba(173, 197, 81, 0.5));
  }
}

/* Somebody who has asked for less movement gets the finished picture. */
@media (prefers-reduced-motion: reduce) {
  .hero-art .traj {
    animation: none;
    stroke-dashoffset: 0;
  }
  .hero-art .pip {
    animation: none;
    opacity: 1;
  }
  html {
    scroll-behavior: auto;
  }
}

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
}
.specs div {
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(3px);
  padding: 7px 11px;
}
.specs dt {
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.specs dd {
  margin: 1px 0 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
}

/* ---- Buttons ------------------------------------------------------------ */

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.08s;
}
.btn:hover {
  border-color: var(--ink-4);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--acc-3);
  border-color: var(--acc-2);
  color: var(--acc);
  box-shadow: 0 0 22px rgba(173, 197, 81, 0.1);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--acc-3) 72%, var(--acc-2));
}
.btn[data-state='pending'] {
  opacity: 0.8;
  cursor: default;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---- Screenshots -------------------------------------------------------- */

/*
 * Narrow: a phone beside its caption, so the list reads as a list. Wide: four
 * phones standing in a row, which is the point of the section.
 */
.shots {
  display: grid;
  gap: 26px 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .shots {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 900px) {
  .shots {
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
  }
}

.shots figure {
  margin: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: 124px 1fr;
  align-items: start;
}
@media (min-width: 900px) {
  .shots figure {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.shots img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line-2);
  border-radius: 15px;
  background: var(--bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.shots figure:hover img {
  transform: translateY(-4px);
  border-color: var(--acc-3);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.55),
    0 0 26px rgba(173, 197, 81, 0.09);
}
.shots figcaption {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.shots figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

/* ---- Blocks ------------------------------------------------------------- */

.split {
  display: grid;
  gap: 24px 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 680px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}
.split p {
  margin: 0;
  font-size: 13.5px;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  padding: 24px 22px 12px;
  margin-top: 44px;
}
.panel h2 {
  margin-bottom: 14px;
}
.panel strong {
  color: var(--ink);
}

.beta {
  border-color: var(--acc-3);
  background: linear-gradient(180deg, rgba(70, 82, 31, 0.14), transparent 70%), var(--surface);
}

/* ---- Form --------------------------------------------------------------- */

form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

input[type='email'] {
  flex: 1 1 240px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
input[type='email']:focus {
  outline: none;
  border-color: var(--acc-2);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--acc) 35%, transparent);
}
input[type='email']::placeholder {
  color: var(--ink-4);
}

/* The honeypot: present for a robot, gone for everyone else. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Footer ------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--line);
  padding: 24px 16px 44px;
  text-align: center;
}
footer p {
  margin: 0 0 6px;
  font-size: 12.5px;
}
footer span {
  color: var(--ink-4);
  margin: 0 8px;
}

/* ---- Long-form pages ---------------------------------------------------- */

.doc {
  max-width: 720px;
}
.doc h1 {
  font-size: clamp(24px, 5vw, 32px);
  margin-bottom: 8px;
}
.doc h2 {
  margin-top: 32px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}
.doc ul {
  margin: 0 0 14px;
  padding-left: 20px;
}
.doc li {
  margin-bottom: 6px;
}
.doc .updated {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
}
