/* Fold Friends site. The app's look: white by day, deep blue at night, ink text, one accent, serif titles.
   The page is the Duo open as a book: words on the left page, the picture on the right, a hairline down the fold. */
:root {
  --ground: #ffffff;
  --ink: #1e2030;
  --ink2: #5a5d70;
  --hair: rgba(30, 32, 48, 0.14);
  --accent: #d93d43;          /* the app's #F2555A, darkened to 4.5:1 for text on white */
  --night: #171b45;
  --night-ink: #ffffff;
  --night-ink2: #b9bcd8;
  --night-hair: rgba(255, 255, 255, 0.18);
  --page: 1180px;
  --gutter: clamp(20px, 4vw, 56px);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Noto Sans SC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #171b45;
    --ink: #ffffff;
    --ink2: #b9bcd8;
    --hair: rgba(255, 255, 255, 0.18);
    --accent: #ff7a7e;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 18px/1.55 var(--sans); overflow-x: clip; }
html:lang(zh-Hans) body { line-height: 1.75; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
p { margin: 0 0 0.8em; }
p:last-child { margin-bottom: 0; }

.top, main, footer { max-width: var(--page); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; text-decoration: none; }
.brand img { border-radius: 8px; }
.top nav { display: flex; gap: 22px; font-size: 16px; color: var(--ink2); }
.top nav a { padding: 8px 0; }

h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 6.4vw, 84px); line-height: 1.03; }
h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; }
:lang(en) h1 { letter-spacing: -0.02em; }
:lang(en) h2 { letter-spacing: -0.01em; }
:lang(zh-Hans) h1, :lang(zh-Hans) h2 { font-family: var(--sans); line-height: 1.2; }
:lang(zh-Hans) h1 { font-size: clamp(34px, 5.4vw, 68px); }

/* Hero: the headline on the left page, the sentence on the right, then the open Duo across both. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: calc(var(--gutter) * 2); row-gap: clamp(28px, 4vw, 48px);
  padding-top: clamp(20px, 5vw, 64px); padding-bottom: clamp(48px, 7vw, 96px); align-items: end; }
.hero h1 { grid-column: 1 / -1; max-width: 14em; }
.hero .lede { grid-column: 1; color: var(--ink2); font-size: clamp(18px, 1.6vw, 21px); max-width: 32em; }
.hero .status { color: var(--ink); font-weight: 600; }
.hero .open { grid-column: 1 / -1; position: relative; display: block; }
.hero .open img { width: 100%; border: 1px solid var(--hair); border-radius: clamp(14px, 2.4vw, 30px); }
.hero .open::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--hair); }

/* A spread: two pages either side of the fold. */
.spread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--hair); }
.spread > * { padding-top: clamp(36px, 5vw, 72px); padding-bottom: clamp(36px, 5vw, 72px); min-width: 0; }
.spread .words { padding-right: var(--gutter); }
.spread .words p { color: var(--ink2); margin-top: 16px; max-width: 26em; }
.spread .picture { padding-left: var(--gutter); border-left: 1px solid var(--hair); }
.shot { border: 1px solid var(--hair); border-radius: 22px; }
.picture.tall .shot { width: min(100%, 400px); }
.picture.wide .shot { width: 100%; border-radius: 16px; }
.picture.phone .shot { width: min(100%, 260px); border-radius: 30px; }
.picture.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.picture.pair .shot { width: 100%; }
#widgets .shot { border-radius: clamp(18px, 2.6vw, 34px); }
.picture.text { font-size: 18px; max-width: 30em; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2em minmax(0, 1fr); padding: 12px 0; border-bottom: 1px solid var(--hair); }
.steps li:first-child { padding-top: 0; }
.steps li::before { content: counter(step); font-family: var(--serif); font-weight: 600; font-variant-numeric: tabular-nums; }
.note { color: var(--ink2); font-size: 16px; margin-top: 16px; }

/* Night: the closed Duo. Full width, the app's deep blue, whatever the system appearance. */
.night { background: var(--night); color: var(--night-ink); margin: 0 calc(50% - 50vw); padding: 0 calc(50vw - 50%); }
.night .spread { border-top: 0; }
.night .spread .words p { color: var(--night-ink2); }
.night .spread .picture { border-left-color: var(--night-hair); }
.night .shot { border-color: var(--night-hair); }
.night + .spread { border-top: 0; }

main > .spread:last-child { border-bottom: 1px solid var(--hair); }
footer { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 28px; padding-bottom: 40px;
  color: var(--ink2); font-size: 15px; }

/* A phone: the two pages stack, as the Duo does in laptop pose. */
@media (max-width: 700px) {
  body { font-size: 17px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero .open::after { display: none; }
  .hero .open img { border-radius: 22px; }
  .spread { grid-template-columns: minmax(0, 1fr); }
  .spread .words { padding-right: 0; padding-bottom: 0; }
  .spread .picture { padding-left: 0; border-left: 0; padding-top: 24px; }
  .picture.tall .shot, .picture.phone .shot { width: min(100%, 320px); }
  .picture.tall.swap .shot { width: 100%; border-radius: 12px; }
}

/* Privacy and other text pages. */
.prose { max-width: 720px; margin: 0 auto; padding: clamp(20px, 5vw, 56px) var(--gutter) 64px; }
.prose h1 { font-size: clamp(32px, 4.4vw, 48px); margin-bottom: 8px; }
.prose h2 { font-size: 24px; margin: 36px 0 10px; }
.prose .dim { color: var(--ink2); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.prose hr { border: 0; border-top: 1px solid var(--hair); margin: 56px 0; }
