/* ============================================================
   Alberto Dente — Portfolio
   Design tokens + components. Dark-first, light available.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body { line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Dark (default) */
  --bg:           #0B1220;
  --bg-2:         #0d1526;
  --surface:      #111827;
  --surface-2:    #1E293B;
  --surface-3:    #233148;
  --border:       #2a3a52;
  --border-2:     #334155;
  --text:         #F8FAFC;
  --text-2:       #CBD5E1;
  --text-3:       #8a9ab3;
  --accent:       #2563EB;
  --accent-2:     #22D3EE;
  --accent-soft:  rgba(37,99,235,.14);
  --cyan-soft:    rgba(34,211,238,.12);
  --success:      #10B981;

  --glass:        rgba(17,24,39,.6);
  --glass-brd:    rgba(148,163,184,.12);
  --hairline:     rgba(148,163,184,.10);
  --grid-line:    rgba(148,163,184,.045);
  --shadow-card:  0 1px 0 0 rgba(255,255,255,.03) inset, 0 16px 40px -20px rgba(0,0,0,.7);
  --shadow-pop:   0 24px 60px -24px rgba(0,0,0,.85);
  --glow:         0 0 0 1px rgba(37,99,235,.4), 0 12px 40px -12px rgba(37,99,235,.45);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --maxw: 1200px;
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --pad:  clamp(20px, 5vw, 40px);
  --gap:  clamp(14px, 1.6vw, 20px);

  --ease: cubic-bezier(.22,.61,.36,1);
}

:root[data-theme="light"] {
  --bg:           #F4F6FB;
  --bg-2:         #eef1f8;
  --surface:      #FFFFFF;
  --surface-2:    #F1F5F9;
  --surface-3:    #E8EEF6;
  --border:       #dfe6f0;
  --border-2:     #cbd5e1;
  --text:         #0B1220;
  --text-2:       #3f4d63;
  --text-3:       #697692;
  --accent:       #1d54d6;
  --accent-2:     #0891b2;
  --accent-soft:  rgba(37,99,235,.10);
  --cyan-soft:    rgba(8,145,178,.10);
  --success:      #059669;

  --glass:        rgba(255,255,255,.7);
  --glass-brd:    rgba(15,23,42,.08);
  --hairline:     rgba(15,23,42,.07);
  --grid-line:    rgba(15,23,42,.04);
  --shadow-card:  0 1px 0 0 rgba(255,255,255,.6) inset, 0 12px 30px -18px rgba(15,23,42,.25);
  --shadow-pop:   0 24px 50px -24px rgba(15,23,42,.3);
  --glow:         0 0 0 1px rgba(37,99,235,.25), 0 12px 36px -14px rgba(37,99,235,.3);
}

/* ============================================================
   BASE
   ============================================================ */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

/* ambient background: faint grid + radial accents */
.bg-field {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 78% -8%, var(--accent-soft), transparent 60%),
    radial-gradient(760px 480px at 8% 8%, var(--cyan-soft), transparent 55%);
}
.bg-field::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 72%);
          mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 72%);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.mono { font-family: var(--font-mono); }
section { position: relative; }

/* ---------- Section heading kit ---------- */
.sec { padding-block: clamp(64px, 9vw, 116px); }
.kicker {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-2);
  display: inline-flex; align-items: center; gap: 9px;
}
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--accent-2); opacity: .7; }
.sec-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 52px); }
.sec-head h2 {
  font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -.02em;
  margin-top: 16px; font-weight: 680;
}
.sec-head p { color: var(--text-2); margin-top: 14px; font-size: 16.5px; max-width: 56ch; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14.5px; font-weight: 560; letter-spacing: -.01em;
  padding: 11px 18px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: all .22s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); background: var(--surface-3); transform: translateY(-2px); }
