/* PinPin website: the shared sticky language (tokens, page chrome, stickies, pills, capsules, todos, glass).
   Every page loads this file; home.css and connect.css add their page rules. Values follow the Paper file "PinPin",
   page "Phase 3 — Website & Brand" (Sticky Home / Connect / Note link / Invalid link / 404 boards).
   No inline styles anywhere: the CSP has no 'unsafe-inline'. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* Width of the one-column stack below the desktop layout; header and footer line up with it. */
  --column: 600px;

  --label: rgb(0 0 0 / 85%);
  /* 58%, not Paper's --color-label-2 54%: 54% black on white is 4.55:1, too close to the 4.5:1 AA floor. */
  --label-2: rgb(0 0 0 / 58%);
  --ring: #007AFF;
  --yellow: #FFF2B0;
  --pink: #FFE3E7;
  --blue: #D8F1FF;
  --green: #DBF8DA;
  --purple: #EBE5FF;
  --gray: #ECEDEF;
  --pink-accent: #B3415E;
  --pink-checkbox: #958083;
  --green-accent: #287C42;
  --green-checkbox: #798C79;
  --on-accent: #FFFFFF;
  --glass: rgb(255 255 255 / 62%);
  --glass-hover: rgb(255 255 255 / 80%);
  --glass-edge: rgb(0 0 0 / 7%);
  --glyph: rgb(0 0 0 / 62%);
  --hairline: rgb(0 0 0 / 8%);
  --inset: rgb(0 0 0 / 5%);
  --cta: #000000;
  --cta-hover: #333333;
  --on-cta: #FFFFFF;
  --cta-shadow: 0 1px 2px #0000001F, 0 6px 16px -4px #00000024;
  --cta-shadow-hover: 0 1px 2px #00000024, 0 10px 22px -6px #0000002E;
  --outline-hover: rgb(0 0 0 / 6%);
  --shadow: 0 0 0 0.5px #00000014, 0 1px 3px #0000000F, 0 10px 28px -6px #00000029;
  /* Gray stickies trade the 0.5px edge for a 1px hairline ring so they don't melt into the white page. */
  --shadow-gray: 0 0 0 1px var(--hairline), 0 1px 3px #0000000F, 0 10px 28px -6px #00000029;
  /* The current page's nav pill: a neutral inset ring in place of the hairline. */
  --shadow-current: inset 0 0 0 1.25px #0000008C, 0 1px 3px #0000000F, 0 10px 28px -6px #00000029;
}

@media (prefers-color-scheme: dark) {
  :root {
    --label: rgb(255 255 255 / 86%);
    --label-2: rgb(255 255 255 / 56%);
    --ring: #0A84FF;
    --yellow: #2D2A1D;
    --pink: #332225;
    --blue: #192A33;
    --green: #202B20;
    --purple: #292535;
    --gray: #26282A;
    --pink-accent: #EEA7B3;
    --pink-checkbox: #836E71;
    --green-accent: #8ED09C;
    --green-checkbox: #6B796B;
    --on-accent: rgb(0 0 0 / 78%);
    --glass: rgb(255 255 255 / 11%);
    /* Not drawn in Paper: the light hover's "glass fills up" step applied to the dark glass. */
    --glass-hover: rgb(255 255 255 / 18%);
    --glass-edge: rgb(255 255 255 / 12%);
    --glyph: rgb(255 255 255 / 72%);
    --hairline: rgb(255 255 255 / 10%);
    --inset: rgb(255 255 255 / 6%);
    --cta: #FFFFFF;
    --cta-hover: #D6D6D6;
    --on-cta: #000000;
    --cta-shadow: 0 1px 2px #00000059, 0 6px 16px -4px #00000066;
    /* Not drawn in Paper: the light hover's "shadow deepens" step applied to the dark shadow. */
    --cta-shadow-hover: 0 1px 2px #00000066, 0 10px 22px -6px #00000080;
    /* Not drawn in Paper: the light secondary hover fill, as white. */
    --outline-hover: rgb(255 255 255 / 8%);
    --shadow: inset 0 0 0 0.5px rgb(255 255 255 / 10%), 0 0 0 0.5px #0000008C, 0 1px 3px #00000040, 0 12px 32px -6px #00000080;
    --shadow-gray: var(--shadow);
    --shadow-current: inset 0 0 0 1.25px #FFFFFF8C, 0 0 0 0.5px #0000008C, 0 1px 3px #00000040, 0 12px 32px -6px #00000080;
  }
}

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

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

/* Below the desktop query: one column in reading order (Paper "… — 390 light" boards). */
body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  margin: 0;
  padding: 16px 16px 24px;
  background: #FFFFFF url("/images/dots-light.svg") center / 256px 256px;
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (prefers-color-scheme: dark) {
  body { background: #000000 url("/images/dots-dark.svg") center / 256px 256px; }
}

main { flex: 1; }
.site-header, main, .site-footer { width: 100%; max-width: var(--column); margin-inline: auto; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
code, pre { font-family: var(--font-mono); }
[hidden] { display: none !important; }

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--cta);
  color: var(--on-cta);
  z-index: 10;
}
.skip-link:focus { top: 12px; }

