/* Keeps — keeps.dewyze.dev
   The scorepad as an artifact: warm ledger paper, a persimmon margin
   rule, tally marks, and the app's own palette (Assets.xcassets). */

:root {
  --paper: #f7f2e8;
  --surface: #ffffff;
  --ink: #2a241d;
  --ink-soft: rgba(42, 36, 29, 0.62);
  --ink-faint: rgba(42, 36, 29, 0.35);
  --accent: #d96b47;
  --accent-link: #a84a28;   /* deepened for AA body-text contrast */
  --rule-line: rgba(42, 36, 29, 0.07);
  --margin-rule: rgba(217, 107, 71, 0.4);
  --dash: rgba(42, 36, 29, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1a17;
    --surface: #2b2924;
    --ink: #f2ede4;
    --ink-soft: rgba(242, 237, 228, 0.62);
    --ink-faint: rgba(242, 237, 228, 0.35);
    --accent: #ed8561;
    --accent-link: #ed8561;
    --rule-line: rgba(242, 237, 228, 0.055);
    --margin-rule: rgba(237, 133, 97, 0.35);
    --dash: rgba(242, 237, 228, 0.28);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Atkinson Hyperlegible", ui-rounded, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  /* Ruled ledger paper: a faint line every two rhythm units. */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(2.2rem - 1px),
    var(--rule-line) calc(2.2rem - 1px),
    var(--rule-line) 2.2rem
  );
  min-height: 100dvh;
  position: relative;
}

/* The notebook's margin rule. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: clamp(1.25rem, calc(50vw - 21rem), 4.5rem);
  width: 1.5px;
  background: var(--margin-rule);
  pointer-events: none;
}

.page {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2.2rem clamp(2.25rem, 8vw, 3rem) 4.4rem clamp(2.5rem, 10vw, 3.5rem);
}

h1,
h2,
.wordmark {
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  margin-block: 1.1rem;
}

h1 .accent {
  color: var(--accent);
}

h2 {
  font-size: 1.35rem;
  margin-block: 3.3rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

p {
  margin-block: 1.1rem;
  max-width: 34rem;
}

a {
  color: var(--accent-link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2.5px;
}

.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
}

/* ---- Chrome ---------------------------------------------------------- */

.wordmark {
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* The small tally logo beside the wordmark. */
.tally-mark {
  height: 1.05em;
  width: auto;
}

.tally-mark line {
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
}

footer {
  margin-top: 4.4rem;
  padding-top: 1.1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

footer a {
  color: inherit;
}

/* ---- Tally marks ------------------------------------------------------ */

.tally-svg {
  display: block;
  margin-top: 2.2rem;
  height: 3.2rem;
  width: auto;
}

.tally-svg line {
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
}

/* Strokes draw themselves in, one at a time. */
@media (prefers-reduced-motion: no-preference) {
  .tally-svg line {
    stroke-dasharray: 110;
    stroke-dashoffset: 110;
    animation: draw 0.35s ease-out forwards;
  }
  .tally-svg line:nth-child(1) { animation-delay: 0.15s; }
  .tally-svg line:nth-child(2) { animation-delay: 0.35s; }
  .tally-svg line:nth-child(3) { animation-delay: 0.55s; }
  .tally-svg line:nth-child(4) { animation-delay: 0.75s; }
  .tally-svg line:nth-child(5) { animation-delay: 1.0s; }

  .rise {
    opacity: 0;
    animation: rise 0.5s ease-out forwards;
  }
  .rise:nth-of-type(2) { animation-delay: 0.08s; }
  .rise:nth-of-type(3) { animation-delay: 0.16s; }
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- The pitch line ---------------------------------------------------- */

.pitch {
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.5;
}

.pitch .dot {
  color: var(--accent);
  padding-inline: 0.55rem;
}

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

.page-wide {
  max-width: 60rem;
}

.hero {
  display: grid;
  gap: 2.2rem;
  align-items: center;
  margin-top: 1.1rem;
}

@media (min-width: 46rem) {
  .hero {
    grid-template-columns: 1.25fr 1fr;
    gap: 3rem;
  }
}

.hero-phone {
  max-width: 17rem;
  justify-self: center;
}

/* ---- Phone frames -------------------------------------------------------- */

.phone {
  margin: 0;
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 1.5px solid var(--dash);
  box-shadow: 0 12px 30px rgba(42, 36, 29, 0.14);
}

.phone figcaption {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-align: center;
}

.phone figcaption strong {
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink);
}

/* ---- Bands: every section argues a benefit ------------------------------- */

.band {
  display: grid;
  grid-template-areas: "copy" "media";
  gap: 2.2rem;
  align-items: center;
  margin-top: 3.3rem;
  background: var(--surface);
  border-radius: 22px;
  padding: 2.2rem clamp(1.5rem, 5vw, 3rem);
  box-shadow: 0 1px 3px rgba(42, 36, 29, 0.06);
}

.band .copy {
  grid-area: copy;
}

.band .media {
  grid-area: media;
}

@media (min-width: 46rem) {
  .band {
    grid-template-areas: "media copy";
    grid-template-columns: 1fr 1.3fr;
  }

  .band.flip {
    grid-template-areas: "copy media";
    grid-template-columns: 1.3fr 1fr;
  }

  /* Bands with several phones: the media side gets the bigger share so
     the shots sit in a row instead of stacking. */
  .band.wide-media {
    grid-template-columns: 1.7fr 1fr;
  }

  .band.flip.wide-media {
    grid-template-columns: 1fr 1.7fr;
  }
}

.band h2 {
  margin-top: 0;
  color: var(--accent-link);
}

.band p {
  color: var(--ink-soft);
}

.band .media {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
}

.band .media .phone {
  flex: 1 1 8rem;
  min-width: 0;
  max-width: 13rem;
}

/* Text-only closer: one centered statement, no phone. */
.band.solo {
  display: block;
  text-align: center;
  padding-block: 3rem;
}

.band.solo .copy {
  max-width: 30rem;
  margin-inline: auto;
}

.badge {
  display: inline-block;
  margin-top: 1.1rem;
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1.5px dashed var(--dash);
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  text-decoration: none;
}

/* ---- Prose pages (support, privacy) ----------------------------------- */

.prose h2 {
  font-size: 1.2rem;
}

.updated {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.email {
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.25rem;
}
