/* pnrapps.com: "Engineered Simplicity". Design notes: docs/DESIGN.md */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #F7F7F3;
  --paper-2: #EFEFEA;
  --ink: #171B24;
  --ink-2: #3B414D;
  --muted: #5C626D;   /* secondary text, 5.7:1 on paper */
  --grey: #858B96;    /* large text and decoration only */
  --line: #E1E1DB;
  --line-strong: #C8C9C2;
  --cobalt: #365CF5;  /* 4.9:1 on paper */
  --pale: #E9EEFF;
  --on-accent: #FFFFFF;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* 8px spacing scale */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px;
  --s7: 56px; --s8: 64px; --s10: 80px; --s12: 96px; --s14: 112px; --s16: 128px;

  --gutter: 20px;
  --max: 1240px;
  --header-h: 64px;
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (min-width: 768px) { :root { --gutter: 40px; --header-h: 72px; } }
@media (min-width: 1200px) { :root { --gutter: 56px; } }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111319;
    --paper-2: #171A21;
    --ink: #ECECE6;
    --ink-2: #C9CBC5;
    --muted: #A0A5AE;
    --grey: #767C88;
    --line: #242831;
    --line-strong: #353A45;
    --cobalt: #7D96FF;
    --pale: #161D36;
    --on-accent: #0D1020;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
main { flex: 1; }
svg { display: block; }
p { margin: 0 0 var(--s2); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cobalt); }
::selection { background: var(--cobalt); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip { position: absolute; left: -9999px; top: 8px; }
.skip:focus { left: var(--s2); z-index: 10; background: var(--ink); color: var(--paper); padding: var(--s1) var(--s2); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Small parts ---------- */
.label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--cobalt);
  flex: none;
}
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em; }

.arrow {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  transition: transform .3s var(--ease);
}
a:hover .arrow, a:focus-visible .arrow { transform: translateX(3px); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 var(--s3);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font: 500 15px/1 var(--font-body);
  text-decoration: none;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.button:hover, .button:focus-visible { background: var(--cobalt); color: var(--on-accent); }
.stores { display: flex; flex-wrap: wrap; gap: var(--s2); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--ink);
  font: 500 15px/1 var(--font-body);
  text-decoration: none;
}
.link-arrow span, .closing-email span, .contact-email span {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size .35s var(--ease);
}
.link-arrow:hover span, .link-arrow:focus-visible span,
.closing-email a:hover span, .contact-email a:hover span { background-size: 100% 1px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: var(--s5) 0 0; }

/* The PNR mark */
.mark { width: 28px; height: 28px; }
.mark-ink { fill: currentColor; }
.mark-accent { fill: var(--cobalt); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: var(--s2); height: var(--header-h); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font: 600 16px/1 var(--font-display);
  letter-spacing: .04em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand .mark { width: 24px; height: 24px; }
@media (min-width: 768px) { .brand .mark { width: 28px; height: 28px; } }

.nav { margin-left: auto; display: flex; }
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  transition: color .25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--cobalt); }
@media (min-width: 768px) { .nav a { padding: 0 14px; } .nav a::after { left: 14px; right: 14px; } }

.header-cta { display: none; }
@media (min-width: 1024px) {
  .header-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: var(--s2);
    padding: 0 var(--s2);
    min-height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font: 500 13px/1 var(--font-mono);
    color: var(--ink);
    text-decoration: none;
    transition: border-color .25s var(--ease), color .25s var(--ease);
  }
  .header-cta:hover { border-color: var(--cobalt); color: var(--cobalt); }
  .header-cta .arrow { width: 14px; height: 14px; }
}

/* ---------- Hero ---------- */
.hero { padding: var(--s6) 0 var(--s10); }
.hero-grid { display: grid; gap: var(--s8); }
.hero h1 {
  margin-top: var(--s3);
  font-size: clamp(2.75rem, 1.2rem + 6vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.045em;
  font-weight: 500;
}
.hero h1 .soft { display: block; color: var(--grey); }
.lead {
  margin: var(--s3) 0 0;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.03rem + .35vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-2);
}
.hero .lead { margin-top: var(--s4); }

