@font-face {
  font-family: AtlasMincho;
  src: url('assets/mincho.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: AlbumNotes;
  src: url('assets/album-notes.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --paper: #f7f4ec;
  --print: #fffcf4;
  --ink: #263333;
  --body: #454944;
  --rule: #c7c4b7;
  --pencil: #984b38;
  --serif: AtlasMincho, "Hiragino Mincho ProN", "Yu Mincho", YuMincho, serif;
  --sans: "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html:has(dialog[open]) { overflow: hidden; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.8 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
h1, h2, p, figure, dl, dd { margin: 0; }
h1, h2 { font: 700 1em/1.28 var(--serif); letter-spacing: -.045em; font-feature-settings: "palt"; }
a, button { color: inherit; }
a { text-decoration: none; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 3px; }
.skip { position: fixed; z-index: 4; top: 0; left: 1rem; padding: .3em 1em; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }
.keep-words { white-space: nowrap; }
.shell { width: min(89%, 1250px); margin-inline: auto; }
.mast { display: flex; align-items: center; gap: 32px; min-height: 84px; border-bottom: 1px solid var(--rule); }
.brand, .mast nav a, .store-link, .example, footer a { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { width: 72px; height: auto; }
.mast nav { display: flex; gap: 26px; font-size: 14px; }
.store-link { margin-left: auto; gap: 7px; font-size: 14px; font-weight: 600; }
.store-link span, .example span { font: 19px/1 Georgia, serif; }
a:is(:hover,:focus-visible) { text-decoration: underline; text-underline-offset: 5px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0,.82fr) minmax(0,1.18fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  align-items: center;
  column-gap: 3%;
  padding: clamp(38px,4.8vw,70px) 0 clamp(30px,3.8vw,55px);
}
.intro { display: contents; }
.hero h1, .intro p, .intro > .badge { grid-column: 1; }
.hero h1 { grid-row: 2; font-size: clamp(46px,5.65vw,84px); line-height: 1.25; }
.hero h1 span { display: inline-block; padding-left: .48em; }
.intro p, .story-copy p { color: var(--body); font-size: clamp(15px,1.16vw,17px); line-height: 1.95; }
.intro p { grid-row: 3; max-width: 26em; margin: 22px 0 20px; }
#print-lead { display: block; margin-bottom: .3em; text-wrap: balance; }
.intro > .badge { grid-row: 4; justify-self: start; }
.badge { display: inline-flex; align-items: center; min-height: 44px; }
.badge img { width: 164px; height: auto; }
.badge:hover { filter: brightness(1.13); }

.atlas-display { grid-column: 2; grid-row: 1 / 6; min-width: 0; padding-top: 6px; }
.artboard { position: relative; aspect-ratio: 1.54; }
.postcard {
  position: absolute; inset: 2% 4% 11% 3.5%; padding: clamp(8px,1vw,15px);
  background: var(--print); box-shadow: 0 1px 2px #45372129, 1px 8px 17px -11px #382d1a75;
  transform: rotate(2deg);
}
.paper-face {
  position: relative; display: grid; grid-template-rows: minmax(0,1fr) auto;
  gap: 3px; height: 100%; padding: 4% 6% 2.5%; background: #e2e5d6;
}
.paper-face::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: url('assets/grain.png'); opacity: .038; }
.artboard[data-place="jp"] .paper-face { background: #dde5e0; }
.artboard[data-place="kyoto"] .paper-face { background: #e9dfcf; }
.artboard[data-place="california"] .paper-face { background: #e3e1cf; }
.shape { position: relative; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.country-name { margin-left: 3%; margin-right: 26%; color: #323b32; font-family: var(--serif); line-height: 1.4; font-size: clamp(16px,1.55vw,23px); letter-spacing: .05em; }
.country-name small { display: block; margin-top: 1px; font: italic clamp(11px,.95vw,14px)/1.15 Georgia, serif; letter-spacing: .015em; }
.snapshot {
  position: absolute; right: .7%; bottom: 2.5%; width: 33%; height: 43%;
  display: grid; grid-template-rows: minmax(0,1fr) auto; padding: 1.1% 1.1% .6%;
  background: #fffcf4; box-shadow: 0 1px 2px #493e3033, 0 5px 9px -6px #382f2375;
  transform: rotate(-5deg);
}
.snapshot img { width: 100%; height: 100%; object-fit: cover; }
.photo-note { color: #5d4a40; font: 600 clamp(13px,1.2vw,18px)/1.4 AlbumNotes, "Klee", "Hiragino Mincho ProN", serif; }
.snapshot .photo-note { padding: .18em .15em 0; text-align: center; }
.country-picker { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px; margin-top: 9px; }
.country-picker > span { margin-right: 6px; font-size: 12px; color: #66665c; }
.country-picker button { position: relative; min-width: 44px; min-height: 44px; padding: 5px 10px; white-space: nowrap; border: 0; background: transparent; color: var(--body); font-size: 14px; }
.country-picker button::after { content: ""; position: absolute; bottom: 5px; left: 9%; right: 9%; height: 3px; border-bottom: 2px solid transparent; border-radius: 40% 15% 70% 30%; transform: rotate(-1.8deg); }
.country-picker button:hover::after { border-color: var(--rule); }
.country-picker button[aria-pressed="true"] { color: var(--pencil); font-weight: 700; }
.country-picker button[aria-pressed="true"]::after { border-color: currentColor; }

.story { display: grid; align-items: center; scroll-margin-top: 16px; }
.story h2 { font-size: clamp(34px,3.7vw,54px); }
.story-copy p { max-width: 29em; margin-top: 18px; }
.story-copy p + p { margin-top: 10px; }
#globe {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 6%;
  padding: clamp(30px,3.8vw,54px) 4.5%; border-block: 1px solid var(--rule);
}
#globe .story-copy { grid-column: 1; grid-row: 1; }
.globe-scene { grid-column: 2; grid-row: 1; display: grid; justify-items: center; }
.sphere { width: min(90%, 402px); height: auto; filter: drop-shadow(2px 7px 6px #5b50321c); }
.journal { grid-template-columns: minmax(0,1.2fr) minmax(0,.8fr); gap: 8%; padding: clamp(45px,6vw,86px) 2%; }
.journal-pair { display: grid; grid-template-columns: 1.04fr .96fr; align-items: start; padding-inline: 2.2%; }
.journal-print { background: var(--print); padding: 3% 3% 2%; box-shadow: 0 1px 2px #463c2d29, 0 5px 11px -8px #322a1c7a; }
.journal-print img { width: 100%; height: auto; object-fit: cover; }
.morning-print { margin: 0 -1% 0 0; transform: rotate(-2deg); }
.morning-print img { aspect-ratio: .76; object-position: center 49%; }
.evening-print { margin: clamp(27px,4.5vw,65px) 0 0 -3%; transform: rotate(3deg); }
.evening-print img { aspect-ratio: .81; object-position: center 50%; }
.journal-print figcaption { padding: 6px 4% 1px; }
.journal-date { display: block; margin-bottom: 9px; color: var(--pencil); font: italic 17px/1.35 Georgia, serif; }
.example { gap: 12px; margin-top: 15px; border-bottom: 1px solid var(--pencil); color: var(--pencil); font-size: 14px; font-weight: 600; }
.example:hover { text-decoration: none; border-bottom-color: currentColor; }

.questions { display: grid; grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr); gap: 8%; padding: 42px 2%; border-top: 1px solid var(--rule); }
.questions h2 { font-size: clamp(27px,2.6vw,38px); }
.questions dl > div + div { margin-top: 13px; border-top: 1px solid #d6d3c8; padding-top: 13px; }
.questions dt { font-size: 16px; font-weight: 650; }
.questions dd { margin-top: 4px; color: var(--body); font-size: 15px; line-height: 1.85; }
.closing { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 22px; padding: 27px 2%; border-block: 1px solid var(--rule); }
.closing h2 { font-size: clamp(21px,2vw,30px); }
footer { display: flex; align-items: center; justify-content: space-between; padding: 17px 0 22px; gap: 12px; }
footer a { line-height: 1.5; }
footer img { width: 52px; height: auto; }
footer div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 20px; font-size: 12px; }

dialog { width: min(430px,90vw); padding: 0 15px 16px; overscroll-behavior: contain; border: 0; background: var(--paper); box-shadow: 0 6px 35px #10231c55; color: var(--ink); }
dialog::backdrop { background: #182322d9; }
dialog img { width: 100%; height: auto; max-height: 72dvh; object-fit: contain; }
.dialog-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; background: var(--paper); }
.dialog-top h2 { font-size: 18px; }
.dialog-top button { width: 44px; height: 44px; border: 0; background: transparent; font: 27px/1 var(--sans); }
.card-preview { position: relative; }
.card-status { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 16px; background: var(--paper); text-align: center; font-size: 14px; color: var(--body); }
.card-status a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }

@media(max-width:1050px) {
  .country-picker > span { display: none; }
  .country-picker { gap: 2px; }
  .country-picker button { padding-inline: 7px; font-size: 13px; }
  .journal { gap: 6%; padding-inline: 1%; }
}
@media(max-width:700px) {
  .shell { width: calc(100% - 40px); }
  .mast { min-height: 64px; gap: 22px; }
  .brand img { width: 57px; }
  .mast nav { gap: 14px; font-size: 12px; }
  .store-link { gap: 4px; font-size: 12px; }
  .store-link span { font-size: 16px; }
  .hero { grid-template-columns: minmax(0,1fr); grid-template-rows: auto; gap: 0; padding: 26px 0 28px; }
  .hero h1 { grid-row: 1; font-size: clamp(44px,10.6vw,65px); line-height: 1.2; }
  .atlas-display { grid-column: 1; grid-row: 2; padding: 0; margin: 18px 0 7px; }
  .artboard { max-width: 490px; margin: auto; aspect-ratio: 1.57; }
  .country-name { font-size: 15px; }
  .country-name small { font-size: 11px; }
  .country-picker { margin-top: 6px; }
  .intro p { margin: 6px 0 11px; max-width: 33em; }
  .badge img { width: 150px; }
  #globe { grid-template-columns: minmax(0,1fr) minmax(0,.85fr); column-gap: 10px; padding: 29px 0 31px; }
  #globe .story-copy { display: contents; }
  #globe h2 { grid-column: 1; grid-row: 1; font-size: clamp(23px,6.1vw,38px); }
  .globe-scene { align-self: center; }
  .sphere { width: min(98%,210px); }
  #globe p { grid-column: 1 / -1; margin-top: 12px; }
  #globe p + p { margin-top: 5px; }
  .journal { grid-template-columns: minmax(0,1fr); gap: 24px; padding: 36px 0 30px; }
  .journal-pair { width: min(100%,480px); margin-inline: auto; }
  .journal-print figcaption { padding-top: 4px; }
  .journal-date { font-size: 15px; margin-bottom: 5px; }
  .journal h2 { font-size: clamp(32px,7.2vw,42px); }
  .story-copy p { margin-top: 13px; max-width: 33em; }
  .questions { grid-template-columns: 1fr; gap: 14px; padding: 29px 0; }
  .closing { padding: 23px 0; }
  footer { align-items: flex-start; padding: 14px 0; }
  footer div { max-width: 78%; gap: 0 13px; font-size: 11px; }
}
@media(max-width:359px) {
  .shell { width: calc(100% - 30px); }
  .mast { gap: 12px; }
  .mast nav { gap: 10px; }
  .country-picker button { padding-inline: 5px; }
  .photo-note { font-size: 12px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }

/* Keep the page switcher independent of the in-page navigation. */
.language-menu { position: relative; flex: none; font-size: 13px; }
.language-menu summary { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 38px; min-height: 44px; padding-inline: 3px; cursor: pointer; list-style: none; font-weight: 600; }
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after { content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-1px) rotate(45deg); }
.language-menu[open] summary::after { transform: translateY(2px) rotate(225deg); }
.language-menu nav { display: grid; position: absolute; z-index: 3; top: 100%; right: 0; gap: 0; width: max-content; min-width: 155px; max-height: min(65dvh, 420px); overflow-y: auto; padding: 5px; background: var(--print); border: 1px solid var(--rule); box-shadow: 0 4px 14px #38352b20; }
.language-menu nav a { padding: 2px 12px; font-family: system-ui, sans-serif; font-size: 14px; }
.language-menu a[aria-current="page"] { color: var(--pencil); background: #f3eee3; }
:root:not(:lang(ja)) { --serif: Georgia, "Times New Roman", serif; --sans: system-ui, sans-serif; }
:root:is(:lang(zh-Hans),:lang(zh-Hant)) { --serif: "Songti SC", "Songti TC", "Noto Serif CJK SC", "Noto Serif CJK TC", serif; }
:root:lang(ko) { --serif: "AppleMyungjo", "Noto Serif KR", Batang, serif; }
:root:lang(hi) { --serif: "Devanagari Sangam MN", "Noto Serif Devanagari", serif; --sans: "Kohinoor Devanagari", "Noto Sans Devanagari", system-ui, sans-serif; }
:root:not(:lang(ja)) .photo-note { font: italic 500 clamp(12px,1.2vw,18px)/1.32 var(--serif); }
:root:not(:lang(ja)) .hero h1 { font-size: clamp(39px,4.8vw,72px); letter-spacing: -.035em; line-height: 1.1; }
:root:not(:lang(ja)) .story h2 { font-size: clamp(30px,3.25vw,49px); }
:root:not(:lang(ja)) .hero h1 span { padding-inline-start: .17em; max-width: 100%; }
:root:is(:lang(ko),:lang(hi)) h1, :root:is(:lang(ko),:lang(hi)) h2 { letter-spacing: 0; line-height: 1.33; }
:root:not(:lang(ja)) .intro p, :root:not(:lang(ja)) .story-copy p { line-height: 1.75; }
:root:lang(ko) :is(h1,h2,p,dd,dt) { word-break: keep-all; overflow-wrap: anywhere; }
@media(max-width:1050px) {
  .mast { gap: 18px; }
}
@media(max-width:700px) {
  .mast { gap: 10px; }
  .mast > nav { gap: 8px; }
  .mast > nav a { line-height: 1.3; }
  .language-menu nav { gap: 0; }
  :root:not(:lang(ja)) .hero h1 { font-size: clamp(39px,8.6vw,57px); }
  :root:not(:lang(ja)) #globe h2 { font-size: clamp(22px,5.1vw,33px); overflow-wrap: break-word; }
  :root:not(:lang(ja)) .journal h2 { font-size: clamp(30px,6.8vw,42px); }
}
@media(max-width:359px) {
  .mast { gap: 6px; }
  .mast > nav { gap: 6px; }
  .brand img { width: 48px; }
  .store-link { white-space: nowrap; }
}
