/* ============================================================
   CodeJato Styles — fidelidade visual ao labs.kpacreators.com
   ============================================================ */

@layer reset, base, layout, components, utilities, animations;

/* -------------- Design tokens ----------------------------- */
:root {
  /* Cores brand */
  --orange-500: #F94E03;
  --orange-600: #FF8C00;
  --orange-tint-04: rgba(249, 78, 3, 0.04);
  --orange-tint-08: rgba(249, 78, 3, 0.08);
  --orange-tint-15: rgba(249, 78, 3, 0.15);
  --orange-tint-22: rgba(249, 78, 3, 0.22);
  --orange-tint-30: rgba(249, 78, 3, 0.30);

  /* Neutros */
  --black: #050505;
  --white: #FFFFFF;
  --cream-bg: #FAF8F2;
  --cream2-bg: #F5F0E8;
  --gray-text: #E0E0DA;
  --gray-mute-65: rgba(224, 224, 218, 0.65);
  --gray-mute-40: rgba(224, 224, 218, 0.40);
  --black-mute-65: rgba(0, 0, 0, 0.65);
  --black-mute-40: rgba(0, 0, 0, 0.40);

  /* Cards escuros */
  --card-dark: linear-gradient(145deg, #1E1407, #150E04);
  --card-border-orange: rgba(249, 78, 3, 0.30);

  /* Fontes */
  --font-stack: 'Montserrat', system-ui, -apple-system, sans-serif;

  /* Sombras assinatura (neo-brutalist offset) */
  --shadow-3d-sm: 0 3px 0 var(--black), 0 6px 12px rgba(0, 0, 0, 0.15);
  --shadow-3d-md: 0 4px 0 var(--black);
  --shadow-3d-lg: 0 6px 0 var(--black);

  /* Gradient progress bar */
  --gradient-progress: linear-gradient(90deg, var(--orange-500), var(--orange-600));

  /* Easings */
  --ease-out-soft: cubic-bezier(.22, .61, .36, 1);

  /* Topbar height (compartilhado por scroll-margin e padding) */
  --topbar-h: 4.5rem;
}

html { scroll-padding-top: var(--topbar-h); }
section[id] { scroll-margin-top: var(--topbar-h); }

/* -------------- Reset ------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: var(--font-stack);
    background: var(--white);
    color: #111;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
  }
  img, svg, video { max-width: 100%; height: auto; display: block; }
  a { text-decoration: none; color: inherit; }
  button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
  html, body { overflow-x: hidden; }
  :focus-visible { outline: 2px solid var(--orange-500); outline-offset: 2px; border-radius: 4px; }
}

/* -------------- Base type --------------------------------- */
@layer base {
  .t-hero { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 900; line-height: 1.08; letter-spacing: -0.03em; }
  .t-section { font-size: clamp(1.75rem, 4.2vw, 2.75rem); font-weight: 900; line-height: 1.18; letter-spacing: -0.02em; }
  .t-body { font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.7; }
  .c-orange { color: var(--orange-500); }
  .bg-black { background: var(--black); color: var(--gray-text); }
  .bg-cream { background: var(--cream-bg); }
  .bg-cream2 { background: var(--cream2-bg); }
  .text-center { text-align: center; }
  .section-py { padding: clamp(3rem, 7vw, 5.5rem) 0; }
}

/* -------------- Layout ------------------------------------ */
@layer layout {
  .container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }
  .container-sm { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2rem); }
  .container-md { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2rem); }
  .grid2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
  .grid3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
  @media (min-width: 768px) {
    .grid2 { grid-template-columns: 1fr 1fr; }
    .grid3 { grid-template-columns: repeat(3, 1fr); }
  }
}

