/* ============================================================
   G. Bhanu Prakash — Portfolio
   Dark · editorial · engineering-precise
   ============================================================ */

:root {
  /* Palette — charcoal base with warm amber accents */
  --bg:           #0f1014;
  --bg-elev:      #16171d;
  --bg-card:      #1a1c23;
  --bg-card-hi:   #1f2129;
  --border:       #262932;
  --border-hi:    #353946;

  --ink:          #e8e6e1;     /* primary text, slightly warm white */
  --ink-soft:     #b6b4ae;     /* secondary */
  --ink-mute:     #7e7c76;     /* tertiary */

  --accent:       #d4a574;     /* warm amber — used sparingly */
  --accent-hi:    #e6bd8c;
  --accent-soft:  rgba(212, 165, 116, 0.12);

  --signal:       #8fb98a;     /* small "live" dot — muted sage */

  /* Type */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --max:          1100px;
  --gutter:       clamp(20px, 5vw, 56px);
  --radius:       14px;
  --radius-sm:    8px;

  /* Motion */
  --ease:         cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Atmospheric layers ---------- */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
}
.glow-1 {
  top: -10vh; right: -10vw;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.35), transparent 60%);
}
.glow-2 {
  bottom: -20vh; left: -10vw;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(95, 120, 160, 0.25), transparent 60%);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(15, 16, 20, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.mark-dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: clamp(12px, 2vw, 26px);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* ---------- Main / Sections ---------- */
main {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(72px, 12vh, 120px) 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  padding-top: 8px;
}
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(80px, 18vh, 160px) 0 clamp(60px, 10vh, 100px);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "text portrait"
    "stats stats";
  column-gap: clamp(32px, 6vw, 72px);
  row-gap: 40px;
  align-items: center;
}
@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "portrait"
      "text"
      "stats";
    row-gap: 32px;
    justify-items: start;
  }
}

.hero-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 620px;
}

/* Portrait */
.hero-portrait {
  grid-area: portrait;
  display: flex;
  justify-content: center;
  align-items: center;
}
.portrait-frame {
  position: relative;
  width: clamp(220px, 28vw, 320px);
  aspect-ratio: 1;
}
.portrait-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px dashed rgba(212, 165, 116, 0.35);
  animation: spin 60s linear infinite;
}
.portrait-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.portrait-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-hi);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 165, 116, 0.12);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.portrait-frame:hover .portrait-img {
  transform: scale(1.02);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(212, 165, 116, 0.3);
}
.portrait-tag {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(15, 16, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  white-space: nowrap;
}
.portrait-tag-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.portrait-tag-text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(143, 185, 138, 0.15);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 10vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ink);
}
.hero-first {
  display: block;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
}
.hero-last {
  display: block;
  font-weight: 600;
}
.hero-suffix {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.28em;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  vertical-align: 0.9em;
  margin-left: 0.4em;
}

.hero-role {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.005em;
}
.hero-sep { color: var(--accent); margin: 0 0.6em; }
.hero-domain { color: var(--ink-mute); font-weight: 400; }

.hero-summary {
  max-width: 640px;
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.65;
}
.hero-summary em {
  font-style: normal;
  color: var(--ink);
  font-weight: 500;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: #1a1109;
}
.btn-primary:hover {
  background: var(--accent-hi);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212, 165, 116, 0.25);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-hi);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hi);
}

/* Hero stats */
.hero-stats {
  grid-area: stats;
  list-style: none;
  padding: 28px 0 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 4px;
  border-top: 1px solid var(--border);
  width: 100%;
}
.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
}
.about-body p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.7;
}
.about-body strong { color: var(--ink); font-weight: 600; }

