/* ---------------------------------------------------------------
   Yashwanth Devavarapu : academic site
   Layout and type modelled on the Academic Pages / Minimal Mistakes
   reference: masthead, left author sidebar, wide content column.
   --------------------------------------------------------------- */

:root {
  --bg:            #ffffff;
  --text:          #494e52;
  --heading:       #3f4347;
  --muted:         #898c8f;
  --link:          #2b7bb9;
  --link-hover:    #17537f;
  --border:        #e8e9ea;
  --rule:          #f0f1f1;
  --band:          #f2f3f3;
  --chip-bg:       #f4f6f7;
  --chip-text:     #5d6469;
  --accent:        #2b7bb9;
  --masthead-bg:   rgba(255, 255, 255, .72);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;
  --masthead-h: 57px;
}

/* Light is the default. Dark applies only when the visitor toggles it. */

:root[data-theme="dark"] {
  --bg:          #191c1e;
  --text:        #c3c8cc;
  --heading:     #e9ebec;
  --muted:       #878d92;
  --link:        #6fb7e3;
  --link-hover:  #9ad0f0;
  --border:      #2c3135;
  --rule:        #24282b;
  --band:        #1f2224;
  --chip-bg:     #23282b;
  --chip-text:   #a7aeb3;
  --accent:      #6fb7e3;
  --masthead-bg: rgba(25, 28, 30, .72);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--masthead-h) + 1.25rem);
}

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

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--bg); color: var(--link);
  padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 16px; top: 8px; }

/* ----------------------------- masthead ----------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

/* Frosted glass only where the browser can actually blur; elsewhere the
   solid background above stays, so the nav is never unreadable. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .masthead {
    background: var(--masthead-bg);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
  }
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 56px;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--heading);
  padding: 1rem 0 .55rem;
  border-bottom: 2px solid var(--heading);
  margin-right: auto;
  white-space: nowrap;
}
.site-title:hover { text-decoration: none; color: var(--heading); }

.nav { display: flex; align-items: center; gap: 1.5rem; }

.nav a {
  color: var(--text);
  font-size: .9375rem;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--heading); text-decoration: none; border-bottom-color: var(--border); }
.nav a[aria-current="page"] { color: var(--heading); font-weight: 600; border-bottom-color: var(--heading); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  line-height: 0;
}
.theme-toggle:hover {
  color: var(--heading);
  border-color: var(--muted);
  background: var(--chip-bg);
}
.theme-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.theme-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ------------------------------ layout ------------------------------ */

.layout {
  display: grid;
  grid-template-columns: 215px 1fr;
  gap: 3rem;
  padding: 2.5rem 0 3.5rem;
  align-items: start;
}

/* ------------------------------ sidebar ----------------------------- */

.sidebar { position: sticky; top: calc(var(--masthead-h) + 1.5rem); }

.avatar {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem;
  background: var(--band);
}

.author__name {
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--heading);
  margin: 0 0 .4rem;
}

.author__bio {
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1.1rem;
}

.author__meta { list-style: none; margin: 0; padding: 0; }

.author__meta li {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-size: .8125rem;
  margin-bottom: .55rem;
  color: var(--text);
}

.author__meta svg {
  width: 14px; height: 14px;
  flex: 0 0 14px;
  margin-top: 3px;
  fill: currentColor;
  color: var(--muted);
}

.author__meta a { color: var(--text); }
.author__meta a:hover { color: var(--link); }

/* ------------------------------ content ----------------------------- */

.content { min-width: 0; overflow-wrap: break-word; }
body { overflow-x: hidden; }

.content h1 {
  font-family: var(--font-head);
  font-size: 1.875rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 1.25rem;
}

.content h2 {
  font-family: var(--font-head);
  font-size: 1.3125rem;
  font-weight: 700;
  color: var(--heading);
  margin: 2.5rem 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--rule);
}

.content h3 {
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--heading);
  margin: 1.75rem 0 .5rem;
}

.content p { margin: 0 0 1.1rem; }