.hero-figure { margin: 0; }
.blueprint { width: 100%; height: auto; max-height: 560px; margin-inline: auto; overflow: visible; }
.hero-figure figcaption {
  margin-top: var(--s2);
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
  font: 12px/1.5 var(--font-mono);
  letter-spacing: .02em;
  color: var(--muted);
}
.bp-dot { fill: var(--line-strong); }
.bp-corner, .bp-grid, .bp-frame, .bp-measure, .bp-leader, .bp-center { fill: none; stroke-width: 1; }
.bp-corner { stroke: var(--grey); }
.bp-grid { stroke: var(--line); }
.bp-frame { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.bp-guide { fill: none; stroke: var(--cobalt); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.bp-measure, .bp-leader, .bp-center { stroke: var(--grey); }
.bp-mark .mark-ink { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.bp-node { fill: var(--paper); stroke: var(--ink); stroke-width: 1.25; }
.bp-text { fill: var(--muted); font: 500 13px var(--font-mono); letter-spacing: .06em; }
.bp-small { font-size: 11px; }

@media (min-width: 768px) {
  .hero { padding: var(--s10) 0 var(--s12); }
  .hero-figure { max-width: 520px; }
}
@media (min-width: 1024px) {
  .hero { padding: var(--s12) 0 var(--s14); }
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); align-items: center; }
  .hero-figure { max-width: none; }
}

/* ---------- Sections ---------- */
.section { padding: var(--s10) 0; }
.section + .section > .container { position: relative; }
.section + .section > .container::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--s10));
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--line);
}
.section + .section > .container::after {
  content: "";
  position: absolute;
  top: calc(-1 * var(--s10) - 3px);
  left: var(--gutter);
  width: 7px;
  height: 7px;
  background: var(--paper);
  border: 1px solid var(--ink);
}
.section-tight { padding-top: var(--s6); }
.section-grid { display: grid; gap: var(--s4); }
.section-head h2 {
  margin-top: var(--s2);
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
  letter-spacing: -.03em;
}
.section-body > :last-child { margin-bottom: 0; }

@media (min-width: 768px) {
  .section { padding: var(--s14) 0; }
  .section + .section > .container::before { top: calc(-1 * var(--s14)); }
  .section + .section > .container::after { top: calc(-1 * var(--s14) - 3px); }
  .section-tight { padding-top: var(--s8); }
}
@media (min-width: 1024px) {
  .section-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s6); }
  .section-head { padding-right: var(--s4); }
}

.statement {
  font: 400 clamp(1.375rem, 1.1rem + 1vw, 1.875rem)/1.35 var(--font-display);
  letter-spacing: -.015em;
  color: var(--ink);
  margin-bottom: var(--s4);
  text-wrap: pretty;
}
.section-body p { max-width: 40rem; color: var(--ink-2); }
.section-body .statement { max-width: 46rem; color: var(--ink); }

/* Capabilities: numbered rows */
.capabilities, .steps, .principles, .notes { list-style: none; margin: 0; padding: 0; }
.capabilities li {
  display: grid;
  gap: var(--s1) var(--s3);
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
}
.capabilities li:last-child { border-bottom: 1px solid var(--line); }
.capabilities .index, .principles h3::before {
  font: 500 12px/1.9 var(--font-mono);
  letter-spacing: .08em;
  color: var(--cobalt);
}
.capabilities h3 { font-size: clamp(1.375rem, 1.2rem + .7vw, 1.75rem); letter-spacing: -.025em; }
.capabilities p { margin: var(--s1) 0 0; color: var(--ink-2); }
@media (min-width: 768px) {
  .capabilities li { grid-template-columns: 56px minmax(0, 5fr) minmax(0, 7fr); align-items: baseline; padding: var(--s5) 0; }
  .capabilities p { margin: 0; }
}

