/* ============================================================
   Nunzio Lella — Portfolio · "Editorial Brutalism"
   Deep black, signal red, massive Cabinet Grotesk + IBM Plex Mono.
   ============================================================ */

:root {
  --bg:        #050505;
  --bg-2:      #0A0A0A;
  --surface:   #0F0F0F;
  --surface-2: #161616;
  --line:      rgba(244,241,235,.16);
  --line-soft: rgba(244,241,235,.08);
  --accent:    #FF2A00;
  --accent-2:  #FF5C38;
  --accent-dim: rgba(255,42,0,.12);
  --text:      #C9C5BD;
  --text-hi:   #F4F1EB;
  --muted:     #8A8A8A;
  --muted-2:   #5E5B56;
  --ok:        #36d399;

  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --display: "Cabinet Grotesk", "Arial Black", system-ui, sans-serif;

  --maxw: 1320px;
  --gut: clamp(20px, 5vw, 72px);
  --r: 0px;

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

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

html { scroll-behavior: smooth; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* cinematic grain overlay */
body::after {
  content: "";
  position: fixed; inset: -50%; z-index: 9998;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .045;
  animation: grain 9s steps(8) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-3%,2%); }
  50% { transform: translate(2%,-3%); }
  75% { transform: translate(-2%,-2%); }
}
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } }

::selection { background: var(--accent); color: #fff; }

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

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- shared atoms ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.kicker::before {
  content: "";
  width: 30px; height: 8px;
  background: var(--accent);
  display: inline-block;
}

.section { padding-block: clamp(80px, 12vw, 170px); position: relative; }
.section-head { margin-bottom: clamp(40px, 5vw, 70px); }
.section-head .idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.section-title {
  font-family: var(--display);
  font-size: clamp(32px, 4.6vw, 58px);
  font-weight: 800;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--text-hi);
  margin-top: 18px;
  line-height: .98;
  max-width: 20ch;
}
.section-sub { color: var(--muted); max-width: 60ch; margin-top: 16px; font-size: 16px; }

.divider { height: 1px; background: var(--line-soft); }

/* reveal animation */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: 72px;
  display: flex; align-items: center;
  transition: background .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5,5,5,.74);
  backdrop-filter: blur(20px) saturate(120%);
  border-bottom-color: var(--line-soft);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.logo { display: flex; align-items: center; gap: 13px; }
.logo .mono-mark {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 900; font-size: 15px; letter-spacing: .02em;
  color: var(--bg);
  background: var(--text-hi);
  transition: background .3s, color .3s, transform .3s var(--ease);
}
.logo:hover .mono-mark { background: var(--accent); color: #fff; transform: rotate(-6deg); }
.logo .logo-name { font-size: 14.5px; font-weight: 700; color: var(--text-hi); letter-spacing: .01em; }
.logo .logo-role { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-2); }
.logo .logo-text { display: flex; flex-direction: column; line-height: 1.3; }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .25s;
  position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -7px; height: 2px; width: 0;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--text-hi); }
.nav-links a:hover::after { width: 100%; }

.btn {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  padding: 14px 24px;
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s, box-shadow .25s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--text-hi); border-color: var(--text-hi); color: var(--bg); transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--accent); }
.btn-ghost { background: transparent; color: var(--text-hi); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); transform: translate(-2px,-2px); box-shadow: 4px 4px 0 rgba(255,42,0,.35); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translate(3px,-3px); }

.nav-cta { display: inline-flex; padding: 11px 20px; }

/* hamburger */
.burger { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; align-items: center; justify-content: center; }
.burger span { width: 18px; height: 2px; background: var(--text-hi); transition: transform .3s var(--ease), opacity .3s; }
.burger.open span:nth-child(1), .burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2), .burger.active span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3), .burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 72px 0 auto 0; z-index: 99;
  background: rgba(5,5,5,.97); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line-soft);
  padding: 18px var(--gut) 32px;
  display: flex; flex-direction: column; gap: 4px;
  transform: translateY(-12px); opacity: 0; pointer-events: none;
  transition: transform .35s var(--ease), opacity .35s;
}
.mobile-menu.open { transform: none; opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--mono); font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text); padding: 15px 4px; border-bottom: 1px solid var(--line-soft);
}
.mobile-menu a .mi { color: var(--accent); margin-right: 16px; }
.mobile-menu .btn { margin-top: 18px; justify-content: center; }

