/* ============================================================
   Luiz Roberto Dendena — Personal Site
   Visual: ink + mint + copper (not purple, not cream)
   ============================================================ */

:root {
  --bg: #070b10;
  --bg-2: #0c1219;
  --bg-elev: #111820;
  --ink: #eef3f8;
  --muted: #8b9aab;
  --faint: #5a6a7c;
  --line: rgba(238, 243, 248, 0.08);
  --line-strong: rgba(238, 243, 248, 0.16);
  --mint: #5dffb0;
  --mint-dim: rgba(93, 255, 176, 0.14);
  --copper: #e8a06a;
  --copper-dim: rgba(232, 160, 106, 0.15);
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 1.25rem;
  --nav-h: 4.5rem;
  --max: 1120px;
  --cursor-size: 40px;
}

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

html {
  scroll-behavior: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--mint) var(--bg);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

body.is-loading {
  overflow: hidden;
}

@media (pointer: coarse) {
  body {
    cursor: auto;
  }
  .cursor,
  .cursor-dot {
    display: none !important;
  }
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: none;
}

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

::selection {
  background: var(--mint);
  color: var(--bg);
}

/* Atmosphere */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(93, 255, 176, 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(232, 160, 106, 0.07), transparent 50%),
    radial-gradient(ellipse 50% 60% at 50% 100%, rgba(93, 255, 176, 0.04), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
}

#webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}

main,
.nav,
.footer,
.loader,
.mobile-menu {
  position: relative;
  z-index: 2;
}

/* Cursor */
.cursor,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  will-change: transform;
}

.cursor {
  width: var(--cursor-size);
  height: var(--cursor-size);
  border: 1px solid rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out),
    background 0.35s, border-color 0.35s;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
}

.cursor.is-hover {
  width: 72px;
  height: 72px;
  background: var(--mint);
  border-color: var(--mint);
  mix-blend-mode: normal;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  transform: translate(-50%, -50%);
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.loader.is-done {
  pointer-events: none;
}

.loader__inner {
  text-align: center;
  width: min(280px, 70vw);
}

.loader__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 4.5rem);
  letter-spacing: -0.06em;
  display: flex;
  justify-content: center;
  gap: 0.08em;
  margin-bottom: 1.75rem;
}

.loader__brand span {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(40deg);
  background: linear-gradient(135deg, var(--ink) 30%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.loader__bar {
  height: 2px;
  background: var(--line-strong);
  border-radius: 99px;
  overflow: hidden;
}

.loader__progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--copper), var(--mint));
  border-radius: inherit;
}

.loader__label {
  margin-top: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  z-index: 100;
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
  opacity: 0;
}

.nav.is-scrolled {
  background: rgba(7, 11, 16, 0.72);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.nav__logo {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.nav__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  color: var(--mint);
}

.nav__name {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.3s;
}

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

.nav__cta {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}

.nav__cta:hover {
  border-color: var(--mint);
  background: var(--mint-dim);
  color: var(--mint);
}

.nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.nav__burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out);
}

.nav__burger.is-open span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav__burger.is-open span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(7, 11, 16, 0.96);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

@media (max-width: 860px) {
  .nav__links {
    display: none;
  }
  .nav__burger {
    display: flex;
  }
  .nav__name {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.35s var(--ease-out), background 0.3s, border-color 0.3s,
    color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.btn span {
  position: relative;
  z-index: 1;
}

.btn--primary {
  background: var(--mint);
  color: #06100b;
  box-shadow: 0 0 0 0 rgba(93, 255, 176, 0.4);
}

.btn--primary:hover {
  box-shadow: 0 0 40px rgba(93, 255, 176, 0.35);
}

.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
}

.btn--ghost:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.btn--lg {
  padding: 1.1rem 2.2rem;
  font-size: 1.05rem;
}

/* Hero */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 2rem) clamp(1.25rem, 5vw, 4rem) 3rem;
  position: relative;
}

@media (min-width: 900px) {
  .hero {
    justify-content: center;
    padding-bottom: 6rem;
  }

  .hero__content {
    padding-bottom: 0;
  }

  .hero__title {
    font-size: clamp(4.25rem, 8.5vw, 7.25rem);
  }
}

.hero__content {
  max-width: min(920px, 100%);
  padding-bottom: 4rem;
  overflow: visible;
}

