/* Pera website v2 (2026-10-15): one stylesheet, no web fonts, no third-party anything.
   Colours = Pera brand tokens (Design/BRAND.md §1): tint #37782A light / #6BB34A dark,
   Increase Contrast #2E6B24 / #86CB63. Contrast checked (WCAG 2.x): body text ≥ 15:1,
   secondary ≥ 5.7:1, links ≥ 4.85:1 on every background used here.
   Layout: content caps at 72rem (1152 px); section bands run the full width. Text lines stay ≤ ~70 characters.
   Breakpoints: one column below 48em (768 px), two columns from 48em (iPad), three columns + the big hero from
   68em (1088 px: Mac, iPad landscape). */

:root {
  color-scheme: light dark;
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --band: #FFFFFF;
  --text: #1D1D1F;
  --text-2: #5E5E63;
  --tint: #37782A;
  --line: #D8D8DC;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --page: 72rem;
  --measure: 36rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1C1C1E;
    --band: #111113;
    --text: #F5F5F7;
    --text-2: #AEAEB2;
    --tint: #6BB34A;
    --line: #38383A;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  }
}

@media (prefers-contrast: more) {
  :root { --tint: #2E6B24; --text-2: #3A3A3C; --line: #8E8E93; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --tint: #86CB63; --text-2: #D1D1D6; --line: #8E8E93; }
}

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

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 1.0625rem; /* 17 px at the default size, like iOS body text; scales with the user's setting */
}

img { max-width: 100%; }

/* Skip link: hidden until focused. */
.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  padding: 0.5rem 0.875rem;
  background: var(--card);
  color: var(--tint);
  border-radius: 8px;
  font-weight: 600;
  z-index: 1;
}
.skip:focus { top: 0.75rem; }

a { color: var(--tint); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; border-radius: 4px; }
#content:focus { outline: none; } /* the skip link's target, not a control */

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

/* Header */
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  text-decoration: none;
  font-family: ui-rounded, system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 1.375rem;
}
.brand img { width: 1.75rem; height: 1.75rem; flex: none; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 0.5rem 0; /* ≥ 44 px tall tap target with the line height */
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--tint); text-decoration-thickness: 2px; }

/* Type */
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 1.4rem + 1.5vw, 2.75rem); }
h2 { font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: 0.35em; }
.site-nav li, .site-footer li { margin-top: 0; } /* row lists: no stacking gap, or items 2+ sit lower */
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }

.lede { font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.5rem); color: var(--text-2); max-width: var(--measure); text-wrap: balance; }
.meta { color: var(--text-2); font-size: 0.9375rem; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }
.eyebrow { font-weight: 600; color: var(--tint); font-size: 0.9375rem; margin-bottom: 0.4rem; }

/* Bands: full-width sections; .alt = the white (Dark: near-black) one */
.band { padding: clamp(2.5rem, 6vw, 5.5rem) 0; }
.band.alt { background: var(--band); }

/* Screenshots: <picture> with a Dark source; no device frames, rounded like the screen, soft shadow. */
.shot { display: block; }
.shot img { display: block; width: 100%; height: auto; box-shadow: var(--shadow); background: var(--card); }
.shot.iphone { width: min(17.5rem, 72vw); }
.shot.iphone img { border-radius: 13.6% / 6.3%; } /* the iPhone screen's corner: ~55 of 402 × 874 points */
.shot.ipad { width: 100%; }
.shot.ipad img { border-radius: 2.6% / 3.5%; }

/* Hero */
.hero { padding-top: clamp(1.5rem, 4vw, 4rem); padding-bottom: clamp(2.5rem, 6vw, 5.5rem); }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
.hero .copy { text-align: center; }
.hero .appicon { width: clamp(5.5rem, 8vw, 8rem); height: auto; border-radius: 22.5%; display: block; margin: 0 auto 1rem; }
.hero h1 { font-family: ui-rounded, system-ui, -apple-system, sans-serif; font-size: clamp(2.75rem, 2rem + 4vw, 5rem); margin-bottom: 0.15em; }
.hero .headline { font-size: clamp(1.625rem, 1.1rem + 2.2vw, 2.75rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; text-wrap: balance; }
.hero .lede { margin: 0 auto 1.25rem; }
.status { display: inline-block; padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--card); color: var(--text-2); font-size: 0.9375rem; font-weight: 500; }
.hero .visual { position: relative; display: flex; justify-content: center; align-items: flex-end; }
.hero .visual .ipad { display: none; }

/* Use cases: stacked on phones, alternating two columns from iPad width */
.cases { display: grid; gap: clamp(3rem, 7vw, 6rem); margin-top: 2.5rem; }
.case { display: grid; gap: 1.5rem; align-items: center; justify-items: center; }
.case .text { max-width: var(--measure); }
.case h3 { font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem); }
.case p { font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); }
.case ul { padding-left: 1.2em; margin: 0; color: var(--text-2); }
.case li + li { margin-top: 0.3em; }
.case .visual { width: 100%; display: flex; justify-content: center; }

/* Gallery: 2 shots a row on phones, 4 from iPad width */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; margin-top: 2rem; }
.gallery figure { margin: 0; display: grid; justify-items: center; align-content: start; gap: 0.75rem; }
.gallery .shot.iphone { width: 100%; max-width: 15rem; }
.gallery figcaption { color: var(--text-2); font-size: 0.9375rem; text-align: center; }