/* -------------- Hero specifics --------------------------- */
@layer components {
  #hero {
    position: relative; overflow: hidden;
    background: var(--white);
    padding-top: calc(var(--topbar-h) + 2rem);
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
  }
  .hero-wrap {
    display: grid; grid-template-columns: 1fr;
    gap: 2rem; align-items: center; position: relative;
  }
  @media (min-width: 900px) {
    .hero-wrap { grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
  }
  .hero-text { display: flex; flex-direction: column; gap: 1.4rem; min-width: 0; }
  .hero-logo { display: block; margin-bottom: .25rem; }
  .hero-sub { color: #333; max-width: 580px; }
  .hero-cta-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: .5rem; }
  .hero-micro { font-size: .82rem; color: #666; font-weight: 600; }

  .hero-visual {
    position: relative;
    border: 2px solid var(--black);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-3d-lg);
    background: var(--card-dark);
    overflow: hidden;
    min-height: 320px;
  }
  .hero-visual__bar {
    display: flex; gap: .5rem; padding: .75rem 1rem;
    background: rgba(0,0,0,.4);
    border-bottom: 1px solid rgba(249,78,3,.15);
  }
  .hero-visual__bar span {
    width: 12px; height: 12px; border-radius: 50%;
    background: rgba(255,255,255,.2);
  }
  .hero-visual__bar span:nth-child(1) { background: #FF5F56; }
  .hero-visual__bar span:nth-child(2) { background: #FFBD2E; }
  .hero-visual__bar span:nth-child(3) { background: #27C93F; }
  .hero-visual__code {
    padding: 1.25rem 1.5rem; color: var(--gray-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .85rem; line-height: 1.65;
    white-space: pre-wrap;
  }
  .hero-visual__code .ac { color: var(--orange-500); font-weight: 700; }
  .hero-visual__code .ok { color: #27C93F; font-weight: 700; }
  .hero-visual__code .dim { color: rgba(224,224,218,.45); }
  .hero-visual__code .cursor { animation: cursor-blink 1s steps(2) infinite; }
  .hero-visual__badge {
    position: absolute; bottom: -16px; right: -8px;
    background: var(--orange-500); color: var(--white);
    padding: .65rem 1rem; border: 2px solid var(--black);
    border-radius: .75rem; box-shadow: var(--shadow-3d-md);
    transform: rotate(-3deg);
  }
  .hero-visual__badge strong { display: block; font-size: 1.15rem; font-weight: 900; }
  .hero-visual__badge span { display: block; font-size: .65rem; font-weight: 600; opacity: .9; }
  @keyframes cursor-blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
}

/* -------------- Components -------------------------------- */
@layer components {

  /* Top bar fixo */
  .top-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    padding: 0.75rem clamp(1rem, 3vw, 1.5rem);
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .top-bar__inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  }
  .top-bar__actions {
    display: flex; align-items: center; gap: 0.75rem;
  }
  @media (max-width: 520px) {
    .top-bar__price { display: none; }
  }

  /* Badge 3D (glass + offset shadow) */
  .badge-3d {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--black);
    font-weight: 600; font-size: 0.75rem;
    border-radius: 0.5rem;
    border: 2px solid var(--black);
    box-shadow: var(--shadow-3d-sm);
    pointer-events: auto; white-space: nowrap;
  }
  .top-bar__doc,
  .top-bar__trial {
    background: var(--orange-500);
    color: var(--white);
    font-weight: 800;
    transition: transform 0.15s var(--ease-out-soft), box-shadow 0.15s var(--ease-out-soft);
  }
  .top-bar__doc:hover,
  .top-bar__trial:hover { transform: translateY(2px); box-shadow: 0 1px 0 var(--black), 0 4px 10px rgba(0, 0, 0, 0.15); }
  @media (max-width: 640px) {
    .top-bar__doc { display: none; }
  }
  .badge-3d__icon { display: inline-flex; align-items: center; justify-content: center; }
  .badge-3d__icon svg, .badge-3d__icon img { width: 16px; height: 16px; }

  /* Botão cartoon (CTA principal) */
  .btn-cartoon {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--orange-500); color: var(--white);
    font-weight: 700; font-family: var(--font-stack); font-size: 1rem;
    border-radius: 9999px;
    border: 2px solid var(--black);
    box-shadow: var(--shadow-3d-md);
    cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.02em;
    text-decoration: none;
    transition: transform 0.15s var(--ease-out-soft), box-shadow 0.15s var(--ease-out-soft);
  }
  .btn-cartoon:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--black); }
  .btn-cartoon:active { transform: translateY(4px); box-shadow: 0 0 0 var(--black); }
  .btn-cartoon--full { width: 100%; max-width: 520px; }
  .btn-cartoon--xl { padding: 1.25rem 2.75rem; font-size: 1.125rem; }
  .btn-cartoon--ghost { background: transparent; color: var(--black); }

  /* Cards escuros (pricing) */
  .card-dark {
    background: var(--card-dark);
    border: 2px solid var(--card-border-orange);
    border-radius: 1.5rem;
    padding: 2rem 1.75rem;
    text-align: center; position: relative; overflow: hidden;
  }
  .card-dark--featured {
    border-color: var(--orange-500);
    box-shadow: 0 0 0 4px rgba(249, 78, 3, 0.15), 0 20px 60px rgba(249, 78, 3, 0.25);
    transform: translateY(-8px) scale(1.02);
    z-index: 2;
    position: relative;
  }
  @media (max-width: 767px) {
    .card-dark--featured { transform: none; }
  }

  /* Card light (comparativo not-vs-yes) */
  .card-light {
    flex: 1; min-width: 220px;
    background: rgba(0, 0, 0, 0.04);
    border: 1.5px solid rgba(0, 0, 0, 0.10);
    border-radius: 0.75rem;
    padding: 1.25rem;
  }
  .card-light--accent {
    background: var(--orange-tint-08);
    border-color: var(--orange-tint-30);
    box-shadow: 0 4px 20px rgba(249, 78, 3, 0.08);
  }

  /* Features ticker */
  .features-ticker {
    overflow: hidden; padding: 1rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
  }
  .features-track {
    display: inline-flex; gap: 2rem;
    animation: marquee-left 40s linear infinite;
    white-space: nowrap;
  }
  .features-item { font-weight: 700; font-size: 0.85rem; color: var(--black); }

  /* Trust bar */
  .trust-bar {
    background: var(--black); padding: 0.85rem 0;
    border-top: 1px solid var(--orange-tint-15);
    border-bottom: 1px solid var(--orange-tint-15);
  }
  .trust-bar__inner {
    display: flex; align-items: center; justify-content: center;
    gap: clamp(1.5rem, 4vw, 3rem); flex-wrap: wrap;
  }
  .trust-bar__item { display: flex; align-items: center; gap: 0.45rem; }
  .trust-bar__val { color: var(--orange-500); font-size: 1rem; font-weight: 900; }
  .trust-bar__lbl { color: var(--gray-mute-65); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; }
  .trust-bar__sep { width: 1px; height: 20px; background: var(--orange-tint-22); flex-shrink: 0; }

  /* FAQ */
  .faq-item {
    border: 2px solid var(--black);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    background: var(--white);
    box-shadow: var(--shadow-3d-md);
  }
  .faq-summary {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; cursor: pointer;
    font-weight: 700; font-size: 1rem;
    list-style: none;
  }
  .faq-summary::-webkit-details-marker { display: none; }
  .faq-icon { font-size: 1.5rem; font-weight: 900; color: var(--orange-500); transition: transform 0.2s; }
  details[open] .faq-icon { transform: rotate(45deg); }
  .faq-body { padding: 0 1.25rem 1.25rem; color: var(--black-mute-65); line-height: 1.7; }

  /* Footer */
  .footer {
    background: var(--black); color: var(--gray-text);
    padding: 3rem 1.5rem 2rem; text-align: center;
  }
  .footer__links { display: flex; justify-content: center; gap: 1.25rem; margin-top: 1rem; flex-wrap: wrap; }
  .footer__links a { font-size: 0.875rem; color: var(--gray-mute-65); text-decoration: underline; }
  .footer__links a:hover { color: var(--orange-500); }

  /* Sticky CTA mobile */
  .sticky-cta {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--white); padding: 0.75rem 1rem;
    border-top: 2px solid var(--black);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 40; display: none;
  }
  @media (max-width: 767px) { .sticky-cta.is-visible { display: block; } }

  /* Scroll progress */
  .scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: var(--gradient-progress);
    z-index: 200; pointer-events: none;
    transition: width 0.1s linear;
  }
}

