/*
 * Printed notices: the one stylesheet for the support, privacy and terms pages in public/.
 * These pages are plain static HTML (linked from the store listings), outside the React app,
 * so the fonts are self-hosted here and the tokens repeat the site's values.
 * A notice is a printed sheet pinned up in the megastructure: paper, ink, one vermilion seal.
 */

/* ---------- Fonts (latin and latin-ext only, no other hosts) ---------- */

@font-face {
  font-family: 'Dela Gothic One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dela-gothic-one-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Dela Gothic One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dela-gothic-one-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/zen-kaku-gothic-new-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/zen-kaku-gothic-new-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/zen-kaku-gothic-new-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/zen-kaku-gothic-new-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/zen-kaku-gothic-new-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/zen-kaku-gothic-new-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens (same values as the site) ---------- */

:root {
  --paper: #f1ede4;
  --panel: #fbf9f4;
  --ink: #0d0d0f;
  --ink-soft: #3b3a37;
  --vermilion: #e5371b;
  --vermilion-deep: #c22a12;

  --font-display: 'Dela Gothic One', 'Arial Black', sans-serif;
  --font-text: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --sheet-max: 740px;
  --ease-ink: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.notice {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  font-kerning: normal;
  font-synthesis: style;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.notice ::selection {
  background: var(--ink);
  color: var(--panel);
}

.notice img {
  display: block;
}

.notice strong {
  font-weight: 700;
  color: var(--ink);
}

.notice em {
  font-style: italic;
  color: inherit;
}

.notice :focus-visible {
  outline: 3px solid var(--vermilion);
  outline-offset: 3px;
}

/* ---------- Top strip ---------- */

.notice-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 var(--gutter);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.notice-strip__home {
  display: inline-flex;
  margin-left: -6px;
  padding: 6px;
  color: var(--ink);
  transition: color 180ms var(--ease-ink);
}

.notice-strip__home:hover {
  color: var(--vermilion);
}

.notice-strip__home svg {
  display: block;
  width: 47px;
  height: 33px;
  overflow: visible;
}

/* Padded to a 28 px touch target; the negative margin keeps the label on the gutter line. */
.notice-strip__app {
  margin-right: -4px;
  padding: 8px 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: underline 2px var(--vermilion);
  text-underline-offset: 5px;
  transition: background-color 180ms var(--ease-ink), color 180ms var(--ease-ink);
}

.notice-strip__app:hover {
  background: var(--vermilion);
  color: var(--panel);
}

/* ---------- Screentone band: the shadow of the strip on the paper ---------- */

/* A 45-degree dot lattice whose dots shrink row by row, so the tone fades by dot size and every
   dot stays solid ink (vector, crisp at any pixel ratio). */
body.notice::before {
  content: '';
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  z-index: 0;
  height: 140px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='140' fill='%230d0d0f'><circle cx='2' cy='2' r='1.9'/><circle cx='6' cy='6' r='1.84'/><circle cx='2' cy='10' r='1.77'/><circle cx='6' cy='14' r='1.71'/><circle cx='2' cy='18' r='1.65'/><circle cx='6' cy='22' r='1.58'/><circle cx='2' cy='26' r='1.52'/><circle cx='6' cy='30' r='1.46'/><circle cx='2' cy='34' r='1.4'/><circle cx='6' cy='38' r='1.33'/><circle cx='2' cy='42' r='1.27'/><circle cx='6' cy='46' r='1.21'/><circle cx='2' cy='50' r='1.15'/><circle cx='6' cy='54' r='1.09'/><circle cx='2' cy='58' r='1.03'/><circle cx='6' cy='62' r='0.97'/><circle cx='2' cy='66' r='0.91'/><circle cx='6' cy='70' r='0.86'/><circle cx='2' cy='74' r='0.8'/><circle cx='6' cy='78' r='0.74'/><circle cx='2' cy='82' r='0.68'/><circle cx='6' cy='86' r='0.63'/><circle cx='2' cy='90' r='0.57'/><circle cx='6' cy='94' r='0.52'/><circle cx='2' cy='98' r='0.47'/><circle cx='6' cy='102' r='0.41'/><circle cx='2' cy='106' r='0.36'/><circle cx='6' cy='110' r='0.31'/></svg>") repeat-x 0 0 / 8px 140px;
  pointer-events: none;
}

/* ---------- The sheet ---------- */

.notice-sheet {
  position: relative;
  z-index: 1;
  width: min(var(--sheet-max), calc(100% - 2 * var(--gutter)));
  margin: 44px auto 0;
  padding: 52px clamp(24px, 6.4vw, 64px) 40px;
  background: var(--panel);
  border: 4px solid var(--ink);
  overflow-wrap: break-word;
}

/* The 1 px inner line of a manga panel, inset 5 px from the border. */
.notice-sheet::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--ink);
  pointer-events: none;
}

@media (min-width: 700px) {
  .notice-sheet {
    box-shadow: 8px 8px 0 var(--ink);
  }
}

/* ---------- Head of the sheet ---------- */

.notice-head {
  margin-bottom: 40px;
}

.notice-head__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.notice-caption {
  display: inline-block;
  padding: 7px 10px 6px;
  background: var(--ink);
  color: var(--panel);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* The app icon is a small window: product colour stays inside its ink frame. */
.notice-icon {
  flex: none;
  width: 56px;
  height: 56px;
  border: 2px solid var(--ink);
  background: var(--panel);
  object-fit: cover;
}

.notice-app {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.notice-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.notice-sub {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-weight: 500;
}

.notice-date {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* 4 px rule over a 1 px rule, 4 px apart. */
.notice-rule {
  height: 9px;
  margin: 30px 0 0;
  border: 0;
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* ---------- Running text ---------- */

/* Text runs the full inner width of the sheet (about 70ch at 17 px), so its right edge lines up
   with the double rule and the FAQ rows. */

/* Zero specificity, so single-class parts (stamp, credit, FAQ answer) set their own margins. */
:where(.notice-body) p {
  margin: 0 0 16px;
}

.notice-lede {
  font-size: 20px;
  line-height: 1.55;
  font-weight: 500;
}

.notice-body h2 {
  position: relative;
  margin: 56px 0 16px;
  padding-top: 20px;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 26px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* The short rule over every section heading. */
.notice-body h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 2px;
  background: var(--ink);
}

.notice-body > h2:first-child {
  margin-top: 0;
}

.notice-body h3 {
  margin: 32px 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.notice-body ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.notice-body li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 26px;
}

/* Small square ink bullet, centred on the first line's lowercase letters. */
.notice-body li::before {
  content: '';
  position: absolute;
  top: 0.74em;
  left: 4px;
  width: 6px;
  height: 6px;
  background: var(--ink);
}

.notice-app-name {
  font-weight: 700;
}

.notice-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---------- Links ---------- */

.notice-body a {
  color: var(--ink);
  text-decoration: underline 2px var(--vermilion);
  text-underline-offset: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 180ms var(--ease-ink), color 180ms var(--ease-ink);
}

.notice-body a:hover {
  background: var(--vermilion);
  color: var(--panel);
}

/* Email addresses are the way to reach a person, so they carry weight inside their sentence. */
.notice-body a[href^='mailto:'] {
  font-weight: 700;
}

/* ---------- FAQ: boxed rows that open and close ---------- */

.notice-faq {
  margin: 0 0 8px;
}

.notice-faq__item {
  border: 2px solid var(--ink);
  background: var(--panel);
}

/* Rows share their rules, like the lines of a printed form. */
.notice-faq__item + .notice-faq__item {
  margin-top: -2px;
}

/* Block, not flex: older iOS Safari ignores flex on summary. The sign is placed absolutely. */
.notice-faq__q {
  position: relative;
  display: block;
  padding: 16px 64px 16px 20px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notice-faq__q::-webkit-details-marker {
  display: none;
}

.notice-faq__q:focus-visible {
  z-index: 1;
}

/* The sign: a boxed plus that becomes a minus. */
.notice-faq__sign {
  position: absolute;
  top: 15px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  transition: background-color 150ms var(--ease-ink), border-color 150ms var(--ease-ink);
}

.notice-faq__sign::before,
.notice-faq__sign::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  background: var(--ink);
  transition: transform 150ms var(--ease-ink), background-color 150ms var(--ease-ink);
}

.notice-faq__sign::after {
  transform: rotate(90deg);
}

.notice-faq__item[open] > .notice-faq__q .notice-faq__sign {
  background: var(--ink);
}

.notice-faq__item[open] > .notice-faq__q .notice-faq__sign::after {
  transform: rotate(90deg) scaleX(0);
}

.notice-faq__item[open] > .notice-faq__q .notice-faq__sign::before,
.notice-faq__item[open] > .notice-faq__q .notice-faq__sign::after,
.notice-faq__q:hover .notice-faq__sign::before,
.notice-faq__q:hover .notice-faq__sign::after {
  background: var(--panel);
}

.notice-faq__q:hover .notice-faq__sign {
  background: var(--vermilion);
  border-color: var(--vermilion);
}

.notice-faq__item[open] > .notice-faq__q {
  border-bottom: 1px solid var(--ink);
}

.notice-faq__a {
  margin: 0;
  padding: 16px 20px 20px;
  animation: notice-lay-down 160ms var(--ease-ink);
}

@keyframes notice-lay-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* ---------- Small printed parts ---------- */

/* A date stamp that sits inside the running text. */
.notice-stamp {
  display: inline-block;
  margin: 12px 0 8px;
  padding: 9px 14px 10px;
  border: 2px solid var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* A footnote, set as in print: a short hairline over smaller soft text. */
.notice-credit {
  position: relative;
  margin: 40px 0 0;
  padding-top: 14px;
  color: var(--ink-soft);
  font-size: 15px;
}

.notice-credit::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 1px;
  background: var(--ink);
}

/* The close of the notice: a hairline into the vermilion seal. */
.notice-end {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 48px;
}

.notice-end::before {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink);
}

.notice-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  background: var(--vermilion);
  color: var(--panel);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.notice-seal::before {
  content: 'VS';
}

/* ---------- Foot: the ink band ---------- */

.notice-foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 64px;
}

.notice-foot__band {
  background: var(--ink);
  color: var(--panel);
}

.notice-foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  width: min(var(--sheet-max), calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: 26px 0 28px;
}

.notice-foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.notice-foot a {
  margin: 0 -3px;
  padding: 4px 3px;
  color: var(--panel);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: underline 2px var(--vermilion);
  text-underline-offset: 4px;
  transition: background-color 180ms var(--ease-ink);
}

.notice-foot a:hover {
  background: var(--vermilion);
}

/* On the ink band the focus ring is panel white. */
.notice-foot a:focus-visible {
  outline-color: var(--panel);
}

/* ---------- Phones: edge to edge with a 16 px margin, no shadow ---------- */

@media (max-width: 699px) {
  body.notice {
    font-size: 16px;
  }

  .notice-strip {
    padding: 0 16px;
  }

  .notice-sheet {
    width: calc(100% - 32px);
    margin-top: 28px;
    padding: 30px 22px 28px;
  }

  .notice-head {
    margin-bottom: 32px;
  }

  .notice-head__top {
    margin-bottom: 22px;
  }

  .notice-lede {
    font-size: 18px;
  }

  .notice-body h2 {
    margin-top: 44px;
    padding-top: 16px;
  }

  .notice-faq__q {
    padding: 14px 56px 14px 16px;
    font-size: 17px;
  }

  .notice-faq__sign {
    top: 13px;
    right: 12px;
  }

  .notice-faq__a {
    padding: 14px 16px 18px;
  }

  .notice-end {
    margin-top: 36px;
  }

  .notice-foot {
    padding-top: 40px;
  }

  .notice-foot__inner {
    width: calc(100% - 32px);
  }
}

/* The narrowest phones (320 to 359 px): room for the longest address with its full stop
   (philosophia.application@gmail.com.), so it moves to its own line whole instead of splitting. */
@media (max-width: 359px) {
  .notice-sheet {
    padding-right: 16px;
    padding-left: 16px;
  }

  .notice-body a[href^='mailto:'] {
    letter-spacing: -0.01em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice *,
  .notice *::before,
  .notice *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  body.notice::before,
  .notice-strip,
  .notice-foot,
  .notice-end {
    display: none;
  }

  .notice-sheet {
    width: auto;
    margin: 0;
    box-shadow: none;
  }
}

/* ---------- Scrollbars: the site's own, in ink ----------
   The same bar as the site (src/index.css): a paper track and a square ink thumb, 12 px across for the page and
   10 px for any inner scroller. At rest the thumb is a 6 px bar in the middle of its track, held there by a border
   in the track's colour (which also leaves a gap at both ends); under the pointer it widens to 8 px. Chromium
   ignores the ::-webkit-scrollbar rules once scrollbar-color or scrollbar-width is set, so the standard pair is
   given only where the pseudo-elements are unknown (Firefox). */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background: var(--paper);
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: var(--paper);
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-thumb {
  min-width: 52px;
  min-height: 52px;
  border: 2px solid var(--paper);
  border-radius: 0;
  background: var(--ink);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:vertical:hover,
::-webkit-scrollbar-thumb:vertical:active {
  border-width: 2px 1px;
}

::-webkit-scrollbar-thumb:horizontal:hover,
::-webkit-scrollbar-thumb:horizontal:active {
  border-width: 1px 2px;
}

/* The page's own bar. Blink takes the window's bar from <body> when body has scrollbar rules, else from <html>. */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  min-width: 54px;
  min-height: 54px;
  border-width: 3px;
}

html::-webkit-scrollbar-thumb:vertical:hover,
html::-webkit-scrollbar-thumb:vertical:active,
body::-webkit-scrollbar-thumb:vertical:hover,
body::-webkit-scrollbar-thumb:vertical:active {
  border-width: 3px 2px;
}

html::-webkit-scrollbar-thumb:horizontal:hover,
html::-webkit-scrollbar-thumb:horizontal:active,
body::-webkit-scrollbar-thumb:horizontal:hover,
body::-webkit-scrollbar-thumb:horizontal:active {
  border-width: 2px 3px;
}

@supports not selector(::-webkit-scrollbar) {
  :root {
    scrollbar-color: var(--ink) var(--paper);
  }

  * {
    scrollbar-width: thin;
  }
}
