/* ============================================
   GRÉGORI CRISPIM — PORTFOLIO
   Dark tech theme with glassmorphism & 3D
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f18;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 212, 255, 0.3);

  --accent-cyan: #00d4ff;
  --accent-purple: #7c3aed;
  --accent-pink: #ec4899;
  --accent-green: #10b981;

  --text-primary: #f0f0f5;
  --text-secondary: #9494a8;
  --text-muted: #5a5a72;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) var(--bg-primary);
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: clip;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

img { max-width: 100%; display: block; }

main {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.container {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 64px);
  box-sizing: border-box;
}

/* ---- Background canvases ---- */
#hero-canvas,
#fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
}

#hero-canvas.is-ready.is-active-bg,
#fx-canvas.is-active-bg {
  opacity: 1;
}

#hero-canvas.is-hidden-bg,
#fx-canvas.is-hidden-bg {
  opacity: 0;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 64px);
  z-index: 100;
  transition: background var(--transition), backdrop-filter var(--transition), border-color var(--transition);
  box-sizing: border-box;
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.nav__logo-bracket { color: var(--accent-purple); }

.nav__logo-cursor {
  color: var(--accent-cyan);
  animation: blink 1s step-end infinite;
  margin: 0 1px;
}

.nav__logo-cursor[hidden] {
  display: none;
}

.nav__links a.active {
  color: var(--accent-cyan);
}

.nav__links a.active::after {
  width: 100%;
}

.nav__links {
  display: flex;
  gap: clamp(16px, 2.5vw, 36px);
  flex-shrink: 0;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transition: width var(--transition);
}

.nav__links a:hover {
  color: var(--text-primary);
}

.nav__links a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  z-index: 101;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transform-origin: center;
  transition: transform var(--transition), opacity var(--transition);
}

.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);
}

.mobile-menu {
  display: flex;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  width: auto;
  max-height: min(70vh, calc(100dvh - var(--nav-height)));
  overflow-y: auto;
  padding: 8px clamp(16px, 4vw, 32px);
  background: rgba(15, 15, 24, 0.96);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px);
  z-index: 99;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-menu a {
  display: block;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 12px 14px;
  border-radius: 10px;
  text-align: left;
  transition: color var(--transition), background var(--transition);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
}

@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: calc(var(--nav-height) + 40px) clamp(16px, 4vw, 64px) 80px;
  z-index: 1;
  box-sizing: border-box;
  overflow-x: clip;
}

.hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "greeting photo"
    "name     photo"
    "role     photo"
    "desc     photo"
    "actions  photo"
    "stats    photo";
  column-gap: clamp(24px, 4vw, 80px);
  row-gap: 0;
  align-items: center;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
}

.hero__greeting { grid-area: greeting; }
.hero__name { grid-area: name; }
.hero__role { grid-area: role; }
.hero__desc { grid-area: desc; }
.hero__actions { grid-area: actions; }
.hero__stats { grid-area: stats; }

.hero__photo {
  grid-area: photo;
  align-self: center;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
  max-width: 100%;
}

.hero__photo-frame {
  position: relative;
  width: clamp(180px, 22vw, 280px);
  max-width: 100%;
  height: fit-content;
  padding: 4px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.2);
  line-height: 0;
}

.hero__photo-frame::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0.25;
  filter: blur(12px);
  z-index: -1;
}

.hero__photo-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 560 / 792;
  object-fit: contain;
  object-position: center center;
  border-radius: 20px;
  background: var(--bg-secondary);
}

.hero__photo-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.hero__photo-handle:hover {
  color: var(--accent-cyan);
}

@media (max-width: 900px) {
  .hero__photo-handle {
    display: none;
  }
}

.hero__greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero__terminal { color: var(--accent-green); margin-right: 8px; }

.hero__name {
  font-size: clamp(2.4rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero__name-line {
  display: block;
  opacity: 0;
  animation: fadeUp 0.8s forwards;
}

.hero__name-line:first-child { animation-delay: 0.4s; }

.hero__name-accent {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation-delay: 0.6s;
}

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--accent-cyan);
  margin-bottom: 20px;
  min-height: 1.6em;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}

.typed-cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent-cyan);
}

.hero__desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: min(640px, 100%);
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.8s 1s forwards;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.8s 1.2s forwards;
}

.hero__stats {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(28px, 4vw, 48px);
  justify-content: flex-start;
  opacity: 0;
  animation: fadeUp 0.8s 1.4s forwards;
  width: auto;
  max-width: 100%;
  min-width: 0;
}

.stat {
  flex: 0 0 auto;
  min-width: 0;
}

