/* REBEL•O — Brand Stylesheet
   "Refined Dark Craftsman" — Linear's precision × Anthropic's warmth
   Colors from brand-guide.md, matched to src/constants/colors.ts */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --orange: #F97316;
  --midnight: #0F172A;
  --slate-dark: #1E293B;
  --snow: #F8FAFC;
  --slate: #64748B;
  --cool-gray: #94A3B8;
  --surface: #F1F5F9;
  --leaf-green: #22C55E;
  --font-brand: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: var(--font-body);
  color: var(--slate-dark);
  line-height: 1.6;
  background: var(--snow);
}

a {
  color: var(--orange);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img, svg {
  max-width: 100%;
  height: auto;
}

/* ── Layout ── */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
  position: relative;
}

.section--midnight {
  background-color: var(--midnight);
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.8' fill='%23F8FAFC' opacity='0.035'/%3E%3C/svg%3E");
  color: var(--snow);
}

.section--surface {
  background: var(--surface);
}

.section--white {
  background: #fff;
}

/* ── Section Transitions ── */

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
  pointer-events: none;
  z-index: 1;
}

.section--culinaria::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0), #0F172A);
  pointer-events: none;
  z-index: 1;
}

/* ── Header / Nav ── */

.header {
  background: var(--midnight);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
  box-shadow: 0 1px 0 var(--slate-dark);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  height: 40px;
  width: auto;
}

.nav__list {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav__link {
  color: var(--cool-gray);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--orange);
  transition: width 0.25s ease, left 0.25s ease;
}

.nav__link:hover {
  color: var(--snow);
  text-decoration: none;
}

.nav__link:hover::after {
  left: 0;
  width: 100%;
}

/* Mobile nav — CSS checkbox hack, zero JS */
.nav-toggle-input {
  display: none;
}

.nav-toggle-label {
  display: none;
  font-size: 1.25rem;
  color: var(--cool-gray);
  cursor: pointer;
  line-height: 1;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--slate-dark);
  border-radius: 6px;
  transition: color 0.2s, border-color 0.2s;
}

.nav-toggle-label:hover {
  color: var(--snow);
  border-color: var(--cool-gray);
}

@media (max-width: 640px) {
  .nav-toggle-label {
    display: block;
  }

  .nav__list {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--midnight);
    border-top: 1px solid var(--slate-dark);
    padding: 1rem 1.5rem;
  }

  .nav__list li {
    padding: 0.75rem 0;
  }

  .nav-toggle-input:checked ~ .nav__list {
    display: flex;
  }
}

/* ── Hero ── */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 6rem 0 5rem;
}

.hero__content {
  max-width: 640px;
}

.hero__eyebrow {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--cool-gray);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: hero-fade-in 0.6s ease-out forwards;
  animation-delay: 0.2s;
}

.hero__title {
  font-family: var(--font-body);
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  color: var(--snow);
  letter-spacing: 4px;
  margin-bottom: 1.25rem;
  line-height: 1.1;
  opacity: 0;
  animation: hero-fade-in 0.6s ease-out forwards;
  animation-delay: 0.3s;
}

.hero__headline {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--snow);
  line-height: 1.5;
  margin-bottom: 1rem;
  max-width: 480px;
  opacity: 0;
  animation: hero-fade-in 0.6s ease-out forwards;
  animation-delay: 0.5s;
}

.hero__subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--cool-gray);
  max-width: 440px;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: hero-fade-in 0.6s ease-out forwards;
  animation-delay: 0.7s;
}

.hero__rule {
  display: block;
  width: 0;
  height: 3px;
  background: var(--orange);
  border: none;
  border-radius: 2px;
  animation: hero-rule-grow 0.5s ease-out forwards;
  animation-delay: 0.9s;
}

/* ── Brand dot pulse ── */

@keyframes brand-dot-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1.2); }
}

.brand-dot {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -0.25em;
  color: var(--orange);
  /* Shift scale origin downward so expansion grows more upward,
     keeping the dot visually centered at max amplitude */
  transform-origin: center 65%;
}

/* Pulse only in hero — about/footer dots stay static */
.hero__title .brand-dot {
  animation: brand-dot-pulse 2.5s ease-in-out 0.9s infinite backwards;
}

/* Glow on dark backgrounds — static text-shadow only (not animated,
   animated text-shadow triggers paint every frame).
   Pulse: 0.4Hz — safe per WCAG 2.3.1 Three Flashes (threshold: 3Hz).
   Infinite auto-play: decorative only. NOT WCAG 2.2.2 compliant
   (would require an explicit in-page pause control — G186).
   Mitigated for motion-sensitive users via prefers-reduced-motion
   (sufficient technique C39 for SC 2.3.3, not 2.2.2). */
.section--midnight .brand-dot,
.footer .brand-dot {
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

/* ── Section headings ── */

.section__title {
  font-family: var(--font-brand);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section__subtitle {
  color: var(--slate);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.section--midnight .section__subtitle {
  color: var(--cool-gray);
}

/* ── Sobre ── */

.sobre__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.sobre__item {
  position: relative;
  padding: 1.5rem;
  padding-left: 1.75rem;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sobre__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  background: var(--orange);
  border-radius: 2px;
}

.sobre__item:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.06);
}

.sobre__item h3 {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.sobre__item p {
  color: var(--slate);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .sobre__grid {
    grid-template-columns: 1fr;
  }
}

/* ── Produtos ── */

.product-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  padding-left: 2.75rem;
  max-width: 520px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid #E2E8F0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  background: var(--orange);
  border-radius: 2px;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 4px 8px rgba(0, 0, 0, 0.06),
    0 16px 32px rgba(0, 0, 0, 0.08);
}

.product-card__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--orange);
  border: 1.5px solid var(--orange);
  border-radius: 100px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1.25rem;
}

