/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, picture, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* === Font === */
@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/Manrope-Variable.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  font-style: normal;
}

/* === Design tokens — light theme (default) === */
:root {
  --bg: #f5f1e8;
  --bg-card: #ebe5d3;
  --bg-elev: #e0d9c4;
  --text: #2d3a2b;
  --text-muted: #6b7561;
  --accent: #5e8b5a;
  --accent-text: #f5f1e8;
  --border: #c9c0a9;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(45, 58, 43, 0.04), 0 2px 8px rgba(45, 58, 43, 0.04);
  --shadow-md: 0 4px 16px rgba(45, 58, 43, 0.06);

  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-y: clamp(48px, 8vw, 96px);

  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --fs-h1: clamp(34px, 5.5vw, 64px);
  --fs-h2: clamp(26px, 3.5vw, 40px);
  --fs-h3: clamp(18px, 2vw, 22px);
  --fs-body: clamp(16px, 1.1vw, 18px);
  --fs-sm: 14px;
  --fs-xs: 12px;
}

/* === Dark theme === */
[data-theme="dark"] {
  --bg: #15201a;
  --bg-card: #1d2a23;
  --bg-elev: #243329;
  --text: #e8efe1;
  --text-muted: #9aa89c;
  --accent: #86b384;
  --accent-text: #15201a;
  --border: #2f3d34;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* === Base === */
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  background: var(--bg);
  color: var(--text);
  transition: background-color 200ms ease, color 200ms ease;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { color: var(--text-muted); }

a { text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 18px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: clamp(10px, 2vw, 28px);
  margin-inline: auto;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  white-space: nowrap;
}
.nav-links a {
  position: relative;
  padding: 4px 2px;
  transition: color 150ms ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(0.6); transform-origin: center; }
.nav-links a[aria-current="section"] { color: var(--text); }
.nav-links a[aria-current="section"]::after { transform: scaleX(1); transform-origin: left center; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--text);
  transition: background 150ms;
}
.icon-btn:hover { background: var(--bg-card); }

.theme-icon-light { display: inline-flex; }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline-flex; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 150ms ease, background 150ms;
}
.btn-sm { padding: 8px 14px; font-size: var(--fs-xs); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-secondary { border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg-card); }

/* Narrow viewport: tighten nav but keep everything visible */
@media (max-width: 560px) {
  .nav { gap: 8px; }
  .brand { font-size: 16px; }
  .nav-links { font-size: 13px; gap: 10px; }
  .nav-actions { gap: 4px; }
  .nav-actions .btn { padding: 6px 10px; font-size: 11px; }
  .icon-btn { width: 36px; height: 36px; }
}

/* === Hero === */
.hero {
  padding: clamp(56px, 9vw, 120px) 0 var(--section-y);
}
.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 820px;
}
.hero-lead {
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--text-muted);
  max-width: 60ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; }
}

/* === Section head (reused) === */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: clamp(32px, 5vw, 56px);
  max-width: 640px;
}
.section-head p { color: var(--text-muted); }

/* === Services === */
.services { padding: var(--section-y) 0; }
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 20px);
}
@media (max-width: 960px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .svc-grid { grid-template-columns: 1fr; }
}
.svc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(20px, 2.2vw, 28px);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  color: var(--text);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms;
}
.svc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.svc-card h3 { margin-top: 4px; }
.svc-card p { color: var(--text-muted); flex: 1; }
.svc-ico {
  display: inline-flex;
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.svc-link {
  margin-top: 8px;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--accent);
}

/* === Process === */
.process {
  padding: var(--section-y) 0;
  background: var(--bg-card);
}
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 20px);
  counter-reset: step;
}
@media (max-width: 880px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
}
.step {
  padding: clamp(20px, 2.2vw, 28px);
  background: var(--bg);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.step-num {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  line-height: 1;
}
.step h3 { margin-top: 4px; }
.step p { color: var(--text-muted); }

/* === Cases === */
.cases { padding: var(--section-y) 0; }
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}
@media (max-width: 640px) {
  .case-grid { grid-template-columns: 1fr; }
}
.case-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  transition: transform 150ms ease, box-shadow 150ms ease;
  color: var(--text);
}
.case-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.case-preview {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 22px;
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(18px, 2.4vw, 28px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--accent-text);
  position: relative;
}
.case-name { z-index: 1; }
.case-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 60%);
}
.case-preview--art    { background: linear-gradient(135deg, #7da678, #5e8b5a); }
.case-preview--health { background: linear-gradient(135deg, #6c9e9a, #4f7d76); }
.case-preview--family { background: linear-gradient(135deg, #a4ad6f, #6e8a4f); }
.case-preview--multi  { background: linear-gradient(135deg, #4d6b5e, #2d3a2b); }
[data-theme="dark"] .case-preview--art    { background: linear-gradient(135deg, #8db988, #4d7349); }
[data-theme="dark"] .case-preview--health { background: linear-gradient(135deg, #6c9e9a, #355551); }
[data-theme="dark"] .case-preview--family { background: linear-gradient(135deg, #aab977, #4d6536); }
[data-theme="dark"] .case-preview--multi  { background: linear-gradient(135deg, #5d836f, #1d2a23); }

.case-body {
  padding: clamp(18px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case-tag {
  align-self: flex-start;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
}
.case-user {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -4px;
}
.case-link {
  margin-top: 6px;
  font-weight: 600;
  color: var(--accent);
  font-size: var(--fs-sm);
}

/* === Final CTA === */
.cta-final { padding: var(--section-y) 0; }
.cta-box {
  text-align: center;
  padding: clamp(40px, 7vw, 80px) var(--gutter);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cta-box p { max-width: 52ch; }
.btn-lg { padding: 14px 26px; font-size: var(--fs-body); }

/* === Footer === */
.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  padding: clamp(40px, 6vw, 64px) 0 24px;
  margin-top: var(--section-y);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: clamp(20px, 3vw, 40px);
}
@media (max-width: 800px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; }
}
.foot-col h4 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.foot-col p { font-size: var(--fs-sm); }
.foot-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col a { color: var(--text); font-size: var(--fs-sm); }
.foot-col a:hover { color: var(--accent); }
.foot-legal address { font-style: normal; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.7; }
.foot-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