.hero__eyebrow {
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.hero__eyebrow span {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  /* Scales to fit "Dendena" without clipping on any viewport */
  font-size: clamp(2.6rem, calc((100vw - 2.5rem) / 7.2), 7.25rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1.75rem;
  max-width: 100%;
}

.hero__line {
  display: block;
  overflow: hidden;
  padding-inline: 0.02em 0.12em;
  margin-inline: -0.02em;
}

.hero__word {
  display: inline-block;
  will-change: transform;
  background: linear-gradient(120deg, var(--ink) 40%, var(--mint) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.hero__sub {
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  margin-bottom: 2.25rem;
  font-weight: 450;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero__scroll {
  position: absolute;
  right: clamp(1.25rem, 5vw, 4rem);
  bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--faint);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, var(--mint), transparent);
  transform-origin: top;
}

.hero__meta {
  position: absolute;
  left: clamp(1.25rem, 5vw, 4rem);
  bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero__meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--copper);
}

@media (max-width: 700px) {
  .hero__scroll,
  .hero__meta {
    display: none;
  }
  .hero__content {
    padding-bottom: 1rem;
  }
}

/* Sections */
.section {
  padding: clamp(5rem, 12vw, 9rem) clamp(1.25rem, 5vw, 4rem);
  max-width: calc(var(--max) + 8rem);
  margin: 0 auto;
}

.section__head {
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
  max-width: 720px;
}

.section__index {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4.8vw, 3.4rem);
  letter-spacing: -0.045em;
  line-height: 1.15;
  text-wrap: pretty;
}

.section__title .word {
  display: inline-block;
  white-space: nowrap;
  will-change: transform, opacity;
}

.section__sub {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 36rem;
  font-size: 1.05rem;
}

/* About */
.about__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

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

.about__portrait {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  perspective: 1000px;
}

.about__frame {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.about__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(0.95);
}

.about__badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(7, 11, 16, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
}

.about__badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(93, 255, 176, 0.6);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(93, 255, 176, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(93, 255, 176, 0);
  }
}

.about__lead {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.about__copy p {
  color: var(--muted);
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem;
}

.stat__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.04em;
  color: var(--mint);
  line-height: 1;
}

.stat__plus {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--mint);
}

.stat__label {
  flex-basis: 100%;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Marquee */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 1.25rem 0;
  background: rgba(255, 255, 255, 0.015);
}

.marquee__track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  letter-spacing: -0.02em;
  color: var(--faint);
  white-space: nowrap;
  will-change: transform;
}

.marquee__track span:nth-child(odd) {
  color: var(--muted);
}

/* Stack */
.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.85rem;
}

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

.stack__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.4rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), transparent 60%);
  text-align: left;
  overflow: hidden;
  transition: border-color 0.35s, background 0.35s, transform 0.35s;
  min-height: 150px;
}

.stack__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    var(--mint-dim),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.stack__item:hover,
.stack__item:focus-visible {
  border-color: rgba(93, 255, 176, 0.35);
  outline: none;
}

.stack__item:hover::before,
.stack__item:focus-visible::before {
  opacity: 1;
}

.stack__icon {
  width: 36px;
  height: 36px;
  color: var(--mint);
}

.stack__icon svg {
  width: 100%;
  height: 100%;
}

.stack__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.stack__hint {
  font-size: 0.8rem;
  color: var(--faint);
  margin-top: auto;
}

/* Focus */
.focus__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
}

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

.focus__card {
  background: var(--bg);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  position: relative;
  transition: background 0.4s;
  min-height: 240px;
}

.focus__card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--mint), var(--copper));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}

.focus__card:hover {
  background: var(--bg-elev);
}

.focus__card:hover::after,
.focus__card.is-active::after {
  transform: scaleX(1);
}

.focus__num {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mint);
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 1.25rem;
}

.focus__title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
}

.focus__text {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 36ch;
}

/* Contact */
.contact {
  text-align: center;
  position: relative;
  padding-bottom: clamp(6rem, 14vw, 10rem);
  max-width: 900px;
}

.contact__glow {
  position: absolute;
  top: 20%;
  left: 50%;
  width: min(600px, 90vw);
  height: 300px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(93, 255, 176, 0.12), transparent 65%);
  pointer-events: none;
  filter: blur(20px);
}

.contact__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
  margin: 1rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact__sub {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 28rem;
  margin: 0 auto 2.5rem;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.75rem clamp(1.25rem, 5vw, 4rem) 2.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--faint);
}

.footer__note {
  color: var(--faint);
}

/* Reveal helpers (initial states set by JS too) */
.reveal-up {
  opacity: 0;
  transform: translateY(36px);
}

.reveal-line span {
  opacity: 0;
  transform: translateY(100%);
}

.hero__word {
  transform: translateY(110%);
}

.stack__item {
  opacity: 0;
  transform: translateY(28px);
}

.focus__card {
  opacity: 0;
  transform: translateY(32px);
}