.btn-line { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn-line:hover { color: var(--text); border-color: var(--accent-2); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 7px; color: var(--accent-2);
  font-weight: 560; font-size: 14px; transition: gap .2s var(--ease), color .2s;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.link-arrow:hover { color: var(--text); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ============================================================
   HEADER
   ============================================================ */
.hdr {
  position: sticky; top: 0; z-index: 50;
  transition: background .3s var(--ease), border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.hdr.scrolled {
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom-color: var(--hairline);
}
.hdr-row { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 640; letter-spacing: -.02em; font-size: 16px; }
.brand .dot {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff; font-family: var(--font-mono);
  font-size: 13px; font-weight: 700; box-shadow: var(--glow);
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  font-size: 14px; color: var(--text-2); padding: 8px 12px; border-radius: 9px;
  transition: color .18s, background .18s; font-weight: 480;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.hdr-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.seg {
  display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 2px; gap: 1px;
}
.seg button {
  border: none; background: transparent; color: var(--text-3); cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 7px;
  font-family: var(--font-mono); transition: all .18s;
}
.seg button.on { background: var(--accent); color: #fff; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
  color: var(--text-2); transition: all .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-btn .moon { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .moon { display: block; }

.burger { display: none; }
.nav-cta { margin-left: 4px; }

@media (max-width: 980px) {
  .nav, .nav-cta { display: none; }
  .burger { display: grid; }
}

/* mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  padding: 24px var(--pad); display: flex; flex-direction: column; gap: 6px;
  transform: translateX(100%); transition: transform .34s var(--ease); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer .drawer-top { display: flex; align-items: center; margin-bottom: 22px; }
.drawer a.nav-l { font-size: 22px; font-weight: 600; padding: 14px 4px; border-bottom: 1px solid var(--hairline); letter-spacing: -.02em; }
.drawer .btn { margin-top: 22px; justify-content: center; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(48px, 8vw, 92px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.18fr .82fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono);
  font-size: 12.5px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); padding: 6px 12px 6px 8px; border-radius: 100px;
}
.hero-eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(16,185,129,.5);} 70%{box-shadow:0 0 0 7px rgba(16,185,129,0);} 100%{box-shadow:0 0 0 0 rgba(16,185,129,0);} }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -.035em;
  font-weight: 700; margin: 22px 0 0;
}
.hero h1 .hl { color: transparent; background: linear-gradient(100deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; }
.hero-sub { color: var(--text-2); font-size: clamp(16px, 1.6vw, 18.5px); margin-top: 22px; max-width: 54ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 28px; color: var(--text-3); font-family: var(--font-mono); font-size: 12.5px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); }

/* 3D module accent */
.scene { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; perspective: 1100px; }
.scene-glow { position: absolute; inset: 8% ; border-radius: 40%; background: radial-gradient(circle, var(--accent-soft), transparent 65%); filter: blur(20px); }
.iso {
  position: relative; width: 60%; aspect-ratio: 1; transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(45deg); animation: float 9s var(--ease) infinite;
}
@keyframes float { 0%,100%{ transform: rotateX(58deg) rotateZ(45deg) translateZ(0);} 50%{ transform: rotateX(58deg) rotateZ(45deg) translateZ(26px);} }
.slab {
  position: absolute; inset: 0; border-radius: 18px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-2);
  box-shadow: 0 30px 50px -30px rgba(0,0,0,.8);
  display: grid; place-content: center; gap: 10px; padding: 18px;
}
.slab.s1 { transform: translateZ(0); }
.slab.s2 { transform: translateZ(34px); }
.slab.s3 { transform: translateZ(68px); }
.slab .row { display: flex; gap: 6px; }
.slab .chip { height: 8px; border-radius: 4px; background: var(--border-2); }
.slab.s3 .chip.a { background: var(--accent); width: 38px; }
.slab.s3 .chip.b { background: var(--accent-2); width: 20px; }
.slab.s2 .chip.a { background: var(--text-3); width: 30px; }
.slab.s2 .chip.b { background: var(--border-2); width: 44px; }
.slab .chip.c { width: 26px; } .slab .chip.d { width: 16px; }
.node {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 14px var(--accent-2); transform: translateZ(96px);
}
.node.n1 { top: 6%; left: 14%; } .node.n2 { top: 12%; right: 8%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.node.n3 { bottom: 8%; left: 30%; width: 10px; height: 10px; }
@media (prefers-reduced-motion: reduce) { .iso { animation: none; } }

/* ---------- fast-path cards ---------- */
.fastpath { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: clamp(40px, 6vw, 64px); }
.fp {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow-card); transition: transform .25s var(--ease), border-color .25s;
  position: relative; overflow: hidden;
}
.fp:hover { transform: translateY(-4px); border-color: var(--accent); }
.fp .fp-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 14px; }
.fp .fp-ic svg { width: 19px; height: 19px; }
.fp h3 { font-size: 16px; letter-spacing: -.01em; }
.fp .fp-tag { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.fp p { color: var(--text-2); font-size: 14px; margin: 8px 0 16px; }

/* ============================================================
   MARQUEE / proof
   ============================================================ */
.proof { border-block: 1px solid var(--hairline); padding-block: 30px; }
.proof-lab { text-align: center; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 20px; }
.marquee { display: flex; gap: 12px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 12px; animation: scroll-x 32s linear infinite; flex: none; }
.proof:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll-x { to { transform: translateX(-50%); } }
.proof-chip {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 10px 16px; border: 1px solid var(--border); border-radius: 100px;
  background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 500;
}
.proof-chip .ph { width: 18px; height: 18px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--border-2); flex: none; }
.proof-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--gap); margin-top: 30px; }
.pstat { text-align: center; padding: 14px; }
.pstat .n { font-size: clamp(24px, 3vw, 34px); font-weight: 700; letter-spacing: -.02em; font-family: var(--font-mono); }
.pstat .n .ed { color: var(--text-3); font-size: .6em; }
.pstat .l { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }

/* ============================================================
   MANIFESTO
   ============================================================ */
.manifesto-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px,5vw,64px); align-items: center; }
.portrait {
  aspect-ratio: 4/5; border-radius: var(--r-lg); border: 1px solid var(--border);
  background:
    linear-gradient(160deg, var(--surface-2), var(--surface));
  position: relative; overflow: hidden; box-shadow: var(--shadow-card);
  display: grid; place-items: center;
}
.portrait .ph-label { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); text-align: center; }
.portrait .ph-ic { width: 54px; height: 54px; margin: 0 auto 12px; color: var(--text-3); }
.portrait .badge {
  position: absolute; bottom: 16px; left: 16px; right: 16px;
  background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--glass-brd);
  border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.portrait .badge .av { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(140deg,var(--accent),var(--accent-2)); flex:none; }
