/* ==========================================================================
   MATHEUS FRAZÃO — SITE.CSS
   Camada do portfólio sobre o DS01 (base + animations + components).
   Usa apenas os tokens do :root de base.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. AJUSTES DO DS (resíduos de verde/vermelho da fusão → laranja solar)
   -------------------------------------------------------------------------- */
.btn-primary:hover, .btn-primary.is-hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.nav-status { border-color: var(--border-neon); }
.badge-neon { border-color: var(--border-neon); }
.wagner-header-cta:hover {
  background: var(--accent-soft);
  border-color: var(--border-accent);
  color: var(--accent-primary);
}
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.82rem; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1rem; border-radius: var(--radius-full); }
section[id] { scroll-margin-top: 5.5rem; }

/* 0.1 LOGO MINIMALISTA MF */
.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 4px;
  transition: transform 0.3s var(--spring-stiff);
}
.brand-logo-svg {
  height: 22px;
  width: auto;
  display: block;
}
.nav-brand:hover .brand-logo-wrap {
  transform: translateY(-1px);
}
.nav-brand:hover .brand-logo-svg circle {
  filter: drop-shadow(0 0 6px rgba(254, 135, 1, 0.9));
}

/* Revelação na rolagem: só esconde quando o JS está ativo */
.js .rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--spring-stiff), transform 0.8s var(--spring-stiff);
}
.js .rv.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   1. HERO MINIMALISTA
   -------------------------------------------------------------------------- */
.hero-min {
  padding-top: 1.5rem;
  min-height: 100vh;
  min-height: 100svh;
}
.hero-min .wagner-layer-3 {
  min-height: calc(100vh - 1.5rem);
  min-height: calc(100svh - 1.5rem);
}
.hero-min .wagner-top-bar { margin-bottom: 0; }

.hero-min-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 1.75rem;
}
.hero-min-role {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-sand);
}
.hero-min-scroll {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero-min-scroll:hover { color: var(--accent-primary); }
.hero-min-scroll svg { animation: scrollNudge 2.2s var(--spring-stiff) infinite; }
@keyframes scrollNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* Entrada do nome gigante */
.wagner-display-text { animation: heroNameIn 1.4s var(--spring-stiff) both; }
.wagner-text-stroke { animation-delay: 0.15s; }
@keyframes heroNameIn {
  from { opacity: 0; letter-spacing: 0.04em; }
  to   { opacity: 1; letter-spacing: -0.04em; }
}

/* --------------------------------------------------------------------------
   2. SOBRE O AUTOR
   -------------------------------------------------------------------------- */
.about-section {
  padding: var(--section-pad) 0;
  position: relative;
  background: var(--glow-ambient), var(--bg-base);
}
.about-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.about-photo {
  position: sticky;
  top: 6.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
}
.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 20%;
}
.about-photo figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
}
.about-photo-name {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--text-primary);
}
.about-photo-role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.about-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 0.5rem;
}

/* Texto revelado palavra por palavra */
.reveal-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.reveal-text em { font-style: normal; }
.reveal-text .w {
  color: rgba(238, 228, 213, 0.14);
  transition: color 0.35s ease;
}
.reveal-text .w.on { color: var(--text-primary); }
.reveal-text .w.hl.on { color: var(--accent-primary); }

.about-sign .hero-signature {
  font-size: clamp(2rem, 3vw, 2.6rem);
  color: var(--text-sand);
}
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-subtle);
}
.about-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem 1rem 0 0;
}
.about-stat + .about-stat {
  border-left: 1px solid var(--border-subtle);
  padding-left: 1.25rem;
}
.about-stat strong {
  font-family: var(--font-condensed);
  font-weight: 400;
  font-size: clamp(2.6rem, 4.5vw, 3.8rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.about-stat span {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   3. PORTFÓLIO (ajustes do bento)
   -------------------------------------------------------------------------- */
.bento-section { background: var(--bg-surface); border-top: 1px solid var(--border-subtle); }
.head-aside { color: var(--text-muted); }
.bento-card-info { gap: 1rem; }
.bento-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin-top: 0.25rem;
}
.bento-arrow-btn { flex: none; }
.bento-card-side:hover .bento-arrow-btn,
.bento-card-half:hover .bento-arrow-btn,
.bento-card-large:hover .bento-arrow-btn {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-inverse);
  transform: rotate(45deg);
}
.bento-card-half:hover .bento-thumb-img,
.bento-card-side:hover .bento-thumb-img { transform: scale(1.05); }

.bento-thumb-wrap.thumb-tall { height: clamp(260px, 32vw, 420px); }
.bento-card-side { gap: 0; }
.bento-side-thumb.thumb-fill { flex: 1; min-height: 280px; height: auto; }
.thumb-light { background: #f3f3f1; }
.thumb-glow {
  background: radial-gradient(circle at 50% 45%, var(--accent-shadow-deep) 0%, #000 72%);
}
.thumb-glow .bento-thumb-img { object-fit: contain; padding: 1rem; }

.portfolio-more {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* --------------------------------------------------------------------------
   4. SERVIÇOS
   -------------------------------------------------------------------------- */
.services-section { padding: var(--section-pad) 0; }
.services-intro {
  max-width: 30ch;
  font-size: 1rem;
  text-align: right;
}
.service-list { border-top: 1px solid var(--border-subtle); }
.service-row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  transition: background 0.35s var(--spring-stiff);
}
.service-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent-primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.45s var(--spring-stiff);
}
.service-row:hover { background: var(--accent-soft); }
.service-row:hover::before { transform: scaleY(1); }
.service-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-primary);
}
.service-name {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  transition: transform 0.4s var(--spring-stiff);
}
.service-row:hover .service-name { transform: translateX(6px); }
.service-desc { font-size: 0.98rem; color: var(--text-muted); max-width: 48ch; }
.service-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   5. CONTATO
   -------------------------------------------------------------------------- */
