:root {
  --color-bg: #F9F7F4;
  --color-surface: #FFFFFF;
  --color-primary: #2C3A4A;
  --color-secondary: #5A6B7D;
  --color-accent-start: #E8A87C;
  --color-accent-end: #D98058;
  --color-accent-gradient: linear-gradient(135deg, var(--color-accent-start) 0%, var(--color-accent-end) 100%);
  --color-text: #1A1D21;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-focus: #D98058;
  --color-code-bg: #F3F4F6;
  
  --font-main: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
  
  --container-max: 1200px;
  --header-height: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  line-height: 1.65;
}

body {
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a:focus-visible {
  color: var(--color-accent-end);
}

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-2xl) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-md);
}

/* Typography */
h1, h2, h3, h4 {
  text-wrap: balance;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-primary);
}

h1 { font-size: clamp(2rem, 1.8rem + 1.5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.4rem + 1vw, 2.25rem); margin-bottom: var(--space-lg); }
h3 { font-size: clamp(1.15rem, 1.1rem + 0.5vw, 1.4rem); margin-bottom: var(--space-sm); }
p { margin-bottom: var(--space-md); color: var(--color-secondary); }

.text-muted { color: var(--color-text-muted); font-size: 0.9em; }
.mono { font-family: var(--font-mono); }

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 247, 244, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

nav ul {
  display: flex;
  gap: var(--space-lg);
}

nav a {
  padding: 0.5rem 0;
  font-weight: 500;
  position: relative;
}

nav a[aria-current="page"] {
  color: var(--color-accent-end);
}

nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent-end);
  border-radius: 2px;
}

@media (max-width: 768px) {
  nav ul { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  font-size: 1rem;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--color-accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 128, 88, 0.35);
}

.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 128, 88, 0.45);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-primary);
}

.btn-outline:hover, .btn-outline:focus-visible {
  border-color: var(--color-accent-end);
  color: var(--color-accent-end);
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  color: var(--color-accent-end);
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-code-bg);
  font-weight: 600;
  color: var(--color-primary);
}

td:last-child { white-space: nowrap; }

/* Details/FAQ */
details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

summary {
  padding: var(--space-md);
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  line-height: 1.2em;
  text-align: center;
  border-radius: 50%;
  background: var(--color-border);
  font-size: 0.8em;
  transition: transform 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

details[open] summary::before {
  content: "-";
  background: var(--color-accent-end);
  color: #fff;
  transform: rotate(180deg);
}

details p, details li {
  padding: 0 var(--space-md) var(--space-md) calc(var(--space-md) + 1.6em);
  margin: 0;
  color: var(--color-secondary);
}

/* Sections & Dividers */
.section-header {
  max-width: 800px;
  margin-bottom: var(--space-xl);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: var(--space-2xl) 0;
}

/* SVG Animations */
.wave-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-flow 6s linear infinite;
}

.wave-path.delay-1 { animation-delay: 1s; }
.wave-path.delay-2 { animation-delay: 2.5s; }
.wave-path.delay-3 { animation-delay: 4s; }

@keyframes draw-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .wave-path { animation: none; stroke-dashoffset: 0.2; }
}

/* Footer */
.site-footer {
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2xl) 0 var(--space-xl);
  margin-top: var(--space-2xl);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.footer-col h4 {
  color: var(--color-accent-start);
  margin-bottom: var(--space-md);
}

.footer-col a {
  display: block;
  padding: 0.25rem 0;
  color: rgba(255, 255, 255, 0.8);
}

.footer-col a:hover { color: #fff; }

.copyright {
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Misc */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  margin-right: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.step-list {
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: var(--space-md);
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--color-accent-gradient);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.download-area {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.hero-svg-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 4/3;
}