.portrait .badge b { font-size: 13.5px; display: block; }
.portrait .badge span { font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); }
.manifesto-body h2 { font-size: clamp(24px, 3.4vw, 36px); line-height: 1.18; letter-spacing: -.02em; font-weight: 600; }
.manifesto-body h2 em { font-style: normal; color: var(--accent-2); }
.manifesto-body p { color: var(--text-2); margin-top: 18px; font-size: 16px; max-width: 56ch; }
.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.principle { display: flex; gap: 11px; align-items: flex-start; }
.principle .ck { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; flex: none; margin-top: 2px; }
.principle .ck svg { width: 13px; height: 13px; }
.principle b { font-size: 14px; font-weight: 560; }
.principle span { font-size: 13px; color: var(--text-3); display: block; }

/* ============================================================
   BENTO SKILLS
   ============================================================ */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); grid-auto-rows: minmax(0, auto); }
.cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 24px; box-shadow: var(--shadow-card); position: relative; overflow: hidden;
  transition: border-color .25s, transform .25s; display: flex; flex-direction: column;
}
.cell:hover { border-color: var(--border-2); transform: translateY(-3px); }
.cell::before { content: ""; position: absolute; inset: 0; background: radial-gradient(440px 200px at 80% -20%, var(--accent-soft), transparent 60%); opacity: 0; transition: opacity .3s; }
.cell:hover::before { opacity: 1; }
.cell.c-wide { grid-column: span 3; }
.cell.c-tall { grid-column: span 3; }
.cell.c-third { grid-column: span 2; }
.cell .cell-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent-2); margin-bottom: 16px; }
.cell .cell-ic svg { width: 20px; height: 20px; }
.cell h3 { font-size: 17px; letter-spacing: -.01em; position: relative; }
.cell > p { color: var(--text-2); font-size: 14px; margin-top: 8px; position: relative; }
.taglist { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; position: relative; }

.tag {
  font-family: var(--font-mono); font-size: 12px; padding: 5px 11px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  cursor: pointer; transition: all .16s var(--ease); user-select: none; line-height: 1.4;
}
.tag::before { content: ""; }
.tag:hover { border-color: var(--accent-2); color: var(--text); }
.tag.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag.active::before { content: "✓ "; }

.filterbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.filterbar .fl { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 8px; }
.filterbar .chips { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }
.filterbar .clear { font-size: 12.5px; color: var(--text-3); cursor: pointer; border: none; background: none; font-family: var(--font-mono); }
.filterbar .clear:hover { color: var(--accent-2); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.proj {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.proj:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow-pop); }
.proj.hide { display: none; }
.proj-thumb { aspect-ratio: 16/10; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background: linear-gradient(150deg, var(--surface-2), var(--surface-3)); }
.proj-thumb .grid-deco { position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 26px 26px; }
.proj-thumb .glyph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); opacity: .8; }
.proj-thumb .glyph svg { width: 64px; height: 64px; }
.proj-thumb .ribbon { position: absolute; top: 12px; left: 12px; font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: 6px; background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--glass-brd); color: var(--text-2); }
.proj-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.proj-body h3 { font-size: 17.5px; letter-spacing: -.015em; }
.proj-cs { display: grid; gap: 10px; margin: 14px 0 4px; }
.proj-cs .cs-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; font-size: 13px; }
.proj-cs .cs-row .lab { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding-top: 2px; }
.proj-cs .cs-row .val { color: var(--text-2); }
.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.proj-tags .pt { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; }
.proj-foot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--hairline); margin-top: 16px; }
.proj-result { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--success); font-family: var(--font-mono); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); display: none; }
.empty-state.show { display: block; }

/* ============================================================
   SERVICES
   ============================================================ */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.svc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 26px; box-shadow: var(--shadow-card); transition: border-color .25s, transform .25s; display: flex; gap: 18px; }
.svc:hover { border-color: var(--accent); transform: translateY(-3px); }
.svc .svc-ic { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: linear-gradient(140deg, var(--accent-soft), var(--cyan-soft)); border: 1px solid var(--border); color: var(--accent-2); }
.svc .svc-ic svg { width: 21px; height: 21px; }
.svc h3 { font-size: 17px; letter-spacing: -.01em; }
.svc .svc-meta { display: grid; gap: 8px; margin: 12px 0 16px; }
.svc .svc-meta div { font-size: 13.5px; color: var(--text-2); display: grid; grid-template-columns: 76px 1fr; gap: 10px; }
.svc .svc-meta .k { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding-top: 2px; }

/* ============================================================
   EXPERIENCE TIMELINE
   ============================================================ */
