/* ==========================================================================
   Base: reset, typography, buttons and form fields
   ========================================================================== */

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
input[type="date"], input[type="time"] { min-height: 40px; }

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

::selection { background: var(--primary); color: var(--on-primary); }

.icon { flex-shrink: 0; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.noscript { padding: 24px; text-align: center; }

/* The underlined typewriter label from the reference ("-project of the month") */
.mono-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mono { font-family: var(--font-mono); }

/* The blinking underscore from "Welcome_" */
.cursor { color: var(--primary); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Buttons ---------- */

.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: var(--text-sm); white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active, .btn-ghost:active { transform: scale(0.97); }

.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-ghost.danger { color: var(--danger); }

.btn-primary.sm, .btn-ghost.sm { height: 34px; padding: 0 12px; font-size: 13px; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }

.link-btn { color: var(--text); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--primary-hover); }

/* ---------- Form fields ---------- */

.input {
  width: 100%; min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { resize: vertical; line-height: 1.5; }

.field-label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted);
}

.hint { font-size: var(--text-xs); color: var(--text-muted); }

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