/* ============================================================
   HERO (home)
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: 100px; padding-bottom: 70px;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(244,241,235,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,241,235,.045) 1px, transparent 1px);
  background-size: 90px 90px;
  -webkit-mask-image: radial-gradient(ellipse 95% 75% at 50% 35%, #000 0%, transparent 80%);
          mask-image: radial-gradient(ellipse 95% 75% at 50% 35%, #000 0%, transparent 80%);
}
.hero-canvas { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-glowline { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .5; }

.hero .wrap { position: relative; z-index: 2; width: 100%; }

.hero-layout { display: grid; grid-template-columns: 1.6fr .8fr; gap: clamp(30px, 5vw, 80px); align-items: center; }

.hero-kicker { margin-bottom: 30px; }
.hero h1 {
  font-size: clamp(56px, 11.5vw, 168px);
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.025em;
  text-transform: uppercase;
  color: var(--text-hi);
}
.hero h1 .ln { display: block; }
.hero h1 .ln span { display: block; }
.hero h1 .ln:nth-child(2) span {
  color: transparent;
  -webkit-text-stroke: 2px var(--text-hi);
}

/* hero entrance — base state visible; animates only when JS adds .loaded */
@media (prefers-reduced-motion: no-preference) {
  .js .hero.loaded .hero-kicker,
  .js .hero.loaded h1,
  .js .hero.loaded .hero-lead-p,
  .js .hero.loaded .hero-cta,
  .js .hero.loaded .hero-contact { animation: heroUp 1s var(--ease) both; }
  .js .hero.loaded h1 { animation-delay: .06s; }
  .js .hero.loaded .hero-lead-p { animation-delay: .18s; }
  .js .hero.loaded .hero-cta { animation-delay: .28s; }
  .js .hero.loaded .hero-contact { animation-delay: .38s; }
}
@keyframes heroUp { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }

.hero-cta { display: flex; gap: 16px; margin-top: 44px; flex-wrap: wrap; }

