/* ===== Cesar Pagano — Portfolio ===== */
:root {
  --bg: #0a0a0d;
  --bg-2: #0e0e12;
  --panel: #111116;
  --panel-2: #17171d;
  --line: #2a2a31;
  --line-2: #3a3a44;
  --white: #f2f2f4;
  --grey: #c3c6cc;
  --muted: #9a9ca5;
  --dim: #686a74;
  --red: #e3202f;
  --red-deep: #7a121b;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 85% -5%, rgba(227, 32, 47, .16), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(227, 32, 47, .07), transparent 60%),
    linear-gradient(180deg, #0c0b0e 0%, var(--bg) 40%);
  background-attachment: fixed;
  color: var(--grey);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* subtle grain / scanlines like the media kit */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
}
main, .foot, .nav { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ===== helpers ===== */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.red { color: var(--red); }
.dim { color: var(--dim); }
.muted { color: var(--muted); }
.strong { color: var(--white); font-weight: 700; }
.small { font-size: 11px; }

/* corner brackets framing the viewport */
.frame { position: fixed; inset: 10px; pointer-events: none; z-index: 50; }
.frame i { position: absolute; width: 22px; height: 22px; border: 1px solid var(--line-2); }
.frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ===== nav ===== */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: rgba(10, 10, 13, .78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--white); }
.sq {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  background: var(--red); color: #fff; border-radius: 3px;
  font: 700 10px/1 var(--mono); letter-spacing: 0;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: flex; gap: 6px; padding: 6px 0; position: relative;
  transition: color .2s;
}
.nav-links a b { color: var(--red); font-weight: 500; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* ===== shared section parts ===== */
.section { padding-block: clamp(64px, 9vw, 120px) 0; }
.kicker { display: flex; align-items: center; gap: 12px; font: 500 11px/1 var(--mono); letter-spacing: .18em; color: var(--grey); text-transform: uppercase; }
.tag { display: inline-grid; place-items: center; width: 22px; height: 22px; background: var(--red); color: #fff; border-radius: 2px; font-size: 9px; letter-spacing: 0; }
.kicker-line { position: relative; height: 1px; background: var(--line); margin: 16px 0 26px; max-width: 640px; }
.kicker-line::before { content: ""; position: absolute; left: 0; top: -1px; height: 3px; width: 160px; background: var(--red); }

.mega { font-family: var(--sans); font-weight: 800; line-height: .9; letter-spacing: -.015em; font-size: clamp(64px, 13.5vw, 196px); text-transform: uppercase; }
.mega span.w, .mega span.g { display: block; }
.mega .w { color: var(--white); }
.mega .g { color: var(--grey); }
.mega-sm { font-size: clamp(52px, 10vw, 136px); }

.tagbar { margin-top: 22px; padding-left: 14px; border-left: 3px solid var(--red); position: relative; max-width: 760px; }
.tagbar::before { content: ""; position: absolute; left: -3px; right: 0; top: -12px; height: 1px; background: var(--line-2); max-width: 560px; }
.tagbar .t1 { font: 700 clamp(12px, 1.4vw, 15px)/1.5 var(--mono); letter-spacing: .14em; color: var(--white); text-transform: uppercase; }
.tagbar .t2 { font: 700 clamp(12px, 1.4vw, 15px)/1.5 var(--mono); letter-spacing: .14em; color: var(--red); }
.tagbar .sub { margin-top: 2px; color: var(--muted); }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid var(--line); margin: 56px 0 26px; }
.sec-head h2 { font: 800 clamp(24px, 3vw, 34px)/1.1 var(--sans); color: var(--white); letter-spacing: .005em; }
.sec-head .meta { font-size: 11px; color: var(--grey); }
.h-index { font-family: var(--mono) !important; letter-spacing: .06em !important; }

/* ===== hero ===== */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 32px 48px; padding-top: clamp(40px, 7vw, 88px); }
.hero-main { min-width: 0; }
.hero .mega { font-size: clamp(64px, 10.5vw, 158px); }
.hero-lead { margin-top: 28px; max-width: 560px; color: var(--muted); font-size: clamp(16px, 1.5vw, 18px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px; border: 1px solid var(--line-2); border-radius: 3px;
  font: 700 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--white);
  background: rgba(17, 17, 22, .7); transition: border-color .2s, background .2s, transform .2s;
}
.btn:hover { border-color: var(--red); transform: translateY(-2px); }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: #ff2f3f; }
.btn-ghost { background: transparent; }

.hud { align-self: start; margin-top: 4px; }
.hud-top { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--white); }
.hud-svg { width: 100%; max-width: 300px; margin: 6px 0 0 auto; }
.hud-svg .play { animation: pulse 2.4s ease-in-out infinite; transform-origin: 155px 130px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.hud-bars { display: grid; gap: 6px; margin-top: -24px; max-width: 200px; }
.hud-bars i { display: block; height: 3px; background: var(--red-deep); }
.hud-bars i:first-child { background: var(--red); }
.hud-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 11px; color: var(--grey); }
.hud-foot .red { font-variant-numeric: tabular-nums; }

