/* ============================================================
   BassSkills — "Music Paper"
   One serif family, warm paper ground, rust accent.
   Hairline rules carry structure; borders and fills are the
   exception, not the default.
   ============================================================ */

:root {
  /* --- colour --- */
  --paper: #F7F2E9;
  --paper-raised: #FCF9F3;
  --ink: #3A342C;
  --ink-soft: #5C5446;
  --ink-muted: #7A7161;
  --ink-faint: #8C8272;
  --ink-ghost: #B5A991;
  --rule: #E3DACA;
  --rule-strong: #CFC4B0;
  --accent: #A45C3D;
  --accent-deep: #7E4429;
  --accent-wash: #F0E3D8;
  --done: #6E7A52;
  --danger: #9C3B2E;

  /* --- spacing --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --space-6: 32px;
  --space-7: 48px;

  /* --- shape --- */
  --radius-sm: 2px;
  --radius: 3px;
  --tap: 44px;

  /* --- type --- */
  --font: 'Newsreader', Georgia, 'Times New Roman', serif;
  --text-display: 34px;
  --text-heading: 21px;
  --text-item: 18px;
  --text-body: 14px;
  --text-meta: 13px;
  --text-label: 12px;
}

/* ============================================================
   Base
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-deep);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Routes.razor focuses the page h1 on every navigation for screen readers
   (FocusOnNavigate). That's an accessibility signal, not a keyboard-focus
   event, so it should not draw the visible ring. */
h1:focus-visible {
  outline: none;
}

/* ============================================================
   Typography
   ============================================================ */

h1 {
  margin: 0;
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

h2 {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 600;
  line-height: 1.25;
}

h3 {
  margin: 0;
  font-size: var(--text-item);
  font-weight: 500;
  line-height: 1.3;
}

p {
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* Any figure the eye compares down a column lines up. */
.numeral,
time {
  font-variant-numeric: tabular-nums;
}

.page-label {
  font-size: var(--text-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.page-meta {
  font-size: var(--text-meta);
  font-style: italic;
  color: var(--ink-faint);
}

/* ============================================================
   Section rule — an italic caption with a hairline running off
   it. The main structural device of this design.
   ============================================================ */

.section-rule {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-4) 0;
  font-size: var(--text-meta);
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.section-rule::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: #DDD4C4;
}

/* ============================================================
   Controls
   Element selectors, so unclassed markup is styled by default.
   ============================================================ */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-4);
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

button:hover {
  background: var(--paper-raised);
  color: var(--ink);
}

button:disabled {
  color: var(--ink-ghost);
  border-color: var(--rule);
  cursor: not-allowed;
}

button:disabled:hover {
  background: transparent;
}

/* Ink fill — the one primary action on a page. */
.button-primary {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  font-weight: 500;
}

.button-primary:hover {
  color: var(--paper);
  background: #2C271F;
}

/* Rust fill — completes or commits something in flight. */
.button-accent {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}

.button-accent:hover {
  color: var(--paper);
  background: var(--accent-deep);
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="password"],
input[type="email"],
input:not([type]),
textarea,
select {
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
}

textarea {
  min-height: 72px;
  line-height: 1.5;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  font-style: italic;
  color: var(--ink-ghost);
}

label {
  display: block;
  font-size: var(--text-meta);
  color: var(--ink-faint);
}

/* --- checkbox ------------------------------------------------ */

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  background: transparent;
  border: 1px solid var(--ink-ghost);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background-color: var(--done);
  border-color: var(--done);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23F7F2E9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2l2.4 2.4L9.5 3.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

/* --- range --------------------------------------------------- */

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  background: var(--accent);
  border: 0;
  border-radius: 50%;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 0;
  border-radius: 50%;
}

/* ============================================================
   Validation and error surfaces — Blazor's own class names
   ============================================================ */

.valid.modified:not([type=checkbox]) {
  border-color: var(--done);
}

.invalid {
  border-color: var(--danger);
}

.validation-message {
  font-size: var(--text-meta);
  color: var(--danger);
}

#blazor-error-ui {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: none;
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-body);
  color: var(--paper);
  background: var(--danger);
}

#blazor-error-ui a {
  color: var(--paper);
}

#blazor-error-ui .dismiss {
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  cursor: pointer;
}

.blazor-error-boundary {
  padding: var(--space-4);
  color: var(--paper);
  background: var(--danger);
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}
