/* How It Works, "Field Guide" look (test version, loaded only by how-it-works-test.html).
 * Printed-handbook pages: aged-paper sheets with a thick-and-thin double border, plain Bevan titles with a
 * thin rule and a tomato diamond, flat photo mats, and no hard shadows, tape or tilted pieces.
 * Colors come from the variables on body.fg. Day is the default; a phone set to dark mode gets the night
 * edition (deep teal-ink sheets, cream type). To preview either on any screen, add ?fg=day or ?fg=night. */

body.fg {
  --fg-sheet: #EADBB4;   /* page sheet */
  --fg-card: #F3E8C6;    /* cards, tickets, photo mats (always paper, dark text) */
  --fg-text: #2E2118;    /* body text on the sheet */
  --fg-title: #12383A;   /* sheet titles */
  --fg-edge: #12383A;    /* sheet border and rules */
  --fg-accent: #9E3224;  /* feature titles, plus/minus tips, FAQ marks */
  --fg-diamond: #9E3224;
  --fg-matedge: #12383A; /* hairline around photo mats */
  --fg-inkrow: #12383A;  /* the dark filter cards */
}
@media (prefers-color-scheme: dark) {
  body.fg:not([data-fg="day"]) {
    --fg-sheet: #143538; --fg-card: #E8D8B0; --fg-text: #E8DDBF; --fg-title: #F3E6C4; --fg-edge: #C9B98F;
    --fg-accent: #FFDE59; --fg-diamond: #D0553C; --fg-matedge: rgba(0, 0, 0, .55); --fg-inkrow: #06171A; background: #0B1F21;
  }
}
body.fg[data-fg="night"] {
  --fg-sheet: #143538; --fg-card: #E8D8B0; --fg-text: #E8DDBF; --fg-title: #F3E6C4; --fg-edge: #C9B98F;
  --fg-accent: #FFDE59; --fg-diamond: #D0553C; --fg-matedge: rgba(0, 0, 0, .55); --fg-inkrow: #06171A; background: #0B1F21;
}
body.fg .m-page.hiw { --paper: var(--fg-card); }

/* ---- Sheets ---- */
body.fg .hiw-sheet {
  background: var(--fg-sheet); color: var(--fg-text); border: 2px solid var(--fg-edge); border-radius: 3px;
  box-shadow: 0 0 0 6px var(--fg-sheet), 0 0 0 8px var(--fg-edge); margin: 56px 8px 0;
}
body.fg .hiw-card + .hiw-sheet { margin-top: 72px; }
/* Diamond dividers sit centered in their 64px gap: no extra space on the side facing the next block. */
body.fg .hiw-gap + .hiw-sheet { margin-top: 0; }
body.fg #calendar.hiw-part { padding-top: 0; }
body.fg #calendar .hiw-card { margin-top: 0; }
/* Text takes its color from the nearest container: the sheet (light or dark) or a paper card (always dark) */
body.fg .hiw-sheet p, body.fg .hiw-sheet li, body.fg .m-page.hiw .hiw-sheet-body p { color: inherit; }
body.fg .m-page.hiw .hiw-sheet-body p.hiw-aside { color: #2E2118; }
body.fg .hiw-sheet a { color: var(--fg-accent); }
body.fg .hiw-sheet a:hover { color: var(--fg-title); }

/* ---- Sheet titles: plain Bevan, thin rule, tomato diamond ---- */
body.fg .hiw-sheet-head { position: relative; display: block; padding: 44px 32px 6px; background: none; border: 0; border-radius: 0; text-align: center; }
body.fg .hiw-sheet-head::before {
  content: ""; display: block; position: absolute; left: 50%; bottom: 8px; width: 10px; height: 10px; margin: 0; border: 0; min-width: 0; flex: none;
  transform: translateX(-50%) rotate(45deg); background: var(--fg-diamond);
}
body.fg .hiw-sheet-head::after {
  content: ""; display: block; flex: none; min-width: 0; height: 14px; border: 0; margin: 16px auto 0; width: 180px; background: var(--fg-edge);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 14'%3E%3Cpath d='M0 7H76M104 7H180' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / 180px 14px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 14'%3E%3Cpath d='M0 7H76M104 7H180' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / 180px 14px no-repeat;
}
body.fg .m-page.hiw h3.hiw-sheet-title, body.fg #faq .hiw-sheet-head h3.hiw-sheet-title {
  display: block; margin: 0; padding: 0; color: var(--fg-title); text-shadow: none; text-transform: none; letter-spacing: 0; font-size: clamp(30px, 4.2vw, 40px);
}
body.fg .hiw-sheet-title::before, body.fg .hiw-sheet-title::after,
body.fg #faq .hiw-sheet-head h3.hiw-sheet-title::before, body.fg #faq .hiw-sheet-head h3.hiw-sheet-title::after { display: none; }