.hero-contact {
  margin-top: 52px; padding-top: 28px; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 10px 30px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.hero-contact a, .hero-contact span { display: inline-flex; align-items: center; gap: 9px; transition: color .25s; }
.hero-contact a:hover { color: var(--accent-2); }
.hero-contact .dot { width: 8px; height: 8px; background: var(--accent); flex: none; }

/* hero portrait — hard offset frame, grayscale → color */
.hero-portrait {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 16px 16px 0 rgba(255,42,0,.22);
  transition: box-shadow .5s var(--ease);
}
.hero-portrait:hover { box-shadow: 8px 8px 0 var(--accent); }
.hero-portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
  filter: grayscale(1) contrast(1.08);
  transition: filter .7s var(--ease), transform .7s var(--ease);
}
.hero-portrait:hover img { filter: grayscale(0) contrast(1.02); transform: scale(1.03); }
.hero-portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,5,5,0) 50%, rgba(5,5,5,.7) 100%);
  pointer-events: none;
}
.hero-portrait .pcap {
  position: absolute; left: 16px; bottom: 16px; z-index: 2;
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-hi); display: flex; align-items: center; gap: 9px;
}
.hero-portrait .pcap .live { width: 8px; height: 8px; background: var(--ok); box-shadow: 0 0 0 4px rgba(54,211,153,.18); animation: livepulse 2s var(--ease) infinite; }
@keyframes livepulse { 0%,100% { box-shadow: 0 0 0 0 rgba(54,211,153,.4); } 50% { box-shadow: 0 0 0 6px rgba(54,211,153,0); } }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 3;
  font-family: var(--mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted-2);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.scroll-hint .line { width: 1px; height: 38px; background: linear-gradient(var(--accent), transparent); animation: scrolldn 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes scrolldn { 0%{transform:scaleY(0);opacity:0} 40%{transform:scaleY(1);opacity:1} 100%{transform:scaleY(1) translateY(38px);opacity:0} }

/* ============================================================
   EDUCATION PANELS (education.html)
   ============================================================ */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.edu-grid .full { grid-column: 1 / -1; }
.panel { border: 1px solid var(--line-soft); padding: 32px 30px; background: var(--surface); transition: border-color .35s; position: relative; }
.panel::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.panel:hover { border-color: var(--line); }
.panel:hover::before { transform: scaleX(1); }
.panel h3 { font-size: 12px; font-family: var(--mono); font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: 24px; }
.edu-item { display: flex; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.edu-item:last-child { border-bottom: none; padding-bottom: 0; }
.edu-item .e-school { color: var(--text-hi); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.edu-item .e-deg { color: var(--muted); font-size: 13.5px; margin-top: 3px; font-family: var(--mono); }
.edu-item .e-when { font-family: var(--mono); font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.cert-list, .lang-list { display: flex; flex-direction: column; gap: 12px; }
.cert-list li, .lang-list li { list-style: none; display: flex; align-items: flex-start; gap: 14px; font-size: 14.5px; color: var(--text); }
.cert-list li .ck { color: var(--accent); font-family: var(--mono); font-size: 13px; margin-top: 1px; }
.tools-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.tools-cloud span { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 8px 14px; border: 1px solid var(--line-soft); transition: color .25s, border-color .25s, background .25s, transform .25s var(--ease); }
.tools-cloud span:hover { color: #fff; border-color: var(--accent); background: var(--accent); transform: translateY(-2px); }
.lang-list li { justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.lang-list li:last-child { border-bottom: none; }
.lang-list .lv { font-family: var(--mono); font-size: 12px; color: var(--accent-2); letter-spacing: .06em; }

/* ============================================================
   EARLIER ROLES (experience.html)
   ============================================================ */
.xp-earlier { margin-top: 30px; padding: 26px 30px; border: 1px dashed var(--line); }
.xp-earlier .ee-label { font-family: var(--mono); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.xp-earlier .ee-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px 40px; }
.xp-earlier .ee-item { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.xp-earlier .ee-item .ee-role { color: var(--text); }
.xp-earlier .ee-item .ee-role b { font-weight: 700; color: var(--text-hi); }
.xp-earlier .ee-item .ee-when { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .nav-links, .nav-cta { display: none; }
  .burger { display: flex; }
  .hero-layout { grid-template-columns: 1fr; }
  .hero-portrait { display: none; }
  .xp-earlier .ee-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .edu-grid { grid-template-columns: 1fr; }
  .hero-contact { gap: 8px 18px; font-size: 11.5px; }
  .hero h1 .ln:nth-child(2) span { -webkit-text-stroke-width: 1.4px; }
}


/* ============================================================
   v4 — CUSTOM MAGNETIC CURSOR
   ============================================================ */
.cur-dot, .cur-ring {
  position: fixed; top: 0; left: 0; z-index: 10000;
  pointer-events: none; border-radius: 50%;
  mix-blend-mode: difference; will-change: transform;
}
.cur-dot { width: 7px; height: 7px; background: #fff; transition: width .25s var(--ease), height .25s var(--ease); }
.cur-ring {
  width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.55);
  transition: width .3s var(--ease), height .3s var(--ease), border-color .3s, background .3s;
}
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.cur-hover .cur-ring { width: 62px; height: 62px; border-color: #fff; background: rgba(255,255,255,.06); }
html.cur-hover .cur-dot { width: 0; height: 0; }
@media (pointer: coarse) {
  .cur-dot, .cur-ring { display: none !important; }
  html.has-cursor, html.has-cursor * { cursor: auto !important; }
}
@media (prefers-reduced-motion: reduce) { .cur-dot, .cur-ring { display: none !important; } }

/* ============================================================
   v4 — HERO TITLE GRADIENT SHEEN (solid line only)
   ============================================================ */
.hero h1 .ln:nth-child(1) span {
  background: linear-gradient(115deg, #FFFFFF 0%, #FFFFFF 42%, #FF5500 50%, #FFFFFF 58%, #FFFFFF 100%);
  background-size: 240% 100%; background-position: 120% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: heroSheen 7s linear infinite;
}
@keyframes heroSheen { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero h1 .ln:nth-child(1) span { animation: none; -webkit-text-fill-color: var(--text-hi); color: var(--text-hi); }
}