/* Approach: three connected steps */
.steps { counter-reset: step; display: grid; gap: var(--s4); position: relative; }
.steps li { counter-increment: step; position: relative; padding-left: var(--s5); }
.steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}
.steps li:first-child::before { background: var(--cobalt); border-color: var(--cobalt); }
.steps li::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 22px;
  bottom: calc(-1 * var(--s4) + 6px);
  width: 1px;
  background: var(--line-strong);
}
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 1.25rem; letter-spacing: -.02em; }
.steps h3::before { content: "0" counter(step) "  "; font: 500 12px var(--font-mono); letter-spacing: .08em; color: var(--muted); white-space: pre; vertical-align: 3px; }
.steps p { margin: var(--s1) 0 0; color: var(--ink-2); }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
  .steps li { padding: var(--s5) 0 0; }
  .steps li::before { top: 0; }
  .steps li::after { left: 16px; right: calc(-1 * var(--s4) + 4px); top: 4px; bottom: auto; width: auto; height: 1px; }
  .steps h3::before { display: block; content: "0" counter(step); margin-bottom: var(--s1); vertical-align: 0; }
}

/* About: principles grid */
.principles { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); counter-reset: principle; }
.principles li { background: var(--paper); padding: var(--s4); counter-increment: principle; }
.principles h3 { font-size: 1.375rem; letter-spacing: -.02em; }
.principles h3::before { content: "0" counter(principle); display: block; margin-bottom: var(--s2); }
.principles p { margin: var(--s1) 0 0; color: var(--ink-2); font-size: 1rem; }
@media (min-width: 768px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .principles li { padding: var(--s5); } }

/* Facts */
.facts {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}
.facts dt { padding-top: var(--s2); font: 500 12px/1.6 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; padding-bottom: var(--s2); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .facts { grid-template-columns: 180px minmax(0, 1fr); }
  .facts dt, .facts dd { padding: var(--s2) 0; margin: 0; border-bottom: 1px solid var(--line); }
  .facts dt { line-height: 1.65rem; }
}

/* Notes list (contact) */
.notes li { padding: var(--s3) 0; border-top: 1px solid var(--line); color: var(--ink-2); max-width: 44rem; }
.notes li:last-child { border-bottom: 1px solid var(--line); }
.notes strong { color: var(--ink); font-weight: 600; }

/* ---------- Page heads (inner pages) ---------- */
.page-head { padding: var(--s8) 0 var(--s4); }
.page-head h1 {
  margin-top: var(--s3);
  max-width: 16ch;
  font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.04em;
}
.page-head .lead { max-width: 38rem; }
@media (min-width: 768px) { .page-head { padding: var(--s12) 0 var(--s6); } }
.page-head-404 { padding-bottom: var(--s14); }

