/*
  Sectech V6 - Responsive Cinematic Polish
  Objetivo: proteger o layout em PC, notebook, tablet e celular sem alterar a direção visual aprovada.
*/

:root {
  --safe-x: clamp(1rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 8vw, 7.5rem);
  --section-y-tight: clamp(3rem, 6vw, 5rem);
  --display-max: 7.25rem;
  --display-min: 2.55rem;
  --title-max: 5.1rem;
  --title-min: 2.05rem;
  --copy-size: clamp(1rem, 1.35vw, 1.24rem);
  --copy-line: 1.72;
}

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

body {
  min-width: 320px;
}

svg,
.btn svg,
.icon-box svg,
.mobile-toggle svg,
.mobile-close svg {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

.container {
  width: min(1180px, calc(100% - (var(--safe-x) * 2))) !important;
}

.section {
  padding-block: var(--section-y) !important;
}

.section-tight {
  padding-block: var(--section-y-tight) !important;
}

.section-title,
.hero h1,
main h1,
.card-title,
.case-title,
.brand-name,
.proof-value {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

.section-title,
.hero h1,
main h1 {
  text-wrap: balance;
}

.hero-copy,
.section-subtitle,
.card-text,
.case-body p,
.proof-label,
.footer p {
  text-wrap: pretty;
}

/* Header: presença de marca sem esmagar menu em telas intermediárias */
.header {
  min-height: 76px;
}

.nav {
  min-height: clamp(72px, 6vw, 86px) !important;
  height: auto !important;
  gap: clamp(.65rem, 1.6vw, 1.25rem) !important;
}

.brand {
  min-width: clamp(178px, 20vw, 250px) !important;
  gap: clamp(.65rem, 1vw, .95rem) !important;
  flex: 0 0 auto;
}

.brand-mark {
  width: clamp(50px, 5vw, 64px) !important;
  height: clamp(50px, 5vw, 64px) !important;
  border-radius: clamp(16px, 1.7vw, 22px) !important;
}

.brand-mark img {
  width: 88% !important;
  height: 88% !important;
  object-fit: contain !important;
}

.brand-name {
  display: block;
  font-size: clamp(.92rem, 1.05vw, 1.08rem) !important;
  letter-spacing: clamp(.14em, .8vw, .23em) !important;
  line-height: 1.05;
  white-space: nowrap;
}

.brand-sub {
  display: block;
  font-size: clamp(.55rem, .68vw, .66rem) !important;
  letter-spacing: clamp(.12em, .65vw, .23em) !important;
  white-space: nowrap;
}

.nav-links {
  gap: clamp(.85rem, 1.1vw, 1.45rem) !important;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.nav-links a {
  font-size: clamp(.66rem, .72vw, .78rem) !important;
  letter-spacing: clamp(.11em, .45vw, .18em) !important;
  white-space: nowrap;
}

.nav-actions {
  flex: 0 0 auto;
}

.nav-actions .btn {
  white-space: nowrap;
  padding-inline: clamp(1rem, 1.35vw, 1.35rem) !important;
}

.flag-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  min-height: 40px;
}

.flag-btn img {
  width: 24px !important;
  height: 24px !important;
  object-fit: cover !important;
}

.mobile-toggle,
.mobile-close {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  touch-action: manipulation;
}

.mobile-panel {
  max-width: min(420px, 100vw) !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom)) !important;
}

.mobile-panel.open {
  box-shadow: -28px 0 90px rgba(0, 0, 0, .55), -12px 0 42px rgba(0, 242, 254, .08);
}

.mobile-links a {
  min-height: 54px;
  display: flex !important;
  align-items: center;
}

/* Hero e blocos cinematográficos */
.hero {
  min-height: min(100svh, 980px);
  padding-top: clamp(6rem, 10vw, 9rem) !important;
  padding-bottom: clamp(4rem, 7vw, 6rem) !important;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr) !important;
  gap: clamp(2rem, 4vw, 4.25rem) !important;
}

.hero h1,
main h1[style] {
  font-size: clamp(var(--display-min), 7.4vw, var(--display-max)) !important;
  line-height: .9 !important;
  letter-spacing: clamp(-.065em, -0.8vw, -.035em) !important;
  max-width: 13ch;
}