.stats { grid-column: 1 / -1; list-style: none; margin: 40px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats li { border-left: 3px solid var(--red); padding: 4px 0 4px 14px; }
.stats b { display: block; font: 800 clamp(26px, 3.4vw, 40px)/1.05 var(--sans); color: var(--white); }
.stats span { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ===== profile ===== */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
.profile-text { display: grid; gap: 34px; padding-left: clamp(0px, 3vw, 28px); }
.item-h { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: var(--red); margin-bottom: 10px; }
.item-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.item p { color: var(--muted); max-width: 64ch; }
.profile-side { border-left: 1px solid var(--line); padding-left: 24px; display: flex; flex-direction: column; gap: 22px; }
.system { border: 1px solid var(--line-2); border-left: 4px solid var(--red); padding: 18px; background: var(--panel); }
.label-w { font-size: 10px; color: var(--white); }
.sys-words { margin-top: 14px; font-size: 15px; line-height: 1.6; color: var(--grey); font-weight: 700; }
.sys-bars { display: grid; gap: 4px; margin-top: 10px; }
.sys-bars i { height: 3px; background: var(--red-deep); }
.side-list { margin: 0; display: grid; gap: 0; }
.side-list div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.side-list dt { font-size: 10px; color: var(--dim); }
.side-list dd { margin: 4px 0 0; font-size: 13px; color: var(--grey); }
.side-list dd.strong { font-size: 15px; }

/* ===== timeline (editing tracks) ===== */
.tl { position: relative; margin-top: 48px; padding: 30px 14px 16px 44px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); overflow: hidden; }
.tl-ruler { position: relative; height: 22px; margin-bottom: 10px; border-bottom: 1px solid var(--line-2);
  background-image: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px calc(100% / 24)); background-size: 100% 6px; background-repeat: no-repeat; background-position: bottom; }
