/* Teparap draft C: the broadsheet. One ink, three yellows, four washes. */
@font-face { font-family: "M PLUS Rounded 1c"; src: url(../fonts/m-plus-rounded-1c-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url(../fonts/m-plus-rounded-1c-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(../fonts/figtree-latin-wght-normal.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Commit Mono"; src: url(../fonts/commit-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Commit Mono"; src: url(../fonts/commit-mono-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* the paper: three tones of one yellow */
  --straw: #fbf0c4;      /* the sheet itself */
  --sun: #f4c41f;        /* the ground the sheet lies on, chapter yellow */
  --ochre: #c98d0e;      /* the deep chapter, key sides */
  --ink: #1c150c;        /* the one ink */
  --ink-2: #4a3c27;      /* second text role, still ink */
  --ink-3: #6e5c3e;      /* faint role, 4.6:1 on straw */
  --hair: rgba(28, 21, 12, .16);
  --now: #ff4a1c;        /* vermilion: the one accent, means "now" */
  /* the four washes, laid after printing */
  --wick: #b8432c; --fern: #2e7a62; --tide: #3b5b9e; --rook: #74365f;
  --title: "M PLUS Rounded 1c", "Figtree", sans-serif;
  --body: "Figtree", sans-serif;
  --mono: "Commit Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-long: cubic-bezier(.16, 1, .3, 1);
  --press: 150ms cubic-bezier(.4, 0, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sun); color: var(--ink); font: 400 17px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
.num, code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a { color: inherit; }
img { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* the signature: a crenellated rule with its reflection */
.crenel { height: 18px; background:
  linear-gradient(var(--ink), var(--ink)) 0 8px / 100% 2px no-repeat,
  repeating-linear-gradient(90deg, var(--ink) 0 16px, transparent 16px 26px) 0 0 / 100% 9px no-repeat,
  repeating-linear-gradient(90deg, rgba(28,21,12,.5) 0 16px, transparent 16px 26px) 0 12px / 100% 1.5px no-repeat,
  repeating-linear-gradient(90deg, rgba(28,21,12,.32) 0 16px, transparent 16px 26px) 0 15px / 100% 1px no-repeat; }
.mark { width: 34px; height: 34px; flex: none; color: var(--ink); }

/* keyboard-key buttons: a key with a printed legend and a pressed travel */
.key { --kc: var(--straw); --ks: var(--ochre); position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 9px 16px 9px 10px; border: 2px solid var(--ink); border-radius: 10px; background: var(--kc); color: var(--ink);
  font: 700 17px/1 var(--body); text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--ink);
  transition: transform var(--press), box-shadow var(--press), background-color 180ms var(--ease); user-select: none; }
.key .cap { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 1.5px solid var(--ink); border-radius: 6px;
  font: 700 15px/1 var(--mono); background: #fff8dc; }
.key:hover { background: #fff6d2; }
.key:active, .key.is-down { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 var(--ink); }
.key.is-down .cap { background: var(--now); color: #fff; border-color: var(--ink); }
.key[disabled], .key[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--ink); }
.key[aria-busy="true"] { cursor: progress; }
.key.ink { --kc: var(--ink); color: var(--straw); box-shadow: 0 4px 0 var(--ochre); }
.key.ink .cap { background: var(--sun); color: var(--ink); }
.key.ink:hover { background: #2f2517; }
.key.small { min-height: 44px; padding: 7px 12px 7px 8px; font-size: 15px; }

/* round menu button */
.round { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); background: var(--straw); display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 3px 0 var(--ink); transition: transform var(--press), box-shadow var(--press), background-color 180ms var(--ease); }
.round:hover { background: #fff6d2; }
.round:active { transform: translateY(2px) scale(.97); box-shadow: 0 1px 0 var(--ink); }
.round span { display: block; width: 18px; height: 2px; background: var(--ink); box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink); }

/* the round menu opens as a folded sheet */
.menu { position: fixed; z-index: 60; top: 14px; right: 14px; width: min(360px, calc(100vw - 28px)); background: var(--straw); border: 2px solid var(--ink);
  border-radius: 14px; padding: 18px; box-shadow: 0 8px 0 var(--ink); transform-origin: top right; transform: perspective(900px) rotateX(-70deg) scale(.96);
  opacity: 0; visibility: hidden; pointer-events: none; transition: transform 150ms var(--ease), opacity 150ms var(--ease), visibility 0s linear 150ms; }
.menu.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition: transform 250ms var(--ease), opacity 200ms var(--ease), visibility 0s; }
.menu nav { display: grid; gap: 4px; margin-top: 8px; }
.menu nav a, .menu nav button { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 8px;
  font: 800 24px/1 var(--title); text-decoration: none; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; }
.menu nav a:hover, .menu nav button:hover { background: var(--sun); }
.menu .close { position: absolute; top: 12px; right: 12px; }
.menu .menu-foot { margin-top: 14px; font-size: 15px; color: var(--ink-2); }
/* the full menu has 13 links: it scrolls inside itself on short screens and sets its links a size smaller */
.menu { max-height: calc(100svh - 28px); overflow: auto; overscroll-behavior: contain; }
.menu nav { gap: 2px; }
.menu nav a, .menu nav button { min-height: 44px; font-size: 20px; }
.menu nav a .mono { font-size: 15px; color: var(--ink-2); }

/* wallet picker */
.wp-back { position: fixed; inset: 0; z-index: 70; background: rgba(28,21,12,.42); display: grid; place-items: center; padding: 16px; opacity: 0;
  pointer-events: none; transition: opacity 200ms var(--ease); }
.wp-back.open { opacity: 1; pointer-events: auto; }
.wp { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--straw); border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: 0 8px 0 var(--ink); padding: 20px; transform: translateY(10px) scale(.96); transition: transform 250ms var(--ease); }
.wp-back.open .wp { transform: none; }
.wp h2 { margin: 0 0 4px; font: 800 26px/1.1 var(--title); }
.wp .sub { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.wp .sec { margin: 16px 0 8px; font: 700 14px/1 var(--body); color: var(--ink-2); }
.wp .row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px;
  background: #fff8dc; cursor: pointer; font: 700 17px/1.1 var(--body); color: var(--ink); margin-bottom: 8px; transition: background-color 150ms var(--ease), transform var(--press); }
.wp .row:hover { background: #fff2bf; }
.wp .row:active { transform: scale(.98); }
.wp .row img { width: 32px; height: 32px; border-radius: 8px; }
.wp .row .tag { margin-left: auto; font: 600 13px/1 var(--body); color: var(--ink-2); }
.wp .row[aria-busy="true"] .tag::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .9s linear infinite; vertical-align: -2px; }
.wp .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wp .tile { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 10px; text-decoration: none;
  font: 600 15px/1.1 var(--body); background: transparent; transition: background-color 150ms var(--ease); }
.wp .tile:hover { background: var(--sun); }
.wp .tile img { width: 26px; height: 26px; border-radius: 6px; }
.wp .err { min-height: 22px; margin: 8px 0 0; font-size: 15px; color: var(--wick); }
.wp .x { float: right; }
@media (max-width: 520px) { .wp .tiles { grid-template-columns: 1fr; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* connected wallet chip */
.who { display: inline-flex; align-items: center; gap: 8px; }
.who .crest { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink); }

/* toasts, stacked from the bottom */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--straw); border-radius: 12px; padding: 12px 16px; font: 600 15px/1.35 var(--body); box-shadow: 0 4px 0 var(--ochre);
  animation: toastIn 400ms var(--ease) both; }
@keyframes toastIn { from { transform: translateY(100%); opacity: 0; } }

.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--now); vertical-align: 1px; margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(255,74,28,.5); animation: ping 1s ease-out infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(255,74,28,0); } 100% { box-shadow: 0 0 0 0 rgba(255,74,28,0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
