/* ==========================================================================
   GIRA Estoque — shared theme layer
   Sits on top of base.css (the existing design tokens + prose styles).
   ========================================================================== */

:root {
  --gira-ink: #14121f;
  --gira-ink-2: #2c2a3d;
  --gira-mute: #5b5c74;   /* 5.4:1 on #ecebf7 */
  --gira-line: #e6e6ef;
  --gira-bg: #ffffff;
  --gira-bg-soft: #f7f6fb;
  --gira-violet: #6b5bd2;
  --gira-violet-deep: #40318f;
  --gira-mint: #0b6e4f;
  --gira-amber: #b5761a;

  /* Gradient interpolation space, unset by default so pre-2024 browsers get a
     plain gradient instead of a syntax error. See visual-effects guidance:
     always keep a non-empty gradient preamble without the token. */
  --in-oklab: ;
  --gira-radius: 16px;
  --gira-wrap: 1120px;
}

@supports (linear-gradient(in oklab, white, black)) {
  :root { --in-oklab: in oklab; }
}

/* The site ships ONE light appearance. It must not follow the operating
   system's dark mode: the palette, the audit box colours and the printed
   screenshots all assume a light ground. Declaring color-scheme: only light
   also stops the browser from auto-darkening form controls and scrollbars. */
:root, body.page { color-scheme: only light; }
html { color-scheme: only light; }

/* Pin form controls and scrollbars to the light theme regardless of OS. */
input, select, textarea, button { color-scheme: only light; }
html { scrollbar-color: #c8c9d8 #f2f2f7; }
::selection { background: color-mix(in srgb, #6b5bd2 26%, #fff); color: #14121f; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.page {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--gira-ink);
  background: var(--gira-bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 .5em;
  font-weight: 800;
  text-wrap: balance;
}

.wrap { width: 100%; max-width: var(--gira-wrap); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a { color: var(--gira-violet-deep); text-underline-offset: .18em; }
a:hover { color: var(--gira-ink); }

/* focus visibility — WCAG 2.4.7 */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--gira-violet);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   header + popover navigation (per navbar guidance)
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, #ffffff 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--gira-line);
}
.header-inner {
  max-width: var(--gira-wrap); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 68px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--gira-ink); }
.brand:hover { color: var(--gira-ink); text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 16px; flex: none;
  background: linear-gradient(135deg, var(--gira-violet), var(--gira-violet-deep));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--gira-violet-deep) 28%, transparent);
}
.brand-text { font-weight: 800; font-size: 1.18rem; letter-spacing: -0.03em; line-height: 1; }
.brand-text small {
  display: block; font-size: .7rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gira-mute); margin-top: 3px;
}

.site-nav { display: contents; }

/* Desktop: inline list, no popover chrome */
.site-menu {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
  position: static; inset: auto; border: 0; background: none;
}
.site-menu li { margin: 0; }
.site-menu a {
  display: inline-block; padding: 8px 12px; border-radius: 9px;
  font-size: .94rem; font-weight: 550; color: var(--gira-ink-2);
  text-decoration: none;
}
.site-menu a:hover { background: var(--gira-bg-soft); color: var(--gira-ink); }
.site-menu a[aria-current="page"] { color: var(--gira-violet-deep); font-weight: 700; }
.site-menu .nav-cta {
  margin-left: 8px; color: #fff; font-weight: 650;
  background: linear-gradient(135deg, var(--gira-violet), var(--gira-violet-deep));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--gira-violet-deep) 26%, transparent);
}
.site-menu .nav-cta:hover { color: #fff; filter: brightness(1.06); }

.menu-button { display: none; }

/* Narrow: the same <ul> becomes a popover anchored under the header. */
@media (max-width: 820px) {
  .menu-button {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 9px 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--gira-line); background: #fff;
    font: inherit; font-size: .92rem; font-weight: 650; color: var(--gira-ink);
  }
  .menu-icon {
    width: 16px; height: 2px; background: currentColor; border-radius: 2px;
    position: relative; display: block;
  }
  .menu-icon::before, .menu-icon::after {
    content: ""; position: absolute; left: 0; width: 16px; height: 2px;
    background: currentColor; border-radius: 2px;
  }
  .menu-icon::before { top: -5px; }
  .menu-icon::after { top: 5px; }

  .site-menu {
    display: block; position: fixed;
    inset: 76px 16px auto 16px;
    max-height: min(70vh, 460px); overflow: auto;
    background: #fff; border: 1px solid var(--gira-line);
    border-radius: 14px; padding: 10px;
    box-shadow: 0 24px 60px rgba(20, 18, 31, .22);
    margin: 0;
  }
  .site-menu a { display: block; padding: 12px 14px; font-size: 1rem; }
  .site-menu .nav-cta { margin: 8px 0 0; text-align: center; }

  /* Animate the popover in with discrete display + overlay transitions.
     `transition-behavior` declared after the shorthand on purpose. */
  .site-menu {
    transition: opacity .18s ease-out, translate .18s ease-out,
                display .18s, overlay .18s;
    transition-behavior: allow-discrete;
    opacity: 0;
    translate: 0 -8px;
  }
  .site-menu:popover-open { opacity: 1; translate: 0 0; }
  @starting-style {
    .site-menu:popover-open { opacity: 0; translate: 0 -8px; }
  }
}