/* -------------- Animations & decorations ------------------ */
@layer animations {
  /* Reveal on scroll — só esconde quando JS está rodando (.js-on no <html>).
     Sem JS: tudo permanece visível. */
  html.js-on .reveal {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
    transition: opacity 0.65s var(--ease-out-soft), transform 0.65s var(--ease-out-soft);
  }
  html.js-on .reveal.is-visible { opacity: 1; transform: translateY(0) scale(1); }

  /* Ambient orbs */
  .ao {
    position: absolute; border-radius: 50%; pointer-events: none;
  }
  @keyframes ao-float-1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
  }
  @keyframes ao-float-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 25px); }
  }
  @keyframes ao-float-3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
  }

  /* Aurora drift (blurred large orbs) */
  @keyframes aurora-drift-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, -40px) scale(1.1); }
  }
  @keyframes aurora-drift-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 30px) scale(0.95); }
  }
  @keyframes aurora-drift-c {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.05); }
  }

  /* Claude Code dancing symbol */
  @keyframes claude-code-dance {
    0%, 100% { transform: translate(0, 24px) rotate(-5deg) scale(1); }
    20% { transform: translate(46px, 70px) rotate(7deg) scale(1.04, 0.96); }
    40% { transform: translate(12px, 132px) rotate(-8deg) scale(0.98, 1.04); }
    60% { transform: translate(74px, 98px) rotate(6deg) scale(1.03, 0.97); }
    80% { transform: translate(28px, 48px) rotate(-4deg) scale(0.99, 1.02); }
  }
  @keyframes claude-code-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 16px 22px rgba(249, 78, 3, 0.22)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 24px 30px rgba(249, 78, 3, 0.34)); }
  }
  .claude-code-symbol {
    position: absolute;
    pointer-events: none;
    transform-origin: center;
    animation: claude-code-dance 2.8s ease-in-out infinite;
  }
  .claude-code-symbol__mark {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
    animation: claude-code-pulse 1.4s ease-in-out infinite;
  }

  /* Price glow */
  @keyframes price-glow {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50%      { text-shadow: 0 0 20px rgba(249, 78, 3, 0.4); }
  }
  .price-glow-anim { animation: price-glow 3s ease-in-out infinite; }

  /* Marquee */
  @keyframes marquee-left {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
  @keyframes marquee-right {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
  }

  /* Section watermark */
  .section-watermark {
    position: absolute;
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.07);
    font-size: clamp(6rem, 18vw, 14rem);
    font-weight: 900;
    pointer-events: none; user-select: none;
    text-transform: uppercase;
    z-index: 0;
  }

  /* Grid overlay */
  .grid-overlay {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
  }
  .grid-overlay--dark {
    background-image:
      linear-gradient(rgba(249, 78, 3, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(249, 78, 3, 0.04) 1px, transparent 1px);
  }

  /* Reduced motion: kill everything */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
  }
}

/* -------------- Utilities --------------------------------- */
@layer utilities {
  .hidden { display: none !important; }
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  .skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--orange-500); color: var(--white);
    padding: 0.5rem 1rem; z-index: 9999;
  }
  .skip-link:focus { top: 0; }
}
