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

:root {
  --bg: #000;
  --fg: #fff;
  --border: 3px solid #fff;
  --fs-base: 1.75rem;
  --fs-large: 2.25rem;
  --fs-xl: 3rem;
  --btn-height: 76px;
  --nav-btn-height: 104px;
  --gap: 1.5rem;
  --content-max: 1500px;
  --line-height: 1.65;
}

html {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: var(--line-height);
}

body {
  background: var(--bg);
  color: var(--fg);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 {
  font-size: var(--fs-xl);
  line-height: 1.2;
  margin-bottom: 2rem;
}

h2 {
  font-size: var(--fs-large);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── Buttons ───────────────────────────────── */

button,
.btn,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-height);
  padding: 0.75rem 1.75rem;
  background: var(--bg);
  color: var(--fg);
  border: var(--border);
  border-radius: 0;
  font-size: var(--fs-base);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
  white-space: nowrap;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
  background: #1c1c1c;
}

button:active,
.btn:active,
input[type="submit"]:active {
  background: #333;
}

/* ── Navigation buttons (Startseite) ───────── */

.nav-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin-top: 1rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--nav-btn-height);
  padding: 1rem 2rem;
  background: var(--bg);
  color: var(--fg);
  border: var(--border);
  border-radius: 0;
  font-size: var(--fs-large);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.02em;
}

.nav-btn:hover {
  background: #1c1c1c;
}

/* ── Focus states (accessibility) ───────────── */

:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
}

/* ── Forms ───────────────────────────────────── */

.form-group {
  margin-top: 1.75rem;
}

label {
  display: block;
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  display: block;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: var(--border);
  border-radius: 0;
  padding: 0.75rem 1rem;
  font-size: var(--fs-base);
  font-family: inherit;
  line-height: var(--line-height);
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M8 11L2 5h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 2rem;
  height: 2rem;
  accent-color: var(--fg);
  vertical-align: middle;
  margin-right: 0.75rem;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-size: var(--fs-base);
  margin-top: 1.75rem;
  cursor: pointer;
  gap: 0.5rem;
}

/* ── Button row ──────────────────────────────── */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* ── Messages ────────────────────────────────── */

.msg-error {
  border: var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: var(--fs-base);
}

.msg-info {
  border: 2px solid #888;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: var(--fs-base);
}

/* ── Back / utility links ────────────────────── */

.back-link {
  display: inline-block;
  font-size: var(--fs-base);
  margin-bottom: 2rem;
}

/* ── Note cards ─────────────────────────────── */

.note-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.note-card {
  border: var(--border);
  padding: 1.5rem;
}

.note-title {
  font-size: var(--fs-large);
  line-height: 1.3;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 1.25rem;
  opacity: 0.75;
  margin-bottom: 1.25rem;
}

.note-category {
  border: 2px solid #fff;
  padding: 0.15rem 0.6rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.note-empty {
  font-size: var(--fs-large);
  opacity: 0.6;
  margin-top: 2rem;
}

/* ── Commit ID ───────────────────────────────── */

.commit-id {
  margin-top: 2rem;
  font-size: 1rem;
  opacity: 0.4;
  font-family: monospace;
}

/* ── Reduced motion ──────────────────────────── */

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