/* ============================================================
   Narayan Thakur — Network & Security Engineer Portfolio
   Theme: dark "console rack" — grounded in NOC / CLI visual language
   ============================================================ */

:root{
  --bg:            #0A0E13;
  --bg-raised:     #10161D;
  --panel:         #121924;
  --line:          #1E2833;
  --line-soft:     #171F29;
  --text:          #E7EDF3;
  --text-dim:      #97A4B0;
  --text-faint:    #5C6773;
  --accent:        #4FD1C5;   /* fiber/signal cyan */
  --accent-dim:    #2E7D74;
  --amber:         #F0B429;   /* status/warn LED */
  --green:         #3FD67A;   /* link-up LED */
  --red:           #E5484D;

  --font-head: "Space Grotesk", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

  --radius-sm: 3px;
  --radius-md: 6px;
  --sidebar-w: 260px;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 42px 42px;
  background-position: -1px -1px;
}

h1, h2, h3{
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
p{ margin: 0 0 1em; color: var(--text-dim); }
p:last-child{ margin-bottom: 0; }
strong{ color: var(--text); font-weight: 600; }

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

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html{ scroll-behavior: auto; }
}

/* faint scanline overlay for texture, very subtle */
.crt-overlay{
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.012) 0px,
    rgba(255,255,255,0.012) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ============ layout shell ============ */
