/* ------------------------------------------------------------------
   Thiago Zanluca · Portfolio
   ------------------------------------------------------------------ */

:root {
  --bg: #0a0908;
  --bg-elevated: #131110;
  --ink: #fafaf7;
  --ink-muted: #a8a39a;
  --ink-dim: #6e6962;
  --accent: #ff5e1a;
  --accent-soft: #ff8a55;
  --accent-glow: rgba(255, 94, 26, 0.18);
  --border: rgba(250, 250, 247, 0.08);
  --border-strong: rgba(250, 250, 247, 0.16);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;

  --max-w: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Subtle radial backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255, 94, 26, 0.08), transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(255, 94, 26, 0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Cursor glow ------------------------------------------------- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
  mix-blend-mode: screen;
  filter: blur(40px);
}

body.cursor-active .cursor-glow {
  opacity: 1;
}

/* Grain texture ----------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Layout primitives ------------------------------------------- */
main {
  position: relative;
  z-index: 5;
}

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: clamp(3rem, 7vw, 5rem);
  max-width: 56rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.section-title {
  font-size: clamp(2rem, 5.5vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink);
}

.section-sub {
  margin-top: 1.5rem;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--ink-muted);
  max-width: 40rem;
  line-height: 1.6;
}

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent-soft);
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-soft);
}

strong {
  font-weight: 600;
  color: var(--ink);
}

/* Navigation -------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  background: rgba(10, 9, 8, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 9, 8, 0.85);
}

.logo {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}

.logo-dot {
  color: var(--accent);
}

.nav nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
}

.nav nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.25s var(--ease-out);
}

.nav nav a:hover {
  color: var(--ink);
}

.nav-cta {
  color: var(--ink) !important;
  border: 1px solid var(--border-strong);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: all 0.25s var(--ease-out) !important;
}

.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg) !important;
}

@media (max-width: 640px) {
  .nav nav a:not(.nav-cta) {
    display: none;
  }
}

/* Hero -------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem var(--gutter) 6rem;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}

.hero-inner {
  width: 100%;
}

.overline {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: clamp(2rem, 5vw, 3rem);
  display: inline-flex;
  align-items: center;
}

.overline::before {
  content: '';
  display: inline-block;
  width: 2.5rem;
  height: 1px;
  background: var(--accent);
  margin-right: 1rem;
}

.hero-title {
  font-size: clamp(2.75rem, 10.5vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--ink);
}

.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--ink-muted);
  max-width: 38rem;
  line-height: 1.55;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: all 0.3s var(--ease-out);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary svg {
  transition: transform 0.3s var(--ease-out);
}

.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px -8px var(--accent-glow);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(250, 250, 247, 0.04);
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: var(--gutter);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scroll-line {
  width: 3rem;
  height: 1px;
  background: var(--ink-dim);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: var(--accent);
  animation: scroll-pulse 2.4s var(--ease-out) infinite;
}

@keyframes scroll-pulse {
  0%   { left: -50%; }
  100% { left: 100%; }
}

/* About ------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

@media (max-width: 880px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-text p {
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-weight: 300;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-lead {
  color: var(--ink) !important;
  font-weight: 400 !important;
}

.about-stats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-stats li {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.about-stats li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.about-stats strong {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.about-stats strong small {
  font-size: 0.5em;
  vertical-align: super;
}

.about-stats span {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* Services ---------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}

.service {
  background: var(--bg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  transition: background 0.4s var(--ease-out);
  position: relative;
  min-height: 18rem;
  display: flex;
  flex-direction: column;
}

.service::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}

.service:hover {
  background: var(--bg-elevated);
}

.service:hover::before {
  opacity: 1;
}

.service-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 2.5rem;
  display: block;
  font-variant-numeric: tabular-nums;
}

.service h3 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
  color: var(--ink);
  line-height: 1.25;
}

.service p {
  font-size: 0.95rem;
  color: var(--ink-muted);
  line-height: 1.6;
  font-weight: 300;
  margin-top: auto;
}

/* Timeline ---------------------------------------------------- */
.timeline {
  list-style: none;
  max-width: 50rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: clamp(1rem, 3vw, 3rem);
  padding: clamp(1.75rem, 3vw, 2.5rem) 0;
  border-top: 1px solid var(--border);
  align-items: start;
  transition: padding-left 0.4s var(--ease-out);
}

.timeline li:hover {
  padding-left: 1rem;
}

.timeline li:last-child {
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.time {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent);
  padding-top: 0.25rem;
  letter-spacing: 0.005em;
}

.role h3 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.role p {
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  font-weight: 300;
  max-width: 36rem;
}

/* Contact ----------------------------------------------------- */
.contact {
  padding-top: clamp(6rem, 14vw, 10rem) !important;
  padding-bottom: clamp(6rem, 14vw, 10rem) !important;
}

.contact-inner {
  text-align: center;
  max-width: 56rem;
  margin: 0 auto;
}

.contact .section-tag {
  display: inline-block;
}

.contact-title {
  font-size: clamp(2.25rem, 7vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin-bottom: 2rem;
}

.contact-lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-muted);
  max-width: 36rem;
  margin: 0 auto clamp(3rem, 6vw, 4.5rem);
  line-height: 1.6;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  text-align: left;
}

.contact-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.3s var(--ease-out);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
  pointer-events: none;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.contact-card:hover::before {
  opacity: 1;
}

.contact-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.contact-card strong {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.contact-arrow {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  color: var(--ink-dim);
  font-size: 1.1rem;
  transition: all 0.3s var(--ease-out);
}

.contact-card:hover .contact-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* Footer ------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem var(--gutter);
  position: relative;
  z-index: 5;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer p {
  font-size: 0.825rem;
  color: var(--ink-dim);
  letter-spacing: 0.01em;
}

.footer-sig {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-muted) !important;
}

/* Reveal animation ------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.services-grid .service.reveal:nth-child(2) { transition-delay: 0.06s; }
.services-grid .service.reveal:nth-child(3) { transition-delay: 0.12s; }
.services-grid .service.reveal:nth-child(4) { transition-delay: 0.18s; }
.services-grid .service.reveal:nth-child(5) { transition-delay: 0.24s; }
.services-grid .service.reveal:nth-child(6) { transition-delay: 0.30s; }

.about-stats li.reveal:nth-child(2) { transition-delay: 0.10s; }
.about-stats li.reveal:nth-child(3) { transition-delay: 0.20s; }

.timeline li.reveal:nth-child(2) { transition-delay: 0.08s; }
.timeline li.reveal:nth-child(3) { transition-delay: 0.16s; }
.timeline li.reveal:nth-child(4) { transition-delay: 0.24s; }

.contact-grid .contact-card.reveal:nth-child(2) { transition-delay: 0.08s; }
.contact-grid .contact-card.reveal:nth-child(3) { transition-delay: 0.16s; }
.contact-grid .contact-card.reveal:nth-child(4) { transition-delay: 0.24s; }

/* Hero auto-reveal on load */
.hero .reveal:nth-child(1) { animation: heroReveal 1s var(--ease-out) 0.15s forwards; }
.hero .reveal:nth-child(2) { animation: heroReveal 1.1s var(--ease-out) 0.30s forwards; }
.hero .reveal:nth-child(3) { animation: heroReveal 1s var(--ease-out) 0.55s forwards; }
.hero .reveal:nth-child(4) { animation: heroReveal 1s var(--ease-out) 0.75s forwards; }

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion */
@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; transform: none; }
  .cursor-glow { display: none; }
}