.timeline { position: relative; max-width: 820px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 1.5px; background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.tl-item { position: relative; padding: 0 0 38px 42px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 19px; height: 19px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); display: grid; place-items: center; }
.tl-dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.tl-when { font-family: var(--font-mono); font-size: 12px; color: var(--accent-2); }
.tl-item h3 { font-size: 17.5px; margin-top: 6px; letter-spacing: -.01em; }
.tl-item .org { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }
.tl-item p { color: var(--text-2); font-size: 14px; margin-top: 10px; max-width: 60ch; }
.tl-item .impact { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tl-item .impact span { font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 4px 10px; }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.tst-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.tst { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.tst .quote-mark { font-family: var(--font-mono); color: var(--accent-2); font-size: 30px; line-height: 1; opacity: .6; }
.tst blockquote { font-size: 15px; color: var(--text); line-height: 1.6; margin-top: 8px; flex: 1; }
.tst .ctx { font-size: 12.5px; color: var(--text-3); font-family: var(--font-mono); margin-top: 16px; }
.tst .who { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.tst .who .av { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border-2); flex: none; display: grid; place-items: center; font-family: var(--font-mono); font-size: 14px; color: var(--text-2); }
.tst .who b { font-size: 14px; display: block; }
.tst .who span { font-size: 12.5px; color: var(--text-3); }

/* ============================================================
   BLOG
   ============================================================ */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.art {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column;
  transition: transform .28s var(--ease), border-color .28s;
}
.art:hover { transform: translateY(-4px); border-color: var(--accent-2); }
.art-thumb { aspect-ratio: 16/9; background: linear-gradient(150deg, var(--surface-2), var(--surface-3)); position: relative; border-bottom: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.art-thumb .deco { position: absolute; inset: 0; opacity: .5; background-image: radial-gradient(var(--grid-line) 1.4px, transparent 1.4px); background-size: 18px 18px; }
.art-thumb .cat-glyph { font-family: var(--font-mono); font-size: 13px; color: var(--accent-2); border: 1px solid var(--glass-brd); background: var(--glass); padding: 6px 12px; border-radius: 8px; position: relative; }
.art-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.art-meta { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.art-meta .cat { color: var(--accent-2); }
.art-meta .lang { margin-left: auto; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.art-body h3 { font-size: 16.5px; line-height: 1.3; letter-spacing: -.01em; margin-top: 12px; }
.art-body p { color: var(--text-2); font-size: 13.5px; margin-top: 8px; flex: 1; }
.art-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); }
.contact-aside h2 { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -.025em; font-weight: 680; }
.contact-aside p { color: var(--text-2); margin-top: 16px; font-size: 16px; max-width: 44ch; }
.contact-links { display: grid; gap: 10px; margin-top: 28px; }
.contact-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color .2s, transform .2s; }
.contact-link:hover { border-color: var(--accent); transform: translateX(3px); }
.contact-link .ci { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent-2); flex: none; }
.contact-link .ci svg { width: 18px; height: 18px; }
.contact-link b { font-size: 14px; display: block; }
.contact-link span { font-size: 12.5px; color: var(--text-3); font-family: var(--font-mono); }

.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(22px, 3vw, 32px); box-shadow: var(--shadow-card); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-family: var(--font-mono); color: var(--text-2); margin-bottom: 7px; letter-spacing: .02em; }
.field label .req { color: var(--accent-2); }
.input, .textarea, .select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 12px 13px; font-size: 14.5px; color: var(--text); transition: border-color .18s, box-shadow .18s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 120px; }
.req-types { display: flex; flex-wrap: wrap; gap: 8px; }
.req-types label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border-2); padding: 8px 12px; border-radius: 8px; transition: all .16s; }
.req-types input { position: absolute; opacity: 0; pointer-events: none; }
.req-types label:has(input:checked) { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.req-types label .rd { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--border-2); }
.req-types label:has(input:checked) .rd { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 45%, transparent 50%); }
.form .err { color: #f87171; font-size: 12px; margin-top: 5px; font-family: var(--font-mono); display: none; }
.field.invalid .input, .field.invalid .textarea { border-color: #f87171; }
.field.invalid .err { display: block; }
.form-success { display: none; text-align: center; padding: 30px 10px; }
.form-success.show { display: block; }
.form-success .ok { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px; background: var(--accent-soft); color: var(--success); display: grid; place-items: center; }
.form-success .ok svg { width: 26px; height: 26px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--hairline); padding-block: 48px 30px; margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer .f-about p { color: var(--text-3); font-size: 13.5px; margin-top: 14px; max-width: 34ch; }
.footer h4 { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 14px; }
.footer .f-col a { display: block; color: var(--text-2); font-size: 14px; padding: 5px 0; transition: color .16s; }
.footer .f-col a:hover { color: var(--accent-2); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--hairline); color: var(--text-3); font-size: 13px; }
.footer-bottom .built { font-family: var(--font-mono); font-size: 12.5px; }
.footer-bottom .socials { display: flex; gap: 8px; }

/* ============================================================
   SUB-PAGE: page hero + breadcrumb
   ============================================================ */
.page-hero { padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(24px, 3vw, 36px); }
.crumb { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); margin-bottom: 18px; }
.crumb a { color: var(--text-3); transition: color .16s; }
.crumb a:hover { color: var(--accent-2); }
.crumb svg { width: 13px; height: 13px; opacity: .6; }
.page-hero h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.06; letter-spacing: -.03em; font-weight: 700; max-width: 18ch; }
.page-hero .lede { color: var(--text-2); font-size: clamp(16px,1.6vw,18px); margin-top: 18px; max-width: 60ch; }

/* blog filter tabs */
.blog-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 36px; }
.blog-tab {
  font-family: var(--font-mono); font-size: 12.5px; padding: 8px 14px; border-radius: 100px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer;
  transition: all .16s var(--ease);
}
.blog-tab:hover { border-color: var(--accent-2); color: var(--text); }
.blog-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.art.hide { display: none; }

/* featured article (blog) */
.feature {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; margin-bottom: 40px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-card);
}
.feature .feat-media { position: relative; min-height: 280px; background: linear-gradient(150deg, var(--surface-2), var(--surface-3)); display: grid; place-items: center; border-right: 1px solid var(--border); }
.feature .feat-media .deco { position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 30px 30px; }
.feature .feat-media .badge { position: relative; font-family: var(--font-mono); font-size: 12px; color: var(--accent-2); border: 1px solid var(--glass-brd); background: var(--glass); padding: 7px 13px; border-radius: 8px; }
.feature .feat-body { padding: clamp(24px, 3vw, 38px); display: flex; flex-direction: column; justify-content: center; }
.feature .feat-body .art-meta { margin-bottom: 14px; }
.feature .feat-body h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.18; letter-spacing: -.02em; }
.feature .feat-body p { color: var(--text-2); margin: 14px 0 22px; font-size: 15px; }

/* ============================================================
   CASE STUDY
   ============================================================ */