.stat__number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.stat__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.stat__label small {
  display: block;
  margin-top: 2px;
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn--primary {
  background: #00bcd4;
  color: #061018;
  border: 1px solid #00bcd4;
  box-shadow: none;
}

.btn--primary:hover:not(:disabled) {
  background: #26c6da;
  border-color: #26c6da;
  color: #061018;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 188, 212, 0.2);
}

.btn--primary:active:not(:disabled) {
  background: #00acc1;
  border-color: #00acc1;
  transform: translateY(0);
  box-shadow: none;
}

.btn--primary:focus-visible {
  outline: 2px solid #80deea;
  outline-offset: 3px;
}

.btn--primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
  background: #3d6d75;
  border-color: #3d6d75;
  color: rgba(6, 16, 24, 0.75);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
}

/* ---- Sections ---- */
.section {
  position: relative;
  padding: clamp(64px, 10vw, 120px) 0;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.section--dark {
  background: var(--bg-secondary);
}

.section__header {
  margin-bottom: 64px;
}

.section__tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-purple);
  display: block;
  margin-bottom: 12px;
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.section__subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 12px;
  max-width: min(640px, 100%);
}

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
}

.about-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 212, 255, 0.08);
}

.about-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.1);
  border-radius: var(--radius);
  margin-bottom: 20px;
  color: var(--accent-cyan);
}

.about-card__icon svg { width: 24px; height: 24px; }

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.about-card strong { color: var(--accent-cyan); }

/* ---- Skills + CPU ---- */
#skills {
  padding-top: 100px;
  padding-bottom: 100px;
}

#skills .section__header {
  margin-bottom: 48px;
}

.skills-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: stretch;
  min-height: 520px;
  width: 100%;
}

.skills-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
}

.skill-group__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.skill-group__top h3 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.skill-group__pct {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.skill-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.skill-group__tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.skill-bar__track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.skill-bar__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 100px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cpu-board {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  overflow: hidden;
}

#cpu-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 480px;
  max-height: 560px;
}

@media (max-width: 1100px) {
  .hero__layout {
    column-gap: clamp(20px, 3vw, 40px);
  }

  .hero__photo-frame {
    width: clamp(160px, 20vw, 240px);
  }
}

@media (max-width: 900px) {
  .skills-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: 0;
  }

  .cpu-board {
    min-height: 300px;
    order: -1;
  }

  #cpu-canvas {
    min-height: 300px;
    max-height: 400px;
  }

  .skills-panel {
    gap: 28px;
  }

  .skill-group__top h3 {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: calc(var(--nav-height) + 32px) clamp(16px, 4vw, 24px) 64px;
    min-height: auto;
  }

  .hero__layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "greeting"
      "name"
      "photo"
      "role"
      "desc"
      "actions"
      "stats";
    text-align: center;
  }

  .hero__photo {
    justify-self: center;
    margin: 8px 0 20px;
  }

  .hero__photo-frame {
    width: min(200px, 52vw);
  }

  .hero__desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .stat {
    flex: 1 1 0;
  }

  .stat__number {
    font-size: 1.35rem;
  }

  .stat__label {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  .portfolio-card__body {
    padding: 16px 18px 20px;
  }

  .about-card,
  .achievement-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .hero__name {
    font-size: clamp(2rem, 12vw, 2.75rem);
  }

  .hero__stats {
    gap: 6px;
  }

  .stat__number {
    font-size: 1.15rem;
  }

  .stat__label {
    font-size: 0.58rem;
    letter-spacing: 0.02em;
  }

  .skill-group__tags span {
    font-size: 0.7rem;
  }
}

/* ---- Portfolio ---- */
.portfolio-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 20px;
}

.portfolio-controls__btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.portfolio-controls__btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.06);
}

.portfolio-controls__btn:active:not(:disabled) {
  transform: scale(0.94);
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.portfolio-controls__btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.portfolio-controls__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--bg-card);
  pointer-events: none;
}

.portfolio-track {
  display: flex;
  gap: clamp(12px, 2vw, 24px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 16px;
  padding: 4px 4px 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) transparent;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.portfolio-track::-webkit-scrollbar { height: 6px; }
.portfolio-track::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 4px;
}

.portfolio-card {
  flex: 0 0 min(560px, calc(100% - 8px));
  max-width: 100%;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .portfolio-card {
    flex-basis: min(560px, calc(50% - 12px));
  }
}

.portfolio-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 16px 48px rgba(0, 212, 255, 0.08);
}

.portfolio-preview--scroll {
  height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0a0a0f;
}

.portfolio-preview__screenshot {
  display: block;
  width: 100%;
  height: auto;
}

.portfolio-preview--iframe {
  height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0a0a0f;
  container-type: inline-size;
}

