/* ─── NAV ──────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  padding: 12px var(--gutter) 0;
}
.nav__inner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: var(--stage-max);
  height: 56px;
  margin-inline: auto;
  padding-inline: var(--pad-x) 0.5rem;
}
/* The bar background lives on a pseudo-element: backdrop-filter on .nav__inner itself
   would turn it into the containing block of the fixed mobile panel. */
.nav__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  opacity: 0;
  transition: opacity var(--dur-base);
}
.nav.is-scrolled .nav__inner::before { opacity: 1; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--blue), var(--sky));
}
.brand__mark img { width: 90%; height: 90%; }
.brand__name { font-size: var(--fs-base); }

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }
.menu-toggle .icon-close { display: none; }
.nav.is-open .menu-toggle .icon-menu { display: none; }
.nav.is-open .menu-toggle .icon-close { display: block; }

/* Mobile / tablet: links, language and CTA live in a sheet */
.nav__panel {
  position: fixed;
  top: 80px;
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(100svh - 96px);
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--card);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
}
.nav.is-open .nav__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.nav__links a {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.nav__links a[aria-current='true'] { color: var(--accent); }
.nav__panel .lang { align-self: flex-start; }
.nav__panel .btn { align-self: flex-start; }

@media (min-width: 960px) {
  .nav__panel { display: contents; visibility: visible; opacity: 1; transform: none; }
  .brand { margin-right: 0; }
  .menu-toggle { display: none; }
  .nav__links { display: flex; gap: 0.125rem; margin-left: 1.5rem; }
  .nav__links a {
    padding: 0.5rem 0.9rem;
    border: 0;
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
    letter-spacing: 0;
    color: var(--ink-2);
    transition: color var(--dur-fast), background-color var(--dur-fast);
  }
  .nav__links a:hover { color: var(--ink); }
  .nav__links a[aria-current='true'] {
    color: var(--ink);
    background: color-mix(in srgb, var(--ink) 9%, transparent);
  }
  .nav__panel .lang { margin-left: auto; align-self: auto; order: 1; }
  .nav__actions { order: 2; }
  .nav__panel .btn { order: 3; align-self: auto; }
  .nav__inner { gap: 0.75rem; padding-right: 0.5rem; }
}

/* ─── HERO ─────────────────────────────────────────────────── */
.hero { padding: 12px var(--gutter) 0; }

.hero__stage {
  --arch-w: min(72vw, 340px);
  --arch-h: calc(var(--arch-w) * 1.36);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  max-width: var(--stage-max);
  margin-inline: auto;
  padding: calc(68px + 1.25rem) var(--pad-x) 1.75rem;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--stage);
}

.hero__visual { position: relative; height: calc(var(--arch-h) + 2.25rem); }

.hero__ghost {
  position: absolute;
  z-index: 0;
  bottom: calc(var(--arch-h) - 0.42em);  /* lower part hides behind the arch */
  left: 50%;
  translate: -50% 0;
  font-size: min(12vw, 17rem);            /* fallback; js/main.js fits it to the stage */
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: var(--ghost);
  -webkit-mask-image: linear-gradient(180deg, #000 25%, transparent 95%);
  mask-image: linear-gradient(180deg, #000 25%, transparent 95%);
  user-select: none;
  pointer-events: none;
  animation: ghost-in 1.2s var(--ease-out) both;
}

.hero__arch {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: var(--arch-w);
  height: var(--arch-h);
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, var(--arch-top), var(--arch-bottom));
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  animation: arch-in 1.1s var(--ease-out) 0.1s both;
}
.hero__portrait {
  position: absolute;
  bottom: 0;
  left: -11%;
  width: 122%;
  max-width: none;
  height: auto;
}

.pill--a { left: calc(50% - var(--arch-w) / 2 - 1.25rem); top: 52%; rotate: -12deg; animation-delay: 0s; }
.pill--b { right: calc(50% - var(--arch-w) / 2 - 1.25rem); top: 20%; rotate: 10deg; animation-delay: -3.5s; }
.hero__visual .pill { opacity: 0; animation: pill-in 0.7s var(--ease-out) 0.9s forwards, bob 7s ease-in-out 1.6s infinite; }

.hero__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: -1.25rem;
}