/* backdrop for the popover */
.site-menu::backdrop { background: rgba(20, 18, 31, .28); }

/* --------------------------------------------------------------------------
   buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 11px; font-weight: 650; font-size: .98rem;
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  font-family: inherit;
  transition: translate .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--gira-violet), var(--gira-violet-deep));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--gira-violet-deep) 30%, transparent);
}
.btn-primary:hover {
  color: #fff; translate: 0 -1px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--gira-violet-deep) 36%, transparent);
}
.btn-ghost { border-color: var(--gira-line); color: var(--gira-ink); background: #fff; }
.btn-ghost:hover { background: var(--gira-bg-soft); color: var(--gira-ink); }

/* --------------------------------------------------------------------------
   shared sections
   -------------------------------------------------------------------------- */

section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--gira-bg-soft); border-block: 1px solid var(--gira-line); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .76rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase;
  color: var(--gira-violet-deep);
  background: color-mix(in srgb, var(--gira-violet) 12%, #fff);
  border-radius: 999px; padding: 6px 14px; margin-bottom: 20px;
}
.section-head { max-width: 44em; margin-bottom: 44px; }
.section-head p { color: var(--gira-mute); font-size: 1.07rem; margin: 0; }

.lede { font-size: 1.15rem; color: var(--gira-ink-2); max-width: 34em; }

/* page-head for legal/support */
.page-head {
  padding: clamp(48px, 6vw, 80px) 0 36px;
  background: var(--gira-bg-soft);
  border-bottom: 1px solid var(--gira-line);
}
.page-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); }
.page-head .lede { margin: 0; }
.page-meta { font-size: .9rem; color: var(--gira-mute); margin-top: 14px; }
.crumbs { font-size: .82rem; color: var(--gira-mute); margin: 0 0 14px; }
.crumbs a { color: var(--gira-mute); }

.prose { max-width: 780px; padding: clamp(40px, 5vw, 64px) 0 clamp(60px, 7vw, 88px); }
.prose h2 { font-size: 1.45rem; margin-top: 2.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.06rem; margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose code {
  background: var(--gira-bg-soft); border: 1px solid var(--gira-line);
  border-radius: 5px; padding: 1px 5px; font-size: .88em;
}
.prose-nav { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 2.6em; }

/* responsive tables: keep semantics, scroll instead of squashing
   (per responsive-table guidance) */
.table-wrap { overflow-x: auto; margin: 0 0 1.5em; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: .93rem; margin: 0; }
.prose th, .prose td {
  text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--gira-line);
  vertical-align: top;
}
.prose th {
  background: var(--gira-bg-soft); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gira-mute); font-weight: 700;
}
.prose tbody tr:last-child td { border-bottom: 0; }