.portfolio-preview {
  border-bottom: 1px solid var(--border);
  position: relative;
}

.portfolio-preview::after {
  content: 'Role para explorar ↕';
  position: sticky;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid var(--border);
  border-radius: 100px;
  pointer-events: none;
  z-index: 2;
}

.portfolio-preview__frame {
  width: 100%;
  height: calc(2400 * 100cqw / 1280);
  overflow: hidden;
}

.portfolio-preview iframe {
  width: 1280px;
  height: 2400px;
  border: none;
  display: block;
  background: #fff;
  transform: scale(calc(100cqw / 1280px));
  transform-origin: top left;
  pointer-events: none;
}

.portfolio-card__body {
  padding: 20px 24px 24px;
  position: relative;
  z-index: 1;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(10px);
}

.portfolio-card__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.12);
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 10px;
}

.portfolio-card__body h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.portfolio-card__body p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.portfolio-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  transition: gap var(--transition);
}

.portfolio-card__link:hover {
  gap: 10px;
}

/* ---- Journey bento grid ---- */
.journey-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.journey-filters__btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.journey-filters__btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.journey-filters__btn.is-active {
  color: var(--bg-primary);
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.journey-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: stretch;
}

.journey-card {
  grid-column: span 4;
  position: relative;
  min-height: 220px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(15, 15, 24, 0.72);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), opacity 0.35s ease, filter 0.35s ease;
}

.journey-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.journey-card.is-hidden {
  display: none;
}

.journey-card--featured {
  grid-column: span 8;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 320px;
  padding: 0;
}

.journey-card--featured:not(:has(.journey-card__media)) {
  grid-template-columns: 1fr;
  min-height: 0;
  padding: 28px 32px;
  background:
    linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(124, 58, 237, 0.06)),
    var(--bg-card);
  border-color: rgba(0, 212, 255, 0.22);
}

.journey-card--featured:not(:has(.journey-card__media)) .journey-card__body {
  padding: 0;
}

.journey-card--tall {
  grid-row: span 2;
  min-height: 460px;
}

.journey-card--wide {
  grid-column: span 8;
  min-height: 280px;
}

.journey-card--photo {
  padding: 0;
}

.journey-card__media,
.journey-card--photo > img,
.journey-card--featured .journey-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journey-card__media {
  min-height: 220px;
  overflow: hidden;
}

.journey-card--featured .journey-card__media img {
  transition: transform 0.7s ease;
}

.journey-card--featured:hover .journey-card__media img {
  transform: scale(1.04);
}

.journey-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  box-sizing: border-box;
}

.journey-card__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.journey-card__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-purple);
  margin-bottom: 10px;
}

.journey-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.journey-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.journey-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 15, 0.05) 0%,
    rgba(10, 10, 15, 0.35) 40%,
    rgba(10, 10, 15, 0.92) 100%
  );
  transition: background var(--transition);
}

.journey-card--photo:hover .journey-card__overlay {
  background: linear-gradient(
    180deg,
    rgba(10, 10, 15, 0.1) 0%,
    rgba(10, 10, 15, 0.45) 35%,
    rgba(10, 10, 15, 0.96) 100%
  );
}

.journey-card--photo > img {
  position: absolute;
  inset: 0;
  transition: transform 0.7s ease;
}

.journey-card--photo:hover > img {
  transform: scale(1.05);
}

@media (max-width: 1100px) {
  .journey-card,
  .journey-card--featured,
  .journey-card--wide {
    grid-column: span 6;
  }

  .journey-card--featured {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .journey-card--featured .journey-card__media {
    min-height: 220px;
  }

  .journey-card--tall {
    grid-row: span 1;
    min-height: 320px;
  }
}

@media (max-width: 700px) {
  .journey-card,
  .journey-card--featured,
  .journey-card--wide {
    grid-column: span 12;
  }

  .journey-card--tall {
    min-height: 300px;
  }
}

/* ---- Achievements ---- */
#conquistas .section__header {
  text-align: center;
}

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 2vw, 24px);
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: all var(--transition);
  flex: 0 1 min(100%, 260px);
  max-width: 300px;
  width: 100%;
  box-sizing: border-box;
}

.achievement-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.1);
}

.achievement-card__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius);
}

.achievement-card__badge i {
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.achievement-card:hover .achievement-card__badge {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.15);
}

.achievement-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.achievement-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ---- Projects ---- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 2vw, 24px);
  width: 100%;
}