.product-card h3 {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.product-card p {
  color: var(--slate);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.product-card__features {
  list-style: none;
  padding: 0;
}

.product-card__features li {
  padding: 0.4rem 0;
  color: var(--slate-dark);
  font-size: 0.95rem;
}

.product-card__features li::before {
  content: '\2713';
  color: var(--orange);
  font-weight: 700;
  margin-right: 0.5rem;
}

/* ── Thermometer (product card) ── */

.thermometer-track {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1.25rem;
}

.thermometer-fill {
  width: 0;
  height: 100%;
  border-radius: 4px;
  /* Cold→hot thermometer: blue→brand orange→red (real thermometer feel,
     same luminance band — all Tailwind 500-weights at ~55% luminance) */
  background: linear-gradient(90deg, #3B82F6, #8B5CF6 30%, #F97316 65%, #EF4444);
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Culinária ── */

.culinaria__text {
  max-width: 640px;
}

.culinaria__text p {
  color: var(--slate);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.culinaria__accent {
  color: var(--leaf-green);
  font-weight: 600;
}

.section--culinaria .section__title {
  border-left: 3px solid var(--leaf-green);
  padding-left: 1rem;
}

/* ── Contacto ── */

.contacto__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.contacto__item h3 {
  font-family: var(--font-brand);
  font-size: 1rem;
  font-weight: 700;
  color: var(--snow);
  margin-bottom: 0.5rem;
}

.contacto__item p,
.contacto__item a {
  color: var(--cool-gray);
  font-size: 0.95rem;
  line-height: 1.7;
}

.contacto__item a:hover {
  color: var(--snow);
}

@media (max-width: 640px) {
  .contacto__grid {
    grid-template-columns: 1fr;
  }
}

/* ── Footer ── */

.footer {
  background: var(--midnight);
  color: var(--cool-gray);
  padding: 2rem 0;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.8;
}

.footer__brand {
  font-family: var(--font-brand);
  font-weight: 700;
  color: var(--snow);
  letter-spacing: 2px;
}

.footer a {
  color: var(--cool-gray);
}

.footer a:hover {
  color: var(--snow);
}

.footer__sep {
  margin: 0 0.4rem;
}

/* ── Legal pages ── */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.legal h1 {
  font-family: var(--font-brand);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.legal .legal__updated {
  color: var(--slate);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.legal h2 {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal p,
.legal li {
  color: var(--slate-dark);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.legal ul,
.legal ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal strong {
  font-weight: 600;
}

.legal__company {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #E2E8F0;
  font-size: 0.9rem;
  color: var(--slate);
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .hero__headline {
    font-size: 1.25rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section__title {
    font-size: 1.5rem;
  }

  .product-card {
    padding: 1.5rem;
    padding-left: 1.75rem;
  }
}

/* ── Animations ── */

/* Hero: staggered fade-in + slide-up on page load (works in all browsers) */
@keyframes hero-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero rule: grows from 0 to 48px */
@keyframes hero-rule-grow {
  from {
    width: 0;
  }
  to {
    width: 48px;
  }
}

/* Thermometer fill: grows from 0 to 72% */
@keyframes thermometer-grow {
  from { width: 0; }
  to   { width: 85%; }
}

/* Section scroll reveals: @keyframes definition (always available) */
@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tier 1 — CSS Scroll-Driven Animations (Chrome/Edge 115+)
   Safari all versions + Firefox stable do NOT support animation-timeline: view() */
@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
  }

  /* Staggered about items — animation-timeline does NOT inherit (MDN: Inherited: no) */
  .sobre__item {
    animation: reveal-in linear both;
    animation-timeline: view();
  }
  .sobre__item:nth-child(1) { animation-range: entry 0% entry 25%; }
  .sobre__item:nth-child(2) { animation-range: entry 3% entry 28%; }
  .sobre__item:nth-child(3) { animation-range: entry 6% entry 31%; }
  .sobre__item:nth-child(4) { animation-range: entry 9% entry 34%; }

  /* Named view timeline on the card — the 6px-tall .thermometer-fill
     element is too small for its own view() timeline (entry range ≈ 6px
     of scroll = instant snap). Track the card instead (≈400px). */
  .product-card {
    view-timeline-name: --card-reveal;
    view-timeline-axis: block;
  }

  .thermometer-fill {
    animation: thermometer-grow linear both;
    animation-timeline: --card-reveal;
    animation-range: entry 80% contain 50%;
    transition: none;
  }
}

/* Tier 2 — Intersection Observer fallback (Safari, Firefox)
   Only hide elements when reduced-motion is NOT preferred (WCAG 2.3.3) */
@supports not (animation-timeline: view()) {
  @media not (prefers-reduced-motion: reduce) {
    .reveal:not(.revealed) {
      opacity: 0;
      transform: translateY(30px);
      transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }
    .revealed {
      opacity: 1;
      transform: translateY(0);
    }

    .revealed .thermometer-fill {
      width: 85%;
    }
  }
}

/* ── Accessibility: reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
