/* Copyright (c) 2026 Brownie, LLC. All rights reserved. */

/*
 * The home page (home.html). Its own stylesheet, so the home page loads only
 * what it shows and the app's styles can change without moving it.
 *
 * One layout for every screen: on a computer it's the H1 design, and below
 * 640 pixels wide (a phone) the H2 design, with smaller headings, less space
 * and fewer links in the header. Colors are variables, with a second set for
 * dark mode, the same as the app's (css/styles.css).
 */

/* ---------- Fonts ---------- */

/*
 * Served from this site, never a font service, so no visitor data leaves
 * nockbook.app. Both fonts are under the SIL Open Font License; see
 * assets/fonts/README.md.
 */
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/barlow-condensed-500-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/barlow-condensed-600-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/barlow-condensed-700-latin.woff2") format("woff2");
}

/* One "variable" file covers every weight from 400 to 600. */
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/public-sans-latin.woff2") format("woff2");
}

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

:root {
  --color-page: #f3f5f1;
  --color-surface: #ffffff;
  --color-text: #16211b;
  --color-text-body: #3d4a42;
  --color-text-muted: #5a675f;
  --color-border: #d9dfd6;
  --color-control-border: #c9d1c5;
  --color-accent: #2a7a45;
  --color-on-accent: #ffffff;
  --color-accent-soft: #e2eee5;
  --color-link: #1f6b3b;
  --color-ten-soft: #fbf0c8;
  --color-ten-border: #ecd98f;
  --color-ten-text: #7a5800;
  --color-footer: #16211b;
  --color-footer-text: #dfe5dc;
  --color-shadow: rgba(22, 33, 27, 0.35);

  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 24px;
  --section-space: 64px;
  --heading-size: 44px;

  color-scheme: light dark;
}

/* Dark mode: the app's dark colors. */
@media (prefers-color-scheme: dark) {
  :root {
    --color-page: #111714;
    --color-surface: #19211d;
    --color-text: #e6ede8;
    --color-text-body: #c3cec7;
    --color-text-muted: #98a69d;
    --color-border: #2b3630;
    --color-control-border: #3d4a42;
    --color-accent: #5cbd7c;
    --color-on-accent: #0d1a12;
    --color-accent-soft: #1e3226;
    --color-link: #7fd09a;
    --color-ten-soft: #3a3014;
    --color-ten-border: #6b5a1f;
    --color-ten-text: #f0c03a;
    --color-footer: #0b100d;
    --color-footer-text: #c3cec7;
    --color-shadow: rgba(0, 0, 0, 0.6);
  }
}

/* A phone: the H2 design's sizes. */
@media (max-width: 639px) {
  :root {
    --gutter: 16px;
    --section-space: 48px;
    --heading-size: 36px;
  }
}

/* ---------- Page ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--color-link);
}

a:hover {
  color: var(--color-text);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
}

h2 {
  font-weight: 700;
  font-size: var(--heading-size);
  line-height: 1;
}

h3 {
  font-weight: 600;
  font-size: 26px;
  line-height: 1.1;
}

p {
  margin: 0;
}

/* Keeps headings clear of the top of the screen after a "#plans" jump. */
[id] {
  scroll-margin-top: 16px;
}

.wrap {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
}

.wrap-narrow {
  max-width: 860px;
}

.section {
  padding-block: var(--section-space);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* A full-width white band, for every other section. */
.band {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.note {
  font-size: 14px;
  color: var(--color-text-muted);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
}

.skip-link:focus {
  top: 8px;
}

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

.button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 600 15px var(--font-body);
  text-decoration: none;
}

.button-primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border: 1px solid var(--color-accent);
}

.button-primary:hover {
  color: var(--color-on-accent);
  filter: brightness(1.08);
}

.button-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-control-border);
}

.button-secondary:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.button-large {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 10px;
  font-size: 17px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-row {
  padding-block: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
}

/*
 * The mark's scan brackets are as tall as the wordmark's capital N: Barlow
 * Condensed's capitals are 0.7 of its size (28px, so about 19.6px), and the
 * brackets fill 87% of the mark's square.
 */
.brand-mark {
  flex: none;
  width: 48px;
  height: 48px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  font-size: 15px;
  font-weight: 600;
}

.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--color-text);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--color-link);
  text-decoration: underline;
}

.nav-sign-in {
  color: var(--color-link);
}

/* "Sign in" for a visitor, "Open app" for someone the app remembers as
   signed in (the script in index.html's head adds "signed-in"). */
