/* ===================================================================
   STOCK OFF — Colchões Técnicos Fabricados em Portugal
   Design language: Artesanal (madeira/cobre, calor) + Tecnológico (petróleo/teal)
   =================================================================== */

:root,
[data-theme='light'] {
  /* Surfaces — linho quente, oficina de marceneiro */
  --color-bg: #f7f2ea;
  --color-surface: #fbf7f0;
  --color-surface-2: #ffffff;
  --color-surface-offset: #efe6d6;
  --color-surface-offset-2: #e8dcc7;
  --color-divider: #e5dac6;
  --color-border: #d9cbae;

  /* Texto */
  --color-text: #2a2317;
  --color-text-muted: #6e6250;
  --color-text-faint: #a89a80;
  --color-text-inverse: #f9f5ec;

  /* Primary — Petróleo tecnológico */
  --color-primary: #0e5c56;
  --color-primary-hover: #0a4642;
  --color-primary-active: #073531;
  --color-primary-highlight: #cfe0dc;

  /* Secondary accent — Cobre artesanal */
  --color-copper: #b5652c;
  --color-copper-hover: #96501f;
  --color-copper-active: #793e17;
  --color-copper-highlight: #ead9c7;

  --color-success: #437a22;
  --color-warning: #964219;

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

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 3px oklch(0.2 0.03 60 / 0.08);
  --shadow-md: 0 8px 20px oklch(0.2 0.03 60 / 0.1);
  --shadow-lg: 0 20px 48px oklch(0.2 0.03 60 / 0.16);

  --content-narrow: 640px;
  --content-default: 980px;
  --content-wide: 1240px;

  --font-display: 'Boska', 'Georgia', serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #16130f;
  --color-surface: #1c1812;
  --color-surface-2: #221c15;
  --color-surface-offset: #251f17;
  --color-surface-offset-2: #2c2519;
  --color-divider: #322a1f;
  --color-border: #3c3324;

  --color-text: #ede4d3;
  --color-text-muted: #a89a80;
  --color-text-faint: #71654f;
  --color-text-inverse: #221c15;

  --color-primary: #5abcae;
  --color-primary-hover: #7ecdc1;
  --color-primary-active: #40968b;
  --color-primary-highlight: #253a37;

  --color-copper: #e0985a;
  --color-copper-hover: #eab27f;
  --color-copper-active: #c17a3c;
  --color-copper-highlight: #3a2e21;

  --color-success: #7cae4f;
  --color-warning: #d68a55;

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

/* ---------- Type scale ---------- */
:root {
  --text-xs: clamp(0.75rem, 0.71rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.02rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.2vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1.3rem + 4vw, 4.5rem);
  --text-hero: clamp(2.75rem, 1rem + 6vw, 5.5rem);
}

/* ---------- Spacing ---------- */
:root {
  --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;
}

/* =================== Layout primitives =================== */
.wrap {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-10));
}

.wrap--narrow {
  max-width: var(--content-narrow);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-copper);
  background: var(--color-copper-highlight);
  border: 1px solid color-mix(in oklab, var(--color-copper) 30%, transparent);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-top: var(--space-4);
  letter-spacing: -0.01em;
}

.section-sub {
  margin-top: var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
}

.section-head--center .section-sub {
  margin-inline: auto;
}

/* =================== Buttons =================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-full);
  white-space: nowrap;
  min-height: 48px;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  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-color: var(--color-border);
}
.btn--ghost:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface-offset);
}

.btn--copper {
  background: var(--color-copper);
  color: var(--color-text-inverse);
}
.btn--copper:hover {
  background: var(--color-copper-hover);
  transform: translateY(-1px);
}

.btn--block {
  width: 100%;
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
}

/* =================== Header =================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.header--hidden {
  transform: translateY(-100%);
}
.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}
.brand__mark {
  width: 36px;
  height: 36px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.brand__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: 0.01em;
  line-height: 1;
}
.brand__word span {
  color: var(--color-copper);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav__links {
  display: flex;
  gap: var(--space-6);
}
.nav__links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}
.nav__links a:hover {
  color: var(--color-text);
}

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

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

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

/* =================== Hero =================== */
.hero {
  padding-top: clamp(var(--space-12), 8vw, var(--space-20));
  padding-bottom: clamp(var(--space-16), 8vw, var(--space-24));
  position: relative;
  overflow: clip;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(var(--space-10), 5vw, var(--space-16));
  align-items: center;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-hero);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin-top: var(--space-5);
  color: var(--color-text);
}
.hero__title em {
  font-style: italic;
  color: var(--color-primary);
}

