/* ------------------------------------------------------------------
   Saisrinivas Mamunuru
   Dark, spacious. The homepage carries the starfield; interior pages
   keep the same sky colour but stay still so they're easy to read.
   ------------------------------------------------------------------ */

:root {
  --ink: #e9eaf0;
  --soft: #9598a9;
  --faint: #5d6073;
  --accent: #b0a5dc;
  --card: #14141b;
  --rule: #26262f;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* The body gradient is viewport-fixed, so anything past one screen height
     would fall through to white without a base colour here. */
  background: #08080c;
}

body {
  margin: 0;
  color: var(--ink);
  font: 400 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(760px 520px at 68% 8%, rgba(88, 78, 140, 0.11) 0%, rgba(88, 78, 140, 0) 68%),
    radial-gradient(1200px 800px at 42% 30%, #16161f 0%, #0c0c12 56%, #08080c 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: inherit;
}

::selection {
  background: rgba(176, 165, 220, 0.22);
}

/* ---------- interior page shell ---------- */

.top {
  border-bottom: 1px solid var(--rule);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
  flex-wrap: wrap;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.75rem;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.home-link svg {
  flex: 0 0 auto;
  opacity: 0.85;
  transition: transform 0.5s ease, opacity 0.25s ease;
}

.home-link:hover svg {
  transform: rotate(14deg) scale(1.08);
  opacity: 1;
}

.top nav {
  display: flex;
  gap: 1.15rem;
  font-size: 0.87rem;
}

.top nav a {
  color: var(--soft);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.top nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.top nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

main {
  padding: 3.5rem 0 6rem;
}

/* ---------- type ---------- */

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
}

.lede {
  color: var(--soft);
  max-width: 54ch;
  margin: 0 0 3.2rem;
}

.lede a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 165, 220, 0.3);
}

.lede a:hover {
  border-bottom-color: var(--accent);
}

h2.sec {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 3.5rem 0 1.4rem;
}

/* ---------- work rows ---------- */

.job {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.job:last-child {
  border-bottom: 0;
}

.badge {
  width: 5rem;
  height: 3.4rem;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.5rem;
}

.badge img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.job-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: baseline;
}

.job-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.job-when {
  font-size: 0.78rem;
  color: var(--faint);
  white-space: nowrap;
}

.job-at {
  font-size: 0.88rem;
  color: var(--soft);
  margin: 0.05rem 0 0.55rem;
}

.job p {
  margin: 0 0 0.6rem;
  color: var(--soft);
  font-size: 0.93rem;
}

.job ul,
.entry ul {
  margin: 0.5rem 0 0;
  padding-left: 1.05rem;
  color: var(--soft);
  font-size: 0.92rem;
}

.job li,
.entry li {
  margin-bottom: 0.42rem;
}

.job li::marker,
.entry li::marker {
  color: var(--faint);
}

.job a,
.entry li a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 165, 220, 0.3);
}

.job a:hover,
.entry li a:hover {
  border-bottom-color: var(--accent);
}

/* ---------- project cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.15rem;
}

.card {
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: var(--faint);
  transform: translateY(-2px);
}

.shot {
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--rule);
  background:
    repeating-linear-gradient(45deg, transparent, transparent 9px,
      rgba(140, 140, 160, 0.05) 9px, rgba(140, 140, 160, 0.05) 18px);
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 0.72rem;
  text-align: center;
  padding: 0.5rem;
}

.shot:has(img) {
  background: #fff;
  padding: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shot img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.card-body {
  padding: 1rem 1.1rem 1.15rem;
}

.card-body h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.card-when {
  color: var(--faint);
  font-size: 0.76rem;
  margin: 0.06rem 0 0.5rem;
}

.card-body p {
  margin: 0 0 0.75rem;
  color: var(--soft);
  font-size: 0.89rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-bottom: 0.8rem;
}

.pill {
  font-size: 0.7rem;
  color: var(--soft);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.06rem 0.42rem;
}

.btns {
  display: flex;
  gap: 0.5rem;
}

.btn {
  font-size: 0.76rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 0.24rem 0.62rem;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- simple entries (education, writing) ---------- */

.entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.entry:has(.badge) {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.1rem;
}

.entry:last-child {
  border-bottom: 0;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: baseline;
}

.entry h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.entry h2 a {
  text-decoration: none;
}

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

.entry-when {
  font-size: 0.78rem;
  color: var(--faint);
  white-space: nowrap;
}

.entry-at {
  font-size: 0.88rem;
  color: var(--soft);
  margin: 0.05rem 0 0.5rem;
}

.entry p {
  margin: 0 0 0.5rem;
  color: var(--soft);
  font-size: 0.93rem;
}

.ext {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 165, 220, 0.3);
}

.ext:hover {
  border-bottom-color: var(--accent);
}

/* ---------- photos ---------- */

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 1.8rem 1.2rem;
}

.photos figure {
  margin: 0;
}

.photos img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--card);
  filter: brightness(0.94);
  transition: filter 0.3s ease;
}

.photos figure:hover img {
  filter: brightness(1.04);
}

.photos figcaption {
  font-size: 0.82rem;
  color: var(--soft);
  margin-top: 0.5rem;
}

.photos figcaption span {
  display: block;
  color: var(--faint);
  font-size: 0.74rem;
}

/* ---------- article ---------- */

.article {
  max-width: 36rem;
}

.article h2 {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 2.6rem 0 0.5rem;
}

.article h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.9rem 0 0.4rem;
}

.article p {
  margin: 0 0 1.1rem;
  color: var(--soft);
}

.article ul,
.article ol {
  color: var(--soft);
  padding-left: 1.1rem;
  margin: 0 0 1.1rem;
}

.article li {
  margin-bottom: 0.4rem;
}

.article strong {
  color: var(--ink);
}

.article blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  color: var(--soft);
  font-style: italic;
}

.article pre {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 9px;
  padding: 0.9rem 1.05rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--soft);
  margin: 0 0 1.2rem;
}

.article code {
  font-family: var(--mono);
  font-size: 0.86em;
}

.article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.scenario,
.loop-diagram {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 9px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.3rem;
  background: rgba(20, 20, 27, 0.55);
}

.scenario h3 {
  margin-top: 0;
}

.scenario p:last-child,
.loop-diagram p:last-child {
  margin-bottom: 0;
}

.verdict {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: 0.3rem;
}

.loop-diagram {
  font-size: 0.86rem;
  color: var(--soft);
}

.loop-arrow {
  color: var(--accent);
  padding: 0 0.3rem;
}

.post-meta {
  font-size: 0.79rem;
  color: var(--faint);
  margin: 0 0 2.4rem;
}

.back {
  font-size: 0.8rem;
  color: var(--faint);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1.6rem;
}

.back:hover {
  color: var(--accent);
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 3rem;
  font-size: 0.8rem;
  color: var(--faint);
}

.foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.foot nav {
  display: flex;
  gap: 1.1rem;
}

.foot a {
  color: var(--soft);
  text-decoration: none;
}

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

/* ---------- responsive ---------- */

@media (max-width: 620px) {
  main {
    padding: 2.5rem 0 4rem;
  }

  .top .wrap {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }

  .top nav {
    width: 100%;
    gap: 0.9rem;
    font-size: 0.82rem;
    flex-wrap: wrap;
  }

  .cards {
    grid-template-columns: 1fr;
  }

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

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