/* ==========================================================================
   AdeVia — Design tokens & component styles
   ========================================================================== */

:root,
[data-theme='light'] {
  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.15rem + 2.6vw, 3.25rem);
  --text-3xl: clamp(2.4rem, 1rem + 4vw, 4.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — warm ivory, echoing the original AdeVia paper texture */
  --color-bg: #f6f1e6;
  --color-surface: #fffdf9;
  --color-surface-2: #fbf6ec;
  --color-surface-offset: #eee4d0;
  --color-surface-offset-2: #e5d9c1;
  --color-divider: #ddd0b3;
  --color-border: #d8cbae;

  /* Text — deep navy ink */
  --color-text: #1c2e42;
  --color-text-muted: #5c6c7d;
  --color-text-faint: #99a6ae;
  --color-text-inverse: #f6f1e6;

  /* Primary accent — terracotta */
  --color-primary: #bd6239;
  --color-primary-hover: #9c4e2c;
  --color-primary-active: #7c3d22;
  --color-primary-highlight: #ecd6c4;

  /* Secondary accent — sage */
  --color-secondary: #7f9470;
  --color-secondary-hover: #677a59;
  --color-secondary-highlight: #dde4d1;

  /* Semantic */
  --color-error: #a13544;
  --color-warning: #964219;
  --color-success: #437a22;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-reveal: 700ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0.25 0.03 60 / 0.08);
  --shadow-md: 0 8px 24px oklch(0.25 0.03 60 / 0.1);
  --shadow-lg: 0 20px 48px oklch(0.25 0.03 60 / 0.14);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1000px;
  --content-wide: 1280px;

  /* Fonts */
  --font-display: 'Erode', Georgia, 'Times New Roman', serif;
  --font-body: 'General Sans', 'Helvetica Neue', Arial, sans-serif;
}

[data-theme='dark'] {
  --color-bg: #111b24;
  --color-surface: #172330;
  --color-surface-2: #1c2a38;
  --color-surface-offset: #22323f;
  --color-surface-offset-2: #2a3d4b;
  --color-divider: #2c3e4c;
  --color-border: #33485a;

  --color-text: #ece4d3;
  --color-text-muted: #a7b0b8;
  --color-text-faint: #6c7982;
  --color-text-inverse: #1c2e42;

  --color-primary: #e08a5b;
  --color-primary-hover: #eba57e;
  --color-primary-active: #f2bd9d;
  --color-primary-highlight: #4a3527;

  --color-secondary: #a3b992;
  --color-secondary-hover: #bad0a9;
  --color-secondary-highlight: #2c3826;

  --color-error: #d16aa0;
  --color-warning: #bb653b;
  --color-success: #6daa45;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 8px 24px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --color-bg: #111b24;
    --color-surface: #172330;
    --color-surface-2: #1c2a38;
    --color-surface-offset: #22323f;
    --color-surface-offset-2: #2a3d4b;
    --color-divider: #2c3e4c;
    --color-border: #33485a;
    --color-text: #ece4d3;
    --color-text-muted: #a7b0b8;
    --color-text-faint: #6c7982;
    --color-text-inverse: #1c2e42;
    --color-primary: #e08a5b;
    --color-primary-hover: #eba57e;
    --color-primary-active: #f2bd9d;
    --color-primary-highlight: #4a3527;
    --color-secondary: #a3b992;
    --color-secondary-hover: #bad0a9;
    --color-secondary-highlight: #2c3826;
    --color-error: #d16aa0;
    --color-warning: #bb653b;
    --color-success: #6daa45;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 8px 24px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.5);
  }
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-secondary);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  flex-shrink: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--color-text);
  font-weight: 500;
}

h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--space-12);
}

.section-head p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 38rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff8f0;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-sm {
  padding: 0.6rem 1.1rem;
  font-size: var(--text-xs);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}

.brand svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.main-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}
.main-nav a:hover {
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-6) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg);
}
.mobile-nav a {
  padding: var(--space-3) var(--space-2);
  font-size: var(--text-base);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.mobile-nav a:hover {
  background: var(--color-surface-offset);
}
.mobile-nav.open {
  display: flex;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-top: clamp(var(--space-16), 10vw, var(--space-24));
  padding-bottom: clamp(var(--space-12), 6vw, var(--space-20));
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-16);
  align-items: center;
}

.hero h1 {
  font-size: var(--text-3xl);
  line-height: 1.08;
  margin-bottom: var(--space-6);
}