.contact-section {
  padding: var(--section-pad) 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 100%, rgba(254, 135, 1, 0.16) 0%, rgba(12, 15, 20, 0) 55%),
    var(--bg-base);
  border-top: 1px solid var(--border-subtle);
}
.contact-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.contact-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.75rem;
}
.contact-title {
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.contact-title span { color: var(--accent-primary); }
.contact-lead { max-width: 44ch; color: var(--text-muted); }
.contact-email { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-email-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.contact-email code {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--text-warm-bone);
  word-break: break-all;
  user-select: all;
}
.contact-socials { display: flex; gap: 0.75rem; }
.contact-socials img { width: 18px; height: 18px; opacity: 0.85; }
.contact-socials a:hover { border-color: var(--border-accent); }

.contact-form { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 0; }
.contact-form .btn-primary { align-self: flex-start; }
select.form-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select.form-input option { background: var(--bg-surface); color: var(--text-primary); }

/* --------------------------------------------------------------------------
   5.5. BIBLIOTECA DE TOKENS & COMPONENTES (DESIGN SYSTEM HUB)
   -------------------------------------------------------------------------- */
.library-section {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: var(--section-pad) 0;
  background: radial-gradient(circle at 50% 0%, rgba(254, 135, 1, 0.08) 0%, transparent 65%), #0c0f14;
  border-top: 1px solid rgba(254, 135, 1, 0.25);
  position: relative;
  z-index: 10;
}

.library-section .reveal-init,
.library-section .ds-block,
.library-section .library-hero-banner {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.library-hero-banner {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 5rem auto;
}

.library-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  background: rgba(254, 135, 1, 0.12);
  border: 1px solid rgba(254, 135, 1, 0.35);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
}

.library-title {
  color: var(--text-headline) !important;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.library-desc {
  font-size: 1.15rem;
  color: var(--text-sand) !important;
  line-height: 1.7;
}

.ds-block {
  margin-bottom: 5.5rem;
}

.ds-block-title {
  color: var(--text-headline) !important;
}

.colors-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.color-card {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid rgba(216, 198, 177, 0.15) !important;
}

.color-name {
  color: var(--text-headline) !important;
}

.type-row {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid rgba(216, 198, 177, 0.15) !important;
}

.type-preview {
  color: var(--text-headline) !important;
}

.component-grid-box {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid rgba(216, 198, 177, 0.15) !important;
}

/* --------------------------------------------------------------------------
   6. RODAPÉ
   -------------------------------------------------------------------------- */
.ds-footer { padding: 2.5rem 0; border-top: 1px solid var(--border-subtle); }
.footer-sign { font-size: 1.8rem; }

/* Toast (usa o componente .toast-box do DS) */
.toast-box { gap: 0.5rem; }

/* --------------------------------------------------------------------------
   7. RESPONSIVO MOBILE DE ALTA PRECISÃO
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  /* Hero Display Text */
  .wagner-display-text {
    font-size: clamp(3.2rem, 14vw, 7.5rem);
    bottom: 18%;
  }

  /* Dobra 2: Sobre o Autor - No Mobile/Tablet a imagem fica ABAIXO do texto */
  .about-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
  }
  .about-content {
    order: 1;
    width: 100%;
  }
  .about-photo {
    order: 2;
    position: relative;
    top: 0;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
  }

  /* Contato */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  /* Serviços */
  .service-row {
    grid-template-columns: 3rem 1fr;
    row-gap: 0.75rem;
  }
  .service-desc, .service-tags {
    grid-column: 2;
  }
  .service-tags {
    justify-content: flex-start;
  }
}

@media (max-width: 810px) {
  .section-head-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .section-title-large {
    font-size: clamp(1.75rem, 5.5vw, 2.5rem);
    line-height: 1.15;
  }
  .services-intro {
    text-align: left;
    max-width: 100%;
  }
  .bento-grid {
    gap: 1.25rem;
  }
  .bento-side-thumb.thumb-fill {
    min-height: 240px;
  }
}

