@font-face { font-family: "Plex Serif"; src: url(fonts/plex-serif-400.woff2) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Plex Serif"; src: url(fonts/plex-serif-400i.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: "Plex Serif"; src: url(fonts/plex-serif-600.woff2) format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Plex Serif"; src: url(fonts/plex-serif-700.woff2) format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Sunrise"; src: url(fonts/waiting-for-the-sunrise.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Archivo Black"; src: url(fonts/archivo-black.woff2) format("woff2"); font-display: block; }

:root {
  --sweep: #f5f2ed;
  --ink: #1f1d1a;
  --muted: #5d554c;
  --plate: #2b3a2d;
  --plate-hi: #3a4d3c;
  --cream: #efe8de;
  --stamp: #21388e;
  --rule: rgba(31, 29, 26, 0.55);
  --gutter: 48px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--sweep);
  color: var(--ink);
  font: 400 15px/1.5 "Plex Serif", Georgia, serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--stamp); color: var(--cream); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#grabzone { position: fixed; pointer-events: none; }
body.grab #gl { cursor: grab; }
body.grabbing, body.grabbing * { cursor: grabbing !important; }

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

.caps { font-weight: 600; font-size: 11px; letter-spacing: 0.11em; text-transform: uppercase; }

/* left: what it is and how it works */
#about {
  position: fixed; left: var(--gutter); top: 50%; translate: 0 -50%;
  width: min(300px, calc(50vw - 260px));
  pointer-events: none;
}
#about .name { margin: 0 0 18px; font-weight: 600; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
#about .term { margin: 0 0 26px; font-size: 21px; line-height: 1.32; letter-spacing: -0.005em; text-wrap: balance; }
#about .term em { font-style: italic; }
#about .how { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
#about .how li { padding: 11px 0 12px; background: radial-gradient(circle, var(--rule) 0.65px, transparent 0.9px) 0 0 / 3.6px 3px repeat-x; }

/* right: the one thing to do */
#composer {
  position: fixed; right: var(--gutter); top: 50%; translate: 0 -50%;
  width: min(344px, calc(50vw - 250px));
  margin: 0;
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

#printOne {
  display: inline-flex; align-items: center; gap: 12px;
  font: 600 13px/1 "Plex Serif", Georgia, serif; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--plate); color: var(--cream); border: 0; border-radius: 3px; cursor: pointer;
  padding: 18px 30px 17px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 10px 22px -12px rgba(30, 40, 30, 0.7);
  transition: background-color 160ms ease-out, translate 120ms ease-out;
}
#printOne:hover { background: var(--plate-hi); }
#printOne:active { translate: 0 1px; }
#printOne:disabled { background: #8d9289; cursor: default; }
#status { margin: 14px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); min-height: 2.8em; }

.own { display: flex; align-items: flex-end; gap: 14px; margin-top: 22px; }
.line { display: block; flex: 1; min-width: 0; }
#line {
  width: 100%; border: 0; padding: 8px 0 9px; margin: 0;
  background: radial-gradient(circle, var(--ink) 0.7px, transparent 1px) 0 100% / 4px 3px repeat-x;
  font: 400 17px/1.3 "Plex Serif", Georgia, serif; color: var(--ink); caret-color: var(--stamp);
  border-radius: 0; outline: none;
}
#line::placeholder { color: #7d746a; opacity: 1; }
#line:focus-visible { background-image: radial-gradient(circle, var(--stamp) 0.8px, transparent 1.1px); }
#print, #keep button {
  font: 600 11px/1 "Plex Serif", Georgia, serif; letter-spacing: 0.14em; text-transform: uppercase;
  border: 0; border-radius: 3px; cursor: pointer;
}
#print { background: none; color: var(--ink); padding: 10px 0 9px; text-decoration: underline; text-decoration-color: rgba(31,29,26,0.35); text-underline-offset: 4px; }
#print:hover { text-decoration-color: var(--ink); }
#print:disabled { color: #8a8076; cursor: default; }

#keep { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; padding-top: 14px;
  background: radial-gradient(circle, var(--rule) 0.65px, transparent 0.9px) 0 0 / 3.6px 3px repeat-x; }
#keep[hidden] { visibility: hidden; }
#keep button { background: none; color: var(--ink); padding: 6px 0; text-decoration: underline; text-decoration-color: rgba(31,29,26,0.35); text-underline-offset: 4px; }
#keep button:hover { text-decoration-color: var(--ink); }

#sound {
  position: fixed; right: var(--gutter); top: 28px;
  background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--muted);
  font: 600 11px/1 "Plex Serif", Georgia, serif; letter-spacing: 0.14em; text-transform: uppercase;
}
#sound span { color: var(--ink); }
#sound:hover { color: var(--ink); }

body.refshot #about, body.refshot #composer, body.refshot #sound { display: none; }

@media (max-width: 860px) {
  :root { --gutter: 20px; }
  #about { top: 18px; translate: none; width: auto; right: 96px; }
  #about .term, #about .how { display: none; }
  #about .name { margin: 0; padding-top: 10px; }
  #sound { top: 18px; }
  #composer {
    top: auto; bottom: 0; left: 0; right: 0; translate: none; width: auto;
    padding: 14px var(--gutter) calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(222,213,204,0), var(--sweep) 26px);
  }
  #printOne { width: 100%; justify-content: center; padding: 16px 20px 15px; }
  #status { min-height: 1.4em; margin-top: 8px; font-size: 12.5px; text-align: center; }
  .own { margin-top: 6px; }
  #line { font-size: 16px; }
  #keep { margin-top: 8px; padding-top: 8px; }
}
