:root {
  color-scheme: light dark;
  --bg: #f4f1ea;
  --fg: #1f1d1a;
  --muted: #6f6a61;
  --line: #ddd6c8;
  --accent: #9b2d20;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", sans-serif;
}
html:lang(zh-Hant) {
  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", "Noto Serif CJK TC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Segoe UI", sans-serif;
}
html:lang(ja) {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Source Han Serif JP", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Segoe UI", sans-serif;
}
html:lang(ko) {
  --serif: "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", Georgia, "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
}
html:lang(en), html:lang(fr), html:lang(de), html:lang(es) {
  --serif: Georgia, "Songti SC", "STSong", "Noto Serif SC", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1c1d;
    --fg: #ebe6dc;
    --muted: #9a958b;
    --line: #34332f;
    --accent: #d9715f;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 var(--sans);
}

a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--line); }
a:hover { text-decoration-color: currentColor; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header shared by the inner pages */
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 0;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 20px;
}
.bar img { width: 28px; height: 28px; border-radius: 7px; }

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Language menu */
.lang { position: relative; z-index: 10; }
.lang summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { color: var(--fg); border-color: var(--fg); }
.lang summary svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.lang ul {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}
.lang li a {
  display: block;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.lang li a:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.lang li a[aria-current] { color: var(--accent); }
.lang.top {
  position: absolute;
  top: 20px;
  right: 24px;
}

/* Home */
.hero {
  padding: 12vh 0 40px;
  text-align: center;
}
.hero .icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}
.hero h1 {
  margin: 24px 0 4px;
  font: 600 56px/1.1 var(--serif);
  letter-spacing: .12em;
  text-indent: .12em;
}
.hero .en {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.hero .lede {
  margin: 28px auto 0;
  max-width: 30em;
  font-family: var(--serif);
  font-size: 19px;
}
.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
}
.btn.primary { background: var(--fg); color: var(--bg); }
.btn:hover { opacity: .85; }
.note { margin-top: 14px; color: var(--muted); font-size: 13px; }

/* The app's gallery, in a landscape iPad */
.stage {
  max-width: 1120px;
  margin: 24px auto 0;
  padding: 0 24px;
}
.ipad {
  --r: clamp(18px, 3.4vw, 40px);
  position: relative;
  padding: clamp(9px, 1.9vw, 22px);
  border-radius: var(--r);
  background: #0d0d0e;
  /* aluminium rim, then the shadow it casts on the page */
  box-shadow:
    0 0 0 1px #2a2a2c,
    0 0 0 clamp(2px, .3vw, 4px) #b9bbbf,
    0 0 0 clamp(3px, .38vw, 5px) #8e9095,
    0 2px 4px rgba(0, 0, 0, .08),
    0 30px 60px -18px rgba(40, 30, 15, .35),
    0 60px 120px -40px rgba(40, 30, 15, .3);
}
.ipad .cam {
  position: absolute;
  top: calc(clamp(9px, 1.9vw, 22px) / 2);
  left: 50%;
  width: clamp(4px, .5vw, 7px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 35%, #3a4152, #111 60%);
}
.screen {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--r) * .55);
  container-type: inline-size;
  background: #f1efea;
}
.screen img { display: block; width: 100%; height: auto; }
/* The live web app, laid out at 1180×820 and scaled to the screen (see index.html). Hidden over
   the picture until it has drawn its first screen. */
.screen iframe {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  transform-origin: 0 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.screen.live iframe { opacity: 1; pointer-events: auto; }
.status { pointer-events: none; transition: opacity .3s ease; }
.screen.live.bare .status { opacity: 0; }
.status {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: 0 2.2cqw;
  height: 2.6cqw;
  color: #1c1b19;
  font: 600 1.12cqw/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}
.status .date { font-weight: 500; }
.status .sp { flex: 1; }
.status svg { height: .9em; width: auto; fill: currentColor; }
.status .batt {
  position: relative;
  width: 2.1em;
  height: 1em;
  margin-left: .15em;
  border: .09em solid currentColor;
  border-radius: .3em;
  opacity: .9;
}
.status .batt::after {
  content: "";
  position: absolute;
  right: -.22em;
  top: 50%;
  width: .12em;
  height: .36em;
  border-radius: 0 .1em .1em 0;
  background: currentColor;
  transform: translateY(-50%);
}
.status .batt i {
  position: absolute;
  inset: .1em;
  right: 22%;
  border-radius: .16em;
  background: currentColor;
}

@media (prefers-color-scheme: dark) {
  .screen { background: #1e1e1f; }
  .status { color: #f2efe9; }
  .ipad {
    box-shadow:
      0 0 0 1px #2a2a2c,
      0 0 0 clamp(2px, .3vw, 4px) #4a4b4f,
      0 0 0 clamp(3px, .38vw, 5px) #2e2f32,
      0 30px 80px -20px rgba(0, 0, 0, .7);
  }
}

@media (max-width: 560px) {
  .hero .br { display: none; }
  .stage { padding: 0 14px; }
}

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 32px;
  margin: 80px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}
.points b { display: block; color: var(--fg); font-family: var(--serif); font-size: 17px; font-weight: 600; }

/* Inner pages */
.doc { max-width: 680px; padding-bottom: 40px; }
.doc h1 { font: 600 34px/1.3 var(--serif); margin: 24px 0 4px; }
.doc h2 { font: 600 20px/1.4 var(--serif); margin: 36px 0 8px; }
.doc .meta { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 56px 0; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 4px; }

footer {
  margin-top: 64px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
footer .sp { flex: 1; }
