/* Shared styles for the store and contact pages: the home page's look, static. */
@font-face {
  font-family: "Source Code Pro";
  font-weight: 200 700;
  font-display: swap;
  src: url(/assets/fonts/source-code-pro-latin.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: "Source Code Pro";
  font-weight: 200 700;
  font-display: swap;
  src: url(/assets/fonts/source-code-pro-latin-ext.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;
}

:root {
  --obj: #0e6e82;
  --fn: #6d3fc0;
  --num: #6d3fc0;
  --cm: #000;
  --code: #767676;
  --ink: #000;
  --bg: #fff;
  --line: #ccc;
  --err: #b00020;
  --ok: #1b7f3b;
  --home: clamp(0.6rem, 3.6vw, 2rem);
  --cur-color: oklch(0.62 0.19 var(--hue, 0));
  --mark: oklch(0.94 0.06 var(--mhue, 0));
}
html[data-mode="dark"] {
  color-scheme: dark;
  --obj: #5cc8e0;
  --fn: #b9a0f2;
  --num: #b9a0f2;
  --cm: #f2f2f2;
  --code: #a0a0a0;
  --ink: #ececec;
  --bg: #2a2a2a;
  --line: #555;
  --err: #ff8a80;
  --ok: #6fcf8b;
  --mark: oklch(0.38 0.07 var(--mhue, 0));
}

html { height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Code Pro", ui-monospace, Consolas, monospace;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
}
main { max-width: 44rem; margin: 0 auto; padding: 4.5rem 1.25rem 4rem; }
p { margin: 0; }
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The header line: offWare is typed, then the cursor blinks after it. */
.note { display: block; color: var(--cm); font-weight: 200; }
/* Same size as the home page's headline (see --home); phones use the larger scale. */
#line { margin: 0 0 1.5rem; font-size: var(--home); line-height: normal; white-space: nowrap; }
@media (max-width: 600px) { :root { --home: clamp(0.6rem, 4.8vw, 2rem); } }
#line b { color: var(--obj); font-weight: 700; }
#cur {
  display: inline-block;
  width: 1ch;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--cur-color);
  animation: blink 1.06s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #cur { animation: none; } }

/* Console blocks and rows. */
.con { margin-top: 2rem; }
.cline { color: var(--code); }
.cline .t-obj { color: var(--obj); }
.cline .t-fn { color: var(--fn); }
.cm { color: var(--cm); font-weight: 200; }
.leaf { padding-left: 1.6ch; }
.t-num { color: var(--num); }
.row { margin-top: 0.75rem; }
a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
a:active { opacity: 0.6; }
/* Action buttons match run() on the home page: console size, bold, underlined. */
.act {
  font: inherit;
  font-size: max(13px, calc(var(--home) * 0.6));
  font-weight: 700;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fn);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.act:hover { text-decoration-thickness: 2px; }
.act:active { opacity: 0.6; }
.act:disabled { color: var(--code); text-decoration: none; cursor: default; opacity: 1; }
.tag { background: var(--mark); padding: 0 0.4ch; }

/* Form fields. */
form { margin-top: 1rem; }
.field { margin-top: 1.25rem; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; padding: 0; color: var(--code); }
input[type="text"], input[type="email"], select, textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
  padding: 0.4rem 0.6rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
}
textarea { min-height: 9rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .act:focus-visible, a:focus-visible, #mode:focus-visible {
  outline: 2px solid var(--fn);
  outline-offset: 2px;
}
.choice { display: block; margin-top: 0.25rem; cursor: pointer; }
.choice input { margin: 0 1ch 0 0; accent-color: var(--fn); }
#status { margin-top: 1rem; min-height: 1.7em; }
#status.bad { color: var(--err); }
#status.ok { color: var(--ok); }
@media (max-width: 600px) { .act { font-size: max(15px, calc(var(--home) * 0.6)); } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fine { margin-top: 1.5rem; color: var(--code); font-size: 0.85em; font-weight: 300; }

/* The {l:d} light and dark switch, pinned to the top right. */
#mode {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  padding: 0 4px;
  border: 0;
  background: var(--bg);
  color: var(--code);
  font: inherit;
  white-space: pre;
  cursor: pointer;
}
#mode:hover { color: var(--ink); }
#mode .ml, #mode .md { padding: 0 2px; }
#mode .on { background: var(--mark); color: var(--ink); }
