/* ============================================================
   Gabriel Valentoni Guelfi — Portfolio
   Estrutura baseada em me.presentation
   Identidade visual (cores) baseada em old.gvalentoni.dev
   Palette: deep navy/blue-gray backgrounds + electric orange
   ============================================================ */

:root {
  --bg-900: #0d1626;   /* brand-bg-deep */
  --bg-800: #1a2235;   /* brand-bg */
  --bg-700: #1e2c42;   /* brand-bg-card */
  --bg-600: #27374f;

  --orange-500: #f07820;  /* primary */
  --orange-400: #ff9933;  /* accent */
  --orange-300: #ffbf6e;  /* light highlight */
  --orange-dim: #b85810;
  --amber:      #e0a040;  /* secondary */

  --wpp: #25d366;
  --wpp-dark: #1da851;

  --text:        #f4f7fb;
  --text-dim:    #a7b2c5;
  --card-bg:     rgba(30, 44, 66, 0.55);
  --card-border: rgba(240, 120, 32, 0.18);
  --glass-blur:  14px;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.8);
  --maxw: 1180px;

  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, rgba(240, 120, 32, 0.12) 0%, transparent 60%),
              linear-gradient(180deg, var(--bg-900) 0%, var(--bg-800) 40%, var(--bg-900) 100%);
  background-color: var(--bg-900);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- Animated microchip background ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.85;
}
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(240, 120, 32, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 120, 32, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 100%);
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: linear-gradient(180deg, rgba(13, 22, 38, 0.85), rgba(13, 22, 38, 0.35));
  border-bottom: 1px solid var(--card-border);
  transition: background 0.3s ease;
}
.nav.is-scrolled { background: rgba(13, 22, 38, 0.94); }
.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}
.nav__logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}
.nav__name { letter-spacing: 0.2px; }
.nav__links { display: flex; align-items: center; gap: 0.3rem; }
.nav__links > a:not(.nav__cta) {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav__links > a:not(.nav__cta):hover { color: var(--text); background: rgba(240, 120, 32, 0.12); }
.nav__cta { margin-left: 0.4rem; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout ---------- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem);
}
.page--contact { border-top: 1px solid var(--card-border); }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.6rem); }
.grid--two      { grid-template-columns: repeat(2, 1fr); }
.grid--three    { grid-template-columns: repeat(3, 1fr); margin-top: 1.4rem; }
.grid--projects { grid-template-columns: repeat(2, 1fr); margin-top: 1.6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.btn--lg { padding: 0.8rem 1.5rem; font-size: 1.02rem; }
.btn--primary {
  color: #fff;
  background: linear-gradient(120deg, var(--orange-500), var(--orange-400));
  box-shadow: 0 10px 30px -10px rgba(240, 120, 32, 0.7);
}
.btn--primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
/* WhatsApp CTA — orange brand button (same scheme as old.gvalentoni.dev) */
.btn--wpp {
  color: #fff;
  background: linear-gradient(120deg, var(--orange-500), var(--orange-400));
  box-shadow: 0 10px 28px -10px rgba(240, 120, 32, 0.65);
  font-size: 0.86rem;
}
.btn--wpp.btn--lg { font-size: 1rem; }
.btn--wpp:hover { transform: translateY(-2px); filter: brightness(1.08); }
.wpp-icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

/* ---------- Hero ---------- */
.page--hero { padding-top: clamp(2rem, 5vw, 3.5rem); }
.hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.hero__photo {
  position: relative;
  width: 260px;
  height: 260px;
  justify-self: center;
}
.hero__photo-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--orange-500), var(--orange-300), var(--amber), var(--orange-500));
  animation: spin 8s linear infinite;
  filter: blur(2px);
  opacity: 0.85;
}
.hero__photo img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-800);
  box-shadow: var(--shadow);
  background: var(--bg-700);
}
.hero__photo img.is-missing {
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  padding: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero__eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.72rem;
  color: var(--orange-400);
  margin-bottom: 0.6rem;
}
.hero__title {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  line-height: 1.05;
  font-weight: 800;
  background: linear-gradient(120deg, #ffffff 0%, var(--orange-300) 55%, var(--orange-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.8rem;
}
.hero__role { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(240, 120, 32, 0.14);
  border: 1px solid rgba(240, 120, 32, 0.4);
  color: var(--orange-300);
}
.hero__pitch {
  color: var(--text);
  font-size: 1.35rem;
  max-width: 24ch;
  margin-bottom: 1.4rem;
}
.hero__pitch strong {
  color: var(--orange-300);
  font-weight: 800;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 2rem);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange-500), var(--orange-300), transparent);
  opacity: 0.7;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 120, 32, 0.45);
  box-shadow: 0 0 24px rgba(240, 120, 32, 0.25), var(--shadow);
}
.card p { color: var(--text-dim); margin-bottom: 0.9rem; }
.card p:last-child { margin-bottom: 0; }
.card strong { color: var(--text); }

