/* ---------- The opening: the headline, then C's seven bars ----------
   The icon's bars, each brushed up the page as it opens. Each bar is its own
   image; a tall mask with a line of bristles across it slides up over the bar,
   so the leading edge is a brush's rather than a fade's. The bars also name
   the seven chapters of the support page below. */
.opening { padding: clamp(2.2rem, 6vw, 6rem) 0 0; }
.opening .display span { display: inline-block; }
.opening .display {
  font-size: clamp(2.9rem, 7.4vw, 6.3rem); line-height: 1.17; font-weight: 700; margin: 0; text-wrap: balance;
  font-family: "Songti TC", "Noto Serif TC", var(--serif);
}
:lang(zh-Hans) .opening .display { font-family: "Songti SC", "Noto Serif SC", var(--serif); font-size: clamp(2.7rem, 6.6vw, 5.2rem); }
:lang(ja) .opening .display { font-family: "Hiragino Mincho ProN", "Noto Serif JP", var(--serif); font-size: clamp(2.3rem, 5.8vw, 4.9rem); line-height: 1.3; }
:lang(ko) .opening .display { font-family: "AppleMyungjo", "Noto Serif KR", var(--serif); font-size: clamp(2.3rem, 5.8vw, 4.9rem); line-height: 1.3; }
:lang(en) .opening .display { font-family: var(--serif); font-size: clamp(2.5rem, 6.2vw, 5.4rem); line-height: 1.12; }
.opening-under { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.2rem 3rem; margin: clamp(1.4rem, 3vw, 2.8rem) 0 clamp(1.6rem, 3vw, 2.8rem); }
.opening-under p { margin: 0; max-width: 46em; font-size: clamp(1.06rem, 1.35vw, 1.22rem); line-height: 1.75; }
.opening-under .actions { margin: 0; flex: none; }

.painting { position: relative; display: grid; grid-template-columns: 132fr 132fr 132fr 232fr 132fr 132fr 132fr; }
.strokes { position: absolute; inset: 0 0 auto; aspect-ratio: 2400 / 900; pointer-events: none; }
.strokes img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none;
  -webkit-mask: var(--m) 0 100% / 100% 300% no-repeat; mask: var(--m) 0 100% / 100% 300% no-repeat;
}
.strokes img:nth-child(3n + 1) { --m: url(/img/opening/mask-1.png); }
.strokes img:nth-child(3n + 2) { --m: url(/img/opening/mask-2.png); }
.strokes img:nth-child(3n) { --m: url(/img/opening/mask-3.png); }
.strokes img:nth-child(2) { --d: 95ms; } .strokes img:nth-child(3) { --d: 190ms; } .strokes img:nth-child(4) { --d: 285ms; }
.strokes img:nth-child(5) { --d: 380ms; } .strokes img:nth-child(6) { --d: 475ms; } .strokes img:nth-child(7) { --d: 570ms; }
@keyframes brush {
  from { -webkit-mask-position: 0 0; mask-position: 0 0; }
  to { -webkit-mask-position: 0 100%; mask-position: 0 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .strokes img { animation: brush 1150ms cubic-bezier(.42, .08, .24, 1) var(--d, 0ms) both; }
}
/* The links stand on the bars; each reaches to its chapter's name under them. */
.painting a { position: relative; display: block; color: var(--ink); text-align: center; text-decoration: none; font-weight: 600; font-size: clamp(.86rem, 1.15vw, 1.02rem); line-height: 1.35; }
.painting a i { display: block; }
.painting a:nth-of-type(n) i { aspect-ratio: 132 / 384; }
.painting a:nth-of-type(4) i { aspect-ratio: 232 / 384; }
.painting a span { display: block; padding: 1rem .35rem 0; }
.painting a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .painting a:hover span { text-decoration: underline; text-underline-offset: .28em; } }
.opening-index { display: none; list-style: none; margin: .9rem 0 0; padding: 0; }
.intro.demo { padding-top: clamp(4rem, 9vw, 8rem); }
.intro.demo .display { font-size: clamp(1.9rem, 4vw, 3.1rem); }

@media (max-width: 759.98px) {
  .opening-under .actions { width: 100%; }
  .opening-under .button { flex: 1; }
  .painting a { visibility: hidden; }
  .painting a span { display: none; }
  .opening-index { display: block; }
  .opening-index a { display: flex; align-items: center; gap: .9rem; min-height: 3.3rem; color: var(--ink); font-weight: 600; font-size: 1.08rem; text-decoration: none; border-top: .5px solid var(--hairline); }
  .opening-index img { width: 3.2rem; height: 1.15rem; flex: none; }
  .opening-index a::after { content: "›"; margin-left: auto; color: var(--faint); font-weight: 400; }
}

/* Apple's badge, unaltered, with a quarter of its height clear around it. */
.opening-under .actions { display: flex; align-items: center; gap: 1rem; }
.opening-badge { display: block; flex: none; line-height: 0; }
.opening-badge img { display: block; width: auto; height: 52px; }
.opening-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The pen lines laid over the opening and the footer (scribble.js). */
.opening-under, .foot { position: relative; }
.opening-under p .scribble-word { white-space: nowrap; }
.scribble { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
@media print { .scribble { display: none; } }
