/* ===== Type Koyomi ===== */

/* Paper, ink and gold from the app's Palette and KoyomiPaper, the page ground in Gold Dust. Dark
   appearance swaps them, following the system unless the visitor picked one with the header toggle,
   which sets data-theme on the root. */
:root {
  color-scheme: light dark;
  --paper: light-dark(#f3eee2, #17140f);
  --ink: light-dark(#14110f, #f2efe8);
  --secondary-ink: light-dark(#3a342e, #cfc8bd);
  --soft-ink: light-dark(#5c554d, #a39a90);
  --rule: light-dark(#dcd6cc, #34302b);
  --sheet: light-dark(#ece8e0, #1d1916);
  --tile: light-dark(#e2ddd2, #2a2521);
  --gold: light-dark(#a0751c, #c09a4c);

  /* The weekday tones a tear-off calendar prints: sumi ink, indigo Saturdays, vermilion Sundays and
     national holidays. */
  --tone-weekday: var(--ink);
  --tone-saturday: light-dark(#1f3f6e, #9db5da);
  --tone-holiday: light-dark(#b8392a, #e8775f);

  /* The same pairs reversed, for the widget shown in the other appearance. */
  --paper-other: light-dark(#17140f, #f3eee2);
  --ink-other: light-dark(#f2efe8, #14110f);
  --rule-other: light-dark(#34302b, #dcd6cc);
  --tone-weekday-other: var(--ink-other);
  --tone-saturday-other: light-dark(#9db5da, #1f3f6e);
  --tone-holiday-other: light-dark(#e8775f, #b8392a);

  --leaf-shadow: 0 22px 44px -28px light-dark(rgba(20, 17, 15, 0.45), rgba(0, 0, 0, 0.8));
  --widget-shadow: 0 0 0 1px light-dark(transparent, #34302b), 0 1px 2px light-dark(rgba(20, 17, 15, 0.12), transparent), 0 10px 24px -14px light-dark(rgba(20, 17, 15, 0.35), rgba(0, 0, 0, 0.7));

  /* Gold Dust's texture tile, drawn at 2x by the app's make_gold_texture.py. */
  --texture: url("../images/paper/sunago-light.png");
  --texture-other: url("../images/paper/sunago-dark.png");

  --font-serif: "Kaisei HarunoUmi", "Hiragino Mincho ProN", serif;
  --font-mono: "DM Mono", "M PLUS 1 Code", ui-monospace, monospace;
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", system-ui, sans-serif;

  /* A length per design point, which each drawn page's context scales. */
  --s: 1px;

  --gutter: clamp(24px, 5.5vw, 80px);
  --section-pad: 80px;
  --block-gap: 48px;
  --h2: clamp(36px, 3.8vw, 54px);
  --body: 18px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --texture: url("../images/paper/sunago-dark.png");
    --texture-other: url("../images/paper/sunago-light.png");
  }
}

:root[data-theme="dark"] {
  --texture: url("../images/paper/sunago-dark.png");
  --texture-other: url("../images/paper/sunago-light.png");
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

img { display: block; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.72; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* The page ground is plain paper; only pages, leaves and widgets carry the texture. */
.textured {
  background-color: var(--paper);
  background-image: var(--texture);
  background-size: 512px 512px;
}

/* The app icon in the page's appearance, as the app's own icon follows the system's. */
.app-icon-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-icon-dark { display: block; }
  :root:not([data-theme="light"]) .app-icon-light { display: none; }
}

:root[data-theme="dark"] .app-icon-dark { display: block; }
:root[data-theme="dark"] .app-icon-light { display: none; }

/* ===== Shared type ===== */

.eyebrow,
.caption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft-ink);
}

.caption { letter-spacing: 0.14em; }

.soft { color: var(--soft-ink); }

.pill {
  height: 44px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-radius: 22px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-large {
  height: 56px;
  padding: 0 28px;
  border-radius: 28px;
  font-size: 17px;
}

.round {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
}

/* Controls that only work with the script stay hidden without it. */
:root:not(.js) .needs-js { display: none; }

.round:disabled {
  opacity: 0.35;
  cursor: default;
}

.round-text {
  width: auto;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.round-text[hidden] { display: none; }

/* Every band holds its content to 1280 px between the gutters. */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
}

.site-header,
.hero,
.section,
.site-footer { padding: 0 var(--gutter); }

/* ===== Header ===== */

.site-header { border-bottom: 1px solid var(--rule); }

.site-header .wrap {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 23px;
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}

.wordmark img {
  width: 36px;
  height: 36px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The toggle shows the appearance it switches to. */
.icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ===== Day page ===== */

/* The app's DayComposition, 334 design points wide at the scale --s. */
.page {
  width: calc(334 * var(--s));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(16 * var(--s));
}

.tone-weekday { color: var(--tone-weekday); }
.tone-saturday { color: var(--tone-saturday); }
.tone-holiday { color: var(--tone-holiday); }

.page-heading {
  font-size: calc(22 * var(--s));
  letter-spacing: 0.1em;
  line-height: 1.3;
  opacity: 0.8;
  white-space: nowrap;
}

.page .numeral {
  width: calc(334 * var(--s));
  height: calc(260 * var(--s));
}

.page-weekday {
  font-size: calc(50 * var(--s));
  letter-spacing: 0.08em;
  line-height: 1.15;
  white-space: nowrap;
}

.page-names {
  margin-top: calc(-6 * var(--s));
  display: flex;
  gap: calc(16 * var(--s));
  font-size: calc(18 * var(--s));
  letter-spacing: 0.16em;
  line-height: 1.2;
  white-space: nowrap;
}

.page-names[hidden] { display: none; }

.page-almanac {
  margin-top: calc(6 * var(--s));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(7 * var(--s));
  opacity: 0.72;
}

.page-almanac > span {
  display: flex;
  gap: calc(16 * var(--s));
  font-size: calc(14 * var(--s));
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}

/* The numeral's ink fills its frame and sits centred in it, as the app's NumeralShape sets it. The
   frame is a size container; each numeral carries its ink box at a 1 px size, measured from the
   font this page loads: --iw and --ih its width and height, --ix and --iy the offsets that centre
   it. Behind it, faintly, the day's moon, as MoonLight draws it. */
.numeral {
  position: relative;
  display: block;
  flex-shrink: 0;
  container-type: size;
}

.numeral-n {
  --fs: min(100cqw / var(--iw), 100cqh / var(--ih));
  position: absolute;
  left: calc(50cqw - var(--fs) * var(--ix));
  top: calc(50cqh + var(--fs) * var(--iy));
  font-size: var(--fs);
  line-height: 1;
  white-space: nowrap;
}

.moon {
  position: absolute;
  left: calc(50cqw - 48cqmin);
  top: calc(50cqh - 48cqmin);
  width: 96cqmin;
  height: 96cqmin;
}

.moon circle {
  fill: currentColor;
  fill-opacity: 0.027;
}

.moon path {
  fill: currentColor;
  fill-opacity: 0.09;
}

/* ===== Hero ===== */

.hero-grid {
  padding: 48px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero h1 {
  margin-top: 28px;
  font-family: var(--font-serif);
  font-size: clamp(56px, 6vw, 88px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero h1 strong {
  font-weight: 700;
  color: var(--gold);
}

.hero-ja {
  margin-top: 22px;
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: var(--secondary-ink);
}

.hero-lead {
  max-width: 500px;
  margin-top: 26px;
  font-size: var(--body);
  line-height: 1.65;
  color: var(--soft-ink);
  text-wrap: pretty;
}

.hero-copy .pill { margin-top: 40px; }

/* The leaf scales with its column on narrower screens, up to the design's 1.06. */
.hero-leaf {
  --s: clamp(0.6px, calc((43.4vw - 105px) / 334), 1.06px);
  --leaf-pad: 30px 36px 34px;
  --leaf-row: calc(334 * var(--s) + 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.leaf-stack {
  position: relative;
  padding-bottom: 14px;
}

.leaf-under {
  position: absolute;
  height: 40px;
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.leaf-under:first-child { left: 12px; right: 12px; bottom: 0; }
.leaf-under:nth-child(2) { left: 6px; right: 6px; bottom: 7px; }

.leaf {
  position: relative;
  padding: var(--leaf-pad);
  border: 1px solid var(--rule);
  border-top: 5px double var(--gold);
  border-radius: 3px;
  box-shadow: var(--leaf-shadow);
}

.credit,
.hero-controls {
  align-self: stretch;
  width: 100%;
  max-width: var(--leaf-row);
  margin: 0 auto;
}

.credit {
  margin-top: 26px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.credit a { border-bottom: 1px solid var(--rule); }
.credit .soft { text-align: right; }

.hero-controls {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-controls .caption {
  flex-grow: 1;
  padding-left: 6px;
}

/* ===== Sections ===== */

.section-inner {
  border-top: 3px double var(--gold);
  padding: var(--section-pad) 0;
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
}

.section-head {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* The section's number and Japanese name, set vertically beside its copy as an almanac's margin. */
.mark {
  writing-mode: vertical-rl;
  padding-right: 18px;
  border-right: 1px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 0.24em;
  line-height: 1;
  color: var(--gold);
}

.mark-n {
  writing-mode: horizontal-tb;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  background: var(--gold);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.section-copy {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-copy-wide { max-width: 760px; }

.section-copy h2 {
  font-family: var(--font-serif);
  font-size: var(--h2);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.section-copy > p:not(.eyebrow) {
  max-width: 580px;
  font-size: var(--body);
  line-height: 1.65;
  color: var(--soft-ink);
  text-wrap: pretty;
}

.narrow-only { display: none; }

/* ===== Day ===== */

/* The featured day taken apart: its page down the middle on one sheet of paper, each tier beside
   its callout. */
.anatomy {
  --s: 1px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px minmax(0, 1fr);
}

.anatomy-paper {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 210px);
  width: 420px;
  border: 1px solid var(--rule);
  border-top: 5px double var(--gold);
  border-radius: 3px;
  box-shadow: var(--leaf-shadow);
}

.anatomy-part {
  grid-column: 2;
  position: relative;
  margin: 0 1px;
  padding: 14px 0;
  border-top: 1px dashed var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}

.anatomy-part:nth-child(2) {
  padding-top: 30px;
  border-top: 0;
}

.anatomy-part:nth-last-child(2) { padding-bottom: 30px; }

.anatomy .numeral {
  width: calc(334 * var(--s));
  height: calc(260 * var(--s));
}

.anatomy-line {
  display: flex;
  gap: calc(16 * var(--s));
  font-size: calc(14 * var(--s));
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0.72;
}

.anatomy .page-names { margin-top: 0; }

.callout {
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-family: var(--font-body);
}

.callout-left {
  grid-column: 1;
  text-align: right;
}

.callout-right {
  grid-column: 3;
  flex-direction: row-reverse;
}

.callout-text {
  flex: 0 1 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.callout-term {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.callout-left .callout-term { justify-content: flex-end; }

.callout-term [lang="ja"] {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.06em;
}

.callout-en,
.paper-ro,
.class-en {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft-ink);
}

.callout-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--soft-ink);
  text-wrap: pretty;
}

.leader {
  flex: 1 1 24px;
  min-width: 24px;
  height: 1px;
  background: var(--rule);
}

.leader-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: var(--gold);
}

/* ===== Week ===== */

.tones {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-size: 14px;
}

.tones li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tone-dot {
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background: currentColor;
}

/* Seven pages side by side, scrolling sideways where they no longer fit. */
.week {
  padding-bottom: 8px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
}

.week-day {
  flex: 1 1 0;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.week-page {
  padding: 32px 10px 16px;
  border: 1px solid var(--rule);
  border-top: 4px double var(--gold);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.week-page .numeral {
  width: 136px;
  height: 92px;
}

.week-weekday {
  font-size: 21px;
  letter-spacing: 0.08em;
  line-height: 1.15;
  white-space: nowrap;
}

.week-note {
  min-height: 16px;
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0.85;
}

.week-credit {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
}

/* ===== Paper ===== */

.papers-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
}

.papers-copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.paper-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paper-choice {
  min-height: 64px;
  padding: 10px 16px 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.paper-choice[aria-pressed="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
  background: var(--sheet);
}

.paper-names {
  flex-grow: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.paper-en {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.paper-ja {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.08em;
  color: var(--secondary-ink);
}

.check {
  flex-shrink: 0;
  display: none;
}

.paper-choice[aria-pressed="true"] .check { display: block; }
.check circle { fill: var(--gold); }

.check path {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.paper-description {
  max-width: 520px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--soft-ink);
}

.paper-name { color: var(--ink); }

.paper-show {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.paper-samples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.paper-sample {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Each sample sets the page in its own appearance, whatever the site's. */
.sample {
  --s: 0.74px;
  padding: 40px 20px;
  border: 1px solid;
  border-radius: 22px;
  display: flex;
  justify-content: center;
  background-size: 512px 512px;
}

.sample-light {
  color-scheme: light;
  border-color: #dcd6cc;
}

.sample-dark {
  color-scheme: dark;
  border-color: #34302b;
}

.sample-light.paper-sunago { background-color: #f3eee2; background-image: url("../images/paper/sunago-light.png"); }
.sample-dark.paper-sunago { background-color: #17140f; background-image: url("../images/paper/sunago-dark.png"); }
.sample-light.paper-washi { background-color: #f4edde; background-image: url("../images/paper/washi-light.png"); }
.sample-dark.paper-washi { background-color: #1b1612; background-image: url("../images/paper/washi-dark.png"); }
.sample-light.paper-straw { background-color: #eee7d1; background-image: url("../images/paper/warabanshi-light.png"); }
.sample-dark.paper-straw { background-color: #1e1a14; background-image: url("../images/paper/warabanshi-dark.png"); }

.paper-credit {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--soft-ink);
}

/* ===== Typefaces ===== */

.classes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}

.class-card {
  padding: 26px 24px 22px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--sheet);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.class-sample {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.class-glyph {
  font-size: 76px;
  line-height: 1.05;
}

.class-iroha {
  font-size: 17px;
  line-height: 1.4;
  color: var(--secondary-ink);
  white-space: nowrap;
  overflow: hidden;
}

.class-name {
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.class-name > p:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.class-ja {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.06em;
}

.class-credit {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--soft-ink);
}

.stats {
  padding-top: 48px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat strong {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.stat strong.stat-latin { letter-spacing: -0.035em; }

.stat p {
  font-size: 16px;
  line-height: 1.55;
  color: var(--soft-ink);
}

/* ===== Widgets ===== */

.widgets-tile {
  padding: 48px 32px;
  border-radius: 28px;
  background: var(--tile);
}

.widgets-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px 32px;
}

.widgets-row figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.widget {
  box-shadow: var(--widget-shadow);
  display: flex;
  flex-direction: column;
}

.widget-large {
  width: 338px;
  height: 354px;
  padding: 18px 16px 14px;
  border-radius: 24px;
}

.widget-large-day {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.widget-large-page { --s: 0.56px; }

.widget-large-credit,
.widget-small-credit {
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
}

.widget-large-credit {
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.widget-stack {
  height: 354px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.widget-smalls {
  display: flex;
  gap: 22px;
}

.widget-small {
  width: 158px;
  height: 158px;
  padding: 14px 14px 12px;
  border-radius: 22px;
}

/* The second small widget shows the other appearance, on the other paper. */
.widget-other {
  --paper: var(--paper-other);
  --rule: var(--rule-other);
  --tone-weekday: var(--tone-weekday-other);
  --tone-saturday: var(--tone-saturday-other);
  --tone-holiday: var(--tone-holiday-other);
  background-image: var(--texture-other);
  color: var(--ink-other);
}

.widget-small-day {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.widget-small-top {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.widget-small-top span:first-child { opacity: 0.8; }
.widget-small-top span:last-child { opacity: 0.72; }

.widget-small-numeral {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-small .numeral {
  width: 126px;
  height: 70px;
}

.widget-small-weekday {
  font-size: 17px;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-align: center;
}

.widget-small-credit {
  margin-top: 6px;
  padding-top: 6px;
  font-size: 8px;
  text-align: center;
}

.widget-medium {
  width: 338px;
  height: 158px;
  padding: 14px 16px;
  border-radius: 22px;
  flex-direction: row;
}

.widget-medium-numeral {
  flex: 1 1 0;
  padding-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-medium .numeral {
  width: 128px;
  height: 112px;
}

.widget-medium-rule {
  width: 1px;
  background: var(--rule);
}

.widget-medium-lines {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.widget-medium-lines > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.widget-medium-lines > div > span {
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.25;
  white-space: nowrap;
}

.widget-medium-heading {
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.widget-medium-lines > div > .widget-medium-weekday {
  font-size: 28px;
  line-height: 1.1;
}

.widget-medium-almanac {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
  opacity: 0.72;
}

.widget-medium-credit {
  font-family: var(--font-mono);
  font-size: 9px;
}

/* The Lock Screen at 9:41, with the inline widget in the system font and the day and the Moon
   below the time. */
.lock-screen {
  width: 400px;
  height: 354px;
  padding: 26px 20px;
  border-radius: 28px;
  background: #1e2733;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.lock-inline {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.lock-time {
  font-size: 92px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lock-widgets {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.lock-widget {
  width: 172px;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lock-widget + .lock-widget { gap: 12px; }

.lock-numeral {
  display: block;
  flex-shrink: 0;
}

.lock-numeral .numeral {
  width: 64px;
  height: 56px;
}

.lock-lines {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.lock-dim { opacity: 0.6; }

.lock-moon { flex-shrink: 0; }

.lock-moon circle {
  fill: #ffffff;
  fill-opacity: 0.22;
}

.lock-moon path { fill: #ffffff; }

/* ===== App ===== */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 40px 48px;
}

.feature {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.feature-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-glyph {
  font-family: "Kaisei Opti", serif;
  font-size: 22px;
  line-height: 1;
}

.feature-gold { color: var(--gold); }

.feature > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.feature p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--soft-ink);
}

/* ===== Download ===== */

.download .wrap {
  border-top: 3px double var(--gold);
  padding: 88px 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.download img {
  width: 112px;
  height: 112px;
}

.download h2 {
  margin-top: 36px;
  font-family: var(--font-serif);
  font-size: var(--h2);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.download-ja {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--secondary-ink);
}

.download-lead {
  max-width: 480px;
  margin-top: 22px;
  font-size: var(--body);
  line-height: 1.65;
  color: var(--soft-ink);
  text-wrap: balance;
}

.download .pill { margin-top: 36px; }

/* ===== Site footer ===== */

.site-footer { border-top: 1px solid var(--rule); }

.site-footer .wrap {
  padding: 28px 0 calc(36px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.site-footer .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: -0.035em;
  line-height: 1;
}

.site-footer .brand img {
  width: 28px;
  height: 28px;
}

.site-footer .brand small {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--soft-ink);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  font-size: 14px;
  color: var(--soft-ink);
}

.site-footer nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ===== Phone ===== */

@media (max-width: 759px) {
  :root {
    --gutter: 16px;
    --section-pad: 48px;
    --block-gap: 32px;
    --h2: 32px;
    --body: 16px;
  }

  .site-header .wrap { height: 64px; }

  .hero-grid {
    padding: 32px 0 48px;
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }

  .hero h1 { font-size: 44px; }
  .hero-ja { font-size: 21px; }

  .hero-leaf {
    --s: clamp(0.6px, calc((100vw - 72px) / 334), 0.78px);
    --leaf-pad: 22px 20px 26px;
    --leaf-row: calc(334 * var(--s) + 40px);
  }

  .section-head {
    flex-direction: column;
    gap: 14px;
  }

  .mark {
    writing-mode: horizontal-tb;
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--gold);
  }

  .wide-only { display: none; }
  .narrow-only { display: inline; }

  .anatomy {
    --s: 0.42px;
    grid-template-columns: 156px minmax(0, 1fr);
  }

  .anatomy-paper {
    left: 0;
    width: 156px;
  }

  .anatomy-part {
    grid-column: 1;
    padding: 8px 0;
  }

  .anatomy-part:nth-child(2) { padding-top: 18px; }
  .anatomy-part:nth-last-child(2) { padding-bottom: 18px; }

  .callout,
  .callout-left,
  .callout-right {
    grid-column: 2;
    padding: 8px 0 8px 14px;
    gap: 0;
    text-align: left;
  }

  .callout-left .callout-term { justify-content: flex-start; }
  .callout-term [lang="ja"] { font-size: 17px; }
  .callout-desc { font-size: 13px; }
  .leader, .leader-dot { display: none; }

  .week { gap: 12px; }

  .week-day {
    flex: 0 0 128px;
    min-width: 0;
  }

  .week-page .numeral {
    width: 104px;
    height: 70px;
  }

  .week-weekday { font-size: 17px; }

  .papers-grid { grid-template-columns: minmax(0, 1fr); }
  .paper-samples { gap: 10px; }

  .sample {
    --s: 0.44px;
    padding: 22px 8px;
    border-radius: 14px;
  }

  .classes {
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 10px;
  }

  .class-card {
    padding: 16px 14px;
    gap: 14px;
  }

  .class-glyph { font-size: 52px; }
  .class-iroha { font-size: 13px; }

  .stats {
    padding-top: 28px;
    grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr));
    gap: 16px;
  }

  .stat strong { font-size: 34px; }
  .stat p { font-size: 13px; }

  .widgets-tile { padding: 20px 8px; }

  /* The widgets keep their real sizes and the row scales down to fit, as the design does. */
  .widgets-row { zoom: 0.84; }

  .features { gap: 28px; }

  .download .wrap { padding: 56px 0 64px; }
}
