:root {
  --color-bg: #f6f3ec;
  --color-bg-alt: #e9e9e5;
  --color-text: #17233d;
  --color-text-muted: #40506b;
  --color-primary: #6b4fb3;
  --color-primary-strong: #49347e;
  --color-forest: #2f684f;
  --color-forest-soft: #dce9df;
  --color-blood: #8d3d4b;
  --color-progress: #b98224;
  --color-skills: #3f78a8;
  --color-on-accent: #fffdf7;
  --color-border: #d6d5d0;

  --font-heading: Sora, "Avenir Next", Arial, sans-serif;
  --font-body: Inter, "Segoe UI", Arial, sans-serif;

  --text-meta: 0.75rem;
  --text-label: 0.875rem;
  --text-body: 1rem;
  --text-lead: 1.125rem;
  --text-subtitle: 1.375rem;
  --text-card-title: 1.75rem;
  --text-section-title: clamp(2rem, 4vw, 2.25rem);
  --text-display: clamp(2.375rem, 5vw, 3.25rem);

  --leading-meta: 1.333;
  --leading-label: 1.429;
  --leading-body: 1.625;
  --leading-heading: 1.16;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3.5rem;
  --space-9: 4.5rem;
  --space-10: 6rem;

  --container-max: 75rem;
  --content-max: 45rem;
  --gutter: 1rem;

  --radius-sm: 0.25rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-pill: 999px;

  --shadow-float: 0 8px 24px rgb(23 35 61 / 8%);
  --focus-ring: 0 0 0 3px rgb(107 79 179 / 35%);

  --transition-fast: 160ms ease;
}

@media (min-width: 768px) {
  :root {
    --gutter: 1.5rem;
  }
}

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

html {
  color-scheme: light;
  background: var(--color-bg);
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
}

main,
header,
footer,
section,
article,
aside,
nav,
figure,
form,
fieldset,
table {
  min-width: 0;
}

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

img,
video {
  height: auto;
}

svg {
  flex: 0 0 auto;
}

iframe {
  border: 0;
}

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

button,
select {
  text-transform: none;
}

button,
[type="button"],
[type="submit"],
[type="reset"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

th,
td {
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

a {
  color: var(--color-primary);
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
  transition: color var(--transition-fast), text-decoration-thickness var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
  text-decoration-thickness: 0.13em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

::selection {
  background: rgb(107 79 179 / 24%);
  color: var(--color-text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-4);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--leading-heading);
  overflow-wrap: anywhere;
}

h1 {
  font-size: var(--text-display);
  line-height: 1.08;
}

h2 {
  font-size: var(--text-section-title);
}

h3 {
  font-size: var(--text-card-title);
  line-height: 1.21;
}

h4 {
  font-size: var(--text-subtitle);
  line-height: 1.3;
}

h5,
h6 {
  font-size: var(--text-body);
  line-height: 1.4;
}

p {
  margin: 0 0 var(--space-4);
}

small {
  font-size: var(--text-meta);
  line-height: var(--leading-meta);
}

strong,
b {
  font-weight: 700;
}

em,
i {
  font-style: italic;
}

hr {
  height: 1px;
  margin: var(--space-6) 0;
  border: 0;
  background: var(--color-border);
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
}

ul:not([class]),
ol:not([class]) {
  display: grid;
  gap: var(--space-2);
}

li > ul,
li > ol {
  margin-top: var(--space-2);
  margin-bottom: 0;
}

blockquote {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--color-primary);
  background: var(--color-bg-alt);
  color: var(--color-text);
}

blockquote > :last-child,
figure > :last-child,
fieldset > :last-child,
.card > :last-child,
.panel > :last-child,
.content-group > :last-child {
  margin-bottom: 0;
}

figure {
  margin: 0 0 var(--space-5);
}

figcaption {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-label);
  line-height: var(--leading-label);
}

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code,
kbd,
samp {
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  padding: 0.1em 0.3em;
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  margin: 0 0 var(--space-5);
  overflow: auto;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  font-size: 0.875rem;
  line-height: 1.55;
}

pre code {
  padding: 0;
  background: transparent;
}

label {
  display: inline-block;
  margin-bottom: var(--space-2);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: var(--text-label);
  font-weight: 650;
  line-height: var(--leading-label);
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-on-accent);
  padding: 0.625rem 0.75rem;
  line-height: 1.4;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
  outline: 0;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.125rem;
  min-height: 1.125rem;
  padding: 0;
  accent-color: var(--color-primary);
}

fieldset {
  min-width: 0;
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

legend {
  padding: 0 var(--space-2);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 700;
}

caption {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-label);
  text-align: left;
}

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

th {
  font-family: var(--font-heading);
  font-size: var(--text-label);
  font-weight: 700;
}

.container {
  width: min(100% - (var(--gutter) * 2), var(--container-max));
  margin-inline: auto;
}

.content {
  max-width: var(--content-max);
}

.section {
  padding-block: var(--space-8);
}

.stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--compact {
  gap: var(--space-2);
}

.stack--relaxed {
  gap: var(--space-6);
}

.cluster {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.cluster > * {
  min-width: 0;
}

.card,
.panel {
  min-width: 0;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.card {
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.panel {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card--elevated {
  box-shadow: var(--shadow-float);
}

.card--muted,
.panel--muted {
  background: var(--color-bg-alt);
}

.card--verified,
.panel--verified {
  border-color: var(--color-forest);
  background: var(--color-forest-soft);
}

.button {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  font-family: var(--font-heading);
  font-size: var(--text-label);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.button:hover {
  text-decoration: none;
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--color-primary);
  color: var(--color-on-accent);
}

.button--primary:hover {
  background: var(--color-primary-strong);
  color: var(--color-on-accent);
}

.button--secondary {
  border-color: var(--color-text);
  background: transparent;
  color: var(--color-text);
}

.button--secondary:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.button--forest {
  background: var(--color-forest);
  color: var(--color-on-accent);
}

.button--forest:hover {
  background: #24533f;
  color: var(--color-on-accent);
}

.tag {
  display: inline-flex;
  min-height: 1.75rem;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.625rem;
  font-family: var(--font-heading);
  font-size: var(--text-meta);
  font-weight: 700;
  line-height: 1.2;
}

.tag--verified {
  border-color: var(--color-forest);
  background: var(--color-forest-soft);
  color: var(--color-forest);
}

.tag--editorial {
  border-color: var(--color-primary);
  background: rgb(107 79 179 / 10%);
  color: var(--color-primary-strong);
}

.tag--blood {
  border-color: var(--color-blood);
  background: rgb(141 61 75 / 10%);
  color: var(--color-blood);
}

.tag--progress {
  border-color: var(--color-progress);
  background: rgb(185 130 36 / 12%);
  color: #765116;
}

.tag--skills {
  border-color: var(--color-skills);
  background: rgb(63 120 168 / 10%);
  color: #28567d;
}

.progress {
  width: 100%;
  height: 0.625rem;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-bg-alt);
}

.progress__bar {
  display: block;
  width: var(--progress-value, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--color-progress);
}

.breadcrumbs {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  color: var(--color-text-muted);
  font-size: var(--text-label);
  line-height: var(--leading-label);
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--color-border);
}

.breadcrumbs a {
  color: inherit;
}

.breadcrumbs a:hover {
  color: var(--color-primary-strong);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: var(--space-3);
  left: var(--space-3);
  transform: translateY(-200%);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  padding: var(--space-3) var(--space-4);
  color: var(--color-on-accent);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-9);
  }
}

@media (min-width: 1024px) {
  .section {
    padding-block: var(--space-10);
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}