* { box-sizing: border-box; }

/* Native cross-page fade for supporting browsers (Chrome/Edge); browsers
   that don't recognize this at-rule just ignore it - no fallback needed. */
@view-transition {
  navigation: auto;
}

:root {
  --bg: #0a0a0a;
  --text: #f2f2f0;
  --text-muted: #9a9a95;
  --text-faint: #7a7a75;
  --accent: #2ee673;
  --border: #1c1c1a;
  --border-accent: #1f5c3a;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

@media (prefers-reduced-motion: no-preference) {
  /* Powers the "Jump to skills" link's scroll to #skills - falls back to an
     instant jump with no rule needed if the user prefers reduced motion. */
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0 auto;
  font-family: var(--font-sans);
  max-width: 1100px;
  padding: 0 20px;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--text);
}

.hero {
  padding: 44px 0 28px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero {
    animation: hero-in .5s ease both;
  }
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.hero-name {
  margin: 0 0 14px;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.hero-cursor {
  /* A plain inline glyph (not an inline-block box) glued directly after the
     name text with no whitespace in between. Browsers only allow a line
     break at whitespace/word boundaries, so this can never end up alone on
     its own line the way an atomic inline-block could - it always stays
     attached to whichever word precedes it ("Goluboff"), wrapping down
     with it as one unit or overflowing slightly rather than orphaning. */
  color: var(--accent);
  margin-left: 0.04em;
  animation: cursor-blink 1s steps(1) infinite;
}

@media (max-width: 600px) {
  /* At this width "Marcelo Goluboff" wraps across two lines. Reserve room
     for both lines up front so the typing animation - which grows the name
     from a one-line-tall to a two-line-tall state - doesn't reflow the bio/
     contact row underneath as it crosses that threshold. */
  .hero-name {
    min-height: 2.3em;
  }
}

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

.hero-bio {
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-contact, .back-link, .site-footer {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.hero-contact a, .back-link a, .project-links a, .project-attachments a, .project-external-links a,
.contact-btn {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}

.contact-btn {
  font: inherit;
  font-family: var(--font-mono);
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 0;
  cursor: pointer;
}

.hero-contact a:hover, .back-link a:hover, .project-links a:hover, .project-attachments a:hover, .project-external-links a:hover,
.contact-btn:hover {
  border-bottom-color: var(--accent);
}

.resume {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  margin: 0 0 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.resume-thumb {
  position: relative;
  flex-shrink: 0;
  display: block;
  width: 84px;
  aspect-ratio: 612 / 792;
  overflow: hidden;
  border: 1px solid var(--border-accent);
  padding: 0;
  background: #141412;
  cursor: pointer;
}

.resume-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.resume-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(10, 10, 10, 0.75);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity .15s;
}

.resume-thumb:hover .resume-thumb-overlay {
  opacity: 1;
}

.resume-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.resume-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.resume-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.resume-download {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
  font-size: 0.9rem;
  width: fit-content;
}

.resume-download:hover {
  border-bottom-color: var(--accent);
}

.resume-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 4, 0.94);
  align-items: center;
  justify-content: center;
}

.resume-modal.open {
  display: flex;
}

.resume-modal-content {
  width: 90vw;
  height: 90vh;
  max-width: 900px;
}

.resume-modal-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.resume-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  height: 56px;
  font-size: 28px;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  transition: background .15s;
}

.resume-modal-close:hover {
  background: rgba(46, 230, 115, 0.1);
}

.contact-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 4, 0.94);
  align-items: center;
  justify-content: center;
}

.contact-modal.open {
  display: flex;
}

.contact-modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: 36px 44px;
  min-width: 280px;
}

.contact-modal-heading {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact-modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.contact-modal-list a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}

.contact-modal-list a:hover {
  border-bottom-color: var(--accent);
}

.contact-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  height: 56px;
  font-size: 28px;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  transition: background .15s;
}

.contact-modal-close:hover {
  background: rgba(46, 230, 115, 0.1);
}

.info-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 0 32px;
}