/* Page chrome: collapsed stickies for the brand, the nav and the footer.
   Too narrow for one row (under ~330px, e.g. a small phone or a zoomed-in window), the pills wrap with the nav's 8px gap. */
.site-header, .site-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.site-header { padding-bottom: 4px; }
.site-footer { padding-top: 16px; }

.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  margin: 0;
  padding: 0 14px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--label);
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: -0.006em;
  white-space: nowrap;
}
.pill-brand { padding: 0 14px 0 10px; }
.pill-gray { background: var(--gray); box-shadow: var(--shadow-gray); }
.pill-gray[aria-current="page"] { box-shadow: var(--shadow-current); }
.pill-muted { color: var(--label-2); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Stickies */
.note {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 32px 16px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: clip;
}
.note-yellow, .pill-yellow { background: var(--yellow); }
.note-pink, .pill-pink { background: var(--pink); }
.note-blue, .pill-blue { background: var(--blue); }
.note-green { background: var(--green); }
.note-purple, .pill-purple { background: var(--purple); }
.note-gray { background: var(--gray); box-shadow: var(--shadow-gray); }
.note h2 { margin: 0; font-size: 22px; line-height: 26px; font-weight: 700; letter-spacing: -0.012em; }
.note p { margin: 0; font-size: 13px; line-height: 18px; letter-spacing: -0.006em; color: var(--label-2); }

/* The app's glass control: copy buttons, step numbers and the home page's sticky buttons. */
.glass {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  border-radius: 11px;
  background: var(--glass);
  box-shadow: inset 0 0 0 0.5px var(--glass-edge), 0 0.5px 1.5px #00000014;
  color: var(--glyph);
}

/* Capsule buttons: primary is solid, secondary is an outline in the text colour. */
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 26px;
  border-radius: 24px;
  background: var(--cta);
  box-shadow: var(--cta-shadow);
  color: var(--on-cta);
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.022em;
  white-space: nowrap;
}
.cta:hover { background: var(--cta-hover); box-shadow: var(--cta-shadow-hover); }
.cta svg { flex-shrink: 0; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.cta-secondary, .cta-secondary:hover { box-shadow: inset 0 0 0 1.5px var(--label); color: var(--label); }
.cta-secondary { background: transparent; }
.cta-secondary:hover { background: var(--outline-hover); }

/* Todos: a native checkbox sits on top of the drawn circle, so Space and screen readers work.
   The sticky's colour supplies --accent and --checkbox. */
.note-pink { --accent: var(--pink-accent); --checkbox: var(--pink-checkbox); }
.note-green { --accent: var(--green-accent); --checkbox: var(--green-checkbox); }
.todos { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.todo {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: start;
  column-gap: 8px;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -0.006em;
}
.todo input {
  position: absolute;
  top: -3px;
  left: -4px;
  width: 24px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.todo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin: 1.5px 0 0 0.5px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.25px var(--checkbox);
  color: var(--on-accent);
}
.todo-box svg { visibility: hidden; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.todo input:checked + .todo-box { background: var(--accent); box-shadow: none; }
.todo input:checked + .todo-box svg { visibility: visible; }
.todo input:focus-visible + .todo-box { outline: 3px solid var(--ring); outline-offset: 2px; }
/* Ticked items drop to the secondary label, no strike-through (as in the app). */
.todo input:checked ~ .todo-text { color: var(--label-2); }

/* One centred sticky: the note link landing, the invalid link and 404 (Paper "Sticky Note link / Invalid link / 404"). */
.notice-page { display: flex; align-items: center; justify-content: center; }
.notice { width: min(520px, 100%); gap: 12px; padding: 36px 16px 20px; }
.notice-short { width: min(440px, 100%); }
.notice h1 { margin: 0; font-size: 26px; line-height: 30px; font-weight: 700; letter-spacing: -0.024em; }
.notice p { font-size: 15px; line-height: 22px; letter-spacing: -0.01em; color: var(--label); text-wrap: pretty; }
.notice .ai-note { padding-top: 4px; font-size: 13px; line-height: 18px; letter-spacing: -0.006em; color: var(--label-2); }
.ai-note code { color: var(--label); font-size: 12px; }
.notice-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
/* padding-block makes the 22px line a 24px tap target (WCAG 2.5.8); the margin keeps Paper's 8px step above it. */
.text-link {
  align-self: flex-start;
  margin-top: 7px;
  padding-block: 1px;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.01em;
  text-decoration: underline 1px;
  text-underline-offset: 3px;
}

/* Desktop, as in the Paper "… — 1440" boards. Same query as home.css, connect.css and DESKTOP in home.js. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  body { gap: 0; padding: 0; }
  .site-header { max-width: none; padding: 28px 40px 0; }
  .site-footer { max-width: none; margin-top: auto; padding: 0 40px 28px; }
  .site-header .pill, .site-footer .pill { width: 132px; padding: 0; }
  .pill-row { gap: 12px; }

  .notice-page { padding-block: 32px; }
  .notice { padding: 36px 32px 32px; }
  .notice h1 { font-size: 30px; line-height: 34px; }
  .notice-actions { flex-direction: row; align-items: center; gap: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .cta { transition: background-color 0.15s, box-shadow 0.15s; }
}