.hero__copy > * { animation: rise 0.9s var(--ease-out) both; }
.hero__copy > :nth-child(1) { animation-delay: 0.35s; }
.hero__copy > :nth-child(2) { animation-delay: 0.45s; }
.hero__copy > :nth-child(3) { animation-delay: 0.55s; }
.hero__copy > :nth-child(4) { animation-delay: 0.65s; }
.hero__aside { animation: rise 0.9s var(--ease-out) 0.75s both; }

.hero__hello { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 0.75rem; }
.hero__title {
  font-size: clamp(2.25rem, 9.6vw, 3.75rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.hero__lead {
  max-width: 34rem;
  margin-top: 1.25rem;
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--ink-2);
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 1.75rem; }

.hero__aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
.hero__aside .status { grid-column: 1 / -1; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes arch-in { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }
@keyframes ghost-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes pill-in { from { opacity: 0; scale: 0.7; } to { opacity: 1; scale: 1; } }

@media (min-width: 560px) {
  .hero__aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__aside .stat { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .hero__aside .stat__label { max-width: none; }
}

/* Tablet: bigger arch, copy stays stacked */
@media (min-width: 720px) and (max-width: 1179px) {
  .hero__stage { --arch-w: min(46vw, 380px); border-radius: var(--radius-xl); }
  .hero__visual { height: calc(var(--arch-h) + 3.5rem); }
  .hero__title { font-size: clamp(3rem, 6.6vw, 4.25rem); }
  .pill--a { left: calc(50% - var(--arch-w) / 2 - 2.5rem); }
  .pill--b { right: calc(50% - var(--arch-w) / 2 - 2.5rem); }
}

/* Desktop: reference composition — copy left, arch center, stats right */
@media (min-width: 1180px) {
  .hero__stage {
    --arch-w: clamp(360px, 30vw, 460px);
    justify-content: flex-end;
    min-height: clamp(680px, calc(100svh - 24px), 940px);
    padding-bottom: 2.5rem;
    border-radius: var(--radius-xl);
  }
  .hero__visual { position: absolute; inset: 0; height: auto; }
  .hero__arch { height: var(--arch-h); }
  .pill--a { left: calc(50% - var(--arch-w) / 2 - 4.25rem); top: calc(68px + 4.5rem); }
  .pill--b { right: auto; left: calc(50% + var(--arch-w) / 2 - 2.5rem); top: calc(68px + 9rem); }

  .hero__content {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 0;
  }
  .hero__copy { max-width: calc(50% - var(--arch-w) / 2 - 1.5rem); }
  .hero__title { font-size: clamp(2.25rem, 3.6vw, 4rem); }
  .hero__lead { font-size: var(--fs-base); }
  .hero__aside { display: flex; flex-direction: column; align-items: stretch; width: min(21rem, calc(50% - var(--arch-w) / 2 - 1.5rem)); gap: 0.75rem; }
  .hero__aside .status { align-self: flex-end; }
  .hero__aside .stat { flex-direction: row; align-items: center; }
  .hero__aside .stat__label { max-width: 10rem; }
}

/* ─── ABOUT ────────────────────────────────────────────────── */
.about__statement {
  font-size: var(--fs-2xl);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.04em;
}
.about__cta { margin-top: clamp(1.5rem, 3vw, 2.25rem); }

/* Bento: two text cards side by side (after the reference) */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.bento > .card--wide { grid-column: 1 / -1; }
@media (min-width: 960px) {
  .bento > .card--wide:nth-child(1) { grid-column: 1 / 7; }
  .bento > .card--wide:nth-child(2) { grid-column: 7 / 13; }
}

/* ─── TIMELINE ─────────────────────────────────────────────── */
.timeline { border-bottom: 1px solid var(--line); }
.tl-item {
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
}
.tl-meta { display: flex; flex-direction: column; gap: 0.25rem; }
.tl-date { font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-company { font-weight: 500; }
.tl-role { font-size: var(--fs-lg); letter-spacing: -0.025em; }
.tl-path {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.tl-list { display: grid; gap: 0.75rem; margin-top: 1.25rem; color: var(--ink-2); max-width: 62ch; }
.tl-list li { position: relative; padding-left: 1.5rem; }
.tl-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 0.75rem;
  height: 1px;
  background: var(--ink-3);
}
.tl-stack { margin-top: 0.9rem; font-size: var(--fs-xs); letter-spacing: 0.01em; color: var(--ink-3); }
.tl-item--minor { padding-block: clamp(1.1rem, 2vw, 1.6rem); }
.tl-item--minor .tl-role { font-size: var(--fs-md); }
.tl-item--minor .tl-list { margin-top: 0.5rem; }
.tl-edu-text { color: var(--ink-2); }

/* ─── NAZARIO SISTEMAS ─────────────────────────────────────── */
.nz { padding-block: 0 var(--space-section); }
.panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: var(--stage-max);
  margin-inline: auto;
  padding: clamp(1.75rem, 5vw, 4.5rem);
  border-radius: var(--radius-xl);
  background: var(--stage);
}
.panel__arch {
  position: absolute;
  z-index: -1;
  right: clamp(-6rem, -2vw, 1rem);
  top: 0;
  width: clamp(14rem, 34vw, 30rem);
  height: auto;
  color: var(--line-strong);
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 78%);
}
.nz__top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
}
.nz__title {
  max-width: 16ch;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 1;
}
.nz__lead {
  max-width: 44ch;
  margin-top: 1.5rem;
  font-size: var(--fs-md);
  color: var(--ink-2);
}
.nz__cta { margin-top: clamp(1.75rem, 3vw, 2.5rem); }
.nz__logo {
  justify-self: end;
  width: min(100%);
  aspect-ratio: 5 / 4;
}
.nz__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1rem);
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 860px) {
  .nz__top { grid-template-columns: minmax(0, 1fr); }
  .nz__logo { justify-self: start; width: min(100%); }
  .nz__facts { grid-template-columns: minmax(0, 1fr); }
}

