/* ============ Piyush Yadav — Data Center Portfolio ============ */
:root {
  --bg: #050a18;
  --bg-2: #081228;
  --panel: #0b1a36;
  --panel-2: #0e2145;
  --line: #16305e;
  --blue: #2f7bff;
  --cyan: #38c8ff;
  --ice: #9fd7ff;
  --text: #d7e6ff;
  --muted: #7d97c4;
  --green: #38e08c;
  --amber: #ffc447;
  --red: #ff5468;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: rgba(47, 123, 255, .4); }
a { color: var(--cyan); text-decoration: none; }
code { font-family: var(--mono); color: var(--ice); background: rgba(47,123,255,.12); padding: 1px 6px; border-radius: 4px; font-size: .9em; }

/* full-page animated data-center backdrop (drawn by bg.js) */
#bgCanvas {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  width: 100vw; height: 100vh;
}

.blink { animation: blink 1.05s steps(1) infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }
.prompt-sign { color: var(--green); font-family: var(--mono); }
.accent { color: var(--cyan); text-shadow: 0 0 22px rgba(56, 200, 255, .55); }
.cmd { color: var(--green); font-family: var(--mono); font-size: .8em; }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(5, 10, 24, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--text); }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  padding: 7px 10px; border-radius: 6px; transition: all .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--cyan); background: rgba(47,123,255,.12); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--cyan); display: block; }

