/* Krish Moodbidri portfolio — original black + red design */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #161616;
  --bg-chip: #1c1c1c;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f3f3f3;
  --muted: #b4b4b4;
  --accent: #e11d2e;
  --accent-hover: #ff3b4a;
  --accent-text: #ff3b4a;
  --accent-soft: rgba(225, 29, 46, 0.16);
  --accent-strong: #b31522;
  --header-h: 4.25rem;
  --radius: 1rem;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --max: 68rem;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(225, 29, 46, 0.16), transparent 55%),
    radial-gradient(900px 420px at -10% 20%, rgba(225, 29, 46, 0.06), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1.0625rem;
  min-height: 100vh;
}

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

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 0.75rem;
}

.container {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--text);
}

.monogram {
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(160deg, var(--accent) 0%, #9f1320 100%);
  color: #ffffff;
}

.monogram {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.55rem;
  font-size: 0.78rem;
}

.nav-name {
  font-size: 0.98rem;
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--bg-elevated);
  padding: 0.55rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}

/* Hero */
.hero {
  padding: 5.5rem 0 4.5rem;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: center;
}

.hero-inner {
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.9fr);
  grid-template-areas:
    "copy photo"
    "graphic photo";
  gap: 1.75rem 3rem;
  align-items: start;
  max-width: none;
}

.hero-copy { grid-area: copy; }
.hero-photo { grid-area: photo; }
.hero-graphic { grid-area: graphic; }