/* ---------- Contact ---------- */
.contact-email, .closing-email { margin: 0 0 var(--s5); }
.contact-email a, .closing-email a {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font: 500 clamp(1.5rem, 1rem + 2.4vw, 2.75rem)/1.15 var(--font-display);
  letter-spacing: -.03em;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-email a:hover, .closing-email a:hover { color: var(--cobalt); }
.contact-email .arrow, .closing-email .arrow { width: 24px; height: 24px; stroke-width: 1.5; }

/* ---------- Closing band ---------- */
.closing { background: var(--pale); padding: var(--s10) 0; margin-top: var(--s4); }
.closing h2 {
  margin: var(--s3) 0 var(--s4);
  font-size: clamp(2.5rem, 1.2rem + 5vw, 5rem);
  line-height: 1;
  letter-spacing: -.045em;
}
.closing-email { margin-bottom: var(--s3); }
.closing-email a { color: var(--cobalt); }
.closing-email a:hover { color: var(--ink); }
.closing-note { margin: 0; font: 12px/1.5 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 768px) { .closing { padding: var(--s14) 0; } }

/* ---------- Prose (privacy, app pages) ---------- */
.prose { max-width: 44rem; }
.prose h2 { font-size: 1.375rem; letter-spacing: -.02em; margin: var(--s6) 0 var(--s2); }
.prose h3 { font-size: 1.125rem; margin: var(--s4) 0 var(--s1); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.1em; margin: 0 0 var(--s2); }
.prose li { margin-bottom: var(--s1); }
.prose a { color: var(--ink); }
.prose a:hover { color: var(--cobalt); }
.prose .button { color: var(--paper); }
.prose .button:hover, .prose .button:focus-visible { color: var(--on-accent); }
.section-body.prose { max-width: none; }

.policy { counter-reset: clause; }
.policy h2 { counter-increment: clause; }
.policy h2::before {
  content: counter(clause, decimal-leading-zero);
  display: block;
  margin-bottom: var(--s1);
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: .08em;
  color: var(--cobalt);
}
.policy-date { margin-top: var(--s2); font: 500 1.25rem/1.3 var(--font-display); letter-spacing: -.01em; }
.summary {
  margin: 0 0 var(--s6);
  padding: var(--s4);
  background: var(--paper-2);
  border-left: 2px solid var(--cobalt);
  max-width: 44rem;
}
.summary h2 { font-size: 1.125rem; margin: 0 0 var(--s2); }
.summary ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); }
.summary p { margin: 0; }
.summary li + li { margin-top: var(--s1); }

/* ---------- Apps ---------- */
.subnav { display: flex; gap: var(--s3); margin: 0 0 var(--s5); border-bottom: 1px solid var(--line); }
.subnav a { padding: var(--s1) 0 var(--s2); color: var(--muted); text-decoration: none; font-size: 15px; }
.subnav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -1px 0 var(--cobalt); }
.app-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.app-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px var(--s3);
  align-items: center;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.app-name { font: 500 1.375rem/1.2 var(--font-display); letter-spacing: -.02em; }
.app-tagline { grid-column: 1; color: var(--muted); }
.app-list .arrow { grid-column: 2; grid-row: 1 / span 2; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: var(--s8) 0 var(--s4); font-size: 15px; }
.footer-top { display: grid; gap: var(--s5); padding-bottom: var(--s6); }
.footer-id .brand { margin-bottom: var(--s3); }
.footer-legal { color: var(--ink-2); line-height: 1.6; }
.footer-legal strong { color: var(--ink); font-weight: 600; letter-spacing: .01em; }
.footer-email { color: var(--ink); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px var(--s3); align-content: start; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { color: var(--ink); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-base p { margin: 0; }
@media (min-width: 768px) {
  .footer-top { grid-template-columns: minmax(0, 1fr) auto; }
  .footer-nav { gap: 0 var(--s4); }
}

/* ---------- Motion (finishing detail only) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes lift { from { transform: translateY(12px); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  /* Headline content is never hidden: it only lifts into place, so it paints immediately (LCP). */
  .hero-text > *, .page-head .container > * { animation: lift .9s var(--ease) both; }
  .hero-text > :nth-child(2), .page-head .container > :nth-child(2) { animation-delay: .06s; }
  .hero-text > :nth-child(3), .page-head .container > :nth-child(3) { animation-delay: .14s; }
  .hero-text > :nth-child(4), .page-head .container > :nth-child(4) { animation-delay: .22s; }
  .bp-construct { animation: fade 1s .2s ease both; }
  .bp-lines { animation: fade 1s .5s ease both; }
  .bp-shape { animation: fade .7s ease both; }
  .bp-s1 { animation-delay: .9s; }
  .bp-s2 { animation-delay: 1.1s; }
  .bp-s3 { animation-delay: 1.25s; }
  .bp-notes { animation: fade .8s 1.4s ease both; }

  @supports (animation-timeline: view()) {
    /* Small units reveal individually, so nothing being read is ever half-faded. */
    .reveal .section-head, .reveal .section-body > *, .reveal .facts {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }
  }
}