/* ---- Cards, tickets and pills: flat paper, thin ink border, no hard shadow ---- */
body.fg :is(.hiw-stat, .hiw-steps li, .hiw-row, .hiw-options li, .hiw-feature-mini, .hiw-aside, .hiw-note, .hiw-bar, .hiw-typebar),
body.fg :is(.hiw-stat, .hiw-steps li, .hiw-row, .hiw-options li, .hiw-feature-mini, .hiw-aside, .hiw-note, .hiw-bar, .hiw-typebar) * { color: #2E2118; }
body.fg .hiw-stat, body.fg .hiw-feature-mini, body.fg .hiw-options li { background: var(--fg-card); border: 2px solid #12383A; border-radius: 6px; box-shadow: none; }
body.fg .hiw-options li { border-radius: 3px; }
body.fg .hiw-typebar, body.fg .hiw-bar { background: var(--fg-card); border: 2px solid #12383A; box-shadow: none; transform: none; }
body.fg .hiw-sheet-body > .hiw-steps { filter: none; }
body.fg .hiw-steps li { background: var(--fg-card); border: 2px solid #12383A; }
body.fg .hiw-steps li::before { color: #F8ECD0; }
body.fg .m-page.hiw .hiw-stat b { color: #9E3224; }
body.fg .m-page.hiw .hiw-steps li a, body.fg .m-page.hiw .hiw-note a, body.fg .hiw-aside a { color: #9E3224; }
body.fg .m-page.hiw .hiw-sheet-body p.hiw-aside { background: var(--fg-card); border: 2px dashed #9E3224; }
body.fg .m-page.hiw h4.hiw-feature-title { color: var(--fg-accent); }
body.fg .m-page.hiw .hiw-feature-mini h4.hiw-feature-title, body.fg .hiw-options strong { color: #12383A; }

/* Filter rows: color-blocked cards in teal, tomato and ink with cream pills.
 * The colors alternate on a diagonal so no two neighbors match; Weather (full width) is tomato. */
body.fg .hiw-row {
  background: var(--c); border: 2px solid #12383A; border-radius: 6px; overflow: hidden;
  box-shadow: inset 0 0 0 5px var(--c), inset 0 0 0 6.5px rgba(248, 236, 208, .55);
}
body.fg .hiw-row:nth-child(5n+4), body.fg .hiw-row:nth-child(5n+5) { --c: var(--fg-inkrow); }
body.fg .hiw-row:last-child { --c: #9E3224; }
body.fg .hiw-row b { background: none; padding: 22px 24px 0; font-size: 23px; color: #FFF7E3; }
body.fg .hiw-chips { padding: 14px 24px 24px; }
body.fg .hiw-chips i {
  transform: none; box-shadow: none; background: var(--fg-card); border: 0; color: #2E2118; border-radius: 3px;
}

/* Plus and minus tips */
body.fg .m-page.hiw .hiw-sheet-body p.hiw-tip { color: var(--fg-accent); }
body.fg .hiw-tip::before { border: 2px solid var(--fg-edge); box-shadow: none; }

/* Callout: flat paper note with a tomato edge instead of a taped sticky note */
body.fg .m-page.hiw .hiw-sheet-body > .hiw-note {
  background: var(--fg-card); border: 2px solid #12383A; border-left: 8px solid #9E3224; border-radius: 3px; box-shadow: none; transform: none; padding: 28px 30px 24px;
}
body.fg .hiw-note::before { display: none; }
body.fg .m-page.hiw .hiw-note p.hiw-note-title { color: #9E3224; }

/* ---- Photos: one flat mat with a hairline edge, no tape, no heavy tilt ---- */
body.fg .hiw-polaroid, body.fg .hiw .m-tile {
  background: var(--fg-card); border-color: var(--fg-card); outline: 1.5px solid var(--fg-matedge); box-shadow: none;
}
body.fg .hiw-polaroid { border-width: 12px; border-bottom-width: 52px; transform: none; }
body.fg .hiw-feature-flip .hiw-polaroid { transform: none; }
body.fg .hiw-polaroid::before, body.fg .hiw .m-tile::before { display: none; }
body.fg .hiw-polaroid figcaption { color: #2E2118; }
body.fg .hiw .m-tile-cal, body.fg .hiw .m-tile-web { transform: none; }
body.fg .hiw .m-tile:hover { transform: translateY(-3px); box-shadow: none; }
body.fg .hiw .m-tile-title, body.fg .hiw .m-tile-title::after { color: #9E3224; }
body.fg .hiw .m-tile-blurb { color: #2E2118; }

/* Part title cards: the same flat mat, photo inside */
body.fg .hiw-card { transform: none !important; border: 12px solid var(--fg-card); border-bottom-width: 12px; outline: 1.5px solid var(--fg-matedge); box-shadow: none; background: none; }
body.fg .hiw-card::before { display: none; }
body.fg .m-hero-banner::before { border-color: var(--fg-card); box-shadow: inset 0 0 0 6px transparent, inset 0 0 0 7px var(--fg-card); }

/* ---- FAQ ---- */
body.fg .hiw-sheet-body > .hiw-faqs { border-bottom-color: color-mix(in srgb, var(--fg-text) 40%, transparent); }
body.fg .hiw-faq { border-top-color: color-mix(in srgb, var(--fg-text) 40%, transparent); }
body.fg .hiw-faq summary { color: var(--fg-text); }
body.fg .hiw-faq summary::after { color: var(--fg-accent); }

/* Embedded demo window: soft shadow instead of the hard block */
body.fg .hiw-sheet-body > .m-demo { box-shadow: 0 10px 24px rgba(11, 35, 37, .3); }

@media (max-width: 620px) {
  /* One column: cycle teal, tomato, ink so no two stacked cards match */
  body.fg .hiw-row:nth-child(3n+1) { --c: #287174; }
  body.fg .hiw-row:nth-child(3n+2) { --c: #9E3224; }
  body.fg .hiw-row:nth-child(3n) { --c: var(--fg-inkrow); }
  body.fg .hiw-row:last-child { --c: #9E3224; }
  body.fg .hiw-sheet-head { padding: 36px 18px 6px; }
  body.fg .m-page.hiw h3.hiw-sheet-title, body.fg #faq .hiw-sheet-head h3.hiw-sheet-title { font-size: 28px; }
  body.fg .hiw-polaroid { border-width: 9px; border-bottom-width: 44px; }
  body.fg .hiw-card { border-width: 9px; }
}

/* Logging In: the two options are color blocks like the filter cards, each with a round icon; the session note is a yellow pill. */
body.fg .hiw-options li.opt-teal { --c: #287174; }
body.fg .hiw-options li.opt-tomato { --c: #9E3224; }
body.fg .hiw-options li.opt-teal, body.fg .hiw-options li.opt-tomato {
  background: var(--c); border: 2px solid #12383A; border-radius: 6px; padding: 26px 28px;
  box-shadow: inset 0 0 0 5px var(--c), inset 0 0 0 6.5px rgba(248, 236, 208, .55);
}
body.fg .hiw-options li.opt-teal *, body.fg .hiw-options li.opt-tomato * { color: #F3E8C6; }
body.fg .hiw-options li.opt-teal strong, body.fg .hiw-options li.opt-tomato strong { color: #FFF7E3; }
body.fg .hiw-opt-ico {
  display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin: 0 0 14px;
  border-radius: 50%; background: #F3E8C6; border: 2px solid #12383A;
}
body.fg .hiw-options li .hiw-opt-ico { color: #12383A; }
body.fg .hiw-options li .hiw-opt-ico * { color: #12383A; }
body.fg .m-page.hiw .hiw-sheet-body p.hiw-stay {
  display: inline-block; margin-top: 32px; padding: 8px 20px; background: #FFDE59; color: #12383A;
  border: 2px solid #12383A; border-radius: 999px; font-size: 18px; font-weight: 600; line-height: 1.3;
}

/* Website features: one column, title and text first, then the screenshot at full sheet width so its details are readable. */
body.fg .hiw-feature-hero { grid-template-columns: minmax(0, 1fr); gap: 30px; align-items: start; }
body.fg .hiw-feature-hero .hiw-feature-text { order: -1; }
body.fg .hiw-feature-hero .hiw-polaroid, body.fg .hiw-feature-flip .hiw-polaroid { order: 0; margin-bottom: 0; }
body.fg .hiw-feature-hero + .hiw-feature-hero { margin-top: 72px; }

/* FAQ: each question is a color-blocked card (teal, tomato, ink) with a round icon; answers open in a cream panel. */
body.fg .hiw-sheet-body > .hiw-faqs { display: flex; flex-direction: column; gap: 14px; border-bottom: 0; }
body.fg .hiw-faq {
  --c: #287174; border: 2px solid #12383A; border-radius: 6px; background: var(--c);
  box-shadow: inset 0 0 0 4px var(--c), inset 0 0 0 5.5px rgba(248, 236, 208, .55);
}
body.fg .hiw-faq:nth-child(3n+2) { --c: #9E3224; }
body.fg .hiw-faq:nth-child(3n) { --c: var(--fg-inkrow); }
body.fg .hiw-faq summary { justify-content: flex-start; gap: 16px; padding: 18px 20px; color: #FFF7E3; }
body.fg .hiw-faq summary span { flex: 1; }
body.fg .hiw-faq-ico {
  flex: none; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 50%; background: #F3E8C6; border: 2px solid #12383A; color: #12383A;
}
body.fg .hiw-faq summary::after {
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding-bottom: 2px; box-sizing: border-box;
  border-radius: 50%; background: #F3E8C6; color: #12383A; font-size: 22px;
}
body.fg .m-page.hiw .hiw-sheet-body .hiw-faq > p {
  margin: 0 14px 14px; padding: 16px 18px; background: var(--fg-card); color: #2E2118; border-radius: 4px; font-size: 19px;
}
@media (max-width: 620px) {
  body.fg .hiw-faq summary { gap: 12px; padding: 14px 14px; }
  body.fg .hiw-faq-ico { width: 36px; height: 36px; }
  body.fg .m-page.hiw .hiw-sheet-body .hiw-faq > p { margin: 0 10px 10px; padding: 14px; }
}
/* Links inside the cream answer panels stay tomato in night mode too (the night accent is yellow, which vanishes on cream). */
body.fg .hiw-sheet .hiw-faq > p a { color: #9E3224; }
body.fg .hiw-sheet .hiw-faq > p a:hover { color: #12383A; }

/* What the Calendar Is: the three stats are color-blocked cards (teal, tomato, ink) with a round icon, like the FAQ and Logging In cards. */
body.fg .hiw-stats:not(.hiw-stats-updates) .hiw-stat {
  --c: #287174; background: var(--c); border: 2px solid #12383A; border-radius: 6px; padding: 24px 16px 26px;
  box-shadow: inset 0 0 0 4px var(--c), inset 0 0 0 5.5px rgba(248, 236, 208, .55);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
body.fg .hiw-stats:not(.hiw-stats-updates) .hiw-stat:nth-child(2) { --c: #9E3224; }
body.fg .hiw-stats:not(.hiw-stats-updates) .hiw-stat:nth-child(3) { --c: var(--fg-inkrow); }
body.fg .m-page.hiw .hiw-stats:not(.hiw-stats-updates) .hiw-stat * { color: #F3E8C6; }
body.fg .m-page.hiw .hiw-stats:not(.hiw-stats-updates) .hiw-stat b { color: #FFF7E3; }
body.fg .m-page.hiw .hiw-stats:not(.hiw-stats-updates) .hiw-stat .hiw-opt-ico, body.fg .m-page.hiw .hiw-stats:not(.hiw-stats-updates) .hiw-stat .hiw-opt-ico * { color: #12383A; }
body.fg .hiw-stats:not(.hiw-stats-updates) .hiw-stat .hiw-opt-ico { margin-bottom: 12px; }

/* Getting It: the steps list starts right under the title, same distance as every other section. */
body.fg .hiw-sheet-body > .hiw-steps:first-child { margin-top: 0; }

/* Header banner: the tallest tower is allowed to be cut off; the other towers keep their tops near the top edge and the building bodies fill the frame (was 58% in marketing.css). */
body.fg .m-hiw-hero .m-about-hero-photo { background-position: center 52%; }