@media (max-width: 768px) {
  /* Reveal Text no Mobile sem quebras ruins */
  .reveal-text {
    font-size: clamp(1.35rem, 4.5vw, 1.95rem);
    line-height: 1.28;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
    word-break: normal;
  }
  .about-sign .hero-signature {
    font-size: 1.85rem;
  }

  /* Serviços como bloco vertical limpo */
  .service-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 1.5rem 0.5rem;
  }
  .service-num {
    font-size: 0.8rem;
  }
  .service-name {
    font-size: clamp(1.3rem, 4vw, 1.6rem);
    line-height: 1.2;
    transform: none !important;
  }
  .service-desc {
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 100%;
  }
  .service-tags {
    justify-content: flex-start;
    gap: 0.4rem;
    margin-top: 0.25rem;
  }
}

@media (max-width: 600px) {
  /* Navbar Compacta no Mobile */
  .site-header {
    top: 0.75rem;
  }
  .header-container {
    padding: 0 0.75rem;
  }
  .floating-navbar {
    padding: 0.45rem 0.85rem;
  }
  .brand-title {
    font-size: 0.92rem;
    letter-spacing: -0.01em;
  }
  .brand-logo-wrap {
    height: 26px;
    padding: 0 2px;
  }
  .brand-logo-svg {
    height: 18px;
  }
  .nav-status {
    padding: 0.32rem 0.7rem;
    gap: 0.45rem;
  }
  .status-text {
    font-size: 0.72rem;
  }

  /* Hero: Prevenir vazamento horizontal do texto display MATHEUS */
  .hero-min {
    padding-top: 1rem;
  }
  .wagner-top-bar {
    padding: 0;
  }
  .wagner-pill-header {
    padding: 0.35rem 0.75rem;
    gap: 0.5rem;
  }
  .wagner-brand-name {
    font-size: 0.82rem;
  }
  .wagner-header-cta {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }
  .wagner-display-text {
    font-size: clamp(2.35rem, 13vw, 4.2rem);
    bottom: 15%;
    letter-spacing: -0.01em;
    max-width: 100vw;
  }
  .hero-min-foot {
    padding-bottom: 1.25rem;
  }
  .hero-min-role {
    font-size: 0.72rem;
  }
  .hero-min-scroll {
    font-size: 0.72rem;
  }

  /* Estatísticas Sobre o Autor em formato horizontal responsivo */
  .about-stats {
    grid-template-columns: 1fr;
    border-top: 1px solid var(--border-subtle);
  }
  .about-stat {
    padding: 0.9rem 0;
    border-left: none !important;
    border-top: 1px solid var(--border-subtle);
    flex-direction: row;
    align-items: baseline;
    gap: 1.25rem;
  }
  .about-stat:first-child {
    border-top: none;
    padding-top: 0.5rem;
  }
  .about-stat strong {
    font-size: 2.1rem;
    min-width: 4rem;
  }
  .about-stat span {
    font-size: 0.85rem;
    line-height: 1.35;
  }

  /* Bento Cards no Mobile */
  .bento-card-large, .bento-card-side, .bento-card-half {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }
  .bento-project-name {
    font-size: 1.3rem;
  }
  .bento-desc {
    font-size: 0.88rem;
    line-height: 1.5;
  }
  .bento-card-info {
    flex-direction: row;
    align-items: flex-end;
    gap: 0.75rem;
  }
  .bento-card-titles {
    flex: 1;
    min-width: 0;
  }
  .bento-category-tag {
    font-size: 0.7rem;
  }
  .bento-arrow-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
  }
  .bento-thumb-wrap.thumb-tall {
    height: 220px;
  }
  .bento-side-thumb.thumb-fill {
    height: 220px;
    min-height: 220px;
  }
  .bento-card-half .bento-thumb-wrap {
    height: 180px;
  }

  /* Contato Mobile */
  .contact-title {
    font-size: clamp(1.9rem, 6.5vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
    overflow-wrap: break-word;
  }
  .contact-lead {
    font-size: 0.92rem;
    line-height: 1.55;
  }
  .contact-left .btn-lg {
    width: 100%;
    justify-content: center;
  }
  .contact-email-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .contact-email code {
    font-size: 0.85rem;
    text-align: center;
    padding: 0.65rem 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    word-break: break-all;
  }
  .contact-email .btn-sm {
    width: 100%;
    justify-content: center;
  }
  .contact-socials {
    justify-content: flex-start;
    gap: 0.65rem;
  }
  .contact-form.component-grid-box {
    padding: 1.25rem 1rem;
    margin-bottom: 0;
  }
  .contact-form .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* Rodapé Mobile */
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .footer-copy {
    font-size: 0.82rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

