/* Cover lettering supplied locally under the SIL Open Font License. */
@font-face {
  font-family: "Archivo Black";
  src: url("fonts/archivo-black.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Japanese display lettering supplied locally under the SIL Open Font License. */
@font-face {
  font-family: "Dela Gothic One";
  src: url("fonts/dela-gothic-one.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

body.theme--524 {
  --ink: #233239;
  --accent: #2f6671;
  --accent-dark: #284c54;
  --muted: #526268;
  --paper: #fcf9f1;
  --cream: #fffdf8;
  --line: #c9cbc0;
  --stamp-blue: #e5eeed;
  --lemon: #f8e48c;
  --latin: "Helvetica Neue", Arial, sans-serif;
}

.book-width, .theme--524 .page-wrap {
  width: min(1160px, calc(100% - clamp(32px, 9vw, 128px)));
  margin-inline: auto;
}
.book-header { border-bottom: 1px solid var(--line); }
.book-header__row { min-height: 64px; display: flex; align-items: center; gap: clamp(16px, 4vw, 48px); }
.book-brand { display: inline-flex; align-items: center; min-height: 44px; gap: 3px; white-space: nowrap; }
.brand-face {
  width: 30px;
  height: 30px;
  margin-right: 5px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: #37b5cc url("../../assets/524-line-products/character.webp") center 46% / 148% auto;
}
.book-brand b { font: 900 25px/1 var(--latin); letter-spacing: -.055em; }
.book-brand > span:last-child { font: 900 13px/1.2 var(--stamp-type); }
.book-nav { display: flex; align-items: center; margin-left: auto; gap: clamp(12px, 2.4vw, 28px); }
.book-nav a, .store-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.store-link { gap: 8px; color: var(--accent-dark); }
.store-link span, .ink-button span, .text-link span { font: 500 17px/1 var(--latin); }

.book-hero {
  --heading-ja: "Dela Gothic One", var(--stamp-type);
  --ink: #203852;
  --accent-dark: #1b385e;
  --cream: #fffdf5;
  --cover-paper: #d4eeeb;
  --lemon: #ffe158;
  --mandarin: #ff825c;
  color: var(--ink);
  position: relative; isolation: isolate; overflow: hidden;
  background-color: var(--cover-paper);
  background-image: linear-gradient(#4381831b 1px, transparent 1px), linear-gradient(90deg, #4381831b 1px, transparent 1px);
  background-size: 24px 24px;
}
.book-hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 9px; pointer-events: none;
  background: radial-gradient(circle at 8px 10px, var(--paper) 7px, #9ab6b6 7.5px, transparent 8.5px) 0 0 / 16px 12px repeat-x;
}
.book-cover { width: min(1240px, calc(100% - clamp(38px, 9.5vw, 144px))); display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(10px, 2vw, 36px); padding-block: clamp(30px, 3.7vw, 60px); }
.cover-copy { min-width: 0; container-type: inline-size; position: relative; z-index: 1; }
.cover-author {
  display: table; margin: 0 0 18px; padding: 3px 15px 4px; transform: rotate(-4deg); color: var(--ink);
  background: #ffe899; clip-path: polygon(2% 0,100% 0,98% 23%,100% 47%,97% 75%,99% 100%,0 100%,2% 70%,0 46%,3% 25%);
  font: 750 12px/1.5 var(--sans); letter-spacing: .09em;
}
.cover-copy h1 { margin: 0; text-align: left; }
.cover-display {
  display: block; font: 400 clamp(75px, 9.8vw, 145px)/.88 "Archivo Black", var(--latin);
  font-size: min(23cqi, 145px); letter-spacing: -.075em; color: var(--ink);
}
.cover-word { display: block; width: fit-content; }
.cover-word--book {
  margin: .035em 0 0; color: var(--lemon);
  -webkit-text-stroke: .038em var(--ink); paint-order: stroke fill; text-shadow: .033em .048em var(--ink);
}
.cover-stop { color: var(--mandarin); }
.cover-ja {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .10em; margin-top: 16px;
  color: var(--accent-dark); font: 400 clamp(22px, 2.55vw, 39px)/1.4 var(--heading-ja);
  letter-spacing: -.035em;
}
.cover-ja small { font-size: .69em; }
.title-number {
  display: inline-block; padding: .07em .19em .09em; border-radius: .24em; transform: rotate(-3deg);
  background: var(--lemon); color: var(--ink); font-size: .92em; line-height: 1;
}
.cover-intro { margin: 9px 0 19px; font-size: clamp(13px, 1.12vw, 16px); line-height: 1.9; }
.cover-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 2px 3px 5px 0; }
.ink-button {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 42px; border: 1.5px solid var(--ink); border-radius: 8px;
  padding: 8px 19px; background: var(--ink); box-shadow: 3px 3px 0 var(--mandarin); color: white; font-size: 14px; font-weight: 750; }
.text-link { color: var(--accent-dark); display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; font-weight: 750; text-decoration: underline; text-underline-offset: 5px; }
.cover-art { position: relative; isolation: isolate; display: grid; place-items: center; width: 100%; aspect-ratio: 1.16; }
.cover-art::before, .cover-art::after { content: ""; position: absolute; pointer-events: none; }
.cover-art::before {
  left: 7%; top: 10%; width: 12%; aspect-ratio: 1; background: var(--mandarin); transform: rotate(10deg);
  clip-path: polygon(50% 0,62% 36%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 37%);
}
.cover-art::after {
  right: 1%; bottom: 12%; width: 12%; height: 3%; transform: rotate(-24deg);
  background: repeating-linear-gradient(120deg,var(--ink) 0 3px, transparent 3px 9px);
}
.cover-speech {
  position: absolute; z-index: 1; right: 1.8%; top: 1.8%; pointer-events: none;
  padding: .32em .64em .38em; border: 2px solid var(--ink); border-radius: 52% 48% 46% 54% / 58% 55% 45% 42%;
  background: var(--cream); color: var(--ink); box-shadow: 2px 3px 0 var(--ink);
  font: 400 clamp(15px, 1.55vw, 24px)/1.25 var(--heading-ja); transform: rotate(4deg);
}
.cover-speech::after {
  content: ""; position: absolute; bottom: -7px; left: 22%; width: 13px; height: 12px;
  border-left: 2px solid; border-bottom: 2px solid; background: inherit;
  transform: skew(-29deg, -24deg); transform-origin: bottom left;
}
.loose-sticker {
  position: absolute; left: 1%; bottom: 6%; width: 22%; height: auto; z-index: 1; transform: rotate(-16deg);
  filter: drop-shadow(2px 0 #fff) drop-shadow(-2px 0 #fff) drop-shadow(0 2px #fff) drop-shadow(1px 4px 1px #253a5440);
}
.sticker-sheet, .paper-shadow { position: absolute; width: 58%; height: 82%; border: 1.5px solid var(--ink); border-radius: 9px; }
.paper-shadow {
  background: repeating-linear-gradient(0deg, transparent 0 13px, #923e4b35 13px 14px), #ff967f;
  transform: translate(5%, 2%) rotate(11deg); box-shadow: 3px 4px 0 #6f4c2c24;
}
.sticker-sheet {
  display: grid; grid-template-rows: 13% 1fr 8%; background: #fffdf3; transform: rotate(-8deg);
  box-shadow: 3px 4px 0 #233a5a40, 9px 15px 18px -10px #25496550; overflow: hidden;
}
.sheet-band, .sheet-foot { display: flex; align-items: center; justify-content: space-between; padding-inline: 6%; }
.sheet-band { background: var(--lemon); border-bottom: 1.5px solid var(--ink); }
.sheet-band b { font: italic 900 clamp(18px, 2.3vw, 35px)/1 var(--latin); letter-spacing: -.09em; }
.sheet-band > span:last-child { font: italic 700 clamp(10px, 1.2vw, 17px)/1 Georgia, serif; }
.hang-hole { position: absolute; top: 5.3%; left: 44%; width: 12%; height: 2.5%; border: 1px solid var(--ink); border-radius: 20px; background: #e0f3ef; box-shadow: inset 1px 1px 1px #21434b44; }
.sheet-drawings { position: relative; background-image: linear-gradient(#1e6b7d14 1px, transparent 1px), linear-gradient(90deg, #1e6b7d14 1px, transparent 1px); background-size: 18px 18px; }
.hero-face {
  position: absolute; width: 66%; aspect-ratio: 1; top: 15%; left: 1%; overflow: hidden;
  border: 5px solid white; border-radius: 50%; outline: 1px solid #acc7ca;
  box-shadow: 2px 4px 0 #1e505925; transform: rotate(4deg);
}
.hero-face img { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.26); }
.diecut { position: absolute; height: auto; filter: drop-shadow(2px 0 0 white) drop-shadow(-2px 0 0 white) drop-shadow(0 2px 0 white) drop-shadow(1px 3px 1px #21434b55); }
.diecut--sushi { width: 40%; right: 0; top: 1%; transform: rotate(17deg); }
.diecut--rice { width: 34%; left: 14%; bottom: 1%; transform: rotate(-12deg); }
.diecut--summer { width: 43%; right: 1%; bottom: 6%; transform: rotate(14deg); }
.spark { position: absolute; color: #ef6c45; line-height: 1; font: 700 clamp(14px, 2.2vw, 30px)/1 Georgia, serif; }
.spark--one { left: 16%; top: 3%; }.spark--two { right: 13%; top: 41%; }
.sheet-foot { border-top: 1px dashed #789498; background: #fffdf3; }
.sheet-foot span:first-child { font: 800 clamp(6px, .65vw, 10px)/1.2 var(--latin); letter-spacing: .09em; }
.sheet-bars { width: 24%; height: 48%; background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 3px, var(--ink) 3px 5px, transparent 5px 6px, var(--ink) 6px 7px, transparent 7px 10px); }

.cover-replay {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  border: 0; background: transparent; cursor: pointer; touch-action: manipulation;
}
.theme--524 .cover-replay:focus-visible { outline-offset: -5px; }

@media (max-width: 600px) {
  .book-cover { grid-template-columns: 1fr; gap: 4px; padding-block: 25px 18px; }
  .cover-author { margin-bottom: 13px; font-size: 11px; }
  .cover-display { display: flex; align-items: baseline; gap: .13em; font-size: min(16cqi,78px); line-height: 1; }
  .cover-word--book { margin: 0; }
  .cover-ja { margin-top: 9px; font-size: clamp(21px,5.25vw,29px); }
  .cover-intro { margin: 9px 0 11px; }
  .cover-art { justify-self: center; width: min(100%,440px); aspect-ratio: 1.55; }
  .sticker-sheet, .paper-shadow { width: 45%; height: 84%; }
  .cover-speech { right: 2%; top: 2.5%; font-size: clamp(14px,4vw,20px); }
  .sheet-band b { font-size: 18px; }
  .sheet-band > span:last-child { font-size: 9px; }
  .hero-face { border-width: 3px; }
  .loose-sticker { left: 3%; width: 20%; }
}
@media (prefers-reduced-motion: no-preference) {
  .ink-button { transition: transform .18s ease-out, box-shadow .18s; }
  .text-link span { transition: transform .18s ease-out; }
  .ink-button:active { transform: translate(2px, 2px); box-shadow: none; }
  @media (hover: hover) {
    .text-link:hover span { transform: translateX(4px); }
  }
}

.theme--524 .stamp-section { padding-block: clamp(38px, 5vw, 69px); }
.stamp-section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 13px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}
.theme--524 .stamp-section h2.section-title {
  margin: 0;
  color: var(--ink);
  font: 900 clamp(27px, 3.3vw, 42px)/1.22 var(--stamp-type);
  letter-spacing: -.025em;
}
.set-count { white-space: nowrap; color: var(--muted); font-size: 12px; }
.stamp-products { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 1.5vw, 21px); }
#emoji { background: #edf2ee; }
#emoji .stamp-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stamp-product a {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--cream);
}
.stamp-product__art, .stamp-product:nth-child(even) .stamp-product__art {
  overflow: hidden;
  aspect-ratio: 1.27;
  border-radius: 2px 2px 0 0;
  border-bottom: 1px solid #dfdcd0;
  background: #f5efe1;
}
#emoji .stamp-product__art { background: #f9f8ee; }
.stamp-product .stamp-product__art > img { width: min(76%, 172px); }
.stamp-product__mosaic { width: min(73%, 162px); gap: 4px; }
.stamp-product__body {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 6px;
  padding: 11px 12px 12px;
}
.stamp-product__body::after { content: "↗" / ""; flex: none; color: var(--accent-dark); font: 500 15px/1.4 var(--latin); }
.theme--524 .stamp-product h3 {
  font: 750 clamp(13px, 1.15vw, 15px)/1.58 var(--sans);
  text-wrap: unset;
}
.stamp-about { display: flex; align-items: center; gap: clamp(16px, 3.5vw, 42px); }
.about-portrait {
  flex: none;
  width: clamp(82px, 12vw, 140px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 3px;
}
.about-portrait img { width: 100%; height: 100%; display: block; }
.about-copy p { margin: 10px 0; }
.stamp-about__store, .about-copy p a { text-decoration: underline; text-underline-offset: 4px; }
.book-footer { border-top: 1px solid var(--line); }
.book-footer > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 20px;
  min-height: 64px;
  padding-right: 132px;
  color: var(--muted);
  font-size: 12px;
}
.theme--524 :focus-visible { outline: 2px solid #995828; outline-offset: 3px; }

@media (hover: hover) {
  .book-nav a:hover, .text-link:hover, .store-link:hover, .book-footer a:hover,
  .stamp-product a:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
  .stamp-product a:hover { border-color: var(--accent); box-shadow: none; }
}
@media (max-width: 900px) {
  .stamp-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .book-header__row { flex-wrap: wrap; justify-content: space-between; gap: 0; padding-top: 4px; }
  .book-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    margin-left: 0;
    border-top: 1px solid var(--line);
  }
  .book-nav a { font-size: 12px; }
  #emoji .stamp-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .stamp-products, #emoji .stamp-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stamp-product__body { padding: 9px; }
  .stamp-about { align-items: start; }
  .about-portrait { width: 64px; }
  .about-copy p { font-size: 13px; }
  .book-footer > div { padding-right: 0; padding-bottom: 60px; }
}

#preview { background: var(--stamp-blue); border-bottom: 1px solid var(--line); }
.line-preview__conversation, .line-preview__controls { border-radius: 8px; }
.line-preview__thread { border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; }
.line-preview__controls { background: var(--cream); }
.line-preview__modes button[aria-pressed="true"] { background: var(--accent-dark); color: white; }
.line-preview__choices button { background: #eff3ee; }

/* The launcher stays within the device's safe area, including in landscape. */
.preview-launcher {
  position: fixed;
  z-index: 8;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--cream);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}
.phone-icon {
  display: grid;
  place-items: center;
  width: 14px;
  height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}
.phone-icon span { width: 7px; height: 5px; border-radius: 4px 4px 4px 0; background: var(--accent); }
@media (hover: hover) {
  .preview-launcher:hover { background: var(--lemon); }
}

.preview-heading, .preview-scroll { padding-inline: 18px; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-close {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--accent-dark);
  font: 400 30px/1 var(--latin); cursor: pointer;
}
.preview-close:hover { background: #fff7; }
html:has(.preview-dialog[open]) { overflow: hidden; }
.preview-dialog {
  --edge: 16px;
  position: fixed; inset: auto max(var(--edge), env(safe-area-inset-right)) max(var(--edge), env(safe-area-inset-bottom)) auto;
  width: min(414px, calc(100% - 2 * var(--edge))); max-width: none; max-height: none;
  margin: 0; padding: 0; overflow: hidden;
  color: var(--ink); background: var(--cream); border: 1px solid var(--ink); border-radius: 8px;
  box-shadow: 0 12px 34px #1b464b28;
}
.preview-dialog::backdrop { background: #23323962; }
.preview-dialog #preview {
  display: flex; flex-direction: column; padding: 0; border: 0;
  max-height: calc(100vh - 2 * var(--edge) - 6px);
  max-height: calc(var(--available-height, 100dvh) - max(var(--edge), env(safe-area-inset-bottom)) - max(var(--edge), env(safe-area-inset-top)) - 6px);
  background: var(--cream);
}
.preview-dialog .preview-heading { flex: none; min-height: 52px; padding: 4px 7px 4px 16px; background: var(--cream); border-bottom: 1px solid var(--line); }
.preview-dialog #preview-title { font-size: 24px; color: var(--accent-dark); }
.preview-dialog .preview-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px; }
.preview-dialog .line-preview { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.preview-dialog .line-preview__conversation { position: static; }
.preview-dialog .line-preview__conversation > .line-preview__bar { padding: 0 12px; }
.preview-dialog .line-preview__utility { min-height: 40px; }
.preview-dialog .line-preview__thread { flex: none; min-height: 0; height: clamp(108px, 21dvh, 165px); padding: 9px 10px; }
.preview-dialog .line-preview__message p[data-line-layout="sticker"] { width: clamp(80px, 13dvh, 108px); }
.preview-dialog .line-preview__controls { padding: 8px 10px 10px; }
.preview-dialog .line-preview__modes { padding-bottom: 6px; }
.preview-dialog .line-preview__hint { margin: 6px 0; }
.preview-dialog .line-preview__choices { gap: 5px; }
.preview-dialog .line-preview__choices button { grid-template-rows: clamp(36px, 6dvh, 49px) auto; padding: 5px 2px; min-height: 44px; }
.preview-dialog .line-preview__note { margin: 8px 4px 0; font-size: 11px; }
@media (max-width: 480px) {
  .preview-dialog { --edge: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .preview-dialog[open] { animation: preview-arrive 180ms ease-out; }
  @keyframes preview-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .theme--524 *, .theme--524 *::after { transition: none; animation: none; }
}