.hero h1 em {
  font-style: normal;
  color: var(--color-primary);
}

.hero .lede {
  margin-bottom: var(--space-8);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.hero-trust span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-trust svg {
  width: 15px;
  height: 15px;
  color: var(--color-secondary);
  flex-shrink: 0;
}

.hero-visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 5;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    var(--color-bg) 0%,
    color-mix(in oklab, var(--color-bg) 0%, transparent) 14%
  );
  z-index: 1;
  pointer-events: none;
}

/* ==========================================================================
   Value grid — "Pourquoi AdeVia"
   ========================================================================== */

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.value-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.value-icon {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-2);
}

.value-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.value-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.value-card:nth-child(4),
.value-card:nth-child(5) {
  grid-column: span 1;
}

/* Center the last two cards of a 5-item, 3-col grid */
@media (min-width: 861px) {
  .value-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .value-card {
    grid-column: span 2;
  }
  .value-card:nth-child(4) {
    grid-column: 2 / span 2;
  }
  .value-card:nth-child(5) {
    grid-column: 4 / span 2;
  }
}

/* ==========================================================================
   Method
   ========================================================================== */

.method {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.method-visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-12);
  box-shadow: var(--shadow-md);
}

.method-visual img {
  width: 100%;
  height: auto;
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-6);
  counter-reset: step;
}

.method-step {
  position: relative;
  padding-top: var(--space-8);
  border-top: 2px solid var(--color-border);
}

.method-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: -0.75em;
  left: 0;
  background: var(--color-surface-2);
  padding-right: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--color-primary);
}

.method-step h3 {
  font-size: var(--text-base);
}

.method-step p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ==========================================================================
   Services
   ========================================================================== */

.services-visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-14);
  box-shadow: var(--shadow-md);
  height: clamp(220px, 28vw, 360px);
}

.services-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  align-items: stretch;
}

.offer-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  position: relative;
}

.offer-card.featured {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.offer-badge {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
}

.offer-card .offer-kicker {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-secondary);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.offer-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.offer-card .offer-desc {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.offer-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.offer-price .amount {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
}

.offer-price .from {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.offer-price-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-6);
}

.offer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  flex: 1;
}

.offer-list li {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: none;
}

.offer-list svg {
  width: 16px;
  height: 16px;
  color: var(--color-secondary);
  flex-shrink: 0;
  margin-top: 0.2em;
}

.offer-card .btn {
  width: 100%;
}

.offer-note {
  margin-top: var(--space-10);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.offer-note a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact {
  background: var(--color-surface-offset);
  border-top: 1px solid var(--color-divider);
}

.contact .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-16);
  align-items: start;
}

.contact h2 {
  font-size: var(--text-2xl);
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.contact-row {
  display: flex;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.contact-row:last-child {
  border-bottom: none;
}

.contact-row .icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-row .icon svg {
  width: 18px;
  height: 18px;
}

.contact-row strong {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: 0.15em;
}
.contact-row span,
.contact-row a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.contact-row a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12);
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
}
.footer-brand svg {
  width: 24px;
  height: 24px;
  color: var(--color-text-faint);
}
.footer-brand span {
  font-size: var(--text-xs);
}

.footer-nav {
  display: flex;
  gap: var(--space-6);
}
.footer-nav a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-nav a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

.reveal {
  opacity: 0;
  clip-path: inset(0 0 12% 0);
  transition:
    opacity var(--transition-reveal),
    clip-path var(--transition-reveal);
}
.reveal.is-visible {
  opacity: 1;
  clip-path: inset(0 0 0% 0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    clip-path: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1000px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    order: -1;
    aspect-ratio: 16 / 10;
  }
  .value-grid,
  .offer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .value-card:nth-child(4),
  .value-card:nth-child(5) {
    grid-column: auto;
  }
  .method-steps {
    grid-template-columns: repeat(2, 1fr);
    row-gap: var(--space-10);
  }
  .contact .wrap {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
}

@media (max-width: 860px) {
  .main-nav {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  section {
    padding-block: var(--space-16);
  }
  .hero h1 {
    font-size: var(--text-2xl);
  }
  .value-grid,
  .offer-grid {
    grid-template-columns: 1fr;
  }
  .method-steps {
    grid-template-columns: 1fr;
  }
  .hero-actions .btn,
  .offer-card .btn {
    width: 100%;
  }
  .hero-actions {
    flex-direction: column;
  }
}
