/* =========================================
   Design Tokens & Base Variables
   ========================================= */
:root {
  --color-bg: #f8f7f4;
  --color-surface: #ffffff;
  --color-surface-hover: #fafafa;
  --color-text: #1a1a1a;
  --color-text-secondary: #555555;
  --color-text-tertiary: #888888;
  --color-primary: #d97b42;
  --color-primary-dark: #b85a22;
  --color-primary-light: #f4d9ca;
  --color-accent: #e8927a;
  --color-border: #e5e2dc;
  --color-border-strong: #d1cdc6;
  --color-success: #4a9e6b;
  
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 40px rgba(217, 123, 66, 0.15);
  
  --container-max: 1200px;
  --header-height: 72px;
}

/* =========================================
   Reset & Base Typography
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-top: 0;
  margin-bottom: var(--space-md);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.15; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); line-height: 1.25; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.35; }
p { margin-bottom: var(--space-md); max-width: 75ch; }
small { font-size: 0.875rem; color: var(--color-text-secondary); }
ul, ol { padding-left: var(--space-lg); margin-top: 0; margin-bottom: var(--space-md); }
li { margin-bottom: var(--space-sm); }

/* =========================================
   Layout Utilities
   ========================================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.section {
  padding: var(--space-3xl) 0;
  position: relative;
}
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-xl);
}
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-lg { margin-top: var(--space-lg); }

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 247, 244, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-text);
}
.brand img {
  height: 32px;
  width: auto;
  object-fit: contain;
}
.brand span {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.main-nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-lg);
}
.main-nav a {
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color 0.2s;
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--color-text); }
.main-nav a[aria-current="page"] { color: var(--color-primary-dark); }
.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

/* =========================================
   Buttons & Interactive Elements
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}
.btn-secondary:hover { background: var(--color-surface-hover); border-color: var(--color-text-tertiary); }
.btn-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
}

/* =========================================
   Cards & Content Blocks
   ========================================= */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}
.card h3 { margin-bottom: var(--space-sm); }
.card p { font-size: 0.95rem; color: var(--color-text-secondary); margin-bottom: 0; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-radius: 99px;
  margin-bottom: var(--space-sm);
}

/* =========================================
   Tables
   ========================================= */
.table-wrapper { overflow-x: auto; 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: #f0efe9; font-weight: 600; color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 500; color: var(--color-text); }

/* =========================================
   FAQ (Details/Summary)
   ========================================= */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  background: var(--color-surface);
  overflow: hidden;
}
.faq-summary {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  transition: transform 0.2s;
}
.faq-item[open] .faq-summary::after { transform: rotate(45deg); }
.faq-item[open] .faq-summary { background: var(--color-surface-hover); border-bottom: 1px solid var(--color-border); }
.faq-answer {
  padding: var(--space-md) var(--space-lg);
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* =========================================
   SVG Animations & Visuals
   ========================================= */
.contour-path {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  opacity: 0.7;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: contour-flow 8s linear infinite;
}
.contour-path.alt {
  stroke: var(--color-accent);
  animation-delay: -2s;
  animation-duration: 10s;
}
.contour-path.third {
  stroke: var(--color-text-tertiary);
  stroke-width: 1;
  opacity: 0.4;
  animation-delay: -4s;
  animation-duration: 12s;
}
@keyframes contour-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.hero-svg-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.hero-svg-container svg {
  width: 100%;
  height: 100%;
  max-width: none;
}
.divider-svg {
  width: 100%;
  height: auto;
  display: block;
  margin: var(--space-xl) 0;
  opacity: 0.6;
}

/* =========================================
   Accessibility & Motion
   ========================================= */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .contour-path { animation: none !important; opacity: 0.5; }
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
  .main-nav ul { gap: var(--space-md); }
  .section { padding: var(--space-2xl) 0; }
  .card { padding: var(--space-lg); }
  th, td { padding: var(--space-sm) var(--space-md); }
}
