/* How-to-use guide styles (site/how-to-use/ and site/pt/how-to-use/).
 *
 * A third stylesheet on purpose, like home.css and style.css: the guide is a
 * long reading page, opened mostly on an iPhone from inside the app, and a
 * change here must not move the home or the legal pages. The tokens and the
 * font faces below are copies of home.css; when the app's palette changes,
 * the three files follow it together.
 *
 * Layout: one reading column on phones, with the contents folded into a
 * <details>; from 1080px the contents become a sticky sidebar. The page is
 * complete without JavaScript. guide.js only highlights the current section
 * in the sidebar and keeps the reader's place across the language switch.
 *
 * There is no fixed header and no entrance animation: inside the app's
 * browser a fixed bar steals screen, and forty screenshots fading in would
 * fight anchor jumps and printing.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/font/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/font/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Display type is Didot, which ships with macOS and iOS; Bodoni Moda only
 * downloads where Didot is missing. The guide sets no italic display text,
 * so the italic faces of home.css are left out. */
@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/font/bodoni-moda-latin-standard-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/font/bodoni-moda-latin-ext-standard-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* colors.light in the app, as in home.css. */
  --bg: #f3ece2;
  --card: #f9f4ec;
  --surface: #fbf7f0;
  --sand: #eae2d6;
  --line: #ddd4c6;
  --ink: #23201c;
  --on-ink: #f6f1e8;
  --gold: #b3a184;
  /* Readable muted text (4.5:1 on every surface here) and the accent
   * darkened to 3.5:1 for rings, numerals and icons. See home.css. */
  --ink-soft: #655e54;
  --muted: #8b8478;
  --gold-deep: #8a7a5f;
  --scrim: 35, 32, 28;
  --radius: 18px;
  --display: 'Didot', 'Bodoni Moda', 'Bodoni 72', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* The phone bezel around full-screen captures. */
  --bezel: #2b2825;
  --gutter: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  background: var(--bg); color: var(--ink); overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
/* The home has no focus style of its own; a guide read with a keyboard or a
 * switch control needs one. */
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 4px; }

.guide-container { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 10;
  background: var(--ink); color: var(--on-ink); padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.skip-link:focus { left: 16px; }

/* Small uppercase label above a title, the app's `typography.eyebrow`. */
.eyebrow {
  display: block; font-size: 11.5px; font-weight: 600; line-height: 1.4;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
}
.rule { width: 40px; height: 1px; background: var(--muted); border: 0; }

/* ── Header: brand and language switch, not fixed ─────────────────────── */
.guide-header { border-bottom: 1px solid var(--line); }
.guide-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 36px; height: 36px; border-radius: 11px; }
.brand span { font-size: 12.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
/* Same pill as the home: two real addresses, and the click writes the
 * cookie Firebase's i18n reads (site/lang.js). */
.lang-toggle { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.lang-toggle a { font-size: 11px; font-weight: 600; letter-spacing: .12em; padding: 8px 13px; color: var(--ink-soft); transition: color .2s; }
.lang-toggle a:hover:not(.on) { color: var(--ink); }
.lang-toggle a.on { background: var(--ink); color: var(--on-ink); }

/* ── Layout: hero, contents and the reading column ─────────────────────── */
.guide-layout { padding-bottom: 72px; }
.guide-main { min-width: 0; }

.guide-hero { padding: 40px 0 4px; }
.guide-hero h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(40px, 8vw, 62px);
  line-height: 1.04; letter-spacing: -.01em; margin-top: 12px; text-wrap: balance;
}
.guide-hero .rule { margin: 22px 0 20px; }
.guide-intro { font-size: 17px; color: var(--ink-soft); max-width: 620px; }
.guide-note {
  display: flex; gap: 12px; align-items: flex-start; max-width: 620px; margin-top: 20px;
  padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  font-size: 14.5px; line-height: 1.55; color: var(--ink-soft);
}
.guide-note svg { flex-shrink: 0; margin-top: 1px; color: var(--gold-deep); }
.guide-video { max-width: 760px; margin-top: 24px; }
.guide-video video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: var(--sand); border: 1px solid var(--line); border-radius: 14px;
}
.guide-video figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }

/* Contents on phones: a <details>, closed by default, so the first screen
 * is the title and the way in, not a hundred links. */
.toc-mobile {
  margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.toc-mobile > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 0 20px; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}
.toc-mobile > summary::-webkit-details-marker { display: none; }
.toc-mobile > summary::after {
  content: ''; width: 8px; height: 8px; margin: -4px 4px 0 0; flex-shrink: 0;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg); transition: transform .2s;
}
.toc-mobile[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.toc-count { margin-left: auto; font-weight: 500; letter-spacing: .08em; text-transform: none; font-size: 13px; color: var(--ink-soft); }
.toc-mobile nav { padding: 0 20px 12px; border-top: 1px solid var(--line); }

.toc-parts, .toc-parts ol { list-style: none; }
.toc-part-label {
  display: block; padding: 18px 0 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep);
}
.toc-mobile .toc-sections > li > a {
  display: block; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.4;
}
.toc-mobile .toc-sections > li:last-child > a { border-bottom: 0; }
.toc-tasks { padding: 0 0 8px 14px; }
.toc-tasks a { display: block; padding: 5px 0; font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); }

/* Contents on wide screens: a sticky sidebar next to the reading column. */
.toc-side { display: none; }
.toc-title {
  font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
}
.toc-side .toc-part-label { padding: 20px 0 4px; }
.toc-side a {
  display: block; padding: 4px 0 4px 12px; margin-left: -2px; border-left: 2px solid transparent;
  font-size: 14px; line-height: 1.4; color: var(--ink-soft); transition: color .15s, border-color .15s;
}
.toc-side a:hover { color: var(--ink); }
.toc-side a[aria-current="true"] { color: var(--ink); border-left-color: var(--gold-deep); }
.toc-side .toc-parts { border-left: 1px solid var(--line); }
.toc-side .toc-part-label { margin-left: 12px; }
.toc-side .toc-tasks { padding: 0 0 4px 12px; }
.toc-side .toc-tasks a { font-size: 13px; }

/* ── Sections and tasks ────────────────────────────────────────────────── */
.guide-section { padding-top: 64px; }
/* Sections part with an ink rule; tasks inside them with a hairline. */
.guide-section + .guide-section > .section-head { border-top: 1px solid var(--ink); padding-top: 26px; }
.guide-section, .task { scroll-margin-top: 16px; }
.section-head { padding-bottom: 8px; }
.section-head h2 {
  font-family: var(--display); font-weight: 400; font-size: clamp(31px, 5.6vw, 44px);
  line-height: 1.1; letter-spacing: -.005em; margin: 12px 0 14px; text-wrap: balance;
}
.lede { font-size: 17px; color: var(--ink-soft); }
.section-head > p + p, .section-head > ul, .section-head > ol:not(.quickstart) { margin-top: 12px; }
.section-head ul { padding-left: 1.2em; color: var(--ink-soft); }

.task { padding: 32px 0 36px; border-top: 1px solid var(--line); }
.section-head + .task { margin-top: 28px; }
.task h3 {
  font-family: var(--display); font-weight: 400; font-size: clamp(24px, 4.4vw, 29px);
  line-height: 1.18; margin-bottom: 10px; text-wrap: balance;
}
.task > p { color: var(--ink-soft); }
.task > p + p { margin-top: 10px; }
.task > ul { margin: 12px 0 0 1.2em; color: var(--ink-soft); }
.task > ul li + li { margin-top: 4px; }

/* Links inside the text (a pointer to another task, say) must read as
 * links: the reset above strips the underline. */
.section-head a, .task a, .tip a, .guide-note a {
  text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px;
}
.section-head a:hover, .task a:hover { text-decoration-color: var(--ink); }

