/* ============================================================
   CODEVO — style.css
   Aesthetic: Industrial Precision / Dark Editorial
   Fonts: Syne (display) + DM Mono (code/labels)
   ============================================================ */

/* ── RESET & TOKENS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0c0c0d;
  --bg-2:      #111113;
  --bg-card:   #161618;
  --line:      rgba(255,255,255,.08);
  --txt:       #e8e8e6;
  --txt-muted: #7a7a78;
  --accent:    #d4f03c;        /* electric lime */
  --accent-2:  #3cf0c8;        /* teal highlight */
  --font-head: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius:    4px;
  --ease:      cubic-bezier(.22,1,.36,1);
  --nav-h:     64px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-head);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── UTILITY ── */
.mono        { font-family: var(--font-mono); }
.container   { width: min(1160px, 92vw); margin-inline: auto; }
.section-label {
  display: block;
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.section-title {
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin-bottom: 2.5rem;
}
.accent { color: var(--accent); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: .85rem;
  letter-spacing: .05em;
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  color: #0c0c0d;
  font-weight: 500;
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212,240,60,.35);
}

/* ── NAV ── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(12,12,13,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background .3s;
}
.nav.scrolled { background: rgba(12,12,13,.97); }
.nav__inner {
  width: min(1160px, 92vw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: .04em;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--accent);
  color: #0c0c0d;
  border-radius: 3px;
  font-size: .95rem;
  line-height: 1;
}
.logo-text { color: var(--txt); }

.nav__links {
  display: flex;
  gap: 2.5rem;
}
.nav__links a {
  text-decoration: none;
  font-size: .85rem;
  letter-spacing: .08em;
  color: var(--txt-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
  transition: color .2s;
}
.nav__links a:hover { color: var(--accent); }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--txt);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s;
}
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 3rem) 6vw 5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* grain overlay */
.hero__noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .04;
  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='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

/* animated bg lines */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg,  var(--line) 0 1px, transparent 1px 80px);
  mask-image: radial-gradient(ellipse 80% 70% at 30% 50%, black 40%, transparent 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeUp .7s var(--ease) .2s forwards;
}
.hero__title {
  font-size: clamp(3rem, 8vw, 7.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.03em;
  display: flex;
  flex-direction: column;
  gap: .1em;
  margin-bottom: 2rem;
}
.hero__title .word {
  display: block;
  opacity: 0;
  animation: fadeUp .7s var(--ease) forwards;
}
.hero__title .word:nth-child(1) { animation-delay: .35s; }
.hero__title .word:nth-child(2) { animation-delay: .5s; }
.hero__title .word:nth-child(3) { animation-delay: .65s; }

.hero__sub {
  font-size: .82rem;
  letter-spacing: .12em;
  color: var(--txt-muted);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp .7s var(--ease) .8s forwards;
}
.hero__content .btn {
  opacity: 0;
  animation: fadeUp .7s var(--ease) .95s forwards;
}

/* spinning badge */
.hero__badge {
  position: absolute;
  bottom: 3.5rem;
  right: 5vw;
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.hero__badge svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  animation: spin 16s linear infinite;
  fill: none;
  stroke: none;
}
.hero__badge text {
  fill: var(--txt-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .07em;
}
.hero__badge-arrow {
  font-size: 1.3rem;
  color: var(--accent);
  animation: bob 2s ease-in-out infinite;
  z-index: 3;
}

.hero__scroll {
  position: absolute;
  left: 6vw;
  bottom: 3rem;
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--txt-muted);
  writing-mode: vertical-lr;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.4s forwards;
}
.hero__scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 40px;
  background: var(--txt-muted);
  margin: .6rem auto 0;
  animation: grow 1.5s ease-in-out infinite;
}

/* ── ABOUT ── */
.about {
  padding: 7rem 0;
  border-bottom: 1px solid var(--line);
}
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about__text {
  color: var(--txt-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}
.about__text strong { color: var(--txt); }
.about__stats {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stat__num {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--accent);
  line-height: 1;
}
.stat__num::after { content: '+'; font-size: 1.8rem; }
.stat:last-child .stat__num::after { content: ''; }
.stat__label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-top: .4rem;
  display: block;
}