.card__title, .section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.card__idx {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--orange-400);
  border: 1px solid rgba(240, 120, 32, 0.4);
  background: rgba(240, 120, 32, 0.08);
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
}

/* Flow list (process steps) */
.flow {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 1rem;
  counter-reset: step;
}
.flow li {
  position: relative;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 0.35rem 0.7rem 0.35rem 1.5rem;
  background: rgba(13, 22, 38, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}
.flow li::before {
  content: counter(step, decimal-leading-zero);
  counter-increment: step;
  position: absolute;
  left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--orange-400);
}

/* ---------- Serviços ---------- */
.services { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.services li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 0.75rem 1rem;
  background: rgba(13, 22, 38, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.services li:hover {
  border-color: rgba(240, 120, 32, 0.5);
  transform: translateX(4px);
  background: rgba(240, 120, 32, 0.08);
}
.services__icon {
  color: var(--orange-400);
  font-size: 0.85rem;
}

/* ---------- Skills ---------- */
.skills-head { margin-top: 3rem; }
.section-title { font-size: 1.6rem; }
.section-sub { color: var(--text-dim); margin-top: 0.3rem; }

.card--skill { padding-top: 1.4rem; }
.skill-group__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  color: var(--orange-300);
}
.skill-list { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.skill {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.6rem;
  align-items: center;
}
.skill__name { font-size: 0.88rem; font-weight: 500; }
.skill__score {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--orange-400);
  font-weight: 600;
}
.skill__bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(13, 22, 38, 0.8);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.skill__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-500), var(--orange-300));
  box-shadow: 0 0 12px rgba(240, 120, 32, 0.5);
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Projetos ---------- */
.projects__head { margin-bottom: 0.4rem; }
.project-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(240, 120, 32, 0.5);
  box-shadow: 0 0 28px rgba(240, 120, 32, 0.28), var(--shadow);
}
.project-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(240, 120, 32, 0.12), rgba(30, 44, 66, 0.55)),
    var(--bg-700);
  border-bottom: 1px solid var(--card-border);
  overflow: hidden;
}
.project-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.1rem;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.project-card__media img.is-loaded { opacity: 1; }
.project-card__media.is-fallback::after {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 2.6rem;
  color: rgba(255, 191, 110, 0.65);
  letter-spacing: 2px;
}
.project-card__media .media-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 191, 110, 0.12) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.project-card__body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; }
.project-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.project-card__title .arrow { color: var(--orange-400); transition: transform 0.2s; }
.project-card:hover .project-card__title .arrow { transform: translate(2px, -2px); }
.project-card__desc { color: var(--text-dim); font-size: 0.9rem; margin: 0; }
.project-card__tech { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; padding-top: 0.3rem; }
.tech-chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--orange-300);
  background: rgba(240, 120, 32, 0.1);
  border: 1px solid rgba(240, 120, 32, 0.32);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

/* ---------- Contato ---------- */
.contact { max-width: 820px; margin: 0 auto; }
.contact__head { text-align: center; margin-bottom: 2.2rem; }
.contact__head .section-title { justify-content: center; }
.contact__head .section-sub { margin-top: 0.4rem; }
.contact__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2.5vw, 1.4rem);
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.contact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 120, 32, 0.5);
  background: rgba(240, 120, 32, 0.07);
}
.contact-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: var(--orange-400);
  background: rgba(240, 120, 32, 0.1);
  border: 1px solid rgba(240, 120, 32, 0.35);
}
.contact-card__icon svg { width: 24px; height: 24px; }
.contact-card__body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.contact-card__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
}
.contact-card__value { font-weight: 600; font-size: 0.98rem; word-break: break-word; }
.contact-card__cta { margin-left: auto; color: var(--orange-300); font-size: 1.1rem; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 2rem clamp(1rem, 4vw, 2rem);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(13, 22, 38, 0.55);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.footer__contact { font-family: var(--mono); color: var(--orange-300); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive — 3 breakpoints
   ============================================================ */

/* Tablet */
@media (max-width: 960px) {
  .grid--three    { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero__role { justify-content: center; }
  .hero__pitch { margin-left: auto; margin-right: auto; }
}

/* Mobile */
@media (max-width: 640px) {
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.8rem 1rem 1.2rem;
    background: rgba(13, 22, 38, 0.98);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--card-border);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links > a:not(.nav__cta) { padding: 0.7rem 0.9rem; }
  .nav__cta { margin: 0.4rem 0 0; justify-content: center; }
  .nav__toggle { display: flex; }

  .grid--two      { grid-template-columns: 1fr; }
  .grid--three    { grid-template-columns: 1fr; }
  .grid--projects { grid-template-columns: 1fr; }
  .contact__cards { grid-template-columns: 1fr; }
  .hero__photo { width: 200px; height: 200px; }
  .hero__pitch { font-size: 1.2rem; }
  .flow li { font-size: 0.78rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .skill__fill { transition: none; }
}