.info-section-heading {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.info-section-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-section-items li {
  padding: 5px 12px;
  border: 1px solid var(--border-accent);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.info-section-items--list {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    transition: opacity .6s ease, transform .6s ease;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .project-card, .featured-card, .project-gallery-item, .resume-thumb {
    transition: transform .18s ease, filter .18s ease;
  }

  .project-card:hover, .featured-card:hover, .project-gallery-item:hover, .resume-thumb:hover {
    transform: translateY(-3px);
  }

  .project-card:active, .featured-card:active, .project-gallery-item:active, .resume-thumb:active,
  .lightbox-close:active, .lightbox-prev:active, .lightbox-next:active, .resume-modal-close:active,
  .contact-modal-close:active {
    transform: scale(0.94);
  }
}

.featured {
  margin: 0 0 50px;
}

.featured-terminal {
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  overflow: hidden;
  background: #0d0d0b;
}

.featured-terminal-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #141412;
  border-bottom: 1px solid var(--border-accent);
}

.featured-terminal-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.featured-terminal-dots span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38382f;
}

.featured-terminal-path {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-accent);
}

.featured-card {
  display: block;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
}

.featured-card-img, .featured-card-img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  display: block;
}

.featured-card-img-placeholder {
  background: #141412;
}

.featured-card-body {
  padding: 14px 16px 20px;
}

.featured-card-title {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.featured-card-brief {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.projects {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 10px;
  padding: 0 0 60px;
}

.project-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.project-card:nth-child(5n+1) {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

.project-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: filter .2s;
}

.project-card-img-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: #141412;
}

.project-card:hover .project-card-img {
  filter: brightness(1.12);
}

.project-card-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: rgba(10, 10, 10, 0.72);
  font-size: 0.95rem;
}

.project-card:nth-child(5n+1) .project-card-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.project-card-title::after {
  content: "";
  display: block;
  width: 14px;
  height: 2px;
  background: var(--accent);
  margin-top: 6px;
  transition: width .2s;
}

.project-card:hover .project-card-title::after {
  width: 28px;
}

@media (max-width: 700px) {
  .projects {
    grid-template-columns: repeat(2, 1fr);
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  color: var(--text-faint);
}

.back-link {
  padding: 20px 0 0;
}

.project-header {
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--border-accent);
}

.project-header h1 {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.project-main {
  max-width: 70ch;
  padding: 32px 0 60px;
}

.project-main h2 {
  margin: 44px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-main h2:first-of-type {
  margin-top: 8px;
}

.project-overview-body {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.project-brief {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.project-overview-img, .project-overview-img-placeholder {
  width: 220px;
  max-width: 40%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  display: block;
}

.project-overview-img-placeholder {
  background: #141412;
}

@media (max-width: 600px) {
  .project-overview-body {
    flex-direction: column;
  }

  .project-overview-img, .project-overview-img-placeholder {
    width: 100%;
    max-width: none;
  }
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.project-gallery-item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}

.project-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: filter .2s;
}

.project-gallery-item:hover img {
  filter: brightness(1.12);
}

.project-gallery-item::after {
  content: "⤢";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.7);
  color: var(--text);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity .15s;
}

.project-gallery-item:hover::after {
  opacity: 1;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 4, 0.94);
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  transition: background .15s;
}

.lightbox-close {
  top: 0;
  right: 0;
  width: 56px;
  height: 56px;
  font-size: 28px;
}

.lightbox-prev, .lightbox-next {
  top: 0;
  bottom: 0;
  width: 64px;
  font-size: 36px;
}

.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(46, 230, 115, 0.1);
}

body.lightbox-active {
  overflow: hidden;
}

.project-bullets, .project-links, .project-attachments, .project-external-links {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.project-bullets li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 10px;
  line-height: 1.55;
}

.project-bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-links li, .project-attachments li, .project-external-links li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 8px;
}

.project-links li::before, .project-attachments li::before, .project-external-links li::before {
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 0.9em;
}

.project-links li::before, .project-external-links li::before {
  content: "↗";
}

.project-attachments li::before {
  content: "⬇";
}
