/* Tankobon's website, served as /assets/style.css: a page of manga panels (src/account/web/DESIGN.md). */

@font-face {
  font-family: 'Dela Gothic One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/dela-gothic-one-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format('woff2');
}

:root {
  color-scheme: light dark;
  --paper: #ffffff;
  --ink: #000000;
  --tone: #5c5c5c;
  --flat: #ececec;
  --red: #c4161c;
  --danger: #c4161c;
  --on-danger: #ffffff;
  --press: #333333;
  --frame: 3px;
  --line: 2px;
  --gutter: 12px;
  --display: 'Dela Gothic One', 'Hiragino Kaku Gothic StdN', 'Arial Black', sans-serif;
  --text: 'Atkinson Hyperlegible Next', -apple-system, system-ui, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000;
    --ink: #f2f2f2;
    --tone: #a3a3a3;
    --flat: #1f1f1f;
    --red: #ff7b72;
    --danger: #c4161c;
    --on-danger: #ffffff;
    --press: #c8c8c8;
  }
  /* White dots merge into a slab at the dense end; grey ones keep the gradation and leave the main button the brightest thing. */
  .head::before { background: var(--tone); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }
body {
  display: grid;
  align-content: start;
  gap: var(--gutter);
  max-width: calc(32rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--gutter);
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--text);
}
::selection { background: var(--ink); color: var(--paper); }

/* The title panel: the name on paper, a screentone gradation rising behind it. */
.head {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 8px 10px 8px 16px;
  border: var(--frame) solid var(--ink);
}
.head::before {
  content: '';
  position: absolute;
  inset: 0 0 0 10.5rem; /* the tone starts after the name (Tankobon is 8 letters at 24px), however narrow the phone */
  z-index: -1;
  background: var(--ink);
  -webkit-mask: url(/assets/tone-x.svg) right top / 240px 10px repeat-y;
  mask: url(/assets/tone-x.svg) right top / 240px 10px repeat-y;
}
.mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font: 400 24px/1 var(--display);
  text-decoration: none;
}
/* Over the tone a link sits in a balloon, the tone cut away behind it as a letterer would. */
.you {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.you:hover { text-decoration: underline; text-underline-offset: .18em; }
.you:focus-visible { box-shadow: 0 0 0 3px var(--paper); }

/* The story panel. */
.page {
  min-width: 0;
  padding: 24px 20px 28px;
  border: var(--frame) solid var(--ink);
  overflow-wrap: break-word;
}
.page > :last-child { margin-bottom: 0; }

h1 {
  margin: 0 0 20px;
  font: 400 28px/1.1 var(--display);
  text-wrap: balance;
}
.lede { margin: -6px 0 24px; font-size: 21px; line-height: 1.4; }
p { text-wrap: pretty; }
h2 { margin: 28px 0 8px; font-size: 21px; line-height: 1.3; font-weight: 700; }
p { margin: 0 0 16px; }
ul { margin: 0 0 16px; padding-left: 1.25em; }
li + li { margin-top: 6px; }
b { font-weight: 700; overflow-wrap: anywhere; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 3px; }

.note { color: var(--tone); font-size: 15px; }
.note a { color: var(--ink); }
/* A narration box: what just happened, on flat tone, so it never reads as a field or a button. */
.done { padding: 12px 14px; border-left: 4px solid var(--ink); background: var(--flat); }
/* The editor's red pencil in the margin: what is wrong with the whole form. */
.page > .error {
  padding: 2px 0 2px 14px;
  border-left: 4px solid var(--red);
  color: var(--red);
  font-weight: 700;
}

form { margin: 0 0 16px; }
.field { margin: 0 0 20px; }
label { display: block; margin: 0 0 6px; line-height: 1.3; font-weight: 700; }
input:not([type="hidden"]) {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 10px 12px;
  border: var(--line) solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}
input[aria-invalid="true"] { border-color: var(--red); }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--paper) inset; -webkit-text-fill-color: var(--ink); }
input.code {
  max-width: 14rem;
  min-height: 60px;
  padding: 8px 14px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
}
.hint { margin: 6px 0 0; color: var(--tone); font-size: 15px; }
.field .error { margin: 6px 0 0; color: var(--red); font-size: 15px; font-weight: 700; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 24px 0 0; }
.field + .actions { margin-top: 28px; }
button {
  flex: 1 1 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 20px;
  border: var(--line) solid var(--ink);
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}
.primary { background: var(--ink); color: var(--paper); }
.primary:hover { border-color: var(--press); background: var(--press); }
button.secondary { background: var(--paper); color: var(--ink); }
button.secondary:hover { background: var(--flat); }
.danger { border-color: var(--danger); background: var(--danger); color: var(--on-danger); }
.danger:hover { text-decoration: underline; text-underline-offset: .18em; }
/* A way on inside a form is a word; a page's own ways on are outlined like its other buttons. */
a.secondary { display: inline-flex; align-items: center; min-height: 44px; }
.page > .actions > a.secondary {
  flex: 1 1 100%;
  justify-content: center;
  min-height: 52px;
  padding: 12px 20px;
  border: var(--line) solid var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.page > .actions > a.secondary:hover { background: var(--flat); }
/* A way on after a form stands apart from it: Delete account, under the everyday ones. */
.page > form + .actions { margin-top: 44px; }

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 10px 20px;
  margin: 0 0 24px;
}
.facts dt { color: var(--tone); font-size: 15px; }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* The Allow page: what the app asks, said large; under the two buttons, who is signed in and the way to another account. */
.app { margin: 0 0 24px; font-size: 21px; line-height: 1.4; }
.account { margin: 0; color: var(--tone); font-size: 15px; }
.account b { color: var(--ink); }
button.word {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: inherit;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .18em;
}
button.word:hover { text-decoration-thickness: 3px; }

.foot { padding: 0 4px; font-size: 15px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--tone); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  button:active, .page > .actions > a.secondary:active { transform: translateY(1px); }
}

/* From 60rem the page is a spread: a tall title panel beside the story panel. */
@media (min-width: 60rem) {
  body {
    grid-template-columns: minmax(0, 1fr) 30rem;
    column-gap: 16px;
    max-width: 62rem;
    padding: 48px 24px;
  }
  /* The title panel keeps its height and stays beside the reader while a long story panel scrolls. */
  .head {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    position: sticky;
    top: 48px;
    flex-direction: column;
    align-items: flex-start;
    min-height: 34rem;
    padding: 20px 24px 28px;
  }
  .head::before {
    inset: 0;
    -webkit-mask: url(/assets/tone-y.svg) left top / 10px 420px repeat-x;
    mask: url(/assets/tone-y.svg) left top / 10px 420px repeat-x;
  }
  /* The name sits at the panel's foot, on paper, with or without the balloon above it. */
  .mark { order: 2; margin-top: auto; font-size: 60px; }
  .you { order: 1; }
  .page { grid-column: 2; grid-row: 1; padding: 36px 40px 40px; }
  h1 { font-size: 36px; margin-bottom: 24px; }
  .foot { grid-column: 2; }
}