.project-card {
  display: block;
  background: rgba(15, 15, 24, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
  transition: all var(--transition);
  transform-style: preserve-3d;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.project-card:hover {
  border-color: var(--border-hover);
  background: rgba(22, 27, 34, 0.95);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.project-card:hover .project-card__icon {
  color: var(--accent-cyan);
}

.project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.project-card__lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.1);
  padding: 4px 10px;
  border-radius: 100px;
}

.project-card__icon {
  color: var(--text-muted);
  transition: color var(--transition);
  display: flex;
}

.project-card__icon svg { width: 20px; height: 20px; }

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.projects-cta {
  text-align: center;
  margin-top: 48px;
}

/* ---- Contact ---- */
.section--contact {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.contact-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.contact-info,
.contact-terminal {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.contact-info p {
  color: var(--text-secondary);
  margin: 16px 0 32px;
  max-width: min(520px, 100%);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  transition: all var(--transition);
  max-width: min(420px, 100%);
  width: 100%;
}

.contact-link i {
  font-size: 1.25rem;
  color: var(--accent-cyan);
}

.contact-link--wa i {
  color: #25d366;
}

.contact-link:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
  color: var(--accent-cyan);
}

.contact-link--wa:hover {
  border-color: rgba(37, 211, 102, 0.55);
  background: rgba(37, 211, 102, 0.08);
  color: #25d366;
}

/* ---- Terminal ---- */
.terminal {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.terminal__dot--red { background: #ff5f57; }
.terminal__dot--yellow { background: #febc2e; }
.terminal__dot--green { background: #28c840; }

.terminal__title {
  margin-left: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal__body {
  padding: 20px;
  line-height: 1.8;
}

.contact-form {
  position: relative;
  font-family: var(--font-sans);
  line-height: 1.5;
}

.contact-form__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field__label abbr {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 700;
}

.field__input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field__input::placeholder {
  color: rgba(148, 148, 168, 0.55);
}

.field__input:hover {
  border-color: rgba(0, 212, 255, 0.28);
}

.field__input:focus {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
  background: rgba(0, 12, 20, 0.55);
}

.field__input.is-invalid,
.field__input.is-invalid:focus {
  border-color: rgba(255, 95, 87, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 95, 87, 0.14);
}

.field__input.is-valid:not(:focus) {
  border-color: rgba(16, 185, 129, 0.45);
}

.field__error {
  min-height: 1.05em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.35;
  color: #ff8a82;
}

.field__input--area {
  resize: vertical;
  min-height: 110px;
  line-height: 1.55;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.contact-form__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 36px;
}

.contact-form__submit {
  flex-shrink: 0;
  min-width: 196px;
}

.contact-form.is-sending .contact-form__submit {
  cursor: wait;
  opacity: 0.8;
}

.contact-form__spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.contact-status {
  min-height: 1.4em;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.contact-status[data-state="success"] {
  color: var(--accent-green);
}

.contact-status[data-state="error"] {
  color: #ff8a82;
}

.contact-status[data-state="pending"] {
  color: var(--accent-cyan);
}

/* ---- Toast ---- */
.toast-stack {
  position: fixed;
  top: calc(var(--nav-height) + clamp(12px, 2vw, 20px));
  right: clamp(16px, 3vw, 28px);
  bottom: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(10, 16, 14, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.45;
  pointer-events: auto;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast.is-leaving {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
}

.toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--accent-green);
  font-size: 1.25rem;
  line-height: 1;
}

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--accent-green);
}

.toast__message {
  color: var(--text-secondary);
}

.toast__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}

.toast__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.toast__close:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.2s ease;
    transform: none;
  }

  .toast.is-visible,
  .toast.is-leaving {
    transform: none;
  }
}

.contact-form.is-success {
  animation: uplinkFlash 0.7s ease;
}

@keyframes uplinkFlash {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.18); }
  100% { filter: brightness(1); }
}

@media (min-width: 901px) {
  .contact-wrapper {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
  }

  .contact-form__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .contact-info p {
    max-width: 100%;
    margin: 12px 0 24px;
  }

  .contact-links,
  .contact-link {
    width: 100%;
    max-width: 100%;
  }

  .contact-link {
    padding: 14px 16px;
  }

  .terminal__bar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .terminal__title {
    font-size: 0.68rem;
  }

  .contact-form__footer {
    flex-direction: column;
    align-items: stretch;
    margin-top: 20px;
  }

  .contact-form__submit {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .field__input {
    font-size: 16px;
  }

  .terminal__body {
    padding: 14px;
  }
}

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 1;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
  margin-top: 12px;
}

.footer__links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--accent-cyan);
}

/* ---- Reveal Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ---- Keyframes ---- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- Tilt cards ---- */
.tilt-card {
  transition: transform 0.1s ease;
  will-change: transform;
}

/* ---- Selection ---- */
::selection {
  background: rgba(0, 212, 255, 0.3);
  color: var(--text-primary);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent-cyan), var(--accent-purple));
  border-radius: 4px;
}
