/* CradleFree's site. The app's day palette for reading, and one lock screen at night,
   which is where the app does its main job. */

@font-face {
  font-family: "CradleFree Numerals";
  src: url("/fonts/numerals-display.woff2") format("woff2");
  font-weight: 560;
  font-display: swap;
}
@font-face {
  font-family: "CradleFree Numerals Text";
  src: url("/fonts/numerals-text.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "CradleFree Kai";
  src: url("/fonts/kai-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Day, as in the app's Palette.swift */
  --ground: #EDF0F3;
  --surface: #FFFFFF;
  --ink: #1C2533;
  --muted: #566173;
  --line: #D5DCE4;
  --amber: #E9A23B;
  --amber-tint: #FBEACB;
  --amber-ink: #8A5609;
  /* Night: the lock-screen card */
  --night: #000000;
  --night-surface: #16110B;
  --night-track: #2A2116;
  --night-ink: #D9A05B;
  --night-muted: #A8814C;
  --night-glow: #FFE7BF;

  --display: "CradleFree Numerals", "Iowan Old Style", Georgia, serif;
  --numeral: "CradleFree Numerals Text", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
}
:lang(zh-Hant) {
  --display: "CradleFree Kai", "Kaiti TC", "BiauKai", "CradleFree Numerals", serif;
  --numeral: "CradleFree Numerals Text", "CradleFree Kai", "Kaiti TC", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
:lang(zh-Hant) body, body:lang(zh-Hant) { line-height: 1.75; }
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

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

/* Header and footer */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 22px/1 var(--display); color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; }
.links a { text-decoration: none; color: var(--muted); }
.links a:hover, .links a[aria-current] { color: var(--ink); }

.foot { border-top: 1px solid var(--line); margin-top: 96px; padding: 28px 0 40px; font-size: 15px; color: var(--muted); }
.foot .links { margin-bottom: 10px; }
.foot p { margin: 0; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 6vw, 88px); align-items: center; padding: 40px 0 24px; }
.hero h1 { font: 400 clamp(42px, 6.2vw, 68px)/1.04 var(--display); letter-spacing: -0.015em; margin: 0 0 24px; max-width: 13ch; }
:lang(zh-Hant) .hero h1 { font-weight: 700; letter-spacing: 0; line-height: 1.25; max-width: none; }
.clause { display: inline-block; }
.hero .lead { font-size: 21px; line-height: 1.5; color: var(--muted); margin: 0 0 32px; max-width: 32em; }
.soon { display: inline-flex; align-items: center; gap: 12px; padding: 14px 20px 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.soon img { width: 44px; height: 44px; border-radius: 11px; }
.soon strong { display: block; font-size: 16px; }
.soon span { display: block; font-size: 14px; color: var(--muted); }

/* The lock screen */
.lock-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.lock {
  width: min(100%, 340px);
  aspect-ratio: 9 / 19.5;
  border-radius: 54px;
  padding: 44px 16px 22px;
  background: radial-gradient(60% 32% at 50% 24%, rgba(255, 196, 120, 0.16), rgba(255, 196, 120, 0) 70%), var(--night);
  box-shadow: 0 0 0 10px var(--ink), 0 30px 60px -30px rgba(28, 37, 51, 0.55);
  color: var(--night-ink);
  display: flex;
  flex-direction: column;
}
.lock .date { text-align: center; font-size: 15px; color: var(--night-muted); margin: 0; }
.lock .clock { text-align: center; font: 560 104px/1 "CradleFree Numerals", Georgia, serif; margin: 2px 0 0; letter-spacing: -0.02em; }
.lock .corner { margin-top: auto; display: flex; justify-content: space-between; padding: 14px 18px 0; }
.lock .corner span { width: 44px; height: 44px; border-radius: 50%; background: rgba(217, 160, 91, 0.12); }

.activity { margin-top: auto; background: var(--night-surface); border-radius: 24px; padding: 14px 14px 14px; }
.activity .state { font-size: 13px; line-height: 1.35; color: var(--night-muted); margin: 0; min-height: 2.7em; }
.activity .total { font: 560 40px/1.1 "CradleFree Numerals", Georgia, serif; margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.activity .buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.activity button {
  appearance: none; border: 0; border-radius: 14px; min-height: 56px; padding: 6px 4px;
  background: var(--night-track); color: var(--night-ink); cursor: pointer;
  font: 600 15px/1.15 var(--sans);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.activity button .t { font: 500 13px/1 "CradleFree Numerals Text", Georgia, serif; font-variant-numeric: tabular-nums; color: var(--night-muted); }
.activity button[aria-pressed="true"] { background: var(--night-ink); color: var(--night); box-shadow: 0 0 18px rgba(255, 231, 191, 0.28); }
.activity button[aria-pressed="true"] .t { color: var(--night); }
.activity button:focus-visible { outline-color: var(--night-glow); }
.lock-stage .hint { margin: 0; font-size: 15px; color: var(--muted); text-align: center; max-width: 26em; }

/* Sections */
.section { padding-top: 104px; }
.section > h2 { font: 400 clamp(32px, 4vw, 44px)/1.12 var(--display); letter-spacing: -0.01em; margin: 0 0 40px; max-width: 20ch; }
:lang(zh-Hant) .section > h2 { font-weight: 700; letter-spacing: 0; line-height: 1.3; }

/* A day, as a timeline like the app's */
.day { list-style: none; margin: 0; padding: 0; position: relative; }
.day::before { content: ""; position: absolute; left: 150px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.day > li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 236px; gap: 0 40px; align-items: start; padding: 0 0 64px; position: relative; }
.day > li:last-child { padding-bottom: 0; }
.day time { font: 500 22px/1.2 var(--numeral); color: var(--amber-ink); padding-right: 24px; position: relative; }
.day time::after { content: ""; position: absolute; right: -6px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--ground); }
.day h3 { font: 400 28px/1.2 var(--display); margin: 0 0 10px; }
:lang(zh-Hant) .day h3 { font-weight: 700; }
.day p { margin: 0; color: var(--muted); max-width: 30em; }
.day .shot { border-radius: 30px; border: 1px solid var(--line); background: var(--surface); }
.day .noshot { color: var(--muted); font-size: 15px; }

/* What it leaves out */
.without { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.without li { border-top: 1px solid var(--line); padding: 22px 0 26px; }
.without strong { display: block; font: 400 24px/1.25 var(--display); margin-bottom: 6px; }
:lang(zh-Hant) .without strong { font-weight: 700; }
.without span { color: var(--muted); }

/* Price */
.price-note { margin: -16px 0 32px; font-size: 19px; color: var(--muted); max-width: 36em; }
.price-foot { margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.plan { border-radius: 28px; padding: 32px; background: var(--surface); border: 1px solid var(--line); }
.plan h3 { font: 400 26px/1.2 var(--display); margin: 0 0 4px; }
:lang(zh-Hant) .plan h3 { font-weight: 700; }
.plan .cost { font: 500 17px/1.4 var(--sans); color: var(--muted); margin: 0 0 20px; }
.plan ul { margin: 0; padding-left: 1.1em; }
.plan li { margin: 6px 0; }
.plan li::marker { color: var(--amber); }
.plan-pass { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.plan-pass .cost { color: #C9D1DC; }
.plan-pass .cost b { font: 560 34px/1 "CradleFree Numerals", Georgia, serif; color: #FFFFFF; margin-right: 6px; }

/* Maker */
.maker { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 760px; }
.maker img { width: 88px; height: 88px; border-radius: 20px; }
.maker p { margin: 0; font-size: 21px; line-height: 1.55; }
.maker p + p { margin-top: 12px; font-size: 17px; color: var(--muted); }

/* Privacy and support pages */
.page { max-width: 720px; padding-top: 40px; }
.page h1 { font: 400 clamp(38px, 5vw, 52px)/1.1 var(--display); margin: 0 0 12px; letter-spacing: -0.01em; }
:lang(zh-Hant) .page h1 { font-weight: 700; letter-spacing: 0; }
.page h2 { font: 400 26px/1.25 var(--display); margin: 48px 0 12px; }
:lang(zh-Hant) .page h2 { font-weight: 700; }
.page h3 { font-size: 18px; margin: 28px 0 8px; }
.page p, .page li { max-width: 38em; }
.page ol, .page ul { padding-left: 1.3em; }
.page li { margin: 6px 0; }
.page li::marker { color: var(--amber-ink); }
.page .lead { font-size: 20px; line-height: 1.55; }
.page .muted { color: var(--muted); }
.page .card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px 28px; margin: 28px 0 8px; }
.page .card p { margin: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 16px; }
  .day::before { left: 5px; }
  .day > li { grid-template-columns: minmax(0, 1fr) 180px; gap: 12px 24px; padding-left: 32px; }
  .day time { grid-column: 1 / -1; padding: 0; }
  .day time::after { left: -32px; right: auto; }
  .without, .plans { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .bar { flex-wrap: wrap; }
  .hero .lead { font-size: 19px; }
  .day > li { grid-template-columns: 1fr; }
  .day .shot { width: 220px; margin-top: 12px; }
  .plan { padding: 26px 22px; }
  .maker { grid-template-columns: 1fr; }
  .maker img { width: 64px; height: 64px; border-radius: 15px; }
  .section { padding-top: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