.about-aside {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  position: sticky;
  top: 80px;
}
.about-aside h3 {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 500;
}
.aside-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aside-list li {
  font-size: 14px;
  color: var(--ink-soft);
  padding-left: 16px;
  position: relative;
}
.aside-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.6em;
  width: 6px; height: 1px;
  background: var(--accent);
}
.aside-list strong { color: var(--ink); font-weight: 500; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: all 0.3s var(--ease);
}
.skill-card:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-hi);
  transform: translateY(-2px);
}
.skill-card--accent {
  border-color: rgba(212, 165, 116, 0.3);
  background: linear-gradient(135deg, var(--bg-card), rgba(212, 165, 116, 0.05));
}
.skill-title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 500;
}
.chips {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips li {
  font-size: 13px;
  color: var(--ink);
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  font-weight: 400;
}

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  padding: 0; margin: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--border-hi), var(--border), transparent);
}
.tl-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 24px;
  padding-bottom: 44px;
  position: relative;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  padding-top: 8px;
}
.tl-marker span {
  display: block;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  position: relative;
  z-index: 1;
}
.tl-item:first-child .tl-marker span {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(212, 165, 116, 0.12);
}

.tl-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: all 0.3s var(--ease);
}
.tl-body:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-hi);
}
.tl-head { margin-bottom: 14px; }
.tl-when {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 8px;
}
.tl-role {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.3vw, 24px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
}
.tl-level {
  font-size: 0.7em;
  font-weight: 400;
  color: var(--ink-mute);
  letter-spacing: 0;
  font-family: var(--font-body);
}
.tl-org {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}
.tl-summary {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 15px;
  font-style: italic;
}
.tl-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.tl-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  top: 4px;
}

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  transition: all 0.3s var(--ease);
}
.edu-card:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-hi);
}
.edu-degree {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.edu-school {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}
.edu-focus {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

/* ---------- Publications ---------- */
.pub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 40px);
}
.pub-lead {
  margin: 0 0 20px;
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.65;
}
.pub-lead strong { color: var(--ink); font-weight: 600; }

.pub-topics {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.pub-topics li {
  font-size: 14px;
  color: var(--ink);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.pub-foot {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.7;
}
.pub-foot strong { color: var(--ink-soft); font-weight: 500; }

/* ---------- Achievements ---------- */
.ach-grid {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.ach-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  align-items: start;
  transition: all 0.3s var(--ease);
}
.ach-card:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-hi);
  transform: translateY(-2px);
}
.ach-badge {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
  padding-top: 2px;
  text-align: center;
}
.ach-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.ach-detail {
  margin: 0;
  font-size: 13px;
  color: var(--ink-mute);
}

/* ---------- Contact ---------- */
.section-contact { border-bottom: none; }
.contact-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elev));
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 48px);
}
.contact-lead {
  margin: 0 0 28px;
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 580px;
}
.contact-rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.contact-row {
  display: grid;
  grid-template-columns: 110px 1fr 24px;
  align-items: center;
  gap: 16px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s var(--ease);
}
.contact-row:hover {
  background: rgba(212, 165, 116, 0.04);
  padding-left: 12px;
}
.contact-row:hover .contact-arrow {
  color: var(--accent);
  transform: translateX(4px);
}
.contact-key {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}
.contact-val {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}
.contact-arrow {
  color: var(--ink-mute);
  transition: all 0.2s var(--ease);
  font-size: 18px;
  text-align: right;
}
@media (max-width: 540px) {
  .contact-row {
    grid-template-columns: 1fr 20px;
  }
  .contact-key {
    grid-column: 1 / -1;
    margin-bottom: -8px;
  }
}

/* ---------- Footer ---------- */
.footer {
  padding: 32px 0 48px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.footer-meta { margin-top: 6px !important; opacity: 0.6; }

/* ---------- Entrance animation ---------- */
.section, .hero-text > *, .hero-portrait, .hero-stats {
  opacity: 0;
  transform: translateY(20px);
  animation: rise 0.8s var(--ease) forwards;
}
.hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.hero-text > *:nth-child(2) { animation-delay: 0.15s; }
.hero-text > *:nth-child(3) { animation-delay: 0.25s; }
.hero-text > *:nth-child(4) { animation-delay: 0.35s; }
.hero-text > *:nth-child(5) { animation-delay: 0.45s; }
.hero-portrait { animation-delay: 0.2s; }
.hero-stats { animation-delay: 0.55s; }

.section { animation-delay: 0s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ---------- Selection ---------- */
::selection {
  background: var(--accent);
  color: #1a1109;
}
