/* Vinicius Cruz — developer portfolio
   Light by default, dark via [data-theme="dark"]. Toggle in app.js. */

:root {
  --bg:        #fbfaf7;
  --surface:   #ffffff;
  --surface-2: #f4f2ec;
  --text:      #17171a;
  --muted:     #605f5a;
  --faint:     #8f8d86;
  --border:    #e7e4dc;
  --accent:    #0f8a5f;   /* emerald */
  --accent-ink:#0b6b49;
  --shadow:    0 1px 2px rgba(20,20,20,0.04), 0 12px 30px rgba(20,20,20,0.06);
  --shadow-sm: 0 1px 2px rgba(20,20,20,0.05);

  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --display: "Bricolage Grotesque", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --pad: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1120px;
}

[data-theme="dark"] {
  --bg:        #0f1115;
  --surface:   #171a20;
  --surface-2: #1d2129;
  --text:      #e9e8e4;
  --muted:     #a3a29b;
  --faint:     #6f6e68;
  --border:    #272b33;
  --accent:    #3ddc97;
  --accent-ink:#7cf0bc;
  --shadow:    0 1px 2px rgba(0,0,0,0.4), 0 16px 36px rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.06; }

a { color: inherit; }

.skip-link {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--text); color: var(--bg); padding: 0.5rem 1rem; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 0.5rem; }

/* ---- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--text); color: var(--bg);
  font-family: var(--sans); font-weight: 600; font-size: 0.92rem;
  padding: 0.7rem 1.25rem; border-radius: 999px;
  text-decoration: none; border: 1px solid var(--text);
  transition: transform 0.18s, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--text); }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn--lg { padding: 0.9rem 1.8rem; font-size: 1.05rem; font-family: var(--mono); }

/* ---- Nav ----------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 600; }
.nav__mark {
  font-family: var(--display); font-weight: 700;
  background: var(--accent); color: #fff;
  width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 8px; font-size: 0.8rem;
}
[data-theme="dark"] .nav__mark { color: #0f1115; }
.nav__name { letter-spacing: -0.01em; }
.nav__links { display: flex; gap: 1.6rem; }
.nav__links a { text-decoration: none; color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
  display: grid; place-items: center;
  width: 2.2rem; height: 2.2rem; border-radius: 999px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); cursor: pointer; transition: border-color 0.2s, transform 0.18s;
}
.theme-toggle:hover { border-color: var(--text); transform: translateY(-1px); }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ---- Layout -------------------------------------------------------------- */

main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

.section { padding: clamp(3.5rem, 9vh, 6.5rem) 0; border-top: 1px solid var(--border); }
.section__head { margin-bottom: 2.5rem; }
.section__kicker {
  font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent-ink); display: block; margin-bottom: 0.9rem;
}
.section__head h2 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); margin: 0; max-width: 20ch; }

/* ---- Hero ---------------------------------------------------------------- */

.hero {
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 8vh, 6rem) 0 clamp(2.5rem, 6vh, 4rem);
}

.badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  padding: 0.35rem 0.75rem; border-radius: 999px; margin: 0 0 1.5rem;
}
.badge__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.eyebrow {
  font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent-ink); margin: 0 0 1rem;
}
.eyebrow span { color: var(--faint); margin: 0 0.35em; }

.hero h1 { font-size: clamp(2.6rem, 1.6rem + 4.6vw, 4.8rem); margin: 0 0 1.4rem; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lead { color: var(--muted); font-size: clamp(1.05rem, 1rem + 0.4vw, 1.2rem); max-width: 46ch; margin: 0 0 2rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.8rem; }

.social { display: flex; gap: 0.6rem; list-style: none; margin: 0; padding: 0; }
.social a {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.18s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.hero__photo { position: relative; justify-self: center; }
.photo-ring {
  width: clamp(200px, 30vw, 320px); aspect-ratio: 1; border-radius: 50%;
  padding: 6px; background: linear-gradient(140deg, var(--accent), transparent 60%);
  box-shadow: var(--shadow);
}
.photo-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; border: 4px solid var(--bg); }
.photo-badge {
  position: absolute; bottom: 0.6rem; right: -0.4rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: 0.78rem; font-weight: 500; padding: 0.45rem 0.8rem; border-radius: 999px;
}

/* ---- Stats --------------------------------------------------------------- */

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  margin-bottom: 1rem;
}
.stat { background: var(--surface); padding: clamp(1.2rem, 3vw, 2rem); }
.stat__num { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 1rem + 3vw, 2.8rem); letter-spacing: -0.03em; }
.stat__num span { color: var(--accent); }
.stat__label { color: var(--muted); font-size: 0.82rem; }

/* ---- Cards --------------------------------------------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.6rem; box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card h3 { font-size: 1.2rem; margin: 0 0 1rem; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  font-family: var(--mono); font-size: 0.76rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 0.28rem 0.6rem;
}
.tags--sm li { font-size: 0.72rem; padding: 0.22rem 0.5rem; }

.skills__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }

/* ---- Experience timeline ------------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.tl {
  display: grid; grid-template-columns: 12rem 1fr; gap: 1rem 2rem;
  padding: 1.8rem 0; border-top: 1px solid var(--border);
}
.tl:first-child { border-top: none; }
.tl__meta { display: flex; flex-direction: column; gap: 0.35rem; }
.tl__date { font-family: var(--mono); font-size: 0.85rem; color: var(--text); }
.tl__domain {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent-ink); align-self: start;
  background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 0.15rem 0.5rem; border-radius: 6px;
}
.tl__body h3 { font-size: 1.25rem; margin: 0 0 0.6rem; }
.tl__body h3 span { color: var(--muted); font-weight: 500; }
.tl__body p { margin: 0 0 0.9rem; color: var(--muted); max-width: 62ch; }

/* ---- Projects ------------------------------------------------------------ */

.projects__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.project__type {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent-ink); display: block; margin-bottom: 0.6rem;
}
.project p { color: var(--muted); margin: 0 0 1.1rem; }

/* ---- Contact ------------------------------------------------------------- */

.contact { border-bottom: 1px solid var(--border); }
.contact__inner { text-align: center; max-width: 40ch; margin: 0 auto; }
.contact__inner .section__kicker { display: inline-block; }
.contact__inner h2 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3.2rem); margin: 0 0 1rem; }
.contact__inner > p { color: var(--muted); margin: 0 auto 2rem; }
.contact__links { list-style: none; display: flex; justify-content: center; gap: 1.5rem; margin: 1.8rem 0 0; padding: 0; }
.contact__links a { text-decoration: none; color: var(--muted); font-family: var(--mono); font-size: 0.9rem; transition: color 0.2s; }
.contact__links a:hover { color: var(--accent); }

/* ---- Footer -------------------------------------------------------------- */

.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 2rem var(--pad) 3rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  color: var(--faint); font-size: 0.8rem;
}

/* ---- Focus / a11y -------------------------------------------------------- */

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px;
}

/* ---- Reveal -------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 860px) {
  .nav__links { display: none; }
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero__photo { order: -1; justify-self: start; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tl { grid-template-columns: 1fr; gap: 0.5rem; }
  .tl__meta { flex-direction: row; align-items: center; gap: 0.8rem; }
}

@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .about__meta { flex-direction: column; }
}

.about__body p { max-width: 64ch; color: var(--muted); }
.about__body p:first-child { color: var(--text); font-size: 1.15rem; }
.about__meta { display: flex; gap: 1.5rem 2.5rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); margin-top: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover, .social a:hover, .theme-toggle:hover { transform: none; }
}