/* ── SERVICES ── */
.services {
  padding: 7rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.service-card {
  background: var(--bg-card);
  padding: 2.2rem 2rem;
  transition: background .25s var(--ease);
  cursor: default;
  outline: none;
}
.service-card:hover,
.service-card:focus {
  background: #1c1c1f;
}
.service-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.service-card__icon {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 1.1rem;
  display: block;
  line-height: 1;
}
.service-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .65rem;
  letter-spacing: -.01em;
}
.service-card p {
  font-size: .88rem;
  color: var(--txt-muted);
  line-height: 1.65;
}

/* ── STACK / COMPETENZE ── */
.stack {
  padding: 7rem 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.stack__intro {
  color: var(--txt-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 3.5rem;
  max-width: 640px;
}

/* scrolling ticker */
.stack__ticker-wrap {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  margin-bottom: 4.5rem;
}
.stack__ticker {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: ticker 28s linear infinite;
  padding-block: 1.2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stack__ticker span {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--txt-muted);
  white-space: nowrap;
  padding: .3rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  flex-shrink: 0;
  transition: color .2s, border-color .2s;
}
.stack__ticker span:hover { color: var(--accent); border-color: var(--accent); }

/* ── COMPETENZE GRID ── */
.competenze-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.competenza-item {
  background: var(--bg-card);
  padding: 2.4rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background .25s var(--ease);
}
.competenza-item:hover { background: #181819; }

.competenza-item__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.competenza-item__icon {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--accent);
  flex-shrink: 0;
  padding: .2rem .5rem;
  border: 1px solid rgba(212,240,60,.3);
  border-radius: 3px;
  line-height: 1.6;
}
.competenza-item h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.competenza-item p {
  font-size: .87rem;
  color: var(--txt-muted);
  line-height: 1.7;
  flex: 1;
}

.competenza-item__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}
.competenza-item__tags li {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--txt-muted);
  padding: .2rem .6rem;
  background: rgba(255,255,255,.04);
  border-radius: 3px;
}

/* ── CONTACT ── */
.contact {
  padding: 7rem 0 6rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.contact__sub {
  color: var(--txt-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 3.5rem;
}
.contact__cards {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 2rem 2.4rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color .2s, transform .2s var(--ease);
  min-width: 220px;
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.contact-card__icon { font-size: 1.5rem; color: var(--accent); }
.contact-card__label {
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-top: .5rem;
}
.contact-card__value {
  font-size: .95rem;
  color: var(--txt);
  line-height: 1.5;
}

/* ── FOOTER ── */
.footer {
  padding: 2.5rem 0;
  background: var(--bg);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer__logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .04em;
  opacity: .7;
  transition: opacity .2s;
}
.footer__logo:hover { opacity: 1; }
.footer__copy {
  font-size: .72rem;
  color: var(--txt-muted);
  letter-spacing: .05em;
  text-align: center;
  line-height: 1.7;
}
.footer__back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--txt-muted);
  text-decoration: none;
  font-size: 1rem;
  transition: border-color .2s, color .2s;
}
.footer__back:hover { border-color: var(--accent); color: var(--accent); }

/* ── KEYFRAMES ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes bob {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
@keyframes grow {
  0%,100% { transform: scaleY(1); opacity: 1; }
  50%      { transform: scaleY(.4); opacity: .4; }
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .competenze-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav__links { display: none; flex-direction: column; gap: 1.5rem; }
  .nav__links.open {
    display: flex;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: rgba(12,12,13,.97);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    z-index: 99;
  }
  .nav__burger { display: flex; }

  .about__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about__stats { gap: 2rem; flex-wrap: wrap; }

  .hero__badge { width: 90px; height: 90px; bottom: 2rem; right: 4vw; }
  .hero__scroll { display: none; }

  .contact__cards { flex-direction: column; }
  .footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  .hero__title { font-size: clamp(2.2rem, 10vw, 4rem); gap: .05em; }
  .competenze-grid { grid-template-columns: 1fr; }
  .about__stats { flex-direction: column; gap: 1.5rem; }
}

/* ── SCROLL-REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
