/* Clair — the site in the app's own look: grey paper, ink, one orange for today, Helvetica Neue, actions as
   underlined words, hairlines between parts. The grid is the studio's: 18 columns, 50px margins, an index at
   the left that follows the reader, the text from the fifth column. Dark when the device is dark, as the app. */


:root {
  --paper: #e9e8e6;
  --ink: #141414;
  --quiet: #5c5b58;      /* 5.5:1 on the paper */
  --ghost: #9b9a96;      /* hover only */
  --sun: #f26a1b;        /* the picture in the mark: never text */
  --sun-text: #ad440a;   /* today, as text: 4.6:1 on the paper */
  --rule: rgba(20, 20, 20, .16);
  --font: "Helvetica Neue", Helvetica, Arial, "Nimbus Sans", system-ui, sans-serif;
  --fs: 17px;
  --lh: 1.3;
  --line: calc(var(--fs) * var(--lh));
  --pad: 20px;
  --gap: 20px;
  --head: 80px;
  --block: 100px;
  --big: clamp(30px, 3.4vw, 50px);
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #111; --ink: #ecebe8; --quiet: #a3a19c; --ghost: #6f6e6a; --sun: #ff7a2e; --sun-text: #ff8a45; --rule: rgba(236, 235, 232, .18); }
}
@media (min-width: 768px) { :root { --pad: 50px; } }
@media (max-width: 767px) { :root { --fs: 16px; --block: 64px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--head); -webkit-text-size-adjust: 100%; color-scheme: light dark; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--fs)/var(--lh) var(--font); letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-variant-numeric: lining-nums; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
h1, h2, h3 { font: inherit; letter-spacing: inherit; }
ol, ul { list-style: none; }
p, li, dd { text-wrap: pretty; }
a { color: inherit; text-decoration: none; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--ghost); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--ink); color: var(--paper); }
em { font-style: italic; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; }

/* Actions are underlined words, as in the app. */
.u { text-decoration: underline 1px; text-underline-offset: .22em; }
.u:hover { color: var(--ink); text-decoration-color: var(--ghost); }
.quiet { color: var(--quiet); }
.quiet:hover { color: var(--ink); }

/* The mark and the name, fixed at the top left; App Store at the right. */
.top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--pad); background: var(--paper); line-height: 1; }
.mark { display: inline-flex; align-items: center; gap: 9px; }
.mark:hover { color: var(--ink); }
.glyph { width: 19px; height: 20px; display: block; }
.glyph .frame { fill: var(--ink); }
.glyph .picture { fill: var(--sun); transform-origin: 100% 50%; transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .glyph .picture { animation: light .9s cubic-bezier(.2, .7, .2, 1) .2s both; }
}
@keyframes light { from { transform: scaleX(0); } }
.word { font-weight: 500; letter-spacing: -.005em; }
.menu-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; line-height: 1; cursor: pointer; }
.menu-btn[hidden] { display: none; }
@media (max-width: 767px) { .top .store-top { display: none; } }
@media (pointer: coarse) { .menu-btn, .u, .quiet { display: inline-flex; align-items: center; min-height: 44px; } }

/* The page: index in columns 1–4, text in 5–14. */
.page { padding: 0 var(--pad); min-height: 100svh; }
main { padding-top: var(--head); }
.side { display: none; }
.nav a { color: var(--quiet); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
@media (min-width: 768px) {
  .top { background: transparent; }
  .menu-btn { display: none; }
  .page { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); column-gap: var(--gap); grid-template-rows: 1fr auto; }
  .side { display: block; grid-column: 1 / span 4; grid-row: 1 / span 2; }
  .nav { position: sticky; top: var(--head); }
  main { grid-column: 5 / span 14; grid-row: 1; min-width: 0; }
  .foot { grid-column: 5 / span 14; grid-row: 2; }
}
@media (min-width: 1024px) { main, .foot { grid-column: 5 / span 10; } }
@media (max-width: 767px) {
  .menu-open { overflow: hidden; }
  .menu-open .side { display: block; position: fixed; z-index: 15; inset: 0; background: var(--paper); padding: var(--head) var(--pad) 24px; }
  .nav a { display: block; padding: 6px 0; }
}

/* Parts: a hairline, the label, then the content; space between them. */
main > section { margin: 0 0 var(--block); }
main > section:not(.hero) { border-top: 1px solid var(--rule); padding-top: 10px; }
.label { margin: 0 0 var(--line); }

/* Opening: today as the app shows it, the line large, the figures, two actions. */
.today { display: grid; justify-items: start; margin-bottom: calc(var(--line) * 1.5); color: var(--sun-text); }
.today[hidden] { display: none; }
.today .day { font-size: clamp(120px, 17vw, 250px); font-weight: 500; line-height: .82; letter-spacing: -.05em; margin: 6px 0 10px -.04em;
  font-variant-numeric: lining-nums; }
.today .month { color: var(--ink); }
.hero h1 { font-size: var(--big); line-height: 1.08; letter-spacing: -.02em; max-width: 15em; text-wrap: balance; margin-bottom: var(--line); }
.figures { margin-bottom: var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 0 var(--gap); }

/* Screens: the iPhone the Simulator draws, three across, captions as titles of works. */
.phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--line) * 2) var(--gap); }
.cap { margin-top: calc(var(--line) * .5); }
.cap em { display: block; }
.cap { color: var(--quiet); }
.cap em { color: var(--ink); }
@media (max-width: 700px) {
  .phones { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; scrollbar-width: none;
    margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); scroll-padding: 0 var(--pad); }
  .phones::-webkit-scrollbar { display: none; }
  .phones:focus-visible { outline-offset: -2px; }
  .phones li { flex: 0 0 62%; scroll-snap-align: start; }
}

/* What it does: the feature at the left, a line beside it, hairlines between. */
.index > div { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); column-gap: var(--gap); padding: 8px 0; border-top: 1px solid var(--rule); }
.index > div:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 620px) { .index > div { grid-template-columns: 1fr; } .index dt { color: var(--quiet); } }

/* Free: three short parts side by side. */
.parts { display: grid; gap: var(--line) var(--gap); }
@media (min-width: 621px) { .parts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* iPad: two screens with the corners of the device. */
.pads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.pads img { border-radius: 3.2% / 2.4%; box-shadow: 0 0 0 1px var(--rule); }

/* Download: the name large, one underlined word. */
.big { font-size: clamp(56px, 8vw, 120px); font-weight: 500; line-height: .9; letter-spacing: -.045em; margin-bottom: var(--line); }
.get .u { font-size: var(--big); letter-spacing: -.02em; line-height: 1.1; text-decoration-thickness: 2px; }
.quiet-line { color: var(--quiet); margin-top: calc(var(--line) * .5); }

/* Footer: one line. */
.foot { display: flex; flex-wrap: wrap; gap: 0 var(--gap); margin: 0 0 15px; border-top: 1px solid var(--rule); padding-top: 10px; color: var(--quiet); }
.foot a:hover { color: var(--ink); }
.foot nav { display: flex; gap: var(--gap); }
@media (pointer: coarse) { .foot a { display: inline-flex; align-items: center; min-height: 44px; } }
