/* base.css: tokens, fonts and shared components for every my-place page.
   Pixel language: square corners, hard stepped edges, no blur, no gradients. */

@font-face {
  font-family: "Press Start 2P";
  src: url("/static/fonts/PressStart2P-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "VT323";
  src: url("/static/fonts/VT323-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  /* wood */
  --wood-0: #2a1810;
  --wood-1: #4a2e1a;
  --wood-2: #6b4426;
  --wood-3: #8a5a35;
  --wood-4: #a8754a;
  /* brick, brass, parchment */
  --brick: #8a3d2a;
  --brick-dark: #6f2f20;
  --brass: #c9a45a;
  --parchment: #e9d9b0;
  --parchment-light: #f6e8cc;
  /* fire */
  --fire-red: #c8321e;
  --fire-orange: #f2933f;
  --fire-yellow: #ffd27a;
  --fire-white: #fff1b8;
  /* night, forest, soot */
  --night-0: #0d1628;
  --night-1: #14213a;
  --forest: #2f4a3a;
  --soot: #1a0d08;

  --font-title: "Press Start 2P", ui-monospace, monospace;
  --font-body: "VT323", ui-monospace, monospace;

  /* One "pixel". Pages that scale a scene override this. */
  --u: 3px;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--soot);
  color: var(--parchment-light);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.2;
  -webkit-font-smoothing: none;
  font-smooth: never;
  font-variant-ligatures: none;
}

h1 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: normal;
}

p {
  margin: 0;
}

/* Visually hidden, still read by screen readers. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- wooden sign: the link and button style for the whole site ------------ */
.sign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(2 * var(--u));
  min-height: 48px;
  padding: 0 calc(5 * var(--u));
  font-family: var(--font-title);
  font-size: 12px;
  line-height: 1;
  color: var(--parchment-light);
  text-decoration: none;
  white-space: nowrap;
  background: var(--wood-2);
  /* light top edge, dark bottom edge, dark outline, hard drop shadow */
  box-shadow:
    inset 0 var(--u) 0 0 var(--wood-3),
    inset 0 calc(-1 * var(--u)) 0 0 var(--wood-1),
    0 0 0 var(--u) var(--wood-0),
    calc(2 * var(--u)) calc(2 * var(--u)) 0 var(--u) rgb(13 6 3 / 0.55);
}

.sign:hover {
  background: var(--wood-3);
  box-shadow:
    inset 0 var(--u) 0 0 var(--wood-4),
    inset 0 calc(-1 * var(--u)) 0 0 var(--wood-2),
    0 0 0 var(--u) var(--wood-0),
    calc(2 * var(--u)) calc(2 * var(--u)) 0 var(--u) rgb(13 6 3 / 0.55);
}

.sign:active {
  transform: translate(var(--u), var(--u));
}

.sign:focus-visible {
  outline: max(3px, var(--u)) solid var(--fire-white);
  outline-offset: calc(2 * var(--u));
}

/* --- plain pages (404 for now) ------------------------------------------- */
body.plain {
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  display: grid;
  gap: 24px;
  justify-items: start;
  max-width: 560px;
  padding: 32px;
  background: var(--wood-1);
  box-shadow:
    inset 0 var(--u) 0 0 var(--wood-2),
    0 0 0 var(--u) var(--wood-0),
    calc(2 * var(--u)) calc(2 * var(--u)) 0 var(--u) rgb(0 0 0 / 0.5);
}

.panel h1 {
  font-size: 18px;
  line-height: 1.5;
  color: var(--fire-yellow);
}

.panel p {
  font-size: 26px;
}

/* --- sign variants -------------------------------------------------------- */
button.sign {
  border: 0;
  cursor: pointer;
}

.sign--small {
  --u: 2px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  font-size: 10px;
}

.sign--quiet {
  background: var(--wood-1);
}

/* --- forms ---------------------------------------------------------------- */
.form {
  display: grid;
  gap: 16px;
  justify-items: start;
  width: 100%;
}

.field {
  display: grid;
  gap: 6px;
  width: 100%;
}

.field span {
  font-family: var(--font-title);
  font-size: 10px;
  color: var(--parchment);
}

input {
  width: 100%;
  min-height: 48px;
  padding: 4px 12px;
  border: 0;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 24px;
  color: var(--wood-0);
  background: var(--parchment-light);
  box-shadow:
    inset 3px 3px 0 0 var(--parchment),
    0 0 0 3px var(--wood-0);
}

input[type="file"] {
  padding: 8px 12px;
  font-size: 20px;
}

input:focus-visible {
  outline: 3px solid var(--fire-yellow);
  outline-offset: 5px;
}

.alert,
.notice {
  padding: 10px 14px;
  font-size: 24px;
  color: var(--wood-0);
  box-shadow: 0 0 0 3px var(--wood-0);
}

.alert  { background: var(--fire-orange); }
.notice { background: var(--parchment); }