/* ─── PROJECTS ─────────────────────────────────────────────── */
.projects {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}
@media (min-width: 640px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--card);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), box-shadow var(--dur-base), background-color var(--dur-base);
}
.project:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: var(--card-hover);
  box-shadow: var(--shadow-card);
}

/* Cover: gradient tile + arches + icon badge (no screenshots) */
.project__thumb {
  --t1: var(--blue);
  --t2: var(--sky);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(140deg, var(--t1), var(--t2));
  color: #fff;
}
.project__thumb::after { content: ''; position: absolute; inset: 0; background: var(--thumb-overlay); pointer-events: none; }
.project__arches {
  position: absolute;
  left: 50%;
  bottom: -14%;
  translate: -50% 0;
  width: 58%;
  height: auto;
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.5;
  transition: transform 700ms var(--ease-out);
}
.project:hover .project__arches { transform: scale(1.05); }
.project__badge {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 5.25rem;
  height: 5.25rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 500ms var(--ease-out);
}
.project:hover .project__badge { transform: translateY(-3px) scale(1.05); }
.project__icon { width: 2.5rem; height: 2.5rem; color: #fff; stroke-width: 1.5; }
.project__logo { width: auto; height: 2.75rem; }

.project__tags { position: absolute; z-index: 2; top: 1rem; left: 1rem; right: 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project__domain {
  position: absolute;
  z-index: 2;
  left: 1.25rem;
  bottom: 1.1rem;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
}

.project__thumb--a { --t1: #0a3fd6; --t2: #1c8fff; }
.project__thumb--b { --t1: #0632a8; --t2: #4a3cf0; }
.project__thumb--c { --t1: #0a5ec4; --t2: #00b7d6; }
.project__thumb--d { --t1: #06407e; --t2: #00a884; }
.project__thumb--e { --t1: #3a2fd0; --t2: #0097f5; }
.project__thumb--v { --t1: #0f3a56; --t2: #1d6a7c; }   /* Vergi brand navy → teal */

.project__body { display: flex; flex: 1; flex-direction: column; padding: clamp(1.25rem, 2.4vw, 1.75rem); }
.project__name { font-size: var(--fs-lg); letter-spacing: -0.03em; }
.project__role { margin-top: 0.35rem; font-size: var(--fs-sm); color: var(--ink-3); }
.project__desc { margin-top: 0.75rem; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.7; }
.project__tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.25rem; }
.project__tech li {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.project__link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  transition: gap var(--dur-base) var(--ease-out), color var(--dur-fast);
}
.project__link .label { border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.project__link:hover { gap: 0.8rem; color: var(--accent); }
/* The whole card is clickable through this link */
.project__link::after { content: ''; position: absolute; inset: 0; }
.project__link--soon { color: var(--ink-3); }
.project__link--soon .label { border-bottom-color: var(--line); }
.project__link--soon:hover { gap: 0.5rem; color: var(--ink-3); }
.project__link--soon::after { content: none; }

/* ─── STACK (feature panel + bento) ────────────────────────── */
#stack { padding-top: 0; }
.panel--feature {
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--feature-bg);
  color: #fff;
}
.feature__head { max-width: 44rem; margin: 0 auto clamp(2rem, 4vw, 3.5rem); text-align: center; }
.feature__title { font-size: var(--fs-xl); letter-spacing: -0.035em; color: #fff; }
.feature__lead { margin-top: 0.75rem; font-size: var(--fs-md); color: rgba(255, 255, 255, 0.8); }

.bento--stack { margin-top: 0; }
.bento--stack > .bcard { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .bento--stack > .bcard { grid-column: span 6; }
  .bento--stack > .b-lang,
  .bento--stack > .b-arch { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  .bento--stack > .b-lang { grid-column: 1 / 6; grid-row: 1 / 3; }
  .bento--stack > .b-data { grid-column: 6 / 10; grid-row: 1; }
  .bento--stack > .b-cloud { grid-column: 10 / 13; grid-row: 1 / 3; }
  .bento--stack > .b-arch { grid-column: 6 / 10; grid-row: 2; }
  .bento--stack > .b-method { grid-column: 1 / 4; grid-row: 3; }
  .bento--stack > .b-ai { grid-column: 4 / 9; grid-row: 3; }
  .bento--stack > .b-langs { grid-column: 9 / 13; grid-row: 3; }
}

/* ─── CONTACT ──────────────────────────────────────────────── */
.contact { padding-bottom: clamp(3rem, 6vw, 5rem); }
.contact__title {
  max-width: 12ch;
  font-size: clamp(2.5rem, 1.3rem + 5.6vw, 6rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.contact__lead { max-width: 54ch; margin-top: 1.5rem; font-size: var(--fs-md); color: var(--ink-2); }
.contact__email {
  display: inline-block;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  font-size: clamp(1.05rem, 0.4rem + 3.4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  padding-bottom: 0.15em;
  transition: color var(--dur-fast), background-size var(--dur-base) var(--ease-out);
}
.contact__email:hover { color: var(--accent); }
.contact__links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-base) var(--ease-out);
}
.contact__link:hover { border-color: var(--line-strong); color: var(--accent); transform: translateY(-2px); }
.contact__link .icon { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.contact__where { margin-top: 2rem; font-size: var(--fs-sm); color: var(--ink-3); }

/* ─── FOOTER ───────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.footer__top { display: inline-flex; align-items: center; gap: 0.5rem; transition: color var(--dur-fast); }
.footer__top:hover { color: var(--accent); }