.tl-ruler span { position: absolute; top: -4px; font: 500 10px/1 var(--mono); color: var(--dim); transform: translateX(-2px); }
.tl-track { position: relative; height: 34px; margin-bottom: 8px; }
.tl-track em { position: absolute; left: -32px; top: 9px; font-style: normal; font-size: 10px; color: var(--dim); }
.clip { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; border-radius: 2px; font: 700 10px/1 var(--mono); letter-spacing: .08em; transform-origin: left; }
.clip.a { background: rgba(227, 32, 47, .16); border: 1px solid rgba(227, 32, 47, .55); color: var(--white); }
.clip.a.hot { background: var(--red); color: #fff; }
.clip.b { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); justify-content: center; padding: 0 2px; }
.tl-playhead { position: absolute; top: 18px; bottom: 8px; left: 44px; width: 2px; background: var(--white); box-shadow: 0 0 12px rgba(255,255,255,.4); }
.tl-playhead b { position: absolute; top: -6px; left: -5px; width: 12px; height: 10px; background: var(--white); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.js .tl .clip { transform: scaleX(0); transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.js .tl.in .clip { transform: scaleX(1); }
.js .tl .tl-playhead { transition: left 2.6s cubic-bezier(.4,0,.2,1) .3s; }
.js .tl.in .tl-playhead { left: calc(44px + (100% - 58px) * .99); }
.js .tl.in .clip:nth-child(3) { transition-delay: .25s; }
.js .tl.in .clip:nth-child(4) { transition-delay: .5s; }
.js .tl.in .clip:nth-child(5) { transition-delay: .75s; }
.tl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 10px; color: var(--dim); }
.lg { display: inline-block; width: 18px; height: 8px; border-radius: 1px; }
.lg.a { background: var(--red); }
.lg.b { background: var(--panel-2); border: 1px solid var(--line-2); }

.journey { list-style: none; margin: 48px 0 0; padding: 0; position: relative; }
.journey::before { content: ""; position: absolute; left: 180px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.j { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0; padding-bottom: 44px; position: relative; }
.j::before { content: ""; position: absolute; left: 175px; top: 6px; width: 11px; height: 11px; background: var(--bg); border: 2px solid var(--red); transform: rotate(45deg); }
.j-hot::before { background: var(--red); }
.j-side::before { border-color: var(--line-2); }
.j-time { display: flex; flex-direction: column; gap: 4px; padding-right: 28px; font-size: 11px; color: var(--dim); }
.j-time .red { font-size: 14px; font-weight: 700; }
.j-side .j-time .red { color: var(--grey); }
.j-body { padding-left: 36px; }
.j-body h3 { font: 800 clamp(20px, 2.3vw, 26px)/1.2 var(--sans); color: var(--white); }
.j-co { margin: 6px 0 12px; font-size: 11px; color: var(--red); font-weight: 700; }
.j-side .j-co { color: var(--muted); }
.j-body > p { color: var(--muted); max-width: 70ch; }
.j-hot .j-body { border: 1px solid var(--line-2); border-left: 4px solid var(--red); background: var(--panel); padding: 22px 24px; margin-left: 36px; border-radius: 3px; }
.j-list { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.j-list li::marker { color: var(--red); }

/* ===== skills ===== */
.skills { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; }
.skills li {
  display: flex; align-items: center; gap: 18px; padding: 14px 16px;
  border: 1px solid var(--line-2); border-left: 5px solid var(--red); border-radius: 3px;
  background: var(--panel); color: var(--white); font-size: 13px; font-weight: 700;
  transition: background .2s, transform .2s;
}
.skills li:hover { background: var(--panel-2); transform: translateX(4px); }
.skills b { color: var(--red); font-size: 10px; font-weight: 500; min-width: 18px; }

.manifesto { margin: 56px 0 0; border: 1px solid var(--line-2); border-left: 6px solid var(--red); border-radius: 4px; padding: clamp(22px, 3vw, 34px); background: rgba(14, 14, 18, .8); }
.manifesto > p:first-child { font-size: 13px; font-weight: 700; }
.m-quote { margin-top: 14px !important; font: 800 clamp(20px, 2.6vw, 30px)/1.35 var(--sans); color: var(--white); max-width: 30ch; }
.manifesto footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 26px; font-size: 10px; color: var(--muted); }

/* ===== works ===== */
.group { border: 1px solid var(--line-2); border-radius: 4px; background: rgba(12, 12, 15, .85); margin-bottom: 18px; overflow: hidden; }
.group-h, .proj-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; background: var(--panel-2); border-left: 5px solid var(--red); font-size: 12px; color: var(--white); font-weight: 700; position: relative; }
.group-h .dim, .proj-h .dim { color: var(--grey); font-weight: 500; font-size: 10px; align-self: center; }
.work { display: grid; grid-template-columns: 36px minmax(0, 1.1fr) minmax(0, 1fr) 24px; align-items: center; gap: 12px; margin: 0 22px; padding: 14px 0; border-bottom: 1px solid var(--line); position: relative; transition: background .2s; }
.group > .work:last-of-type { border-bottom: 0; }
.work > b { color: var(--red); font-size: 10px; font-weight: 500; align-self: start; padding-top: 6px; }
.w-name { display: flex; flex-direction: column; border-left: 1px solid var(--red); padding-left: 10px; font: 800 clamp(17px, 1.8vw, 21px)/1.2 var(--sans); color: var(--white); transition: color .2s, transform .25s; }
.w-name small { font-size: 10px; font-weight: 500; color: var(--red); margin-top: 3px; }
.w-name small i { font-style: normal; color: var(--dim); }
.w-note { font-size: 11px; text-transform: none; letter-spacing: .02em; color: var(--dim); }
.w-go { color: var(--dim); font-size: 18px; transition: color .2s, transform .2s; justify-self: end; }
.work:hover .w-name { transform: translateX(6px); }
.work:hover .w-go { color: var(--red); transform: translate(3px, -3px); }
.work:hover .w-name small i { color: var(--grey); }
.group-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 6px 22px 0; padding: 18px 0; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); font-weight: 700; }

