/* =========================================================
   TYPERA — provisional brand
   Everything visual about the app lives here as tokens + a few
   components. Swap the tokens to rebrand; nothing else needs to change.

   Mood: a print shop's pinboard. Warm paper, black felt-tip ink,
   sticker colours, hard offset shadows, nothing perfectly straight.
   ========================================================= */

:root {
  /* colour */
  --paper: #f5f0e6;
  --paper-2: #ebe3d3;
  --card: #fffdf8;
  --ink: #1f1d1a;
  --ink-soft: #5c574f;
  --tomato: #ff5b3a;
  --marigold: #ffc53d;
  --cobalt: #2f45ff;
  --mint: #a8e0c2;
  --blush: #ffc2d1;

  /* type */
  --f-display: "Shantell Sans", "Comic Neue", system-ui, sans-serif;
  --f-body: "Schibsted Grotesk", system-ui, sans-serif;
  --f-mono: "Space Mono", ui-monospace, monospace;

  /* shape */
  --line: 2px solid var(--ink);
  --r-wobbly: 14px 10px 16px 9px / 10px 15px 9px 14px;
  --r-small: 9px 7px 10px 6px / 7px 10px 6px 9px;
  --shadow: 3px 3px 0 var(--ink);
  --shadow-big: 5px 6px 0 var(--ink);
}

* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* dotted cutting-mat grid */
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: 1.05; margin: 0; }
a { color: inherit; }
::selection { background: var(--marigold); }

/* ---------- buttons ---------- */
.btn {
  appearance: none; cursor: pointer;
  font: 700 14px/1 var(--f-display);
  color: var(--ink); background: var(--card);
  border: var(--line); border-radius: var(--r-small);
  padding: 9px 14px; min-height: 40px;
  box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform .08s, box-shadow .08s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: var(--shadow); }
.btn:focus-visible, .field:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.btn--hot { background: var(--tomato); color: #fff; }
.btn--sun { background: var(--marigold); }
.btn--mint { background: var(--mint); }
.btn--ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn--ghost:hover { box-shadow: none; transform: none; background: var(--card); }
.btn--icon { padding: 0; width: 40px; justify-content: center; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- form bits ---------- */
.field, select, textarea, input[type=text], input[type=number] {
  font: 15px/1.3 var(--f-body); color: var(--ink);
  background: var(--card); border: var(--line); border-radius: var(--r-small);
  padding: 8px 10px; min-height: 40px; width: 100%;
}
textarea { resize: vertical; min-height: 80px; font-family: var(--f-display); font-size: 16px; }
label.lbl { display: grid; gap: 5px; font: 700 13px/1.2 var(--f-display); }
label.lbl small { font: 12px/1.3 var(--f-body); color: var(--ink-soft); font-weight: 400; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }

input[type=range] { width: 100%; accent-color: var(--tomato); height: 26px; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: var(--line); border-radius: var(--r-small); background: var(--card); cursor: pointer; }

/* toggle switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 13px/1.2 var(--f-display); cursor: pointer; min-height: 36px; }
.switch input { appearance: none; width: 44px; height: 26px; border: var(--line); border-radius: 20px; background: var(--paper-2); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.switch input:checked { background: var(--mint); }
.switch input:checked::after { transform: translateX(18px); }

/* stickers / chips */
.chip { display: inline-block; font: 700 12px/1 var(--f-display); padding: 5px 9px; border: var(--line); border-radius: 20px; background: var(--card); }
.chip--sun { background: var(--marigold); }
.chip--mint { background: var(--mint); }
.chip--blush { background: var(--blush); }

/* hand-drawn underline */
.scribble { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 2, 70 11, 110 6 S 170 3, 198 7' fill='none' stroke='%23ff5b3a' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") bottom left / 100% .32em no-repeat; padding-bottom: .12em; }

/* panels */
.panel { background: var(--card); border: var(--line); border-radius: var(--r-wobbly); box-shadow: var(--shadow); }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 800 24px/1 var(--f-display); letter-spacing: -.02em; }
.logo svg { width: 30px; height: 34px; flex: none; }

/* dialogs */
dialog { border: var(--line); border-radius: var(--r-wobbly); box-shadow: var(--shadow-big); background: var(--card); color: var(--ink); padding: 0; max-width: min(720px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: color-mix(in srgb, var(--ink) 45%, transparent); }
dialog .dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
dialog .dlg-body { padding: 10px 20px 22px; display: grid; gap: 14px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
