:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", Consolas, monospace;
  --color-bg: #FAFAF8;
  --color-surface: #FFFFFF;
  --color-text: #1A1A1C;
  --color-text-secondary: #6E6E73;
  --color-accent-start: #FF7A5C;
  --color-accent-end: #FFB347;
  --color-border: #E5E5EA;
  --color-bg-soft: #F4F4F2;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 20px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.09);
  --container-max: 1180px;
  --spacing-section: clamp(3.5rem, 7vw, 7rem);
  --transition-base: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

*, *::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-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 { letter-spacing: -0.02em; margin-bottom: 0.75rem; font-weight: 700; }
h1 { font-size: clamp(2.25rem, 4.5vw, 3.25rem); line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); }
p { margin-bottom: 1rem; max-width: 68ch; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; padding-left: 0; }

.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 1.5rem; }
section { padding: var(--spacing-section) 0; }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header p { margin: 0.75rem auto 0; color: var(--color-text-secondary); }

/* Header & Nav */
header { position: sticky; top: 0; z-index: 100; background: rgba(250,250,248,0.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--color-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; font-size: 1.125rem; white-space: nowrap; }
.logo img { width: 30px; height: 30px; object-fit: contain; }
nav ul { display: flex; gap: 1.5rem; flex-wrap: wrap; }
nav a { font-size: 0.9375rem; font-weight: 500; color: var(--color-text-secondary); padding: 0.5rem 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-text); border-color: var(--color-accent-start); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.875rem 1.75rem; border-radius: 999px; font-weight: 600; font-size: 1rem; cursor: pointer; transition: all var(--transition-base); border: none; outline: none; text-align: center; }
.btn:focus-visible { outline: 3px solid var(--color-accent-end); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--color-accent-start), var(--color-accent-end)); color: #fff; box-shadow: 0 4px 15px rgba(255,122,92,0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,122,92,0.35); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { border-color: var(--color-text-secondary); background: #f8f8f6; }
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Layout Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }

/* Cards */
.card { background: var(--color-surface); border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-card); transition: transform var(--transition-base), box-shadow var(--transition-base); border: 1px solid var(--color-border); display: flex; flex-direction: column; height: 100%; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-icon { width: 40px; height: 40px; margin-bottom: 1rem; color: var(--color-accent-start); }
.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; color: var(--color-text-secondary); font-size: 0.9375rem; }

/* Tables */
.table-wrapper { overflow-x: auto; margin: 1.5rem 0; border-radius: var(--radius-sm); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { font-weight: 600; color: var(--color-text-secondary); background: var(--color-bg-soft); }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { margin-bottom: 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; background: var(--color-surface); }
summary { padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; transition: background var(--transition-base); }
summary::-webkit-details-marker { display: none; }
summary:hover { background: #fafaf8; }
details[open] summary { background: var(--color-bg-soft); border-bottom: 1px solid var(--color-border); }
.faq-answer { padding: 1rem 1.25rem; color: var(--color-text-secondary); line-height: 1.7; }
.faq-answer p { margin-bottom: 0.5rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* News & Related */
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-meta { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--color-text-secondary); margin-bottom: 0.5rem; }
.news-card h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.news-card p { font-size: 0.9375rem; color: var(--color-text-secondary); flex-grow: 1; }
.news-link { display: inline-block; margin-top: 1rem; font-weight: 600; font-size: 0.9375rem; color: var(--color-accent-start); }
.related-list li { margin-bottom: 0.875rem; display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 0.625rem; border-bottom: 1px dotted var(--color-border); }
.related-list a:hover { color: var(--color-accent-start); }
.related-desc { font-size: 0.875rem; color: var(--color-text-secondary); margin-top: 0.25rem; }

/* SVG Animation Utilities */
@keyframes contour-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes wave-drift {
  0%, 100% { transform: translateX(0) scaleY(1); opacity: 0.6; }
  50% { transform: translateX(12px) scaleY(1.05); opacity: 1; }
}
.svg-contour path { stroke-dasharray: 1; stroke-dashoffset: 0; animation: contour-flow 6s linear infinite alternate; }
.svg-wave path { animation: wave-drift 8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.svg-layer { opacity: 0.8; transition: opacity 0.3s; }
.svg-layer:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Responsive */
@media (max-width: 840px) {
  .split-layout { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; gap: 1rem; }
  nav ul { justify-content: center; gap: 1rem; }
  .btn-group { justify-content: center; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  section { padding: 2.5rem 0; }
}