.cs-hero-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 22px; }
.cs-hero-meta .m { display: inline-flex; flex-direction: column; gap: 2px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.cs-hero-meta .m .k { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.cs-hero-meta .m .v { font-size: 14px; font-weight: 560; }
.cs-cover { aspect-ratio: 21/9; border-radius: var(--r-lg); border: 1px solid var(--border); overflow: hidden; position: relative; background: linear-gradient(150deg, var(--surface-2), var(--surface-3)); display: grid; place-items: center; margin: clamp(28px,4vw,44px) 0; box-shadow: var(--shadow-card); }
.cs-cover .deco { position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 40px 40px; }
.cs-cover .glyph { position: relative; color: var(--text-3); }
.cs-cover .glyph svg { width: 80px; height: 80px; }

.cs-layout { display: grid; grid-template-columns: 1fr 280px; gap: clamp(32px, 5vw, 64px); align-items: start; }
.cs-toc { position: sticky; top: 92px; }
.cs-toc h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 12px; }
.cs-toc a { display: block; font-size: 13.5px; color: var(--text-2); padding: 7px 0 7px 14px; border-left: 2px solid var(--border); transition: all .16s; }
.cs-toc a:hover, .cs-toc a.active { color: var(--text); border-left-color: var(--accent-2); }
.cs-toc .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.cs-toc .stack-stat { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.cs-toc .stack-stat:last-child { border-bottom: none; }
.cs-toc .stack-stat span { color: var(--text-3); }
.cs-toc .stack-stat b { font-family: var(--font-mono); color: var(--success); }

.prose h2 { font-size: clamp(22px, 2.8vw, 30px); letter-spacing: -.02em; margin-top: 44px; scroll-margin-top: 92px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; margin-top: 28px; letter-spacing: -.01em; }
.prose p { color: var(--text-2); font-size: 16px; margin-top: 14px; max-width: 68ch; }
.prose ul.ticks { margin-top: 16px; display: grid; gap: 10px; }
.prose ul.ticks li { display: flex; gap: 11px; color: var(--text-2); font-size: 15px; align-items: flex-start; }
.prose ul.ticks li svg { width: 18px; height: 18px; color: var(--accent-2); flex: none; margin-top: 3px; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; padding: 18px 20px; margin-top: 24px; }
.callout .lab { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-2); }
.callout p { margin-top: 6px; color: var(--text); font-size: 15.5px; }
.code-block { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-top: 22px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; }
.code-block .cmt { color: var(--text-3); }
.code-block .kw { color: var(--accent-2); }
.code-block .fn { color: #c4b5fd; }
.code-block .str { color: var(--success); }
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); margin-top: 22px; }
.result-grid .rc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; }
.result-grid .rc .n { font-size: 26px; font-weight: 700; font-family: var(--font-mono); letter-spacing: -.02em; }
.result-grid .rc .l { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.cs-cta { margin-top: 52px; padding: clamp(26px,4vw,40px); background: linear-gradient(140deg, var(--surface), var(--surface-2)); border: 1px solid var(--border); border-radius: var(--r-lg); text-align: center; box-shadow: var(--shadow-card); }
.cs-cta h3 { font-size: clamp(20px,2.4vw,26px); letter-spacing: -.02em; }
.cs-cta p { color: var(--text-2); margin: 10px auto 22px; max-width: 46ch; }

@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .feature .feat-media { min-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
  .cs-layout { grid-template-columns: 1fr; }
  .cs-toc { position: static; order: -1; }
  .cs-toc .toc-nav { display: none; }
  .result-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .06s; }
.reveal[data-d="2"] { transition-delay: .12s; }
.reveal[data-d="3"] { transition-delay: .18s; }
.reveal[data-d="4"] { transition-delay: .24s; }

/* ============================================================
   i18n visibility
   ============================================================ */
:root[data-lang="it"] [data-lang-en] { display: none !important; }
:root[data-lang="en"] [data-lang-it] { display: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .scene { max-width: 360px; margin: 0 auto; order: -1; }
  .manifesto-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 380px; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cell.c-wide, .cell.c-tall, .cell.c-third { grid-column: span 2; }
  .projects-grid, .blog-grid, .tst-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .proof-stats { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .fastpath { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .cell.c-wide, .cell.c-tall, .cell.c-third { grid-column: span 1; }
  .projects-grid, .blog-grid, .tst-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  .svc { flex-direction: column; gap: 12px; }
}
