:root {
  --color-dark: #240F29;
  --color-paper: #F6F3F7;
  --color-text: #201523;
  --color-brand: #A711CF;
  --color-accent: #ED6E73;
  --color-bg: var(--color-paper);
  --color-fg: var(--color-text);
  --color-highlight: var(--color-brand);

  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);

  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-body: 1.65;
}

.dark-face {
  --color-bg: var(--color-dark);
  --color-fg: var(--color-paper);
  --color-highlight: var(--color-accent);
  --card-border: 2px solid var(--color-paper);
  --card-shadow: 4px 4px 0 var(--color-paper);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-fg);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: 1.25rem; margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }

.marker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: calc(var(--gap) * 0.5);
  color: var(--color-highlight);
}

.hl { color: var(--color-highlight); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--color-fg);
  border: 2px solid var(--color-fg);
}
.btn:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn:focus-visible { outline: 3px solid var(--color-highlight); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

.card {
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  background: var(--color-bg);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); min-width: 0; }
    th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--color-fg); min-width: 0; }
th { font-weight: 700; }

details { border: var(--card-border); box-shadow: var(--card-shadow); margin-bottom: var(--gap); padding: 16px; background: var(--color-bg); }
summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; line-height: 1; }
details[open] summary::after { content: "-"; }
details > div { margin-top: var(--gap); }

header { position: sticky; top: 0; z-index: 100; background: var(--color-bg); border-bottom: 1px solid var(--color-fg); padding: 16px 0; }
nav { display: flex; justify-content: space-between; align-items: center; }
.nav-links { display: flex; gap: var(--gap); list-style: none; }
.nav-links a { text-decoration: none; color: var(--color-fg); font-weight: 600; }
.nav-links a[aria-current="page"] { color: var(--color-highlight); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
footer { padding: var(--section-y) 0; border-top: 1px solid var(--color-fg); margin-top: var(--section-y); }

.timeline { border-left: 2px solid var(--color-fg); padding-left: var(--gap); margin-left: 0.5rem; }
.timeline-item { position: relative; margin-bottom: var(--gap); padding-bottom: var(--gap); }
.timeline-item::before { content: attr(data-step); position: absolute; left: -0.9rem; top: 0; width: 1.8rem; height: 1.8rem; background: var(--color-accent); color: var(--color-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; }
.tip-list { list-style: none; counter-reset: tip; }
.tip-list li { counter-increment: tip; margin-bottom: var(--gap); padding-left: 2.5rem; position: relative; }
.tip-list li::before { content: "TIP " counter(tip); position: absolute; left: 0; top: 0; font-weight: 700; color: var(--color-highlight); font-size: 0.85rem; }

.news-card time { display: block; font-size: 0.85rem; color: var(--color-highlight); margin-bottom: 0.5rem; font-weight: 600; }

.hero-visual { width: 100%; max-width: 420px; height: auto; margin-top: var(--gap); }
.svg-anim { width: 100%; height: auto; overflow: visible; }
.draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.anim-draw { animation: drawLine 6s ease-in-out infinite; }
.anim-float { animation: floatY 5s ease-in-out infinite; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-delay-1 { animation-delay: 0.5s; }
.anim-delay-2 { animation-delay: 1s; }

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  20%, 80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .draw { stroke-dashoffset: 0 !important; }
  .anim-float, .anim-breathe { transform: none !important; opacity: 1 !important; }
}

@media (max-width: 768px) {
  .hero-layout { flex-direction: column; }
  .scenario-split { flex-direction: column; }
  .nav-links { display: none; }
}
