/* The katakana name tool (site-src/name.mjs): the ink band of the home page with the field in it,
   the result on a card over its edge, then two steps (keep the image, learn the rest). On top of
   style.css: the site's paper, ink and seal red, pill buttons, rounded cards (docs/SPEC.md §6). */
@font-face { font-family: 'Goshuin'; font-display: block; src: url('/fonts/Goshuin.woff2') format('woff2'); }
.nm {
  --ink: #2F2B27;
  --card: #FFFEFB;
  --stone: #ECE6DC;
  --red: #B8402F;
  --brown: #231A15;
  --washi: #FBF6EA;
  --sand: #D9C6B2;
  --rose: #E9A79B;
  --body: #5E574F;
  --kana: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', 'Meiryo', sans-serif;
  --brush: 'Goshuin', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
}
.nm [hidden] { display: none !important; }
.nm main { max-width: none; padding: 0; margin: 0; }
.nm-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ——— The ink band, with the field ——— */
.nm-band { background: var(--brown) url('/img/ink/sumi-band.webp') center / cover; color: var(--washi); text-align: center; padding: 40px 24px 56px; }
.nm.has-result .nm-band { padding-bottom: 130px; }
.nm-glyph { font: normal 60px/1 var(--brush); color: var(--rose); margin: 0 0 6px; }
.nm-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand); margin: 0 0 10px; }
.nm-band h1 { color: var(--washi); font-size: clamp(36px, 6vw, 64px); line-height: 1.04; letter-spacing: -0.03em; max-width: 780px; margin: 0 auto 14px; }
.nm-band h1 span { color: var(--rose); }
.nm-lead { color: var(--sand); font-size: 18px; max-width: 560px; margin: 0 auto 26px; }
.nm-form { max-width: 520px; margin: 0 auto; }
#nm-in { width: 100%; height: 58px; border: 0; border-radius: 29px; background: var(--washi); color: var(--ink); padding: 0 24px; text-align: center; font: 600 18px/1 'Plus Jakarta Sans', system-ui, sans-serif; outline: none; -webkit-appearance: none; appearance: none; }
#nm-in::placeholder { color: #A99E90; font-weight: 500; }
#nm-in:focus-visible { box-shadow: 0 0 0 4px rgba(233, 167, 155, 0.45); }
.nm-say { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; color: #B8A996; }
.nm-chip { height: 34px; padding: 0 14px; border: 0; border-radius: 17px; background: rgba(251, 246, 234, 0.12); color: var(--washi); font: 700 13px/1 'Plus Jakarta Sans', system-ui, sans-serif; cursor: pointer; }
.nm-chip[aria-pressed="true"] { background: var(--washi); color: var(--ink); }
.nm-msg { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.nm-msg:empty { margin: 0; }
.nm-band .nm-msg { color: var(--sand); }
.nm-band .nm-msg.bad { color: var(--rose); }
.nm-msg.bad { color: #8A3B2F; }

/* ——— Below the band ——— */
.nm-body { max-width: 880px; margin: 0 auto; padding: 0 20px 80px; }
.nm-card { background: var(--card); border-radius: 28px; padding: 26px 28px; box-shadow: var(--shadow); }

/* The result, over the band's edge */
.nm-result { margin-top: -96px; position: relative; border-radius: 32px; padding: 34px 32px 28px; box-shadow: 0 24px 60px rgba(35, 26, 21, 0.18); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px 28px; align-items: center; }
.nm-result-name, .nm-result-signs { min-width: 0; }
.nm-who { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); margin: 0; }
.nm-kana { font: 700 clamp(46px, 8vw, 88px)/1.12 var(--kana); margin: 6px 0 0; white-space: nowrap; color: var(--ink); }
.nm-reading { font-size: 20px; font-weight: 600; color: var(--muted); margin: 2px 0 0; }
.nm-note { font-size: 13px; color: var(--muted); background: var(--stone); border-radius: 14px; padding: 10px 14px; margin: 14px 0 0; }
.nm-alts { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.nm-alts button { font: 700 16px/1 var(--kana); color: var(--ink); background: var(--stone); border: 0; border-radius: 12px; padding: 6px 10px; margin: 0 2px; cursor: pointer; }
.nm-alts button:hover { background: var(--line); }
.nm-why { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin: 6px 0 0; padding-top: 18px; border-top: 1px solid var(--stone); }

/* Tiles: one per sign, its sound under it */
.nm-tiles { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nm-tiles li { min-width: 60px; padding: 10px 8px 8px; border-radius: 16px; background: var(--paper, #F5F2EC); text-align: center; margin: 0; }
.nm-tiles li.sep { min-width: 0; padding: 0 2px; background: none; display: flex; align-items: center; color: var(--muted); font-family: var(--kana); font-size: 22px; }
.nm-tiles b { display: block; font: 700 28px/1.2 var(--kana); color: var(--ink); }
.nm-tiles span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.nm-tiles small { display: block; font-size: 10px; line-height: 1.2; color: var(--red); margin-top: 2px; max-width: 76px; }

/* Steps */
.nm-step { display: flex; align-items: center; gap: 12px; margin: 40px 0 14px; }
.nm-step b { width: 30px; height: 30px; border-radius: 15px; background: var(--ink); color: var(--card); display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.nm-step h2 { font-size: 22px; letter-spacing: -0.01em; margin: 0; }

/* Keep the image: the thumbnails are the buttons */
.nm-share { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.nm-share > p:first-child { margin: 0; flex: 1; min-width: 240px; color: var(--body); }
.nm-share .nm-msg { flex-basis: 100%; text-align: right; }
.nm-thumbs { display: flex; gap: 18px; align-items: flex-end; flex: none; }
.nm-thumb { border: 0; padding: 0; background: none; cursor: pointer; text-align: center; font: 700 13px/1 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ink); }
.nm-pic { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper, #F5F2EC) url('/img/ink/paper.webp') center / cover; border-radius: 14px; box-shadow: 0 6px 16px rgba(47, 43, 39, 0.14), inset 0 0 0 1px var(--line); margin-bottom: 8px; overflow: hidden; padding: 0 8px; transition: transform 0.15s; }
.nm-thumb-sq .nm-pic { width: 130px; height: 130px; }
.nm-thumb-st .nm-pic { width: 82px; height: 146px; }
.nm-pic small { font-size: 7px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.nm-pic i { font: normal 700 19px/1.2 var(--kana); white-space: nowrap; margin: 4px 0 2px; color: var(--ink); }
.nm-thumb-st .nm-pic i { font-size: 13px; }
.nm-pic em { font-style: normal; font-size: 8px; color: var(--muted); }
.nm-thumb:hover .nm-pic, .nm-thumb:focus-visible .nm-pic { transform: translateY(-3px); }

/* Learn the rest: the seal-red band */
.nm-cta { background: var(--red) url('/img/ink/sumi-red.webp') center / cover; color: var(--washi); border-radius: 32px; padding: 34px 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 30px; }
.nm-cta-text { font-size: 21px; line-height: 1.4; font-weight: 700; margin: 0; flex: 1; min-width: 260px; }
.nm-cta-go { flex: none; max-width: 100%; }
#nm-cta-other { flex: 1 1 100%; }
.nm-cta-sub { color: #F6D8D0; font-size: 14px; margin: 10px 0 0; }
#nm-cta-iphone .nm-cta-sub { text-align: center; }
.nm-cta a:not(.nm-btn) { color: var(--washi); text-decoration-color: rgba(251, 246, 234, 0.6); }
.nm-notify { margin-top: 12px; max-width: 560px; }
.nm-row { display: flex; gap: 10px; }
.nm-row input[type="email"] { flex: 1; min-width: 0; height: 52px; border: 0; border-radius: 26px; background: var(--washi); color: var(--ink); padding: 0 20px; font: 600 16px/1 'Plus Jakarta Sans', system-ui, sans-serif; outline: none; }
.nm-cta .nm-msg { color: #F6D8D0; }
.nm-cta .nm-msg.bad { color: var(--washi); font-weight: 700; }
.nm-legal { font-size: 12px; color: #F1C3B8; margin: 10px 0 0; }
.nm-legal a, .nm-cta .nm-msg a { color: inherit; }
.nm-notify.is-done .nm-row, .nm-notify.is-done .nm-legal { display: none; }

/* Buttons: pills */
.nm-btn { display: inline-flex; align-items: center; justify-content: center; height: 52px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--ink); color: var(--card); font: 700 15px/1 'Plus Jakarta Sans', system-ui, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap; }
.nm-btn:disabled { opacity: 0.6; cursor: default; }
.nm-btn-paper { background: var(--washi); color: var(--ink); }
.nm-btn-paper:hover { color: var(--ink); filter: brightness(0.97); }

.nm-private { font-size: 14px; color: var(--muted); text-align: center; margin: 26px 0 0; }
.nm-faq { max-width: 720px; margin: 56px auto 0; }
.nm-faq h2 { margin-top: 0; }
.nm-faq h3 { font-size: 17px; font-weight: 800; margin: 26px 0 6px; }

@media (max-width: 760px) {
  .nm-band { padding: 28px 16px 40px; }
  .nm.has-result .nm-band { padding-bottom: 110px; }
  .nm-lead { font-size: 16px; }
  .nm-body { padding: 0 16px 64px; }
  .nm-result { grid-template-columns: minmax(0, 1fr); text-align: center; padding: 28px 18px 22px; }
  .nm-kana { font-size: 15vw; }
  .nm-tiles { justify-content: center; }
  .nm-tiles li { min-width: 54px; }
  .nm-why { text-align: left; }
  .nm-step h2 { font-size: 19px; }
  .nm-share { flex-direction: column; align-items: stretch; padding: 22px; }
  .nm-thumbs { justify-content: center; }
  .nm-share .nm-msg { text-align: center; }
  .nm-cta { flex-direction: column; align-items: stretch; padding: 26px 20px; }
  .nm-cta-text { font-size: 18px; min-width: 0; }
  .nm-cta-go .nm-btn { width: 100%; white-space: normal; text-align: center; }
  .nm-row { flex-direction: column; }
  .nm-row input[type="email"] { flex: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .nm-result { animation: nm-in 0.25s ease-out; }
  @keyframes nm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