.content ul, .content ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.content li { margin-bottom: .4rem; }

.lead { font-size: 1.0625rem; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* -------------------------- publication list ------------------------ */

.pub-group { margin-bottom: 1.75rem; }

.pub {
  scroll-margin-top: calc(var(--masthead-h) + 1rem);
  padding: .95rem 0;
  border-bottom: 1px solid var(--rule);
}
.pub-group > .pub:first-child { padding-top: .2rem; }
.pub:last-child { border-bottom: 0; }

.pub__title {
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 .3rem;
  line-height: 1.4;
}

.pub__authors { font-size: .875rem; color: var(--text); margin: 0 0 .3rem; }
.pub__authors .me { font-weight: 700; color: var(--heading); }

.pub__venue { font-size: .875rem; color: var(--muted); margin: 0 0 .5rem; }

.pub__links { font-size: .8125rem; display: flex; flex-wrap: wrap; gap: .9rem; }

details.abstract { margin-top: .6rem; }
details.abstract > summary {
  cursor: pointer;
  font-size: .8125rem;
  color: var(--link);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
details.abstract > summary::-webkit-details-marker { display: none; }
details.abstract > summary::before { content: "▸"; font-size: .7rem; }
details.abstract[open] > summary::before { content: "▾"; }
details.abstract > summary:hover { color: var(--link-hover); }
details.abstract p {
  font-size: .875rem;
  line-height: 1.6;
  margin: .6rem 0 0;
  padding-left: .9rem;
  border-left: 2px solid var(--border);
  color: var(--text);
}

/* ------------------------------- chips ------------------------------ */

.tag {
  display: inline-block;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: 3px;
  padding: .15rem .45rem;
  margin-left: .4rem;
  vertical-align: 2px;
  white-space: nowrap;
}

.skills { list-style: none; padding: 0; margin: 0 0 1.1rem; }
.skills li { margin-bottom: .55rem; font-size: .9375rem; }
.skills strong { color: var(--heading); }

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

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

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

.entry__title { font-family: var(--font-head); font-size: 1.0625rem; font-weight: 700; color: var(--heading); margin: 0; }
.entry__date { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.entry__sub { font-size: .875rem; color: var(--muted); margin: .15rem 0 .55rem; }
.entry ul { margin: .5rem 0 0; }
.entry li { font-size: .9375rem; }

.stack { font-size: .8125rem; color: var(--muted); margin-top: .5rem; }
.stack strong { color: var(--chip-text); font-weight: 600; }

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

.footer {
  background: var(--band);
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0;
  font-size: .8125rem;
  color: var(--muted);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--link); }
.footer__follow { display: flex; gap: 1.25rem; align-items: center; margin-bottom: .5rem; }
.footer__label { text-transform: uppercase; letter-spacing: .06em; font-size: .6875rem; font-weight: 600; }
.footer svg { width: 13px; height: 13px; fill: currentColor; vertical-align: -2px; margin-right: .3rem; }

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

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 2rem; padding-top: 2rem; }
  .sidebar { position: static; text-align: center; }
  .avatar { width: 110px; height: 110px; }
  .author__bio { max-width: 34rem; margin-left: auto; margin-right: auto; }
  .author__meta {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.1rem;
  }
  .author__meta li { margin-bottom: 0; }
  .content h1 { font-size: 1.625rem; }
  .masthead { position: static; }
  .masthead__inner { min-height: 0; padding-bottom: .5rem; }
  .site-title { margin-right: 0; width: 100%; border-bottom: 0; padding-bottom: 0; }
  .nav { flex-wrap: wrap; gap: 1.1rem; }
}

@media (max-width: 420px) {
  .content h1 { font-size: 1.4375rem; }
  .content h2 { font-size: 1.1875rem; }
  .avatar { width: 96px; height: 96px; }
}

@media print {
  .masthead, .footer, .sidebar, .theme-toggle { display: none; }
  .layout { display: block; }
  body { font-size: 11pt; color: #000; }
}
