/* ==========================================================================
   Dheeraj Ramasahayam — portfolio stylesheet
   Dark theme, fiber-line research layout, print + reduced-motion styles.
   No external dependencies, fonts, or CDNs — system font stack only.
   ========================================================================== */

:root{
  --bg:#0a0f1a; --panel:#111827; --line:#1f2937;
  --text:#e5e7eb; --muted:#94a3b8;
  --accent:#22d3ee; --heal:#34d399; --fail:#f87171;
  --font:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
}

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

html{ background:var(--bg); }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

img, svg, canvas{ max-width:100%; }

a{ color:var(--accent); }
a:hover, a:focus{ color:var(--heal); }

h1, h2, h3{ line-height:1.2; color:var(--text); }

/* Skip link */

.skip{
  position:absolute;
  left:-9999px;
  top:auto;
  z-index:1000;
  background:var(--panel);
  color:var(--text);
  border:1px solid var(--accent);
  border-radius:8px;
  padding:.75rem 1rem;
}

.skip:focus{
  left:1rem;
  top:1rem;
}

/* Layout */

main{
  max-width:72rem;
  margin:0 auto;
}

section{
  max-width:72rem;
  margin:0 auto;
  padding:5rem 1.5rem;
  scroll-margin-top:5rem;
}

section > h2{
  font-size:1.75rem;
  margin-top:0;
}

.section-lede{
  color:var(--muted);
  max-width:48rem;
}

/* Top navigation */

.topnav{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:100;
  display:flex;
  align-items:center;
  gap:1.25rem;
  padding:.9rem 1.5rem;
  background:rgba(10,15,26,.75);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  overflow-x:auto;
  white-space:nowrap;
}

.topnav a{
  color:var(--text);
  text-decoration:none;
  font-size:.9rem;
}

.topnav a:hover, .topnav a:focus{
  color:var(--accent);
}

.topnav .btn-resume{
  margin-left:auto;
  border:1px solid var(--accent);
  border-radius:8px;
  padding:.4rem .75rem;
  color:var(--accent);
}

.topnav .btn-resume:hover, .topnav .btn-resume:focus{
  background:var(--accent);
  color:var(--bg);
}

@media (max-width:640px){
  .topnav{
    justify-content:flex-start;
  }
  .topnav .btn-resume{
    margin-left:0;
  }
}

/* Hero */

.hero{
  min-height:100svh;
  position:relative;
  display:grid;
  place-items:center;
  overflow:hidden;
  padding:6rem 1.5rem 3rem;
  text-align:center;
}

#topology{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  background:var(--bg);
}

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background:radial-gradient(ellipse at center, rgba(10,15,26,.55) 0%, rgba(10,15,26,.75) 45%, rgba(10,15,26,.95) 100%);
  pointer-events:none;
}

.hero-inner{
  position:relative;
  z-index:1;
  max-width:44rem;
}

.hero .kicker{
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:.85rem;
  color:var(--accent);
  margin:0 0 .5rem;
}

.hero h1{
  font-size:clamp(2rem, 5vw, 3.25rem);
  margin:0 0 1rem;
}

.hero .sub{
  color:var(--muted);
  font-size:1.05rem;
  max-width:38rem;
  margin:0 auto 1.75rem;
}

.hero .hero-caption{
  color:var(--muted);
  font-size:.85rem;
  max-width:36rem;
  margin:1.75rem auto 0;
}

/* Stats */

.stats{
  list-style:none;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:.75rem 1rem;
  margin:0 0 1rem;
  padding:0;
}

.stats li{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:999px;
  padding:.4rem .9rem;
  font-size:.85rem;
  color:var(--muted);
}

/* Cards */

.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:1.25rem;
  transition:border-color .2s ease, transform .2s ease;
}

.card:hover, .card:focus-within{
  border-color:var(--accent);
  transform:translateY(-2px);
}

.card h3{
  margin-top:0;
}

.card .links{
  display:flex;
  gap:1rem;
  flex-wrap:wrap;
  margin-bottom:0;
}

/* Projects grid */