.app{
  display: flex;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* ============ sidebar / rack ============ */
.rack{
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
}

.rack-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.brand{ display: flex; align-items: center; gap: 12px; }

.brand-glyph{
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  background: rgba(79,209,197,0.06);
  flex-shrink: 0;
}

.brand-text{ display: flex; flex-direction: column; line-height: 1.3; }
.brand-name{ font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: #fff; }
.brand-role{ font-size: 11px; color: var(--text-faint); }

.menu-toggle{
  display: none;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius-sm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
.menu-toggle span{ width: 16px; height: 1.5px; background: var(--text-dim); }

.nav{ margin-top: 40px; flex: 1; }

.nav-link{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  margin-bottom: 2px;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover{ background: rgba(255,255,255,0.03); color: var(--text); }
.nav-link.is-active{
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(79,209,197,0.07);
}
.nav-index{ color: var(--text-faint); font-size: 12px; width: 26px; flex-shrink: 0; }
.nav-link.is-active .nav-index{ color: var(--accent-dim); }
.nav-label::before{ content: ""; }

.rack-status{
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 11.5px;
  color: var(--text-faint);
}
.status-row{ display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.status-row.muted{ color: var(--text-faint); }
.status-val{ color: var(--text-dim); }
.status-dot{
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(63,214,122,0.8);
  flex-shrink: 0;
}

/* ============ stage / panels ============ */
.stage{
  flex: 1;
  min-width: 0;
  padding: 40px 56px 80px;
}

.panel{ display: none; animation: panelIn 0.4s ease; }
.panel.is-active{ display: block; }

@keyframes panelIn{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: translateY(0); }
}

.term-bar{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin-bottom: 0;
}
.term-dot{ width: 9px; height: 9px; border-radius: 50%; opacity: 0.85; }
.term-dot.r{ background: var(--red); }
.term-dot.y{ background: var(--amber); }
.term-dot.g{ background: var(--green); }
.term-path{ margin-left: 8px; font-size: 12px; color: var(--text-faint); }

/* ============ HOME ============ */
.hero{
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 48px 44px;
  margin-bottom: 28px;
}

.eyebrow-line{
  font-size: 12.5px;
  color: var(--accent);
  margin: 0 0 18px;
}

.hero-copy h1{
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.12;
  margin-bottom: 20px;
}

.hero-desc{ max-width: 46ch; font-size: 14.5px; }

.hero-actions{ display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{
  background: var(--accent);
  color: #06211E;
}
.btn-primary:hover{ background: #6EE0D5; }
.btn-ghost{
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover{ border-color: var(--accent-dim); color: var(--accent); }

/* topology graphic */
.hero-topology{ display: flex; justify-content: center; }
.topo-svg{ width: 100%; max-width: 380px; }
.topo-links line{ stroke: var(--line); stroke-width: 1.4; }
.topo-core circle{ fill: rgba(79,209,197,0.09); stroke: var(--accent); stroke-width: 1.6; }
.topo-core-label{ fill: var(--accent); font-family: var(--font-head); font-size: 15px; font-weight: 700; }
.topo-node circle{ fill: var(--bg-raised); stroke: var(--line); stroke-width: 1.4; }
.topo-node text{ fill: var(--text); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.topo-node .topo-tag{ fill: var(--text-faint); font-size: 9.5px; font-weight: 400; }
.pulse-dot{ fill: var(--accent); filter: drop-shadow(0 0 4px rgba(79,209,197,0.9)); }

.stat-strip{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 40px;
}
.stat{
  background: var(--panel);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-num{ font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--accent); }
.stat-label{ font-size: 11.5px; color: var(--text-faint); }

.block-title{
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: none;
  color: var(--text-faint);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.chip-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; }
.chip-group-label{ display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.chips{ display: flex; flex-wrap: wrap; gap: 8px; }
.chip{
  font-size: 12px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  background: var(--bg-raised);
}
.chip-accent{ border-color: var(--accent-dim); color: var(--accent); background: rgba(79,209,197,0.06); }

/* ============ EXPERIENCE ============ */
.section-title{ font-size: 26px; margin: 24px 0 6px; }
.section-sub{ font-size: 13.5px; margin-bottom: 32px; }

.log{ position: relative; padding-left: 4px; }

.log-entry{
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 20px;
}

.log-rail{ position: relative; display: flex; justify-content: center; }
.log-rail::before{
  content: "";
  position: absolute;
  top: 6px; bottom: -32px;
  width: 1px;
  background: var(--line);
}
.log-entry:last-child .log-rail::before{ display: none; }
.log-node{
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1.5px solid var(--text-faint);
  margin-top: 6px;
  z-index: 1;
}
.log-node.up{
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 7px rgba(63,214,122,0.7);
}

.log-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 32px;
}

.log-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.log-head h3{ font-size: 18px; margin-bottom: 4px; }
.log-org{ font-size: 13px; color: var(--text-dim); margin: 0; }
.log-time{
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.up-badge{
  background: rgba(63,214,122,0.12);
  color: var(--green);
  border: 1px solid rgba(63,214,122,0.4);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
}

.log-list{ display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.log-list li{
  font-size: 13.5px;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
}
.log-list li::before{
  content: "›";
  position: absolute; left: 0; top: 0;
  color: var(--accent-dim);
}

.log-tags{ display: flex; flex-wrap: wrap; gap: 7px; }
.log-tags span{
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text-faint);
}

/* ============ CERTIFICATION ============ */
.cert-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}
.cert-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.cert-card::before{
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.cert-top{ display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.cert-mark{
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 4px 9px;
  border-radius: var(--radius-sm);
}
.cert-state{ font-size: 10px; color: var(--green); letter-spacing: 0.04em; }
.cert-card h3{ font-size: 15px; line-height: 1.4; margin-bottom: 8px; }
.cert-issuer{ font-size: 12.5px; color: var(--text-faint); margin: 0; }

.edu-block{ margin-top: 8px; }
.edu-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.edu-card h3{ font-size: 15.5px; margin-bottom: 6px; }

/* ============ ABOUT ============ */
.about-grid{
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  margin-top: 8px;
  align-items: start;
}
.about-copy p{ font-size: 14.5px; max-width: 64ch; }

.about-facts{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.fact-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.fact-row:last-child{ border-bottom: none; padding-bottom: 0; }
.fact-row:first-child{ padding-top: 0; }
.fact-row span{ color: var(--text-faint); }
.fact-row strong{ text-align: right; }

/* ============ CONNECT ============ */
.connect-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.connect-card{
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.connect-card:hover{ border-color: var(--accent-dim); transform: translateY(-2px); }
.connect-icon{
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(79,209,197,0.08);
  color: var(--accent);
}
.connect-text{ display: flex; flex-direction: column; gap: 2px; flex: 1; }
.connect-text strong{ font-size: 14.5px; }
.connect-text span{ font-size: 12px; color: var(--text-faint); }
.connect-arrow{ color: var(--text-faint); font-size: 16px; }

.ping-result{
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.ping-result .ok{ color: var(--green); }

/* ============ footer ============ */
.site-footer{
  border-top: 1px solid var(--line);
  padding: 18px 56px;
  font-size: 11.5px;
  color: var(--text-faint);
  display: flex;
  gap: 8px;
  max-width: 1440px;
  margin: 0 auto;
}
.footer-sep{ color: var(--line); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px){
  .chip-grid{ grid-template-columns: 1fr; }
  .about-grid{ grid-template-columns: 1fr; }
  .cert-grid{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; padding: 36px 28px; }
  .hero-topology{ order: -1; }
  .topo-svg{ max-width: 280px; }
  .stat-strip{ grid-template-columns: repeat(2, 1fr); }
  .stage{ padding: 32px 28px 64px; }
}

@media (max-width: 760px){
  .app{ flex-direction: column; }
  .rack{
    position: sticky; top: 0; z-index: 50;
    width: 100%; height: auto;
    padding: 16px 20px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .menu-toggle{ display: flex; }
  .nav{
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav.is-open{ max-height: 320px; margin-top: 18px; }
  .nav ul{ display: flex; flex-direction: column; }
  .rack-status{ display: none; }
  .connect-grid{ grid-template-columns: 1fr; }
  .cert-grid{ grid-template-columns: 1fr; }
  .stat-strip{ grid-template-columns: 1fr 1fr; }
  .site-footer{ padding: 16px 20px; flex-direction: column; gap: 2px; }
}

@media (max-width: 480px){
  .hero-copy h1{ font-size: 28px; }
  .stat-strip{ grid-template-columns: 1fr; }
}