.hero-copy {
  font-size: var(--copy-size) !important;
  line-height: var(--copy-line) !important;
  max-width: 68ch !important;
}

.kicker {
  max-width: 100%;
  font-size: clamp(.66rem, .8vw, .76rem) !important;
  letter-spacing: clamp(.14em, .95vw, .26em) !important;
  line-height: 1.35;
}

.hero-actions {
  align-items: center;
  gap: clamp(.75rem, 1.5vw, 1rem) !important;
}

.btn {
  min-height: 50px !important;
  padding: .94rem clamp(1.05rem, 2vw, 1.5rem) !important;
  max-width: 100%;
  text-align: center;
}

.hero-proof {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(.7rem, 1.2vw, 1rem) !important;
}

.proof-card {
  min-width: 0;
  padding: clamp(.95rem, 1.6vw, 1.25rem) !important;
}

.proof-value {
  font-size: clamp(1.25rem, 2vw, 1.7rem) !important;
  line-height: 1;
}

.proof-label {
  font-size: clamp(.72rem, .85vw, .82rem) !important;
  line-height: 1.42 !important;
}

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

.visual-shell {
  display: grid;
  place-items: center;
  min-height: clamp(340px, 42vw, 580px);
  padding: clamp(.85rem, 1.5vw, 1.2rem) !important;
}

.hero-media {
  width: 100% !important;
  height: auto !important;
  max-height: clamp(300px, 42vw, 560px) !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: clamp(18px, 2vw, 28px) !important;
}

.visual-shell .hero-media[src$='.jpg'],
.visual-shell .hero-media[src$='.jpeg'],
.visual-shell .hero-media[src*='unsplash'] {
  height: clamp(320px, 42vw, 560px) !important;
  object-fit: cover !important;
}

.holo-panel {
  max-width: min(340px, calc(100% - 24px));
}

.mini-grid {
  min-width: 0;
}

/* Grids responsivos para evitar sobreposição em notebook/tablet */
.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)) !important;
  gap: clamp(1rem, 1.8vw, 1.35rem) !important;
}

.service-card {
  min-height: auto !important;
  padding: clamp(1.2rem, 2.2vw, 1.85rem) !important;
  border-radius: clamp(22px, 2.5vw, 32px) !important;
}

.card-title {
  font-size: clamp(1.32rem, 2vw, 1.7rem) !important;
  line-height: 1.1 !important;
}

.card-text {
  font-size: clamp(.95rem, 1.2vw, 1.02rem);
  line-height: 1.72 !important;
}

.two-col {
  grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr) !important;
  gap: clamp(2rem, 4vw, 4rem) !important;
}

.holo-scene {
  min-height: clamp(420px, 50vw, 560px) !important;
  border-radius: clamp(24px, 3vw, 36px) !important;
}

.scene-wrap {
  inset: 86px 18px 18px !important;
}

.machine-3d {
  width: min(280px, 72vw) !important;
  height: min(250px, 62vw) !important;
}

.case-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)) !important;
  gap: clamp(1rem, 1.8vw, 1.35rem) !important;
}

.case-media {
  height: auto !important;
  aspect-ratio: 16 / 10;
}

.case-media img,
.case-media video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center;
}

.case-body {
  padding: clamp(1.05rem, 2vw, 1.35rem) !important;
}

.tech-cloud {
  gap: clamp(.55rem, 1vw, .85rem) !important;
}

.tech-chip,
.pill {
  white-space: normal;
  text-align: center;
}

.form-grid {
  gap: clamp(.75rem, 1.5vw, 1rem) !important;
}

.field {
  min-height: 52px;
}

textarea.field {
  min-height: 150px !important;
}

.footer-grid {
  grid-template-columns: minmax(280px, 1.35fr) repeat(3, minmax(150px, .7fr)) !important;
}

.table-wrap {
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 780px;
}

pre {
  max-width: 100%;
  overflow: auto;
}

/* Breakpoints de refinamento */
@media (max-width: 1260px) {
  .nav-links {
    gap: .9rem !important;
  }
  .nav-links a {
    letter-spacing: .12em !important;
  }
}

