/* Antonio Tamucci — portfolio. Stile ripreso dal biglietto da visita. */
:root {
  --bg: #171a19;
  --bg-2: #1c201f;
  --surface: #202524;
  --line: #2b3230;
  --text: #f2f2f2;
  --muted: #8c9a94;
  --lime: #aef351;
  --lime-2: #8fd13a;
  --lime-dim: rgba(174, 243, 81, .14);
  --radius: 14px;
  --wrap: 1160px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--font); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--lime); color: var(--bg); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.lime { color: var(--lime); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--lime); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip:focus { left: 12px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(23, 26, 25, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.header.scrolled { border-color: var(--line); }
.header .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 30px; width: auto; }
.brand span { font-weight: 300; font-size: 1.05rem; letter-spacing: .2px; }
.brand b { font-weight: 700; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; color: var(--muted); font-size: .95rem; padding: 8px 12px; border-radius: 8px; transition: color .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav .btn { margin-left: 8px; color: var(--bg); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); width: 44px; height: 44px; border-radius: 10px; cursor: pointer; }
.menu-toggle svg { width: 22px; height: 22px; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  font: 600 .95rem/1 var(--font); padding: 14px 22px; border-radius: 10px; border: 1px solid transparent;
  background: var(--lime); color: var(--bg); transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { background: #c2f774; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--lime); color: var(--lime); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Decorazioni del biglietto ---------- */
.deco { position: relative; isolation: isolate; }
.deco::before, .deco::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.deco::before { /* triangolo verde in alto a destra */
  top: 0; right: 0; width: min(360px, 40vw); height: min(300px, 34vw);
  background: linear-gradient(225deg, var(--lime) 0%, #6fae2c 22%, rgba(23, 26, 25, 0) 46%);
  clip-path: polygon(30% 0, 100% 0, 100% 70%);
  opacity: .9;
}
.deco::after { /* triangolo scuro-verde in basso a sinistra */
  left: 0; bottom: 0; width: min(300px, 36vw); height: min(260px, 30vw);
  background: linear-gradient(45deg, #3f6a1d 0%, rgba(23, 26, 25, 0) 60%);
  clip-path: polygon(0 20%, 0 100%, 72% 100%);
}
.line { position: absolute; height: 1px; background: var(--lime); transform-origin: left center; opacity: .75; z-index: -1; pointer-events: none; }
.comment { font-family: var(--mono); font-size: .82rem; color: var(--muted); line-height: 1.5; white-space: pre; }
.dash { width: 38px; height: 4px; background: var(--lime); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero { min-height: calc(100svh - 72px); display: flex; align-items: center; padding: 72px 0 96px; overflow: hidden; }
.hero .comment.top { position: absolute; top: 28px; left: max(24px, calc((100vw - var(--wrap)) / 2 + 24px)); }
.hero .comment.bottom { position: absolute; right: max(24px, calc((100vw - var(--wrap)) / 2 + 24px)); bottom: 34px; }
.hero-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-logo { width: clamp(180px, 30vw, 380px); height: auto; filter: drop-shadow(0 10px 40px rgba(174, 243, 81, .12)); }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 6.4vw, 5rem); line-height: 1.02; letter-spacing: -.5px; }
.hero h1 .n { display: block; font-weight: 300; }
.hero h1 .c { display: block; font-weight: 700; }
.roles { margin: 18px 0 22px; color: var(--muted); font-size: clamp(1.02rem, 1.7vw, 1.3rem); font-weight: 300; }
.slogan { font: 700 clamp(1.05rem, 1.9vw, 1.45rem)/1.3 var(--mono); color: var(--lime); margin: 18px 0 32px; }
.slogan .cursor { display: inline-block; width: .6ch; height: 1.1em; vertical-align: -.15em; background: var(--lime); margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sezioni ---------- */
section { scroll-margin-top: 80px; }
.section { padding: clamp(72px, 10vw, 120px) 0; position: relative; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kicker { font: 500 .85rem var(--mono); color: var(--lime); letter-spacing: .5px; margin: 0 0 14px; }
.kicker::before { content: "// "; color: var(--muted); }
.section h2 { margin: 0 0 16px; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; font-weight: 600; letter-spacing: -.3px; }
.section h2 b { color: var(--lime); font-weight: 700; }
.lead { color: var(--muted); max-width: 640px; margin: 0 0 40px; font-size: 1.05rem; }

/* ---------- Lavori ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.chip {
  font: 500 .85rem var(--mono); color: var(--muted); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--lime); border-color: var(--lime); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card {
  display: flex; flex-direction: column; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(174, 243, 81, .5); }
.card[hidden] { display: none; }
.card .cover { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .cover img { transform: scale(1.03); }
.card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.tag { font: 500 .74rem var(--mono); color: var(--lime); background: var(--lime-dim); border-radius: 6px; padding: 4px 8px; }
.card .more { font: 500 .85rem var(--mono); color: var(--lime); margin-top: 6px; }

/* ---------- Servizi ---------- */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.service { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.service .ico { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--lime-dim); color: var(--lime); margin-bottom: 18px; }
.service .ico svg { width: 26px; height: 26px; }
.service h3 { margin: 0 0 10px; font-size: 1.25rem; }
.service p { margin: 0 0 16px; color: var(--muted); font-size: .96rem; }
.service ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.service li { font-size: .92rem; padding-left: 22px; position: relative; }
.service li::before { content: ">"; position: absolute; left: 0; color: var(--lime); font-family: var(--mono); font-weight: 700; }

/* ---------- Chi sono ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.about p { margin: 0 0 16px; color: #cfd6d3; }
.stack { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; font-family: var(--mono); font-size: .88rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.stack .k { color: var(--lime); }
.stack .s { color: #f2c27b; }
.stack .c { color: var(--muted); }

/* ---------- Contatti ---------- */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.contact h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.contact h2 b { color: var(--lime); }
.contact-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.contact-list a { display: flex; align-items: center; gap: 16px; text-decoration: none; font-family: var(--mono); font-size: 1rem; word-break: break-all; }
.contact-list a:hover span { color: var(--lime); }
.contact-list .ico { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--lime); }
.contact-list .ico svg { width: 22px; height: 22px; }
.frame {
  position: relative; border: 1px solid var(--lime); border-radius: 18px; padding: 40px 32px; text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(174, 243, 81, .08), transparent 70%);
}
.frame::before, .frame::after { content: ""; position: absolute; width: 34px; height: 34px; border: 3px solid var(--lime); }
.frame::before { top: 18px; left: 18px; border-right: 0; border-bottom: 0; }
.frame::after { bottom: 18px; right: 18px; border-left: 0; border-top: 0; }
.frame p { margin: 0 0 20px; font-family: var(--mono); color: var(--muted); }
.frame .big { font: 600 1.4rem var(--font); color: var(--text); margin-bottom: 8px; }

/* ---------- Pagina progetto ---------- */
.project-hero { padding: 56px 0 48px; overflow: hidden; }
.back { font: 500 .88rem var(--mono); color: var(--muted); text-decoration: none; }
.back:hover { color: var(--lime); }
.project-hero h1 { margin: 22px 0 10px; font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.08; letter-spacing: -.4px; }
.project-hero .sub { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--muted); font-weight: 300; margin: 0 0 24px; max-width: 760px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--mono); font-size: .88rem; color: var(--muted); margin-bottom: 28px; }
.meta b { color: var(--text); font-weight: 500; }
.project-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 8; background: var(--surface); }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 6vw, 72px); padding-top: 56px; padding-bottom: 96px; align-items: start; }
.project-body .intro { font-size: 1.15rem; color: #dfe5e2; margin: 0 0 32px; }
.project-body h2 { font-size: 1.4rem; margin: 36px 0 12px; font-weight: 600; }
.project-body h2::before { content: "# "; color: var(--lime); font-family: var(--mono); }
.project-body p { color: #cfd6d3; margin: 0 0 14px; }
.project-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.project-body li { padding-left: 24px; position: relative; color: #cfd6d3; }
.project-body li::before { content: ">"; position: absolute; left: 0; color: var(--lime); font-family: var(--mono); font-weight: 700; }
.aside { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 20px; }
.aside h3 { margin: 0 0 8px; font: 500 .8rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.next { border-top: 1px solid var(--line); padding: 40px 0 72px; }
.next a { text-decoration: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.next small { font-family: var(--mono); color: var(--muted); }
.next strong { display: block; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
.next a:hover strong { color: var(--lime); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0; }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer p { margin: 0; color: var(--muted); font-size: .9rem; }
.footer .comment { white-space: normal; }

/* ---------- Animazioni all'ingresso ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .services { grid-template-columns: 1fr; }
  .about, .contact, .project-body { grid-template-columns: 1fr; }
  .aside { position: static; }
}
@media (max-width: 760px) {
  .menu-toggle { display: grid; place-items: center; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 20px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 8px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav .btn { margin: 14px 0 0; justify-content: center; border-bottom: 0; }
  .hero { padding: 108px 0 110px; min-height: auto; }
  .hero .line { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-logo { width: 190px; }
  .hero .comment.top { top: 18px; left: 16px; }
  .hero .comment.bottom { bottom: 22px; right: 16px; }
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: 1fr; }
  .project-cover { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