.hero__sub {
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 46ch;
  line-height: 1.55;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.hero__figure {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 5;
}
.hero__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, oklch(0.15 0.03 60 / 0.55) 100%);
}
.hero__badge {
  position: absolute;
  left: var(--space-5);
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #fff;
}
.hero__badge-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: oklch(1 0 0 / 0.15);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid oklch(1 0 0 / 0.3);
}
.hero__badge-icon svg {
  width: 20px;
  height: 20px;
}
.hero__badge-text {
  font-size: var(--text-xs);
  line-height: 1.35;
}
.hero__badge-text strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
}

/* Trust strip */
.trust {
  margin-top: clamp(var(--space-12), 6vw, var(--space-20));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.trust__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  border-left: 1px solid var(--color-divider);
}
.trust__item:first-child {
  border-left: none;
}
.trust__item svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.trust__item strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.trust__item span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* =================== Reveal animation =================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =================== Tech section =================== */
.tech {
  background: var(--color-surface);
  border-block: 1px solid var(--color-divider);
}
.tech__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(var(--space-10), 5vw, var(--space-16));
  align-items: center;
}
.tech__figure {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.tech__list {
  display: grid;
  gap: var(--space-6);
}
.tech-feature {
  display: flex;
  gap: var(--space-4);
}
.tech-feature__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tech-feature__icon svg {
  width: 24px;
  height: 24px;
}
.tech-feature h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
}
.tech-feature p {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 48ch;
}

/* =================== Craft section =================== */
.craft__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.craft-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
}
.craft-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-copper-highlight);
  color: var(--color-copper);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}
.craft-card__icon svg {
  width: 22px;
  height: 22px;
}
.craft-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  color: var(--color-text);
}
.craft-card p {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* =================== Products =================== */
.products {
  background: var(--color-surface);
  border-block: 1px solid var(--color-divider);
}
.products__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--color-primary) 40%, var(--color-border));
}
.product-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-surface-offset);
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-card:hover .product-card__media img {
  transform: scale(1.05);
}
.product-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.product-card__tag {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.product-card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  color: var(--color-text);
  line-height: 1.25;
}
.product-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex: 1;
}
.product-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.product-card__price {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.product-card__price strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
}
.product-card__cta {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.product-card__cta svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-interactive);
}
.product-card:hover .product-card__cta svg {
  transform: translateX(3px);
}

.products__more {
  margin-top: var(--space-12);
  display: flex;
  justify-content: center;
}

/* =================== Guarantee =================== */
.guarantee__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5) var(--space-10);
}
.check-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.check-item__icon {
  width: 32px;
  height: 32px;
  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;
}
.check-item__icon svg {
  width: 16px;
  height: 16px;
}
.check-item h3 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
}
.check-item p {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* =================== Final CTA =================== */
.cta-banner {
  background: linear-gradient(135deg, var(--color-primary-active), var(--color-primary));
  color: var(--color-text-inverse);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-12), 7vw, var(--space-20));
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 15% 20%, oklch(1 0 0 / 0.12), transparent 40%),
    radial-gradient(circle at 85% 80%, oklch(1 0 0 / 0.1), transparent 45%);
  pointer-events: none;
}
.cta-banner__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-2xl);
  position: relative;
}
.cta-banner__sub {
  margin-top: var(--space-4);
  font-size: var(--text-base);
  color: oklch(from var(--color-text-inverse) l c h / 0.82);
  position: relative;
}
.cta-banner__actions {
  margin-top: var(--space-8);
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  position: relative;
}
.cta-banner .btn--primary {
  background: #fff;
  color: var(--color-primary-active);
}
.cta-banner .btn--primary:hover {
  background: oklch(0.96 0.01 90);
}
.cta-banner .btn--ghost {
  border-color: oklch(1 0 0 / 0.4);
  color: #fff;
}
.cta-banner .btn--ghost:hover {
  background: oklch(1 0 0 / 0.12);
}

/* =================== Footer =================== */
.footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12);
}
.footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer__brand svg {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}
.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer__links {
  display: flex;
  gap: var(--space-6);
}
.footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer__links a:hover {
  color: var(--color-text);
}

/* =================== Responsive =================== */
@media (max-width: 960px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .hero__figure {
    order: -1;
    aspect-ratio: 16 / 10;
  }
  .tech__grid {
    grid-template-columns: 1fr;
  }
  .tech__figure {
    order: -1;
  }
  .craft__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
  .products__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust__item:nth-child(3) {
    border-left: none;
  }
  .trust__item:nth-child(3),
  .trust__item:nth-child(4) {
    border-top: 1px solid var(--color-divider);
  }
}

@media (max-width: 720px) {
  .nav__links {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .craft__grid {
    grid-template-columns: 1fr;
  }
  .products__grid {
    grid-template-columns: 1fr;
  }
  .guarantee__grid {
    grid-template-columns: 1fr;
  }
  .trust {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer__row {
    flex-direction: column;
    align-items: flex-start;
  }
}
