:root {
  --color-bg: #f8f6f1;
  --color-surface: #ffffff;
  --color-primary: #3a5a40;
  --color-primary-dark: #2d4a38;
  --color-secondary: #5c6b5f;
  --color-accent: #d4a373;
  --color-text: #2c2a25;
  --color-text-muted: #6b6861;
  --color-border: #e3dfda;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --spacing-section: clamp(3rem, 8vw, 5rem);
  --spacing-unit: 1rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; transition: color 0.2s; }
a:hover, a:focus-visible { color: var(--color-accent); }
button, input, select, textarea { font: inherit; }

/* Typography */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--color-primary); text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); margin-bottom: 1.25rem; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 75ch; }
.text-muted { color: var(--color-text-muted); }
.section-header { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.section-header p { margin: 0.75rem auto 0; color: var(--color-text-muted); }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
section { padding: var(--spacing-section) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2.5rem; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* Header & Footer */
header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 100; backdrop-filter: blur(8px); background: rgba(255,255,255,0.92); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--color-text); font-weight: 700; font-size: 1.25rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; list-style: none; gap: 2rem; }
nav a { text-decoration: none; font-weight: 500; padding: 0.5rem 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-color: var(--color-primary); color: var(--color-primary); }
.footer { background: #2c2a25; color: #dcdad5; padding: 3.5rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2.5rem; }
.footer h4 { color: #fff; margin-bottom: 1rem; font-size: 1.1rem; }
.footer ul li { margin-bottom: 0.6rem; }
.footer a { color: #b0aea9; text-decoration: none; }
.footer a:hover { color: var(--color-accent); }
.copyright { text-align: center; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #3d3b36; font-size: 0.9rem; color: #8a8881; }

/* Components */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.875rem 1.75rem; background: var(--color-primary); color: #fff; text-decoration: none; border-radius: var(--radius); font-weight: 600; border: none; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.btn:hover { background: var(--color-primary-dark); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-outline { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }

.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.icon-box { width: 48px; height: 48px; background: #eef0eb; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem; }
.icon-box svg { width: 24px; height: 24px; stroke: var(--color-primary); stroke-width: 1.8; fill: none; }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; background: var(--color-surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--color-border); }
th, td { padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: #f4f2ed; font-weight: 600; color: var(--color-primary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafaf8; }

details { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden; transition: box-shadow 0.2s; }
details:hover { box-shadow: var(--shadow-sm); }
summary { padding: 1.1rem 1.25rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.25rem; color: var(--color-secondary); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 1.25rem 1.25rem; color: var(--color-text-muted); line-height: 1.65; }

.step-list { counter-reset: step; padding-left: 0; }
.step-list li { position: relative; padding-left: 2.75rem; margin-bottom: 1.25rem; }
.step-list li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 1.75rem; height: 1.75rem; background: var(--color-accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }

.mockup-frame { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem; background: #fdfdfd; position: relative; }
.mockup-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.mockup-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0ddd8; }
.mockup-chat { background: #f4f5f2; border-radius: 8px; padding: 1rem; height: 200px; display: flex; flex-direction: column; gap: 0.75rem; }
.chat-bubble { padding: 0.75rem 1rem; border-radius: 8px; max-width: 70%; font-size: 0.9rem; color: #333; }
.bubble-in { background: #fff; align-self: flex-start; }
.bubble-out { background: #dcf8c6; align-self: flex-end; }

/* SVG Animations */
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-reverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
@keyframes float-gentle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes draw-path { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.anim-spin { animation: spin-slow 16s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-spin-reverse { animation: spin-reverse 20s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-float { animation: float-gentle 7s ease-in-out infinite; }
.anim-draw path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-path 4s ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .anim-spin, .anim-spin-reverse, .anim-float, .anim-draw { animation: none !important; }
}

/* Responsive tweaks */
@media (max-width: 768px) {
  nav ul { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(1.85rem, 6vw, 2.75rem); }
  table { display: block; overflow-x: auto; }
}