/* Numbered steps: an ink disc with a cream numeral. The disc is absolutely
 * placed, not a grid column, because a step mixes text and inline labels. */
ol.steps { list-style: none; counter-reset: step; margin-top: 18px; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 42px; min-height: 28px; }
ol.steps > li + li { margin-top: 12px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--on-ink);
  font: 600 13px/28px var(--sans); text-align: center;
}

/* An app label, exactly as the app spells it: a quiet chip, so the eye can
 * find "what to tap" in a step without shouting. */
strong.ui {
  font-weight: 600; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 7px; padding: 0 6px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.tip {
  margin-top: 22px; padding: 14px 18px; background: var(--card);
  border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 12px;
  font-size: 15px; line-height: 1.6; color: var(--ink-soft);
}
.tip > strong:first-child { color: var(--ink); font-weight: 600; }

/* ── Quick start and the tab map (getting-started section) ─────────────── */
ol.quickstart {
  list-style: none; counter-reset: quick; margin-top: 24px; padding: 4px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
ol.quickstart > li { counter-increment: quick; position: relative; padding: 16px 0 16px 50px; }
ol.quickstart > li + li { border-top: 1px solid var(--line); }
ol.quickstart > li::before {
  content: counter(quick, decimal-leading-zero); position: absolute; left: 0; top: 13px;
  font-family: var(--display); font-size: 28px; line-height: 1; color: var(--gold-deep);
}

/* The assembler wraps every table in .table-wrap, so a wide table scrolls
 * inside its card instead of widening the page. */
.table-wrap {
  margin-top: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
table.tab-map { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
table.tab-map caption {
  caption-side: top; text-align: left; padding: 16px 16px 10px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
}
table.tab-map th, table.tab-map td { padding: 12px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
table.tab-map thead th {
  font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft);
  white-space: nowrap; padding-top: 10px; padding-bottom: 10px;
}
table.tab-map tbody th { font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.25; white-space: nowrap; }
table.tab-map td { color: var(--ink-soft); }

/* ── Screenshots ───────────────────────────────────────────────────────── */
/* A full-screen capture sits in a slim phone bezel drawn in CSS, lighter
 * than the home's .phone: forty heavy frames in a row would weigh on the
 * page. The bezel is a spread shadow, not padding or a border, so the frame
 * box IS the image box and the highlight rings, placed in percent, land on
 * the right pixels at any size. The screen corners of the captures are
 * flattened onto the bezel colour when they are encoded, so the light
 * background below only shows while an image loads. */
figure.shot { width: min(100%, 280px); margin: 30px auto 0; }
.shot .frame {
  position: relative; overflow: hidden; background: var(--sand);
  /* ~198 px of the 1320 x 2868 capture: the iPhone's own screen corner. */
  border-radius: 15% / 6.9%;
  box-shadow: 0 0 0 5px var(--bezel), 0 0 0 6px rgba(var(--scrim), .12),
              0 28px 48px -28px rgba(var(--scrim), .55);
}
.shot .frame img { width: 100%; }
/* A crop is a detail (a sheet, a card, a row), not a phone: a light card. */
figure.shot.crop { width: min(100%, 360px); }
.shot.crop .frame {
  border-radius: 16px; background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 18px 36px -24px rgba(var(--scrim), .5);
}
.shot figcaption {
  margin-top: 16px; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); text-align: center; text-wrap: balance;
}

/* The highlight: positioned in percent of the (cropped) capture by the
 * assembler, so it stays on its target at any rendered size. Decorative:
 * the step text says what to tap. */
.ring {
  position: absolute; pointer-events: none; border-radius: 12px;
  border: 2.5px solid var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(251, 247, 240, .85), 0 0 0 7px rgba(138, 122, 95, .22);
}

/* Layout review only (assemble.py --placeholder): a neutral frame with the
 * shot id where the capture will go. */
.shot .frame.placeholder {
  aspect-ratio: 1320 / 2868; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 18px; text-align: center; color: var(--ink-soft);
  background: repeating-linear-gradient(135deg, var(--sand) 0 12px, var(--card) 12px 24px);
}
.frame.placeholder .shot-id { font: 600 12px/1.4 ui-monospace, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere; }
.frame.placeholder .shot-note { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

/* Two or three screens of one task, side by side when there is room;
 * stacked on a phone, where two captures side by side would be unreadable. */
.shot-row { display: flex; flex-direction: column; align-items: center; gap: 36px; margin-top: 30px; }
.shot-row > figure.shot { margin: 0; }

/* ── Back to the contents (phones; the sidebar covers wide screens) ────── */
.to-top { margin-top: 40px; text-align: right; }
.to-top a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 0;
  font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
}
.to-top a:hover { color: var(--ink); }

/* ── Footer, as on the home ────────────────────────────────────────────── */
.guide-footer { background: var(--sand); border-top: 1px solid var(--line); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; margin-bottom: 40px; }
.footer-brand p { color: var(--ink-soft); font-size: 14.5px; margin-top: 16px; max-width: 340px; }
.footer-brand .motto { font-size: 11px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-deep); }
.footer-grid h2 { font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.footer-grid ul { list-style: none; display: grid; gap: 8px; }
.footer-grid a { font-size: 14.5px; transition: color .2s; }
.footer-grid a:hover { color: var(--gold-deep); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 22px; display: flex; flex-direction: column; gap: 8px;
  color: var(--ink-soft); font-size: 13px;
}

/* ── Wider screens ─────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .shot-row { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 36px 28px; }
  .shot-row > figure.shot { flex: 0 1 260px; width: auto; }
  .shot-row > figure.shot.crop { flex-basis: 320px; }
  /* Three screens: narrower, so they share one line in the reading column. */
  .shot-row > figure.shot:first-child:nth-last-child(3),
  .shot-row > figure.shot:first-child:nth-last-child(3) ~ figure.shot { flex-basis: 204px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
}

@media (min-width: 1080px) {
  .guide-layout {
    display: grid; grid-template-columns: 232px minmax(0, 720px); column-gap: 72px; justify-content: center;
    grid-template-areas: ". hero" "side main";
  }
  .guide-hero { grid-area: hero; padding-top: 64px; }
  .toc-mobile { display: none; }
  .toc-side {
    display: block; grid-area: side; align-self: start; position: sticky; top: 24px;
    max-height: calc(100vh - 48px); overflow-y: auto; margin-top: 64px; padding: 0 4px 24px 0;
    scrollbar-width: thin;
  }
  .guide-main { grid-area: main; }
  .guide-section { padding-top: 72px; }
  .guide-section, .task { scroll-margin-top: 24px; }
  .to-top { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toc-mobile > summary::after, .toc-side a, .lang-toggle a { transition: none; }
}

/* ── Print: the text, the steps and small screenshots ──────────────────── */
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; font-size: 10.5pt; line-height: 1.5; }
  .skip-link, .lang-toggle, .toc-side, .to-top, .guide-note svg { display: none !important; }
  .toc-mobile:not([open]) { display: none; }
  .guide-layout { display: block; padding-bottom: 0; }
  .guide-hero { padding-top: 12pt; }
  .guide-section { padding-top: 18pt; break-before: auto; }
  .task { padding: 12pt 0; break-inside: avoid-page; }
  h2, h3 { break-after: avoid; }
  ol.steps > li, .tip, ol.quickstart, .table-wrap, figure.shot { break-inside: avoid; }
  figure.shot { width: 52mm; margin-top: 10pt; }
  figure.shot.crop { width: 72mm; }
  .shot-row { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8mm; }
  .shot-row > figure.shot { flex: 0 0 auto; }
  .shot .frame { box-shadow: 0 0 0 1px #9a9185; }
  ol.steps > li::before, .ring, .shot .frame, strong.ui {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ring { box-shadow: none; }
  .guide-footer { background: none; padding: 16pt 0 0; }
  .guide-footer .footer-grid { display: none; }
}
