@font-face {
  font-family: "Zen Maru Gothic";
  src: url("zen-maru-500.woff?v=7") format("woff");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Zen Maru Gothic";
  src: url("zen-maru-700.woff?v=7") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #fffaf5;
  --white: #fffcfa;
  --ink: #49333f;
  --muted: #665269;
  --accent: #775381;
  --lavender: #eae1fb;
  --line: #e5d9eb;
  --site-font: "Zen Maru Gothic", "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.25rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 1rem/1.85 var(--site-font);
  overflow-wrap: anywhere;
}
h1, h2, h3, p, figure, ul { margin: 0; }
h1, h2 { font-family: var(--site-font); font-weight: 700; line-height: 1.38; }
h1 { font-size: clamp(1.78rem, 4.2vw, 2.85rem); }
h2 { font-size: clamp(1.28rem, 2.9vw, 1.78rem); }
h3 { font-size: 1.1rem; line-height: 1.6; }
ul { padding-inline-start: 1.2em; }
a { color: var(--accent); text-underline-offset: .25em; }
a:hover { text-decoration-thickness: .13em; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #8056ad; outline-offset: 4px; }
.skip { position: absolute; top: .5rem; left: .5rem; z-index: 4; padding: .5rem 1rem; background: var(--white); transform: translateY(-180%); }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(100% - 2.5rem, 74rem); margin-inline: auto; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: .95rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font: 700 1.15rem/1.4 var(--site-font); text-decoration: none; }
.moon { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 50%; box-shadow: inset .37rem -.24rem var(--accent); flex: none; transform: rotate(-14deg); }
.topbar nav { display: flex; gap: clamp(.55rem, 3vw, 1.65rem); flex-wrap: wrap; }
.topbar nav a { font-size: .9rem; font-weight: 700; text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.main { min-height: 50vh; padding-block: clamp(1rem, 3.8vw, 2.75rem) clamp(2.75rem, 6vw, 5rem); }
/* The reference artwork is displayed through two windows, leaving the controls as HTML. */
.hero {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 31%);
  align-items: center;
  gap: clamp(1rem, 4vw, 2.6rem);
  padding: clamp(1.4rem, 4.4vw, 3.5rem);
  border: 1px solid #eadfed;
  border-radius: clamp(1.5rem, 3.7vw, 2.7rem);
  background: linear-gradient(112deg, #fff9fb, #f9f1fb 63%, #f5eafa);
  box-shadow: 0 .8rem 2.25rem #583b7610;
}
.hero-clouds {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 0% 107%, #eee2f6 0 7%, transparent 7.4%),
    radial-gradient(ellipse at 8% 108%, #eee2f6 0 6%, transparent 6.4%),
    radial-gradient(ellipse at 17% 110%, #f1e7f8 0 6%, transparent 6.4%),
    radial-gradient(ellipse at 96% 104%, #ece0f4 0 10%, transparent 10.4%),
    radial-gradient(ellipse at 84% 109%, #eee4f6 0 8%, transparent 8.4%);
}
.hero-crop {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 7% 93%, transparent),
    linear-gradient(to bottom, transparent, #000 5% 96%, transparent);
  mask-composite: intersect;
}
.hero-crop img {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
}
.hero-lettering {
  /* Window at (92, 22), 870 by 306 in the 1770 by 889 reference. */
  aspect-ratio: 870 / 306;
  width: min(100%, 38rem);
  color: var(--ink);
}
.hero-lettering img { width: 203.4483%; left: -10.5747%; top: -7.1895%; }
.hero-ram {
  /* Window at (1220, 117), 535 by 456 from the same reference. */
  aspect-ratio: 535 / 456;
  width: min(100%, 22rem, 30vw);
}
.ram .hero-ram img { max-width: none; width: 330.8411%; left: -228.0374%; top: -25.6579%; }
.ram-hero { gap: .65rem; }
.hero .ram-hero figcaption {
  width: 100%;
  max-width: 21rem;
  padding: .65rem .6rem;
  border-radius: 2rem 2.4rem 2.1rem 2.5rem;
  background: #fffafb;
  color: #60436a;
  font-size: clamp(.95rem, 1.45vw, 1.1rem);
}
.intro { max-width: 66ch; margin-top: 1.15rem; color: var(--ink); font-size: clamp(1rem, 1.45vw, 1.14rem); }
.browse-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.25rem; }
.memo textarea, .memo-feeling input {
  width: 100%; min-width: 0; color: var(--ink); border: 1px solid #c5b2d7;
  border-radius: .8rem; background: var(--white); padding: .65rem .8rem;
}
::placeholder { color: var(--muted); opacity: 1; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
  padding: .55rem .9rem; border-radius: .75rem; border: 1px solid transparent;
  background: var(--accent); color: #fff; font-weight: 700; white-space: nowrap; text-decoration: none;
}
button:hover, .button:hover { background: #49346d; }
.button.outline, .delete { background: var(--white); color: var(--accent); border-color: #d2c1e6; }
.button.outline:hover, .delete:hover { background: #f6eefb; }
.ram { display: grid; align-items: center; justify-items: center; gap: .15rem; min-width: 0; visibility: hidden; }
.ram-visible { visibility: visible; }
.ram img { width: 100%; max-width: 30vw; height: auto; display: block; object-fit: contain; }
.ram figcaption { color: #402c58; text-align: center; border: 1px solid #e3d5f0; background: var(--white); border-radius: .85rem; padding: .3rem .7rem; max-width: 14rem; width: fit-content; font-size: .88rem; line-height: 1.55; }
.ram-small img { width: min(5.25rem, 20vw); }
.ram-footer img { width: min(4rem, 15vw); }
.daily > .ram, .hotto > .ram, .goodbye > .ram { flex: 0 0 auto; }
.ram-yay img { width: min(4rem, 17vw); }
.ram-small { display: flex; flex-direction: row-reverse; }
.panel { padding: clamp(1rem, 3vw, 1.65rem); background: var(--white); border: 1px solid var(--line); border-radius: 1.2rem; }
.daily, .hotto { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.daily { margin-top: 1.5rem; background: #fdf4e9; border-color: #ede0cf; }
.daily h2 { color: #4a355d; font-size: 1.25rem; }
.daily p, .hotto p { margin-top: .35rem; }
.section, .memo { margin-top: clamp(1.65rem, 4vw, 2.8rem); }
.section > h2, .section-heading { margin-bottom: .9rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.dream-grid, .category-grid, .kana-links, .memo-lists ul, .scenes-nav ul { padding: 0; list-style: none; }
.dream-grid, .category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.dream-grid a, .category-grid a {
  display: flex; align-items: center; gap: .5rem; min-height: 3.25rem; height: 100%;
  padding: .6rem .85rem; background: var(--white); color: var(--ink);
  border: 1px solid var(--line); border-radius: .8rem; font-weight: 700; text-decoration: none;
}
.dream-grid a::before { content: ""; flex: none; width: .42rem; height: .42rem; border-radius: 50%; background: #a88ccc; }
.dream-grid a:hover, .category-grid a:hover { background: #f4ebfa; border-color: #c4aed9; }
.category-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.category-grid a { justify-content: center; flex-direction: column; gap: .12rem; padding: .8rem .5rem; text-align: center; }
.category-grid small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.browse-description { margin-top: .45rem; color: var(--muted); }
.browse-back { margin-top: 1.25rem; }
.category-list { margin-top: 1.25rem; }
.pending-topics { margin-top: 1rem; }
.pending-topics summary { font-weight: 700; cursor: pointer; }
.pending-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: .35rem .9rem; padding: 0; margin-block: .7rem .85rem; list-style: none;
}
.pending-list li { padding-block: .3rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.crumb { display: flex; flex-wrap: wrap; gap: .55rem; font-size: .9rem; color: var(--muted); margin-bottom: 1.15rem; }
.page-heading { border-radius: 1.35rem; background: #f3ebfa; border: 1px solid var(--line); padding: clamp(1.1rem, 4vw, 2.25rem); margin-bottom: 1rem; }
.kana-links { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.kana-links a { display: grid; place-items: center; text-decoration: none; min-width: 2.75rem; min-height: 2.75rem; background: var(--white); border-radius: .6rem; border: 1px solid var(--line); }
.kana-group + .kana-group { margin-top: 1rem; }
.kana-group h2 { margin-bottom: .4rem; }
.scenes-nav ul { display: flex; flex-wrap: wrap; gap: .4rem .55rem; margin-top: .65rem; }
.scenes-nav a { display: inline-block; background: #f3ebfa; padding: .3rem .62rem; border-radius: .55rem; font-size: .92rem; }
.article, .related, body[data-article] .memo { max-width: 52rem; margin-inline: auto; }
.article-heading {
  padding: clamp(1.15rem, 5vw, 2.7rem); border: 1px solid var(--line); border-radius: 1.6rem;
  background: linear-gradient(140deg, #f2e8fa, #fff8f0);
}
.article-heading h1 { margin-top: .65rem; }
.category-tag { display: inline-block; padding: .2rem .68rem; border-radius: 1rem; background: var(--lavender); font-size: .9rem; font-weight: 700; }
.article-subtitle { margin-top: .35rem; color: var(--muted); }
.article-intro { margin-top: 1rem; max-width: 43em; }
.answer { font-size: 1.065rem; }
.answer + .answer { margin-top: .6rem; }
.scenes-nav, .article-scenes, .reflection, .hotto { margin-top: 1.5rem; }
.scenes-nav h2, .hotto h2 { font-size: 1.25rem; }
.scene { scroll-margin-top: .5rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.scene h3 { color: #4c366b; margin-bottom: .3rem; }
.scene:target { background: #f4edf9; padding-inline: .85rem; border-radius: .7rem; }
.reflection p { margin-top: .5rem; }
.hotto { background: #f2e9fa; }
.related .dream-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.muted { color: var(--muted); font-size: .9rem; }
.memo .muted { margin-block: .3rem .75rem; }
.memo textarea { display: block; resize: vertical; }
.memo-feeling { display: grid; gap: .3rem; margin-top: .7rem; }
.memo-feeling input { font: inherit; }
.memo-lists .memo-content { min-width: 0; overflow-wrap: anywhere; }
.memo-lists .memo-content p { margin-block: .2rem; }
.memo-lists .memo-content button { margin-block: .3rem; white-space: normal; }
.memo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-top: .6rem; min-height: 2.75rem; }
.memo-status { color: var(--accent); }
.memo-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: .85rem; }
.memo-lists li { display: flex; align-items: center; justify-content: space-between; gap: .55rem; border-bottom: 1px solid var(--line); padding-block: .35rem; }
.memo-lists p { white-space: pre-wrap; }
.delete { font-size: .875rem; padding-inline: .55rem; }
.site-footer { border-top: 1px solid var(--line); background: #f1eafa; }
.footer-inner { padding-block: 1.1rem 1.45rem; }
.goodbye { display: flex; align-items: center; gap: .5rem 1rem; font-family: var(--site-font); font-size: 1.06rem; font-weight: 700; }
.bookmark, .disclaimer { color: var(--muted); font-size: .875rem; }
.bookmark { margin-bottom: .7rem; }
.disclaimer { margin-top: .55rem; }

@media (max-width: 48rem) {
  .shell { width: min(100% - 1.75rem, 68rem); }
  .hero { gap: .65rem; padding: 1.35rem 1rem; grid-template-columns: minmax(0, 1fr) minmax(6rem, 24%); align-items: start; }
  .hero-content { display: contents; }
  .hero h1 { grid-column: 1; align-self: center; }
  .hero .intro, .hero .browse-actions { grid-column: 1 / -1; margin-top: .25rem; }
  .hero .ram-hero { grid-row: 1; grid-column: 2; }
  .hero .ram-hero figcaption { padding: .28rem .4rem; font-size: .8rem; }
  .dream-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 29rem) {
  .topbar { gap: .4rem .65rem; flex-wrap: wrap; }
  .brand { font-size: .98rem; }
  .topbar nav a { font-size: .8rem; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 27%); }
  .hero .ram-hero figcaption { display: none; }
  .browse-actions .button { padding-inline: .6rem; }
  .section-heading .ram { flex-direction: column; }
  .section-heading .ram figcaption { font-size: .76rem; padding-inline: .35rem; }
  .memo-lists { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.dream-chat-link { margin-top: .75rem; }
.dream-chat { margin: 1rem auto 0; max-width: 52rem; }
.dream-chat summary { cursor: pointer; font-size: 1.12rem; font-weight: 700; }
.dream-chat[open] summary { margin-bottom: .65rem; }
.dream-chat-form { display: grid; gap: .75rem; margin-top: .9rem; }
.dream-chat label { display: block; font-weight: 700; }
.dream-chat input, .dream-chat select {
  width: 100%; min-width: 0; color: var(--ink); border: 1px solid #c5b2d7;
  border-radius: .8rem; background: var(--white); padding: .6rem .8rem; font: inherit;
}
.dream-chat-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.dream-chat-options label, .dream-chat-result label { margin-bottom: .3rem; }
.dream-chat-custom { margin-top: .65rem; }
.dream-chat-result { margin-top: 1rem; }
.chat-status:not(:empty) { margin-top: .45rem; color: var(--accent); font-weight: 700; }
@media (max-width: 35rem) {
  .hero .dream-chat-link { grid-column: 1 / -1; margin-top: .15rem; }
  .dream-chat-options { grid-template-columns: 1fr; }
}

.dream-chat-guide {
  display: flex; align-items: center; justify-content: space-between;
  gap: .85rem; margin-block: .65rem .9rem;
}
.dream-chat-guide ol { margin: .45rem 0 0; padding-inline-start: 1.3rem; }
.dream-chat .ram-chat { flex: 0 0 auto; align-self: start; }
.dream-chat .ram-chat img { width: min(4.75rem, 19vw); height: auto; }
@media (max-width: 29rem) {
  .dream-chat-guide { align-items: start; gap: .5rem; }
}

.dream-chat-result { padding: 1rem; background: var(--lavender); border-radius: .8rem; }
.dream-chat-result p { white-space: pre-wrap; overflow-wrap: anywhere; }
.dream-chat-form button:disabled { opacity: .65; cursor: wait; }

.category-icon { width: 2.25rem; height: 2.25rem; object-fit: contain; flex: 0 0 auto; }
.category-title { display: flex; align-items: center; gap: .45rem; }
.category-grid .category-icon { margin-bottom: .1rem; }


.illustrated-dreams a { gap: .55rem; }
.illustrated-dreams a::before { content: none; }
.dream-art-small, .dream-art-large, .scene-heading img { flex: 0 0 auto; object-fit: contain; }
.dream-art-small { width: 2rem; height: 2rem; }
.article-title-row { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.article-title-row > div { min-width: 0; }
.dream-art-large { width: clamp(3rem, 14vw, 4.75rem); height: auto; }
.scene-heading { display: flex; align-items: center; gap: .45rem; }
.article-scenes .scene {
  margin-top: .7rem; padding: .8rem 1rem;
  border: 1px solid var(--line); border-radius: .85rem; background: var(--white);
}
.article-scenes .scene:target { background: #f5edfb; border-color: var(--accent); }
@media (max-width: 29rem) {
  .illustrated-dreams { grid-template-columns: 1fr; }
}

/* A starry backdrop frames the dictionary's light reading surfaces. */
body {
  --night-text: #fff4ff;
  --night-muted: #e4d5f1;
  --night-link: #f5d9ff;
  min-height: 100vh;
  color: var(--night-text);
  background-color: #251d41;
  background-image:
    radial-gradient(circle at 12% 11%, #ffe3a2b0 0 1.5px, transparent 2.8px),
    radial-gradient(circle at 66% 32%, #fff2ff9e 0 1px, transparent 2.1px),
    radial-gradient(circle at 81% 77%, #dcc4fc9e 0 1.6px, transparent 2.5px),
    radial-gradient(circle at 36% 68%, #ffe6b46e 0 1px, transparent 2px),
    radial-gradient(circle at 21% 84%, #c6a9f48c 0 1px, transparent 2px),
    radial-gradient(ellipse at 50% 3rem, #594383, transparent 45rem),
    linear-gradient(156deg, #30234f, #221a3b 75%, #19142e);
  background-size: 257px 239px, 311px 280px, 283px 333px, 319px 303px, 347px 211px, auto, auto;
}
.site-header {
  border-color: #ad92ca59;
  background: #241b3b;
}
.brand, .topbar nav a { color: var(--night-text); }
.moon { box-shadow: inset .37rem -.24rem #ffe3a2; }
.hero {
  color: var(--ink);
  border-color: #e1d2f4;
  background: linear-gradient(112deg, #fcf5fc, #f1e6fa 65%, #e6d7f5);
  box-shadow: 0 1rem 2.75rem #0e08254f;
}
.hero-clouds {
  background:
    radial-gradient(circle at 93% 14%, #aa7ec4 0 1px, transparent 2.4px),
    radial-gradient(circle at 87% 11%, #d1a236c9 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 96% 56%, #bb91d6 0 1px, transparent 2px),
    radial-gradient(circle at 5% 82%, #c1a4dc 0 1.2px, transparent 2.2px),
    radial-gradient(ellipse at 2% 111%, #e5d5f3 0 13%, transparent 13.4%),
    radial-gradient(ellipse at 15% 113%, #e9dcf5 0 12%, transparent 12.4%),
    radial-gradient(ellipse at 98% 113%, #ddccf0 0 16%, transparent 16.4%);
}
.hero .button { background-color: #634584; }
.hero .button:hover { background-color: #49346d; }
.hero .button.outline { background-color: #fffcfa; }
.hero .button.outline:hover { background-color: #f1e6fa; }
.panel, .page-heading, .article-heading, .article-scenes, .reflection { color: var(--ink); }
.article-scenes, .reflection {
  padding: clamp(1rem, 3vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--white);
}
.crumb, .site-footer .disclaimer, .site-footer .bookmark { color: var(--night-muted); }
.crumb a, .main > .dream-chat-link a, .main > .browse-back > a:not(.button), .site-footer a { color: var(--night-link); }
.site-footer {
  border-color: #ad92ca59;
  background: #211830;
}