/* ============ HERO ============ */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; text-align: center; padding: 110px 24px 60px;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(47,123,255,.20), transparent 65%),
    radial-gradient(ellipse 45% 35% at 15% 90%, rgba(56,200,255,.10), transparent 60%),
    radial-gradient(ellipse 45% 35% at 85% 90%, rgba(47,123,255,.10), transparent 60%),
    var(--bg);
}
.rack-bg { position: absolute; inset: 0; overflow: hidden; opacity: .5; perspective: 700px; }
.rack-lights {
  position: absolute; inset: -10% -20%;
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 14px 22px;
  transform: rotateX(24deg) translateY(-4%);
}
.rl {
  height: 4px; border-radius: 2px;
  background: rgba(47,123,255,.35);
  animation: rlPulse 3s ease-in-out infinite;
}
.rl.bright { background: var(--cyan); box-shadow: 0 0 12px rgba(56,200,255,.8); }
.rl.white { background: #e8f4ff; box-shadow: 0 0 10px rgba(232,244,255,.8); }
@keyframes rlPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.hero-content { position: relative; z-index: 2; max-width: 900px; }
.hero-kicker { font-family: var(--mono); color: var(--green); margin-bottom: 10px; letter-spacing: .05em; }
.hero-name {
  font-size: clamp(2.6rem, 8vw, 5.2rem); font-weight: 800; letter-spacing: .04em;
  line-height: 1.05; margin-bottom: 14px;
}
.hero-role { font-family: var(--mono); font-size: clamp(1rem, 3vw, 1.45rem); color: var(--ice); min-height: 2em; }
.hero-tag { color: var(--muted); margin-top: 10px; font-size: 1.02rem; }
.hero-cta { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 8px; font-weight: 600;
  font-family: var(--mono); font-size: .9rem; transition: all .22s; border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #04101f;
  box-shadow: 0 6px 26px rgba(47,123,255,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(56,200,255,.55); }
.btn-ghost { border-color: var(--line); color: var(--ice); background: rgba(11,26,54,.5); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.hero-stats { margin-top: 52px; display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.stat {
  background: rgba(11,26,54,.65); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 26px; min-width: 150px;
}
.stat-num { display: block; font-family: var(--mono); font-size: 2rem; font-weight: 700; color: var(--cyan); }
.stat-num::after { content: "+"; color: var(--blue); }
.stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: var(--muted); animation: bob 1.8s ease-in-out infinite; font-size: .9rem;
}
@keyframes bob { 50% { transform: translateX(-50%) translateY(7px); } }

/* ============ SECTIONS ============ */
.section { max-width: 1200px; margin: 0 auto; padding: 90px 24px 30px; }
.section-wide { max-width: 1320px; }
.section-title { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 700; margin-bottom: 28px; font-family: var(--mono); }
.section-sub { color: var(--muted); margin: -16px 0 26px; max-width: 760px; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 12px; padding: 26px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card:hover { border-color: rgba(56,200,255,.45); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s, transform .6s; }
.reveal.vis { opacity: 1; transform: none; }

/* ============ ABOUT ============ */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start; }
.about-text p { margin-bottom: 14px; color: var(--text); }
.about-facts { list-style: none; margin-top: 18px; display: grid; gap: 9px; }
.about-facts li { font-size: .92rem; color: var(--muted); }
.fact-key {
  display: inline-block; min-width: 96px; font-family: var(--mono); font-size: .74rem;
  color: var(--cyan); text-transform: uppercase; letter-spacing: .06em;
}
.code-card { padding: 0; overflow: hidden; }
.code-titlebar {
  display: flex; align-items: center; gap: 7px; padding: 11px 15px;
  background: rgba(8, 18, 40, .9); border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.code-file { margin-left: 8px; font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.code-card pre { padding: 18px 20px; overflow-x: auto; font-size: .8rem; line-height: 1.75; }
.code-card code { background: none; padding: 0; color: var(--text); }
.code-card .c { color: #5a7bab; } .code-card .k { color: var(--cyan); } .code-card .s { color: var(--green); }

/* ============ SKILLS ============ */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.skill-card h3 { font-size: 1.02rem; margin-bottom: 18px; }
.skill-bar { margin-bottom: 15px; }
.skill-bar span { font-size: .82rem; color: var(--muted); display: block; margin-bottom: 6px; }
.bar { height: 7px; background: rgba(22,48,94,.8); border-radius: 4px; overflow: hidden; }
.fill {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 12px rgba(56,200,255,.5);
  transition: width 1.2s cubic-bezier(.22,.8,.3,1);
}

/* ============ TIMELINE ============ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue), transparent);
}
.tl-item { position: relative; margin-bottom: 26px; }
.tl-dot {
  position: absolute; left: -28px; top: 26px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 0 4px rgba(56,200,255,.2), 0 0 16px rgba(56,200,255,.8);
}
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl-head h3 { font-size: 1.15rem; }
.tl-badge {
  font-family: var(--mono); font-size: .72rem; color: var(--green);
  border: 1px solid rgba(56,224,140,.4); background: rgba(56,224,140,.08);
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.tl-org { color: var(--cyan); font-size: .9rem; margin: 6px 0 14px; font-family: var(--mono); }
.tl-list { list-style: none; display: grid; gap: 9px; }
.tl-list li { padding-left: 20px; position: relative; color: var(--muted); font-size: .94rem; }
.tl-list li::before { content: "▸"; position: absolute; left: 0; color: var(--cyan); }
.tl-list strong { color: var(--text); }

/* ============ PROJECTS ============ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 20px; }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 16px 40px rgba(3, 10, 26, .8); }
.project-icon { font-size: 1.7rem; margin-bottom: 12px; }
.project-card h3 { font-size: 1.02rem; margin-bottom: 10px; color: var(--ice); }
.project-card p { font-size: .88rem; color: var(--muted); margin-bottom: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span {
  font-family: var(--mono); font-size: .68rem; color: var(--cyan);
  border: 1px solid rgba(56,200,255,.3); background: rgba(47,123,255,.08);
  padding: 3px 10px; border-radius: 999px;
}

/* ============ AWS ARCHITECTURE ============ */
.aws-card { padding: 18px; }
.aws-svg { width: 100%; height: auto; display: block; font-family: var(--mono); }
.aline { stroke: #2f7bff; stroke-width: 2; fill: none; marker-end: url(#arr); opacity: .8; }
.adash { stroke-dasharray: 6 6; opacity: .55; marker-end: none; }
.ab { fill: rgba(11, 26, 54, .92); stroke: var(--line); stroke-width: 1.5; }
.ab-g:hover .ab { stroke: var(--cyan); }
.ab-vpc { fill: rgba(8, 18, 40, .6); stroke: rgba(56, 200, 255, .5); }
.ab-ec2 { fill: rgba(47, 123, 255, .16); stroke: rgba(47, 123, 255, .6); }
.ab-db { fill: rgba(56, 224, 140, .10); stroke: rgba(56, 224, 140, .55); }
.ab-s3 { fill: rgba(56, 224, 140, .08); stroke: rgba(56, 224, 140, .45); }
.az { fill: rgba(47, 123, 255, .05); stroke: rgba(47, 123, 255, .35); stroke-dasharray: 5 5; }
.at { fill: var(--text); font-size: 15px; text-anchor: middle; font-weight: 600; }
.as { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.t-vpc { fill: var(--cyan); letter-spacing: .08em; }
.t-sm { font-size: 12.5px; }
.t-xs { font-size: 9.5px; }
.pkt { fill: var(--cyan); filter: drop-shadow(0 0 5px var(--cyan)); }
.pkt-bak { fill: var(--green); filter: drop-shadow(0 0 5px var(--green)); }

/* ============ REVERSE PROXY + SECURITY ============ */
.athin { stroke-width: 1.2; opacity: .5; marker-end: none; }
.ab-ip { stroke: rgba(255, 196, 71, .55); }
.ab-proxy { stroke: rgba(56, 200, 255, .65); fill: rgba(47, 123, 255, .12); }
.t-ipaddr { fill: var(--amber); font-size: 14px; letter-spacing: .08em; }
.proxy-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; align-items: start; }
.proxy-points { padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.proxy-points p { font-size: .84rem; color: var(--muted); margin: 7px 0; }
.proxy-points b { color: var(--ice); }

.sec-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: start; }
.f2b-ban { background: rgba(255, 84, 104, .08); border-left: 2px solid var(--red); padding-left: 6px; }
.ban-list { display: grid; gap: 8px; min-height: 90px; }
.ban-item {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 84, 104, .08); border: 1px solid rgba(255, 84, 104, .4);
  border-radius: 7px; padding: 8px 13px; font-family: var(--mono); font-size: .78rem;
}
.ban-ip { color: var(--red); }
.ban-when { color: var(--muted); font-size: .7rem; }
.ban-empty { color: var(--muted); font-family: var(--mono); font-size: .76rem; padding: 10px 2px; }
.jail-pre { background: #04091a; border: 1px solid var(--line); border-radius: 0 0 8px 8px; padding: 14px 16px; overflow-x: auto; font-size: .76rem; line-height: 1.8; font-family: var(--mono); }
.jail-pre .k { color: var(--cyan); } .jail-pre .s { color: var(--green); } .jail-pre .c { color: #5a7bab; }

@media (max-width: 960px) {
  .proxy-grid, .sec-grid { grid-template-columns: 1fr; }
}

/* ============ NOC / DATA CENTER ============ */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; margin-left: 10px;
  font-size: .62rem; letter-spacing: .18em; color: var(--green);
  border: 1px solid rgba(56,224,140,.4); border-radius: 999px; padding: 4px 12px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: blink 1.4s infinite; box-shadow: 0 0 10px var(--green); }
.noc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.noc-title {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; color: var(--ice);
  margin-bottom: 14px; display: flex; justify-content: space-between; align-items: baseline;
}
.chart-val { color: var(--cyan); font-size: .9rem; }
.host-rows { display: grid; gap: 8px; }
.host-row {
  display: flex; justify-content: space-between; font-size: .84rem;
  border-bottom: 1px dashed rgba(22,48,94,.9); padding-bottom: 7px;
}
.host-row span { color: var(--muted); font-family: var(--mono); font-size: .76rem; }
.host-row b { color: var(--text); font-weight: 500; font-family: var(--mono); font-size: .8rem; text-align: right; }
.svc-lights { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.svc { font-family: var(--mono); font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.led {
  width: 9px; height: 9px; border-radius: 50%; background: #24406e; display: inline-block;
}
.led-on { background: var(--green); box-shadow: 0 0 8px var(--green); animation: ledFlicker 2.6s infinite; }
.led-warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.led-err { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink .8s infinite; }
@keyframes ledFlicker { 0%,100% { opacity: 1; } 92% { opacity: 1; } 96% { opacity: .4; } }

.noc-chart canvas { width: 100%; display: block; }

.racks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rack {
  background: linear-gradient(180deg, #0a1830, #060f22);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px 8px;
}
.rack-name { font-family: var(--mono); font-size: .62rem; color: var(--muted); text-align: center; margin-bottom: 8px; letter-spacing: .18em; }
.rack-units { display: grid; gap: 4px; }
.ru {
  height: 11px; border-radius: 2px; background: #0d1f3f; border: 1px solid #12294f;
  display: flex; align-items: center; gap: 3px; padding: 0 4px;
}
.ru i { width: 4px; height: 4px; border-radius: 50%; display: block; }
.ru .g1 { background: var(--green); box-shadow: 0 0 5px var(--green); }
.ru .g2 { background: var(--cyan); box-shadow: 0 0 5px var(--cyan); }
.ru .gw { background: var(--amber); box-shadow: 0 0 5px var(--amber); }
.ru .ge { background: var(--red); box-shadow: 0 0 5px var(--red); }
.ru .off { background: #1b3560; }
.rack-legend { display: flex; gap: 18px; margin-top: 14px; font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.rack-legend span { display: flex; align-items: center; gap: 6px; }

.log-window {
  font-family: var(--mono); font-size: .74rem; line-height: 1.8; height: 300px;
  overflow-y: auto; background: #04091a; border: 1px solid var(--line); border-radius: 8px; padding: 14px;
}
.log-line { white-space: nowrap; }
.log-time { color: #4a6a9c; }
.log-ok { color: var(--green); }
.log-warn { color: var(--amber); }
.log-err { color: var(--red); }
.log-info { color: var(--ice); }

/* ============ TERMINAL ============ */
.term { padding: 0; overflow: hidden; }
.term-body {
  background: #04091a; padding: 18px; height: 440px; overflow-y: auto;
  font-family: var(--mono); font-size: .84rem; line-height: 1.75; cursor: text;
}
.term-body:focus { outline: none; }
#termOut div { white-space: pre-wrap; word-break: break-word; }
.term-input-line { display: flex; gap: 8px; align-items: center; }
.term-prompt { color: var(--green); white-space: nowrap; }
#termInput {
  flex: 1; background: none; border: 0; outline: none; color: var(--text);
  font-family: var(--mono); font-size: .84rem; caret-color: var(--cyan);
}
.t-cyan { color: var(--cyan); } .t-green { color: var(--green); }
.t-amber { color: var(--amber); } .t-red { color: var(--red); }
.t-mut { color: var(--muted); } .t-ice { color: var(--ice); }

/* ============ CONTACT ============ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.contact-card { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; color: var(--text); }
.contact-card:hover { transform: translateY(-4px); }
.contact-icon { font-size: 1.5rem; }
.contact-key { font-family: var(--mono); font-size: .66rem; letter-spacing: .2em; color: var(--muted); }
.contact-val { font-size: .9rem; color: var(--ice); word-break: break-all; }
.contact-cta { text-align: center; margin-top: 36px; }

/* ============ FOOTER ============ */
.footer {
  margin-top: 90px; border-top: 1px solid var(--line); padding: 34px 24px 40px;
  text-align: center; font-family: var(--mono); font-size: .82rem; color: var(--muted);
  background: var(--bg-2);
}
.footer-copy { margin-top: 8px; font-size: .72rem; }
.footer-admin { color: var(--muted); }
.footer-admin:hover { color: var(--cyan); }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .about-grid, .noc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: rgba(5,10,24,.97); border-bottom: 1px solid var(--line); padding: 12px 20px;
  }
  .nav-links.open { display: flex; }
  .racks { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 12px; }
  .stat { min-width: 120px; padding: 12px 16px; }
}