.grid{
  display:grid;
  grid-template-columns:1fr;
  gap:1.25rem;
  margin-top:2rem;
}

@media (min-width:560px){
  .grid{
    grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Research — fiber line */

.paper-line{
  list-style:none;
  margin:2rem 0 0;
  padding:0 0 0 2.25rem;
  position:relative;
}

.paper-line::before{
  content:"";
  position:absolute;
  top:.5rem;
  bottom:.5rem;
  left:.5rem;
  width:2px;
  background:linear-gradient(to bottom, var(--accent), var(--heal));
}

.paper-line li{
  position:relative;
  margin-bottom:1.5rem;
}

.paper-line li:last-child{
  margin-bottom:0;
}

.paper-line li::before{
  content:"";
  position:absolute;
  top:1.4rem;
  left:-1.9rem;
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 4px var(--bg), 0 0 0 5px var(--line);
}

/* Papers 6 and 7 are drafts/in-progress — mark node with fail/muted accent */
.paper-line li:nth-child(n+6)::before{
  background:var(--muted);
}

.paper-card p{
  color:var(--muted);
}

/* Badges */

.badge{
  display:inline-block;
  text-transform:uppercase;
  font-size:.7rem;
  letter-spacing:.04em;
  font-weight:600;
  padding:.25rem .6rem;
  border-radius:999px;
  border:1px solid var(--accent);
  color:var(--accent);
  background:transparent;
  margin-bottom:.6rem;
}

/* Draft / not-yet-published papers (items 6 and 7 in the fiber line) get a
   muted, less prominent badge treatment instead of inventing a new class. */
.paper-line li:nth-child(n+6) .badge{
  border-color:var(--muted);
  color:var(--muted);
}

/* Patent */

.patent-meta{
  color:var(--muted);
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:.9rem;
}

.patent-meta strong{
  color:var(--fail);
}

/* Field work — deploy log */

.deploy-log{
  list-style:none;
  margin:2rem 0 0;
  padding:0;
}

.log-entry{
  border-left:2px solid var(--line);
  padding:.25rem 0 .25rem 1.25rem;
  margin-bottom:2rem;
}

.log-entry:last-child{
  margin-bottom:0;
}

.log-entry h3{
  margin-bottom:.25rem;
}

.log-meta{
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color:var(--heal);
  font-size:.85rem;
  margin-top:0;
}

.log-entry ul{
  color:var(--muted);
  padding-left:1.25rem;
}

/* Skills chips */

.chip-label{
  font-size:1rem;
  color:var(--muted);
  margin:1.5rem 0 .5rem;
}

.chips{
  list-style:none;
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  margin:0 0 1rem;
  padding:0;
}

.chips li{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:999px;
  padding:.3rem .75rem;
  font-size:.8rem;
  color:var(--text);
}

.certs, .education{
  color:var(--muted);
  font-size:.9rem;
}

/* Footer */

footer{
  text-align:center;
  color:var(--muted);
  font-size:.85rem;
  padding:2rem 1.5rem 3rem;
}

/* Reveal-on-scroll (progressive enhancement; no-JS always visible) */

html.js .reveal{
  opacity:0;
  transform:translateY(16px);
  transition:opacity .6s, transform .6s;
}

html.js .reveal.visible{
  opacity:1;
  transform:none;
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce){
  *{
    animation:none !important;
    transition:none !important;
  }
}

/* Print */

@media print{
  *{
    background:#fff !important;
    color:#000 !important;
    box-shadow:none !important;
  }

  html.js .reveal{
    opacity:1 !important;
    transform:none !important;
  }

  #topology, .topnav, .skip{
    display:none !important;
  }

  .hero{
    min-height:0;
    padding:1rem 0;
  }

  .hero::before{
    display:none;
  }

  a{
    text-decoration:underline;
  }

  a[href^="http"]::after{
    content:" (" attr(href) ")";
    font-size:.8em;
  }

  .card, .log-entry, .paper-card{
    border:1px solid #ccc !important;
    break-inside:avoid;
    page-break-inside:avoid;
  }
}
