/*
 * ndge.ca, one stylesheet for all three pages.
 *
 * Colours are the app's own (src/theme/tokens.ts in Memory_Recall) and the
 * brand kit's. Lavender is the store screenshots' accent and is kept tiny:
 * the stroke under the question, link underlines, the focus ring, text
 * selection. It never carries text, because at #C9B8E4 on ivory it could not.
 *
 * Fraunces is served from this site rather than Google Fonts, so loading the
 * privacy policy does not tell a third party who read it.
 */

@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/Fraunces_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/Fraunces_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ivory: #F7F3EC;
  --paper: #E9DFD4;
  --cocoa: #37291F;
  --ink: #392D26;
  --ink-soft: #5C4F46;
  --line: #E6DED3;
  --line-strong: #CFC5B8;
  --lavender: #C9B8E4;
  --purple: #6B4DA3;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  /* The phone's own font, as in the app: San Francisco on an iPhone. */
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Helvetica, Arial, sans-serif;

  --gutter: 20px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--lavender); color: var(--cocoa); }

a {
  color: var(--cocoa);
  text-decoration-line: underline;
  text-decoration-color: var(--lavender);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--purple); }

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

img { display: block; max-width: 100%; height: auto; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--cocoa);
  color: var(--ivory);
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* The wordmark: Fraunces Bold, cocoa, the period always there. */
.mark {
  display: inline-block;
  font: 700 26px/1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--cocoa);
  text-decoration: none;
  padding: 24px 0 8px;
}

/* ---------------------------------------------------------------- landing */

.copy { padding-top: 40px; }

/* The notification, edge to edge of its bubble, rounded to iOS's own
   radius (70 px on a 1102 x 193 bubble). It arrives once, the way a real one
   does, and simply sits there when motion is reduced. */
.nudge {
  width: 100%;
  max-width: 380px;
  border-radius: 6.4% / 36%;
  margin: 0 0 28px;
}
@media (prefers-reduced-motion: no-preference) {
  .nudge { animation: arrive 560ms cubic-bezier(0.2, 0.9, 0.25, 1) 250ms both; }
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(-14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.question {
  margin: 0;
  font: 700 clamp(40px, 11vw, 64px)/1.04 var(--serif);
  letter-spacing: -0.02em;
  color: var(--cocoa);
  text-wrap: balance;
  max-width: 11em;
}

/* The one hand-drawn thing, borrowed from the store screenshots. */
.stroke {
  display: block;
  width: 104px;
  height: 12px;
  margin: 18px 0 24px;
  color: var(--lavender);
}

.intro {
  margin: 0 0 28px;
  font-size: 19px;
  line-height: 1.5;
  max-width: 26em;
}

.cta {
  display: block;
  width: 100%;
  max-width: 400px;
  padding: 17px 20px;
  border-radius: 14px;
  background: var(--cocoa);
  color: var(--ivory);
  font: 600 18px/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
}
.cta:hover { background: #2A1F19; }
.cta:focus-visible { outline-offset: 4px; }

.cta-note {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 400px;
}
.desktop-only { display: none; }

/* Real captures on the app's launch-screen paper, one swipe wide. */
.shots {
  margin: 48px calc(var(--gutter) * -1) 0;
  padding: 28px var(--gutter);
  background: var(--paper);
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
/* Focusable so a keyboard can scroll it; the ring sits inside the band. */
.shots:focus-visible { outline-offset: -4px; border-radius: 0; }
.shots figure {
  flex: 0 0 56%;
  max-width: 240px;
  margin: 0;
  scroll-snap-align: start;
}
.shots img {
  width: 100%;
  aspect-ratio: 600 / 1190;
  object-fit: cover;
  object-position: top;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  background: var(--ivory);
}
.shots figcaption {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-soft);
}

.more { padding: 40px 0 8px; }
.more section + section { margin-top: 36px; }

.more h2 {
  margin: 0 0 8px;
  font: 600 24px/1.2 var(--serif);
  letter-spacing: -0.01em;
  color: var(--cocoa);
}
.more p { margin: 0; max-width: 32em; }
.more .small { font-size: 16px; color: var(--ink-soft); }

.site-foot {
  margin-top: 48px;
  padding: 20px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}
.site-foot nav { display: flex; gap: 24px; margin-bottom: 10px; }
.site-foot p { margin: 0; }

@media (min-width: 900px) {
  :root { --gutter: 40px; }

  .landing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'copy shots' 'more shots';
    column-gap: 56px;
    align-items: start;
  }
  .copy { grid-area: copy; padding-top: 72px; }
  .more { grid-area: more; }

  .desktop-only { display: block; }

  /* A small fan of notes, tilted at the app's own note angles. */
  .shots {
    grid-area: shots;
    position: relative;
    margin: 72px 0 0;
    padding: 0;
    height: 620px;
    background: none;
    overflow: visible;
  }
  .shots figure {
    position: absolute;
    width: 250px;
    max-width: none;
  }
  .shots figure:nth-child(1) { left: 0; top: 40px; transform: rotate(-4deg); }
  .shots figure:nth-child(2) { left: 26%; top: 0; transform: rotate(3deg); z-index: 1; }
  .shots figure:nth-child(3) { left: 52%; top: 64px; transform: rotate(-2deg); z-index: 2; }
  .shots figcaption { display: none; }
  .shots img { box-shadow: 0 1px 2px rgba(55, 41, 31, 0.08); }
}

/* ------------------------------------------------------------ long reads */

.doc { max-width: 38em; padding: 40px 0 8px; }

.doc h1 {
  margin: 0 0 8px;
  font: 700 clamp(34px, 9vw, 48px)/1.08 var(--serif);
  letter-spacing: -0.02em;
  color: var(--cocoa);
}
.doc .meta { margin: 0 0 32px; color: var(--ink-soft); font-size: 16px; }

.doc .lead {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  padding-left: 16px;
  border-left: 3px solid var(--lavender);
  margin: 0 0 8px;
}
.doc .lead p { margin: 0 0 12px; }

.doc h2 {
  margin: 40px 0 10px;
  font: 600 24px/1.2 var(--serif);
  letter-spacing: -0.01em;
  color: var(--cocoa);
}
.doc h3 {
  margin: 28px 0 6px;
  font: 600 17px/1.35 var(--sans);
  color: var(--ink);
}
.doc p, .doc li { color: var(--ink); }
.doc p { margin: 0 0 14px; }
.doc ul { padding-left: 22px; margin: 0 0 14px; }
.doc li { margin-bottom: 8px; }
.doc strong { color: var(--cocoa); }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 20px;
  font-size: 15px;
  line-height: 1.5;
}
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid var(--line-strong);
}
.doc th { font-weight: 600; color: var(--cocoa); }
.doc td + td, .doc th + th { padding-left: 10px; }

.doc .signoff {
  margin-top: 40px;
  font-size: 16px;
  color: var(--ink-soft);
}

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

/* One item per line, with room between them, so a wrapped line never reads
   as the start of the next item. */
.doc td .item { display: block; }
.doc td .item + .item { margin-top: 8px; }
