:root {
  --color-bg-primary: #0B0D10;
  --color-bg-secondary: #171B22;
  --color-fg-primary: #F3F0E8;
  --color-fg-secondary: #A8ADB7;
  --color-accent: #C62828;
  --color-border: #23262C;
  --color-overlay: rgba(243, 240, 232, 0.12);
  --color-badge-bg: #C62828;
  --color-badge-fg: #FFFFFF;

  --font-heading: "Inter Tight", "Inter", Arial, sans-serif;
  --font-body: "Inter", Arial, sans-serif;

  --text-xs: 0.875rem;
  --text-sm: 1rem;
  --text-md: 1.25rem;
  --text-lg: 1.5rem;
  --text-xl: 2rem;
  --text-xxl: 2.75rem;

  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --shadow-soft: 0 4px 16px rgba(11, 13, 16, 0.25);

  --container-max: 1200px;
  --container-pad: 24px;

  --transition-fast: 0.15s ease;
}

@media (max-width: 900px) {
  :root {
    --text-xxl: 2.25rem;
    --text-xl: 1.75rem;
    --container-pad: 16px;
  }
}

@media (max-width: 600px) {
  :root {
    --text-xxl: 2rem;
    --text-xl: 1.5rem;
  }
}

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg-primary);
  color: var(--color-fg-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.5;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--color-fg-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

h1 {
  font-size: clamp(2rem, 4vw, var(--text-xxl));
}

h2 {
  font-size: clamp(1.75rem, 3vw, var(--text-xl));
}

h3 {
  font-size: var(--text-lg);
}

h4 {
  font-size: var(--text-md);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-fg-primary);
}

small {
  font-size: var(--text-xs);
  color: var(--color-fg-secondary);
}

ul,
ol {
  padding-left: var(--space-4);
  margin-bottom: var(--space-3);
}

li {
  margin-bottom: var(--space-2);
}

blockquote {
  margin-bottom: var(--space-4);
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-border);
  color: var(--color-fg-secondary);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;
}

.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  width: 100%;
}

.section {
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
}

@media (max-width: 600px) {
  .section {
    margin-top: var(--space-5);
    margin-bottom: var(--space-5);
  }
}

.card {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

.panel {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-soft);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--color-accent);
  color: #ffffff;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.button:hover,
a.button:hover {
  background: #a81f1f;
  color: #ffffff;
  border-color: transparent;
}

.button-outline {
  background: transparent;
  border: 1px solid var(--color-fg-primary);
  color: var(--color-fg-primary);
}

.button-outline:hover,
a.button-outline:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

.input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-accent);
  outline: none;
}

label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-fg-secondary);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
}

.table th {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.table tr:nth-child(even) {
  background: var(--color-overlay);
}

.badge-21 {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-badge-bg);
  color: var(--color-badge-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  text-decoration: none;
  z-index: 1000;
}

@media (max-width: 600px) {
  .badge-21 {
    width: 28px;
    height: 28px;
  }
}

.ribbon {
  position: relative;
  width: 100%;
  background: var(--color-accent);
  color: var(--color-badge-fg);
  font-size: var(--text-xs);
  line-height: 1.35;
  text-align: center;
  padding: var(--space-2);
  z-index: 999;
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-soft);
  max-width: 500px;
  width: calc(100% - 32px);
  margin: auto;
}

.flex {
  display: flex;
  gap: var(--space-3);
  min-width: 0;
}

.flex-col {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}

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

@media (max-width: 600px) {
  .ribbon {
    padding: var(--space-2) var(--space-3);
  }

  .panel,
  .card {
    padding: var(--space-3);
  }

  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