.callout {
  background: color-mix(in srgb, var(--gira-violet) 8%, #fff);
  border-left: 3px solid var(--gira-violet);
  border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 0 0 1.6em;
  font-size: .95rem;
}
.callout p:last-child { margin-bottom: 0; }

/* forms */
.form { display: grid; gap: 18px; max-width: 560px; margin-bottom: 2em; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 650; font-size: .9rem; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: .97rem; padding: 12px 13px;
  border: 1px solid #cfd1e1; border-radius: 10px; background: #fff; color: var(--gira-ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field :user-invalid { border-color: #c0392b; }
.hint { font-size: .84rem; color: var(--gira-mute); margin: 0; }
.form-status { font-size: .93rem; margin: 0; min-height: 1.4em; }
.form-status[data-state="ok"] { color: var(--gira-mint); }
.form-status[data-state="err"] { color: #a33; }

/* footer */
.site-footer {
  background: var(--gira-ink); color: #c9cad8;
  padding: 56px 0 28px; font-size: .91rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.7fr 1fr 1fr;
  gap: 36px; padding-bottom: 34px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-brand { color: #fff; }
.footer-brand .brand-text { color: #fff; }
.footer-brand .brand-text small { color: #8f90a6; }
.site-footer p { color: #9b9db1; margin: 16px 0 0; max-width: 32em; }
.footer-col h2 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .12em;
  color: #8f90a6; margin: 0 0 14px; font-weight: 700;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.site-footer a { color: #d6d7e4; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 22px; color: #84869c; font-size: .82rem;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  body.page { font-size: 16px; }
}

/* --------------------------------------------------------------------------
   reduced motion — opt in, never blanket-disable
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .site-menu { transition: opacity .18s ease-out, display .18s, overlay .18s; translate: 0 0; }
  @starting-style { .site-menu:popover-open { opacity: 0; translate: 0 0; } }
}

/* ==========================================================================
   Hero photograph + audit overlay (shared)
   The photo is the LCP element: width/height are declared, fetchpriority=high
   and a tiny inline LQIP fills the box before the file arrives.
   ========================================================================== */

.hero-visual { position: relative; min-width: 0; }

/* A/C/D: widen the image column so the photograph carries the hero */
@media (min-width: 901px) {
  .hero-grid, .hero-c .hero-grid {
    grid-template-columns: .95fr 1.05fr;
    gap: clamp(28px, 4vw, 56px);
  }
}

.audit-frame {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #ecebf4;
  box-shadow:
    0 2px 4px rgba(20,18,31,.06),
    0 18px 44px rgba(20,18,31,.16),
    0 46px 90px -34px color-mix(in srgb, var(--gira-violet-deep) 40%, transparent);
  isolation: isolate;
}

.audit-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1100 / 569;
  object-fit: cover;
  background-repeat: no-repeat;
  background-position: center;
  /* subtle colour grade so the purple overlay reads as a scan, not a sticker */
  filter: saturate(.96) contrast(1.03);
}

/* scan sweep across the shelf, purely decorative */
.audit-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--gira-violet) 22%, transparent) 0%,
    transparent 26%, transparent 74%,
    color-mix(in srgb, var(--gira-violet-deep) 26%, transparent) 100%);
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ---- bounding boxes, positioned over real features in the photo ---- */
.box {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w); height: var(--h);
  translate: -50% -50%;
  border-radius: 4px;
  border: 2px solid var(--box, #fff);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 2px 10px rgba(0,0,0,.25);
  pointer-events: none;
  z-index: 4;
}
.box::after {
  content: attr(data-label);
  position: absolute;
  left: -2px; bottom: 100%;
  margin-bottom: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--box, #fff);
  color: #14121f;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .02em;
  white-space: nowrap;
  line-height: 1.3;
}
.box-ruptura  { --box: #ff2d55; }
.box-fora     { --box: #ffb020; }
.box-perfeito { --box: #34d399; }



/* ---------- legend under/over the audit frame ---------- */
.audit-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 14px 0 0;
  padding: 0;
  font-size: .82rem;
  font-weight: 550;
  color: var(--gira-ink-2);
}
.audit-legend span { display: inline-flex; align-items: center; gap: 6px; }
.audit-legend .dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 2px;
}
.dot-perfeito { background: #34d399; }
.dot-ruptura  { background: #ff2d55; }
.dot-fora     { background: #ffb020; }

@media (max-width: 900px) {
  .audit-legend { font-size: .72rem; gap: 8px 14px; }
}

/* ---------- editorial value list (replaces the icon-card grid) ---------- */
.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 46px;
  border-top: 1px solid var(--gira-line);
}
.value {
  padding: 26px 32px 4px 0;
  border-right: 1px solid var(--gira-line);
}
.value:last-child { border-right: 0; padding-right: 0; }
.value h3 {
  font-size: 1.02rem;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.value p {
  margin: 0;
  font-size: .93rem;
  color: var(--gira-mute);
  max-width: 32ch;
}
@media (max-width: 860px) {
  .values { grid-template-columns: 1fr; border-top: 0; }
  .value {
    border-right: 0;
    border-top: 1px solid var(--gira-line);
    padding: 20px 0 4px;
  }
}

/* ---------- craft-floor corrections ---------- */

/* sections need bottom breathing room, not content flush to the border */
section.hero { padding-bottom: clamp(60px, 8vw, 104px); }

/* the coloured shadow halo is decoration; replace with a neutral depth shadow */
.btn-primary {
  box-shadow: 0 6px 16px rgba(20, 18, 31, 0.18);
}
.btn-primary:hover {
  box-shadow: 0 10px 22px rgba(20, 18, 31, 0.22);
}

/* functional micro-labels: never below 11px */
.brand-text small { font-size: .72rem; }
.page-meta, .hero-note { font-size: .9rem; }



/* ==========================================================================
   Audit callouts — one leader line per verdict, no legend
   Layout rule: the label is clamped inside the frame. A left-side callout puts
   its label to the left but never past the frame edge; a right-side callout
   mirrors it. Labels are short so they fit the width at every breakpoint.
   ========================================================================== */

.audit-frame { position: relative; overflow: hidden; }
.scan { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

.callout {
  position: absolute;
  left: var(--x); top: var(--y);
  width: 0; height: 0;
}

/* marker on the product */
.callout .dot {
  position: absolute;
  left: -4px; top: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid var(--c, #fff);
  background: rgba(0, 0, 0, .55);
  box-shadow: none;
}

/* the leader line */
.callout .line {
  position: absolute;
  top: 0;
  height: 1px;
  width: var(--len, 54px);
  background: var(--c, #fff);
  border: 0;
}

/* the label, clamped to the frame */
.callout .tag {
  position: absolute;
  top: -11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--c, #fff);
  color: #0b0b10;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.35;
  white-space: nowrap;
}

/* left-pointing: line and label extend to the LEFT of the marker */
.callout--left .line { right: 0; }
.callout--left .tag  { right: var(--len, 54px); margin-right: 4px; }

/* right-pointing: line and label extend to the RIGHT of the marker */
.callout--right .line { left: 0; }
.callout--right .tag  { left: var(--len, 54px); margin-left: 4px; }

/* a callout whose label would leave the frame is flipped instead of clipped.
   --flip is set in the markup where needed. */
.callout--flip .line { left: auto; right: 0; }
.callout--flip .tag  { left: auto; right: var(--len, 54px); margin-left: 0; margin-right: 4px; }

/* verdict palette, from the study's own convention */
.callout--conforme { --c: #22c55e; }
.callout--ruptura  { --c: #f5d000; }
.callout--fora     { --c: #ef4444; }
.callout--frente   { --c: #a855f7; }

@media (prefers-reduced-motion: no-preference) {
  .callout { animation: callout-in .5s cubic-bezier(.16,1,.3,1) both; }
  .callout:nth-child(1) { animation-delay: .40s; }
  .callout:nth-child(2) { animation-delay: .80s; }
  .callout:nth-child(3) { animation-delay: 1.20s; }
  .callout:nth-child(4) { animation-delay: 1.60s; }
  @keyframes callout-in {
    from { opacity: 0; scale: .82; }
    to   { opacity: 1; scale: 1; }
  }
}

@media (max-width: 900px) {
  .callout .tag  { font-size: .64rem; padding: 1px 5px; }
  .callout { --len: 34px; }
}
@media (max-width: 620px) {
  /* two lines only: the photo is too small for four labels */
  .callout--conforme, .callout--frente { display: none; }
}

/* callout children are bare boxes: no inherited sizing or fill */
.callout i, .callout b { display: block; margin: 0; padding: 0; }
.callout .line, .callout .dot { box-sizing: border-box; }

/* Hard reset for the callout wrappers.
   They are zero-size anchors on the photograph: any inherited background,
   border or outline turns them into a visible block over the image. */
.callout,
.callout .dot,
.callout .line,
.callout .tag {
  background-clip: border-box;
}
.callout {
  background: none !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: visible;
}
.callout .tag {
  background: var(--c, #fff);
  border: 0;
  outline: 0;
}