/* Feature cards: 1, 2, 3 columns */
.features { display: grid; gap: 1rem; margin-top: 2rem; }
.feature { background: var(--card); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.band.alt .feature { background: var(--bg); }
.feature h3 { font-size: 1.125rem; margin-bottom: 0.3em; }
.feature p { margin: 0; color: var(--text-2); font-size: 0.975rem; }
.feature .strip { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }
.feature .strip img { width: 1.75rem; height: 1.75rem; }

/* Privacy block */
.privacy { background: var(--card); border-radius: calc(var(--radius) + 6px); padding: clamp(1.5rem, 4vw, 3rem); display: grid; gap: 1.5rem; }
.privacy p:last-child { margin-bottom: 0; }
.privacy .points { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.privacy .points li { margin: 0; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.privacy .points strong { display: block; }
.privacy .points span { color: var(--text-2); font-size: 0.975rem; }

/* Get Pera */
.get { text-align: center; }
.get .appicon { width: 4.5rem; height: auto; border-radius: 22.5%; display: block; margin: 0 auto 1rem; }
.get .lede { margin: 0 auto 1rem; }
.get .meta { margin: 0; }

/* Text pages (privacy, support): one readable card; the privacy contents list moves to the left on wide screens */
.doc { padding: clamp(1rem, 3vw, 2rem) 0 clamp(2.5rem, 5vw, 4rem); }
.doc .card { background: var(--card); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 3rem); max-width: 46rem; margin: 0 auto; }
.doc .card h2 { font-size: 1.375rem; margin-top: 1.75em; }
.doc .card h3 { font-size: 1.0625rem; margin-top: 1.25em; }
.doc .card h1 + *, .doc .card > h2:first-child, .doc .card > h3:first-child { margin-top: 0; }
.doc .card .lede { font-size: 1.1875rem; color: var(--text); max-width: none; text-wrap: wrap; }
.doc .faq h3 { margin-top: 1.5em; }
.toc { margin: 1.5rem 0 2rem; }
.doc .card .toc h2 { font-size: 0.9375rem; color: var(--text-2); margin: 0 0 0.4rem; font-weight: 600; letter-spacing: 0; }
.toc ul { list-style: none; padding: 0; margin: 0; border-bottom: 1px solid var(--line); }
.toc li { margin: 0; padding: 0.3rem 0; border-top: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.35; }
.toc a { display: block; padding: 0.15rem 0; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Footer */
.site-footer { padding: 2rem 0 3rem; color: var(--text-2); font-size: 0.9375rem; border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { display: inline-block; padding: 0.4rem 0; }
.site-footer p { margin: 0; }
.site-footer .legal { flex-basis: 100%; font-size: 0.8125rem; margin-top: 0.5rem; }

/* ≥ 768 px: iPad portrait and up */
@media (min-width: 48em) {
  .hero .wrap { grid-template-columns: 1.1fr 1fr; }
  .hero .copy { text-align: left; }
  .hero .appicon { margin-left: 0; }
  .hero .lede { margin-left: 0; }
  .case { grid-template-columns: 1fr 1fr; justify-items: start; gap: 3rem; }
  .case:nth-child(even) .text { order: 2; }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .privacy { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ≥ 1088 px: Mac and big iPad landscape */
@media (min-width: 68em) {
  .hero .wrap { grid-template-columns: 1fr 1.35fr; gap: 3rem; }
  .hero .visual { min-height: 32rem; padding-bottom: 2.5rem; }
  /* The iPhone overlaps the iPad's corner by 1rem and ends on the content's right edge (Nick N944: no overhang). */
  .hero .visual .ipad { display: block; width: calc(100% - 1rem); margin-right: 1rem; }
  .hero .visual .iphone { position: absolute; right: 0; bottom: 0; width: 13rem; }
  .case { grid-template-columns: 1fr 1.1fr; gap: 5rem; }
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Privacy policy: contents on the left (on the page background, stays in view), the text in its card on the right.
     The policy block is generated (sync-privacy.py) with the contents list inside it, so this is CSS only:
     the card becomes a grid, the list spans every row of column 1, the white card is drawn behind column 2. */
  .doc.has-toc .card {
    display: grid;
    grid-template-columns: 15rem minmax(0, 40rem);
    column-gap: 6rem;
    align-items: start;
    max-width: 64rem;
    padding-left: 0;
    background: none;
    position: relative;
    isolation: isolate;
  }
  .doc.has-toc .card::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 18rem;
    background: var(--card);
    border-radius: var(--radius);
    z-index: -1;
  }
  .doc.has-toc .card > * { grid-column: 2; }
  .doc.has-toc .card > h2 { margin-top: 1em; } /* grid items' margins don't collapse: same gap as before */
  .doc.has-toc .card > .toc {
    grid-column: 1;
    grid-row: 1 / span 400;
    align-self: start;
    position: sticky;
    top: 1.5rem;
    margin: 0;
    padding: 0;
    border: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  :root { --bg: #FFFFFF; --card: #FFFFFF; --band: #FFFFFF; --text: #000000; --text-2: #333333; --tint: #000000; --shadow: none; }
  .site-nav, .skip, .site-footer ul { display: none; }
  .doc .card { padding: 0; }
  .doc.has-toc .card > .toc { display: none; }
}
