@font-face {
  font-family: "Bimoji Mincho";
  src: url("assets/heading.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Bimoji Brush";
  src: url("assets/brush.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbf8f1;
  --ink: #28201d;
  --muted: #61554d;
  --vermilion: #963a32;
  --vermilion-dark: #782c27;
  --line: #ddd2c3;
  --mincho: "Bimoji Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --brush: "Bimoji Brush", var(--mincho);
  font-family: "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  scroll-padding-top: 5rem;
}

:root:lang(en) {
  --mincho: Georgia, "Times New Roman", serif;
  font-family: system-ui, sans-serif;
}

:root:lang(zh-Hans) {
  --mincho: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root:lang(zh-Hant) {
  --mincho: "Songti TC", "Noto Serif CJK TC", PMingLiU, serif;
  font-family: "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

:root:lang(ko) {
  --mincho: AppleMyungjo, "Noto Serif KR", Batang, serif;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

* { box-sizing: border-box; }
body, p, h1, h2, h3, ol { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.24em; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 5px;
}

.container { width: min(100% - 5rem, 72.5rem); margin-inline: auto; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 3;
  top: 0.8rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  color: var(--ink);
  background: var(--paper);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img, .download-icon { border-radius: 24%; }
.header-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.header-nav a, .site-footer a { text-decoration: none; }
.header-nav a { font-size: 0.875rem; white-space: nowrap; }
.header-nav a:hover, .site-footer a:hover { text-decoration: underline; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--vermilion);
  border-radius: 0.5rem;
  color: var(--vermilion-dark);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.button:hover { background: #f4e6df; }
.header-download { padding: 0.5rem 0.9rem; font-size: 0.875rem; white-space: nowrap; }

.hero {
  display: grid;
  grid-template-columns: 0.89fr 1.11fr;
  align-items: center;
  gap: clamp(2rem, 4.8vw, 4.5rem);
  padding-block: clamp(3rem, 6vw, 5.5rem);
}

.hero-copy { min-width: 0; }
.hero-photo {
  width: 100%;
  aspect-ratio: 1.17;
  object-fit: cover;
  border-radius: 0.65rem;
  background: #e7dbca;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--vermilion-dark);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.section-label::before {
  content: "";
  width: 1.65rem;
  height: 1px;
  background: currentColor;
}

h1, h2 {
  font-family: var(--mincho);
  font-weight: 400;
  line-height: 1.3;
}

h1 {
  margin-top: 1.05rem;
  font-size: clamp(3rem, 4.65vw, 4.3rem);
  letter-spacing: 0.015em;
}

h2 { font-size: clamp(2rem, 3.3vw, 3.1rem); letter-spacing: 0.02em; }
h3 { font-size: 1.125rem; line-height: 1.5; }
.hero-lead { max-width: 25rem; margin-top: 1.4rem; color: var(--muted); line-height: 1.95; }
.store-links {
  --badge-height: 3.125rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
}
.hero .store-links { margin-top: 1.8rem; }
.store-link img {
  width: auto;
  height: var(--badge-height);
}
.store-link-google img {
  /* The official image has 29px of transparent padding above and below the badge. */
  height: calc(var(--badge-height) * 250 / 192);
}
:root:lang(en) .store-link-google {
  /* The English image also includes 41px of transparent padding on the sides. */
  margin-inline: calc(var(--badge-height) * -41 / 168);
}
:root:lang(en) .store-link-google img {
  height: calc(var(--badge-height) * 250 / 168);
}
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 1rem; margin-top: 0.65rem; }
.store-note { color: var(--muted); font-size: 0.8125rem; }
.hero-try-link { display: none; color: var(--vermilion-dark); font-size: 0.875rem; }

.demo-section {
  --demo-foreground: #fff8ef;
  --demo-accent: #efb7a2;
  color: var(--demo-foreground);
  background: #2c2220;
}
.demo-section :focus-visible { outline-color: var(--demo-accent); }
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3.5rem;
  max-width: 58rem;
  padding-block: clamp(3.25rem, 7vw, 6rem);
}
.demo-section .section-label { color: var(--demo-accent); }
.demo-copy h2 { margin-block: 0.95rem 1rem; }
.demo-copy > p:not(.section-label) { max-width: 22rem; color: #e4d6cc; }

.character-picker {
  padding: 0;
  margin: 1.55rem 0 0;
  border: 0;
  min-inline-size: 0;
}
.character-picker legend { padding: 0; margin-bottom: 0.55rem; font-size: 0.875rem; }
.character-options { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.character-options button {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid #947e75;
  border-radius: 0.3rem;
  color: inherit;
  background: transparent;
  font-family: var(--brush);
  font-size: 1.65rem;
  line-height: 1;
}
.character-options button:hover { background: #493531; }
.character-options button[aria-pressed="true"] {
  color: #44241e;
  background: var(--demo-accent);
  border-color: var(--demo-accent);
}

.demo-preview { width: min(100%, 25rem); justify-self: end; }
.trace-paper {
  position: relative;
  container-type: inline-size;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 0.55rem;
  overflow: hidden;
  isolation: isolate;
  background: #faf4e7;
  box-shadow: 0 0.9rem 2.5rem #160b0966;
}
.trace-paper::before {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: -1;
  border: 1px solid #b87c6e8f;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), #b87c6e55 50%, transparent calc(50% + 0.5px)),
    linear-gradient(transparent calc(50% - 0.5px), #b87c6e55 50%, transparent calc(50% + 0.5px));
}
.trace-guide {
  font-family: var(--brush);
  font-size: clamp(7rem, 32vw, 19rem);
  font-size: 76cqw;
  color: #a39a8b;
  line-height: 1;
  user-select: none;
}
#trace-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.paper-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.guide-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  margin-right: auto;
  cursor: pointer;
  font-size: 0.875rem;
}
.guide-toggle input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--demo-accent); }
.paper-actions button {
  min-height: 2.75rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid #947e75;
  border-radius: 0.3rem;
  color: inherit;
  background: transparent;
  font-size: 0.875rem;
}
.paper-actions button:not(:disabled):hover { background: #493531; }
.paper-actions button:disabled { color: #b69f95; border-color: #6c5750; }

.how-section, .features-section, .faq-section { padding-block: clamp(3.75rem, 8vw, 7rem); }
.section-heading h2 { margin-top: 0.65rem; }
.steps, .scenes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: 2.35rem;
}
.steps { list-style: none; padding: 0; }
.steps li { border-top: 1px solid var(--line); padding-top: 1.35rem; }
.steps img { width: 7.25rem; margin-bottom: 1.2rem; }
.steps p, .scene-copy p { margin-top: 0.5rem; color: var(--muted); }

summary { cursor: pointer; font-weight: 700; }
summary::marker { color: var(--vermilion); }
.intro-video { width: min(100%, 48rem); margin: 2rem auto 0; }
.intro-video figcaption { font-weight: 700; }
.intro-video video {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 1rem;
  border-radius: 0.55rem;
  background: #e7dbca;
}

.features-section { background: #f1e8da; }
.scenes { gap: clamp(1rem, 2.2vw, 1.75rem); }
.scene { overflow: hidden; border-radius: 0.55rem; background: var(--paper); }
.scene-sample {
  display: grid;
  place-items: center;
  height: 10.25rem;
  overflow: hidden;
}
.scene-sample span {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 8rem;
  writing-mode: vertical-rl;
  font-family: var(--brush);
  font-size: 1.8rem;
  line-height: 1;
  white-space: nowrap;
  background: #fffaf2;
  box-shadow: 0.2rem 0.3rem 0.7rem #44311c24;
}
.sample-celebration { background: #e8d0c5; }
.sample-celebration span { font-size: 3.75rem; rotate: -8deg; }
.sample-condolence { background: #dcdad3; }
.sample-condolence span { rotate: 6deg; }
.sample-address { background: #e4e3d6; }
.sample-address span { width: 5.4rem; rotate: -5deg; font-size: 1.5rem; }
.scene-copy { padding: 1.2rem 1.25rem 1.45rem; }
.reference-note { margin-top: 1.65rem; color: var(--muted); }

.faq-section { max-width: 54rem; }
.faq-list { margin-top: 1.8rem; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 1.15rem 0.25rem; }
.faq-list p { max-width: 70ch; padding: 0 0.25rem 1.2rem; color: var(--muted); }

.download-section { background: #f1dfd7; padding-block: 3rem; }
.download-inner { display: flex; align-items: center; gap: 1.25rem; }
.download-icon { flex: none; }
.download-inner h2 { font-size: clamp(1.65rem, 2.55vw, 2.35rem); }
.download-inner p { margin-top: 0.5rem; color: var(--muted); }
.download-inner .store-links { flex: none; margin-left: auto; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  padding-block: 1.6rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer nav { display: flex; gap: 0.6rem 1.25rem; flex-wrap: wrap; }
.site-footer .language-nav {
  flex-basis: 100%;
  gap: 0.25rem 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}
.language-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.65rem;
  border-radius: 0.35rem;
}
.language-nav a[aria-current="page"] {
  color: var(--vermilion-dark);
  background: #f1dfd7;
  font-weight: 700;
}

@media (max-width: 65rem) {
  .container { width: calc(100% - 3.5rem); }
  .hero { grid-template-columns: 1fr 1fr; }
  h1 { font-size: clamp(2.6rem, 5.1vw, 3.5rem); }
  .download-inner { flex-wrap: wrap; }
  .download-inner .store-links { flex: 0 1 auto; margin-left: 0; }
}

@media (max-width: 48rem) {
  .container { width: calc(100% - 2.5rem); }
  .header-inner { min-height: 4.1rem; }
  .header-nav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 1.9rem; padding-block: 2.5rem; }
  h1 { font-size: clamp(2.2rem, 10vw, 3.8rem); }
  .hero-photo { aspect-ratio: 1.37; }
  .hero-try-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .demo-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .demo-copy h2 br { display: none; }
  .demo-preview { justify-self: start; }
  .steps, .scenes { margin-top: 1.5rem; }
  .steps { grid-template-columns: 1fr; gap: 0.85rem; }
  .steps li { display: flex; align-items: center; gap: 1rem; padding-top: 0.85rem; }
  .steps img { flex: none; width: 5rem; margin: 0; }
  .scenes { grid-template-columns: 1fr; gap: 0.75rem; }
  .scene { display: grid; grid-template-columns: minmax(5.5rem, 23%) 1fr; }
  .scene-sample { height: auto; min-height: 8rem; }
  .scene-sample span { width: 3rem; height: 6.7rem; }
  .sample-celebration span { font-size: 2.75rem; }
  .sample-condolence span { font-size: 1.6rem; }
  .scene-copy { padding: 0.95rem; }
  .download-inner { align-items: flex-start; }
  .download-icon { width: 3.35rem; }
  .download-inner > div:first-of-type { flex: 1 1 12rem; }
  .download-inner .store-links { flex-basis: 100%; }
}

@media (max-width: 23rem) {
  .container { width: calc(100% - 2rem); }
  .header-download { padding-inline: 0.5rem; }
  .brand { gap: 0.45rem; font-size: 0.875rem; }
  .brand img { width: 2rem; }
  .store-links { --badge-height: 2.75rem; }
}