html:not(.signed-in) .when-signed-in,
html.signed-in .when-signed-out {
  display: none;
}

/* A phone's header keeps just Sign in and Plans (the H2 design). */
@media (max-width: 639px) {
  .site-nav {
    gap: 12px;
  }

  .site-nav .wide-only {
    display: none;
  }

  /* Sign in first, then Plans, as the H2 design has them. */
  .nav-sign-in {
    order: -1;
  }
}

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

.hero {
  padding-block: 72px var(--section-space);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px;
}

.hero-text {
  flex: 1 1 460px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

h1 {
  font-weight: 700;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.5px;
  text-wrap: balance;
}

.lead {
  max-width: 560px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--color-text-body);
}

@media (max-width: 639px) {
  .hero {
    padding-top: 40px;
  }

  h1 {
    font-size: 46px;
  }
}

/* The phone showing a scanned card: an illustration, not a screenshot. */
.phone {
  flex: 0 1 340px;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phone-screen {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 32px;
  padding: 22px 18px;
  box-shadow: 0 24px 48px -24px var(--color-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.archer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-link);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 18px var(--font-display);
}

.archer-text {
  display: flex;
  flex-direction: column;
}

.archer-text b {
  font-weight: 600;
}

.small-muted {
  font-size: 12px;
  color: var(--color-text-muted);
}

.score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 52px;
  line-height: 0.9;
}

.score-out-of {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.ends {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.end {
  display: flex;
  align-items: center;
  gap: 4px;
}

.end > span:not(.end-total) {
  width: 34px;
  height: 28px;
  border-radius: 6px;
  background: var(--color-page);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.end > .ten {
  background: var(--color-ten-soft);
  border-color: var(--color-ten-border);
  color: var(--color-ten-text);
}

.end-total {
  margin-left: auto;
  font-size: 18px;
}

.fake-button {
  height: 46px;
  border-radius: 10px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font: 600 15px var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone figcaption {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- How it works ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 24px;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-number {
  font: 700 56px var(--font-display);
  line-height: 1;
  color: var(--color-accent);
}

.steps p {
  line-height: 1.55;
  color: var(--color-text-body);
}

/* ---------- Cards: who it's for, and plans ---------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--color-text-body);
}

/* On a white band (the plans), cards take the page color to stand apart. */
.band .card {
  background: var(--color-page);
}

.audiences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}

/* ---------- What it does ---------- */

.features {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 24px 40px;
}

.features > div {
  padding-top: 14px;
  border-top: 2px solid var(--color-accent);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.features dt {
  font: 600 22px var(--font-display);
}

.features dd {
  margin: 0;
  line-height: 1.55;
  color: var(--color-text-body);
}

/* ---------- Plans ---------- */

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-intro p {
  font-size: 17px;
  color: var(--color-text-body);
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.plan {
  padding: 22px;
}

.plan h3 {
  font-weight: 700;
}

.plan-featured {
  border: 2px solid var(--color-accent);
}

.price {
  font: 700 48px var(--font-display);
  line-height: 1;
}

.per {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.plan-who {
  font-size: 15px;
  font-weight: 600;
}

.plan ul {
  flex: 1;
  padding-left: 18px;
  gap: 6px;
  font-size: 15px;
  line-height: 1.45;
}

.plan .button {
  min-height: 46px;
}

/* ---------- Questions ---------- */

.faq {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
}

.faq details {
  border-bottom: 1px solid var(--color-border);
  padding-block: 4px;
}

.faq summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* A plus that turns into a minus while the answer shows. */
.faq summary::after {
  content: "+";
  flex: none;
  font: 600 26px var(--font-display);
  color: var(--color-accent);
}

.faq details[open] summary::after {
  content: "–";
}

.faq p {
  margin-bottom: 16px;
  line-height: 1.6;
  color: var(--color-text-body);
}

/* ---------- Closing ---------- */

.closing {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.closing h2 {
  max-width: 620px;
  font-size: 40px;
  line-height: 1.05;
}

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

.site-footer {
  background: var(--color-footer);
  color: var(--color-footer-text);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.footer-row {
  padding-block: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-line svg {
  flex: none;
  width: 24px;
  height: 24px;
}

.footer-small {
  font-size: 13px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-weight: 600;
}

.footer-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: #ffffff;
}

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

@media (max-width: 639px) {
  .footer-row {
    padding-block: 28px;
  }
}