@media (max-width: 1160px) {
  .nav-links,
  .nav-actions .btn {
    display: none !important;
  }
  .mobile-toggle,
  .mobile-close {
    display: inline-flex !important;
  }
  .brand {
    min-width: auto !important;
  }
  .hero-grid,
  .two-col {
    grid-template-columns: 1fr !important;
  }
  .hero-visual {
    order: -1;
    max-width: 780px;
    margin-inline: auto;
    width: 100%;
  }
  .hero h1,
  main h1[style] {
    max-width: 14ch;
  }
  .holo-scene {
    width: 100%;
  }
}

@media (max-width: 920px) {
  :root {
    --safe-x: clamp(.9rem, 4vw, 1.5rem);
    --section-y: 4.5rem;
    --section-y-tight: 3.25rem;
    --display-min: 2.35rem;
    --display-max: 5rem;
  }
  .hero {
    min-height: auto;
    padding-top: 6.2rem !important;
  }
  .hero-proof {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .section-title {
    font-size: clamp(2.05rem, 8vw, 4.4rem) !important;
    line-height: .98 !important;
    letter-spacing: -.05em !important;
  }
  .visual-shell {
    min-height: clamp(300px, 65vw, 480px);
  }
  .hero-media {
    max-height: clamp(280px, 60vw, 480px) !important;
  }
  .holo-panel {
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: .9rem !important;
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 680px) {
  :root {
    --safe-x: 1rem;
    --display-min: 2.25rem;
    --display-max: 3.85rem;
    --copy-size: 1rem;
    --copy-line: 1.68;
  }
  .nav {
    min-height: 72px !important;
  }
  .brand-mark {
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
  }
  .brand-name {
    font-size: .88rem !important;
    letter-spacing: .16em !important;
  }
  .brand-sub {
    display: none !important;
  }
  .nav-actions {
    gap: .5rem !important;
  }
  .flag-btn {
    display: none !important;
  }
  .hero h1,
  main h1[style] {
    font-size: clamp(2.35rem, 13.5vw, 3.8rem) !important;
    line-height: .96 !important;
    letter-spacing: -.045em !important;
    max-width: 100% !important;
  }
  .kicker {
    letter-spacing: .13em !important;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch !important;
  }
  .btn {
    width: 100%;
    min-height: 52px !important;
  }
  .hero-proof {
    grid-template-columns: 1fr !important;
  }
  .proof-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .85rem;
    align-items: center;
  }
  .proof-label {
    margin-top: 0 !important;
  }
  .visual-shell {
    min-height: 280px;
    border-radius: 24px !important;
  }
  .hero-media {
    max-height: 330px !important;
  }
  .mini-grid {
    grid-template-columns: 1fr !important;
  }
  .scene-toolbar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scene-wrap {
    inset: 110px 10px 16px !important;
  }
  .holo-scene {
    min-height: 420px !important;
    padding: 1rem !important;
  }
  .machine-3d {
    transform: scale(.78) rotateX(-16deg) rotateY(33deg) !important;
  }
  .ai-console {
    min-height: 520px !important;
  }
  .chat-form {
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
  }
  .form-grid .span-2 {
    grid-column: auto !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 420px) {
  :root {
    --safe-x: .85rem;
  }
  .brand-name {
    font-size: .78rem !important;
    letter-spacing: .14em !important;
  }
  .brand-mark {
    width: 44px !important;
    height: 44px !important;
  }
  .mobile-toggle,
  .mobile-close {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .hero h1,
  main h1[style] {
    font-size: clamp(2.08rem, 12.5vw, 3.2rem) !important;
  }
  .section-title {
    font-size: clamp(1.85rem, 10vw, 3rem) !important;
  }
  .visual-shell {
    min-height: 245px;
  }
  .hero-media {
    max-height: 280px !important;
  }
  .service-card,
  .case-card,
  form.glass {
    border-radius: 22px !important;
  }
  .scene-toolbar {
    grid-template-columns: 1fr !important;
  }
  .holo-scene {
    min-height: 390px !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .service-card,
  .case-card,
  [data-tilt] {
    transform: none !important;
  }
  .glitch-lite::before,
  .glitch-lite::after {
    display: none;
  }
}

@supports (height: 100svh) {
  .hero {
    min-height: min(100svh, 980px);
  }
}

body.menu-open { overflow: hidden; touch-action: none; }