/* ===== special projects ===== */
.proj { border: 1px solid var(--line-2); border-left: 6px solid var(--red); border-radius: 4px; background: rgba(12, 12, 15, .85); margin-bottom: 18px; overflow: hidden; }
.proj-h { border-left: 0; }
.proj-b { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; padding: clamp(20px, 3vw, 32px); }
.proj-l h3 { font: 800 clamp(28px, 3.6vw, 44px)/1.1 var(--sans); color: var(--white); text-transform: uppercase; margin-bottom: 14px; }
.proj-l .muted { margin-top: 2px; }
.direct { display: block; margin-top: 28px; max-width: 480px; border: 1px solid var(--line-2); border-left: 4px solid var(--red); border-radius: 3px; padding: 14px 16px; background: var(--bg); transition: border-color .2s, transform .2s; }
.direct:hover { border-color: var(--red); transform: translateY(-2px); }
.d-go { display: block; margin-top: 4px; color: var(--grey); }
.d-go b { color: var(--red); font: 800 18px/1.2 var(--sans); }
.viz { border: 1px solid var(--line-2); border-left: 5px solid var(--red); border-radius: 3px; padding: 16px 18px; background: var(--bg-2); display: flex; flex-direction: column; gap: 14px; color: var(--grey); }
.graph { width: 100%; height: auto; }
.js .graph .line { stroke-dasharray: 320; stroke-dashoffset: 320; transition: stroke-dashoffset 1.6s ease .2s; }
.js .in .graph .line { stroke-dashoffset: 0; }
.frames { display: flex; gap: 16px; justify-content: center; }
.frames div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.frames i { width: 52px; height: 52px; border: 1px solid var(--line-2); background: linear-gradient(#2a0f13, #2a0f13) center / 72% 72% no-repeat; }
.clock { width: 56px; margin: 0 auto; }
.clock .hand { transform-origin: 30px 36px; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.explore { margin-top: 30px; }
.explore .sec-head { margin-top: 30px; }

/* ===== contact ===== */
.contact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 48px; }
.c-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--line-2); border-left: 5px solid var(--red); border-radius: 3px; background: var(--panel); min-width: 0; transition: transform .2s, border-color .2s, background .2s; }
.c-card b { color: var(--white); font: 700 15px/1.3 var(--sans); overflow-wrap: anywhere; }
.c-card:hover { transform: translateY(-3px); border-color: var(--red); background: var(--panel-2); }

/* ===== footer ===== */
.foot { padding-top: 90px; padding-bottom: 40px; font-size: 10px; }
.foot-ticks { height: 10px; border-bottom: 1px solid var(--line-2); background-image: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 40px); margin-bottom: 14px; }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 3px 0; }

/* ===== reveal ===== */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ===== responsive ===== */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hud { display: none; }
  .profile { grid-template-columns: 1fr; }
  .profile-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proj-b { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .journey::before { left: 5px; }
  .j { grid-template-columns: 1fr; padding-left: 30px; padding-bottom: 36px; }
  .j::before { left: 0; }
  .j-time { flex-direction: row; gap: 12px; align-items: baseline; padding: 0 0 8px; }
  .j-body { padding-left: 0; }
  .j-hot .j-body { margin-left: 0; padding: 18px; }
  .work { grid-template-columns: 26px minmax(0, 1fr) 20px; margin: 0 16px; }
  .w-note { display: none; }
  .group-foot { margin-inline: 16px; }
  .tl { padding-left: 34px; }
  .tl-track em { left: -26px; }
  .tl-playhead { left: 34px; }
  .js .tl.in .tl-playhead { left: calc(34px + (100% - 48px) * .99); }
  .clip { font-size: 8px; padding: 0 4px; }
  .clip.b { font-size: 0; }
  .frame { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .tl .clip { transform: none; }
  .js .graph .line { stroke-dashoffset: 0; }
}