.hero-photo {
  justify-self: stretch;
  align-self: start;
  border-radius: 1.15rem;
  overflow: hidden;
  border: 1px solid rgba(225, 29, 46, 0.45);
  box-shadow:
    0 0 0 6px var(--accent-soft),
    0 18px 50px rgba(225, 29, 46, 0.18),
    var(--shadow);
  background: #111;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-text);
  margin: 0 0 0.85rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.35rem, 5.4vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.hero-hook {
  margin: 0.85rem 0 0;
  font-size: clamp(1.05rem, 2.1vw, 1.28rem);
  color: var(--accent-text);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.tagline {
  margin: 0.55rem 0 0.3rem;
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: #e8e8e8;
  font-weight: 400;
}

.location {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.typewriter {
  margin: 0.55rem 0 0;
  min-height: 1.5em;
  font-size: clamp(0.98rem, 1.8vw, 1.12rem);
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.typewriter-caret {
  display: inline-block;
  width: 0.12em;
  height: 1em;
  margin-left: 0.12em;
  background: var(--accent);
  vertical-align: -0.1em;
  animation: caretBlink 1s steps(1) infinite;
}

.typewriter.is-static .typewriter-caret {
  animation: none;
  opacity: 0;
}

@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.intro {
  margin-top: 2.1rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.intro-heading {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.intro-icon {
  color: var(--accent-text);
  font-size: 1.05rem;
  line-height: 1;
}

.intro-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.about-highlights {
  margin-top: 1.15rem;
  max-width: 46rem;
}

.intro-list li {
  position: relative;
  padding-left: 1.05rem;
  color: #e0e0e0;
  font-size: 0.98rem;
  line-height: 1.55;
}

.intro-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}

.intro-list strong {
  color: var(--accent-text);
  font-weight: 600;
}

.hero-graphic {
  min-width: 0;
  max-width: 24rem;
  width: 100%;
}

.cluster-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cluster-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: #111111;
}

.status-pip {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
  animation: pipGlow 2.4s ease-in-out infinite;
}

.cluster-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: #e8e8e8;
}

.cluster-meta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.node-grid {
  display: block;
  width: 100%;
  height: auto;
  background: #0a0a0a;
}

.node {
  fill: #2a2a2a;
  stroke: rgba(225, 29, 46, 0.35);
  stroke-width: 1;
  animation: nodePulse 3.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.node-2, .node-8, .node-11, .node-17 { animation-delay: 0.35s; }
.node-3, .node-6, .node-14, .node-19 { animation-delay: 0.7s; }
.node-5, .node-9, .node-16 { animation-delay: 1.05s; }
.node-4, .node-10, .node-13, .node-20 { animation-delay: 1.4s; }
.node-7, .node-12, .node-15 { animation-delay: 1.75s; }

.packet-a {
  animation: packetA 5.5s ease-in-out infinite;
}

.packet-b {
  animation: packetB 6.5s ease-in-out infinite;
}

.term {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.55;
  padding: 0.75rem 0.95rem 0.95rem;
  background: #0a0a0a;
  border-top: 1px solid var(--line);
  color: #c6c6c6;
  min-height: 7.2rem;
}

.term p {
  margin: 0;
  color: #e0e0e0;
}

.term .prompt {
  color: var(--accent);
  margin-right: 0.35rem;
  font-weight: 600;
}

.term .out {
  color: var(--muted);
  padding-left: 0.9rem;
}

.term-line {
  animation: lineIn 8s ease-in-out infinite;
  opacity: 0;
}

.t1 { animation-delay: 0s; }
.t2 { animation-delay: 1.1s; }
.t3 { animation-delay: 2.2s; }
.t4 { animation-delay: 3.3s; }
.t5 { animation-delay: 4.4s; }

.cursor {
  display: inline-block;
  width: 0.5rem;
  height: 0.85em;
  background: var(--accent);
  vertical-align: -0.1em;
  animation: blink 1s steps(1) infinite;
}

@keyframes pipGlow {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50% { box-shadow: 0 0 0 6px rgba(225, 29, 46, 0.32); }
}

@keyframes nodePulse {
  0%, 100% { fill: #2a2a2a; }
  42% { fill: #e11d2e; }
}

@keyframes packetA {
  0% { cx: 36; cy: 36; opacity: 0; }
  8% { opacity: 1; }
  35% { cx: 244; cy: 36; }
  60% { cx: 244; cy: 120; }
  85% { cx: 36; cy: 120; opacity: 1; }
  100% { cx: 36; cy: 36; opacity: 0; }
}

@keyframes packetB {
  0% { cx: 244; cy: 92; opacity: 0; }
  10% { opacity: 1; }
  40% { cx: 36; cy: 92; }
  70% { cx: 36; cy: 36; }
  100% { cx: 140; cy: 64; opacity: 0; }
}

@keyframes lineIn {
  0%, 4% { opacity: 0; }
  12%, 82% { opacity: 1; }
  92%, 100% { opacity: 0; }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--accent-hover);
  color: var(--accent-text);
  background: var(--accent-soft);
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: #111111;
  border-block: 1px solid var(--line);
}

.section-cta {
  text-align: left;
}

.section-label {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-text);
}

.section h2 {
  margin: 0 0 1.4rem;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.lead {
  font-size: 1.15rem;
  max-width: 46rem;
}

.section p {
  color: #e0e0e0;
}

.muted {
  color: var(--muted) !important;
}

/* Contact */
.contact-grid,
.edu-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 600px) {
  .contact-grid,
  .edu-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card,
.edu-card,
.project-card,
.job {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
}

.contact-kicker,
.project-kicker,
.edu-year {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-text);
  margin: 0 0 0.45rem;
}

.contact-card p,
.edu-card p {
  margin: 0.15rem 0;
}

.contact-card a {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Work */
.jobs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.15rem;
}

.job {
  display: grid;
  grid-template-columns: minmax(14rem, 0.38fr) 1fr;
  gap: 1.25rem 2rem;
}

.job-meta h3 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.job-org {
  margin: 0;
  color: var(--accent-text);
  font-weight: 600;
}

.job-place,
.job-dates {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.job ul {
  margin: 0;
  padding-left: 1.15rem;
}

.job li + li {
  margin-top: 0.55rem;
}

.edu-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

/* Skills / tools */
.skill-groups {
  display: grid;
  gap: 1.5rem;
}

.skill-group h3 {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f3f3f3;
}

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

.chips li {
  background: var(--bg-chip);
  border: 1px solid var(--line);
  color: #e8e8e8;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.chips-wide li {
  background: var(--bg-card);
}

/* Project */
.project-card {
  max-width: 46rem;
  box-shadow: var(--shadow);
}

.project-card h3 {
  margin: 0 0 0.7rem;
  font-size: 1.4rem;
}

.project-card p:last-child {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

/* Mobile */
@media (max-width: 860px) {
  .nav-name {
    display: none;
  }

  .nav-toggle {
    display: flex;
    z-index: 120;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 150;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem 1.15rem;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.15rem;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    box-shadow: 0 18px 40px rgba(4, 8, 18, 0.55);
  }

  .nav.is-open .nav-menu {
    display: flex;
  }

  .nav-menu a {
    font-size: 1rem;
    padding: 0.7rem 0.8rem;
  }

  .job {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .hero {
    min-height: auto;
    padding: 3.5rem 0 3rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "copy"
      "graphic";
    gap: 1.5rem;
    justify-items: start;
  }

  .hero-photo {
    width: 10.75rem;
    height: 10.75rem;
    border-radius: 50%;
    justify-self: start;
    box-shadow:
      0 0 0 5px var(--accent-soft),
      0 12px 32px rgba(225, 29, 46, 0.22);
  }

  .hero-photo img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center 18%;
  }

  .hero-graphic {
    max-width: 24.5rem;
  }
}

@media (max-width: 420px) {
  .container,
  .nav {
    width: min(var(--max), calc(100% - 1.5rem));
  }

  .section {
    padding: 3.25rem 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-toggle-bar {
    transition: none;
  }

  .status-pip,
  .node,
  .packet-a,
  .packet-b,
  .term-line,
  .cursor,
  .typewriter-caret {
    animation: none !important;
  }

  .typewriter-caret {
    opacity: 0;
  }

  .term-line,
  .packet-a,
  .packet-b {
    opacity: 1;
  }

  .node-5, .node-11, .node-18,
  .node-2, .node-8, .node-14 {
    fill: #e11d2e;
  }
}
