/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(./?mortyurl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u8w4BMUTPHjxsAUi-qNiXg7eU0.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(./?mortyurl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u8w4BMUTPHjxsAXC-qNiXg7Q.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(./?mortyurl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u_w4BMUTPHjxsI5wq_FQftx9897sxZ.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(./?mortyurl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u_w4BMUTPHjxsI5wq_Gwftx9897g.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(./?mortyurl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(./?mortyurl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(./?mortyurl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(./?mortyurl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -- theme variables -- */
:root {
  --bg: #1a1a2e;
  --text: #dedede;
  --text-dim: #888;
  --heading: #ffffff;
  --link: #9fcefd;
  --accent: #c27721;
  --card-bg: rgba(30, 30, 50, 0.85);
  --card-hover: rgba(40, 40, 65, 0.9);
  --card-border: #444;
  --name: #ffffff;
  --rule: #ffffff;
}
[data-theme="light"] {
  --bg: #f0efe8;
  --text: #333;
  --text-dim: #666;
  --heading: #111;
  --link: #1a5fa0;
  --accent: #b05a10;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-hover: rgba(240, 240, 235, 0.95);
  --card-border: #bbb;
  --name: #111;
  --rule: #555;
}

a {
  color: var(--link);
  font-style: italic;
  text-decoration: none;
}

a:focus,
a:hover {
  color: var(--accent);
  text-decoration: none;
}

body,
td,
th,
tr,
a {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13.5px
}

.refs {
  text-align: center
}

.name {
  text-align: center
}

.pfp {
  padding: 2.5%;
  width: 40%;
  max-width: 40%
}

.pfpmobile {
  display: none;
}

.main {
  padding: 2.5%;
  width: 65%;
  vertical-align: middle;
}

body {
  background-color: var(--bg);
  margin: 0;
  position: relative;
  transition: background-color 0.3s;
}

p {
  text-align: justify;
  color: var(--text);
  word-spacing: -2px;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
}

.my-name {
  color: var(--heading);
}

strong {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

heading {
  color: var(--heading);
  font-family: 'Courier New', Courier, monospace;
  font-size: 22px;
  font-weight: bold;
}

h1, h2, h3 {
  color: var(--heading);
  font-family: 'Courier New', Courier, monospace;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
  margin-bottom: 12px;
}

ul {
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
}

papertitle {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  font-weight: 700
}

name {
  color: var(--name);
  font-family: 'Courier New', Courier, monospace;
  font-size: 40px;
}

.one {
  width: 160px;
  height: 160px;
  position: relative;
}

.two {
  width: 160px;
  height: 160px;
  position: absolute;
  transition: opacity .2s ease-in-out;
  -moz-transition: opacity .2s ease-in-out;
  -webkit-transition: opacity .2s ease-in-out;
}

.fade {
  transition: opacity .2s ease-in-out;
  -moz-transition: opacity .2s ease-in-out;
  -webkit-transition: opacity .2s ease-in-out;
}

span.highlight {
  background-color: #3b3b3b;
}

.theme-toggle {
  position: fixed; top: 14px; right: 16px; z-index: 100;
  background: var(--card-bg); border: 1px solid var(--card-border);
  color: var(--text); font-family: monospace; font-size: 14px;
  padding: 4px 10px; cursor: pointer; border-radius: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.equal-contribution {
  color: var(--text-dim);
  vertical-align: text-top;
}

.code-button {
  color: var(--accent);
  font-weight: bold;
  text-decoration: none;

}

.code-button:focus,
.code-button:hover {
  color: var(--link);
  font-style: italic;
  text-decoration: none;
}

.star-badge {
  height: 19px;
  display: block;
}

/* repo link + star kept together as one atomic, seamless block */
.repo-star {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
}
.repo-star code {
  color: var(--accent);
  font-weight: bold;
}
.repo-star:hover code {
  color: var(--link);
  font-style: italic;
}
/* inside a card title, the repo name reads as the heading */
.cardtitle .repo-star code {
  color: var(--heading);
  font-style: normal;
}
.cardtitle .repo-star:hover code {
  color: var(--link);
}
/* multi-repo title: tighter spacing so all repos fit one line at full size */
.cardtitle-repos {
  gap: 6px 9px;
}
.cardtitle-repos .repo-star {
  gap: 4px;
}
.title-suffix {
  color: var(--heading);
  font-weight: bold;
}

* {
  box-sizing: border-box;
}

/* project cards — 2x2 grid with equal rows so all cards are exactly the same size */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 16px;
  padding: 16px 0;
}

.cardtitle {
  color: var(--heading);
  font-weight: bold;
  font-family: 'Courier New', Courier, monospace;
  word-spacing: normal;
  overflow-wrap: break-word;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

/* Style the counter cards */
.card {
  box-shadow: 0 4px 8px 4px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
  padding: 16px;
  text-align: center;
  background-color: var(--card-bg);
  font-family: 'Courier New', Courier, monospace;
  text-wrap: wrap;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s;
}

.card p,
.card h3 {
  text-align: center !important;
  word-spacing: 0 !important;
  overflow-wrap: break-word;
  line-height: 1.6;
}

/* cursor: pointer; */

.card:hover {
  background-color: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* mobile stuff */

@media screen and (max-width: 600px) {

  .theme-toggle {
    top: 8px; right: 8px; font-size: 12px; padding: 3px 8px;
  }

  .card p {
    text-align: center;
    text-justify: inter-word;
    word-spacing: normal;
    hyphens: auto;
    line-height: 1.6;
  }

  /* Responsive columns: stack the cards in one column, sized to content */
  .row {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  /* hide original pfp */
  .pfp {
    display: none;
  }

  .name {
    order: 1;
    display: block;
  }

  .pfpmobile {
    order: 2;
    width: 80%;
    display: block;
    margin: auto;
  }

  p {
    text-align: left;
    word-spacing: normal;
    hyphens: none;
    -webkit-hyphens: none;
    line-height: 1.65;
  }

  .bio {
    order: 3;
    display: block;
  }

  .refs {
    order: 4;
    display: block;
  }

  .intro {
    display: flex;
    flex-flow: column;
  }

  .main {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* scale things up */

  .star-badge {
    height: 26px;
  }

  body,
  td,
  th,
  tr,
  a {
    font-size: 16px;
  }

  strong {
    font-size: 17px;
  }

  name {
    font-size: 42px;
  }

  heading {
    font-size: 30px;
  }

  papertitle {
    font-size: 16px;
  }
}

/* blog stuff */
.blog-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 15px 20px;
  margin-top: 10px;
  box-shadow: 0 4px 8px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s;
  font-family: 'Courier New', Courier, monospace;
}

.blog-card:hover {
  background-color: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-card a:hover {
  text-decoration: underline;
}

.note {
  border-left: 4px solid var(--accent);
  background-color: var(--card-bg);
  padding: 12px 16px;
  margin: 1em 0;
  border-radius: 4px;
}

.note::before {
  content: "Note";
  display: block;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 6px;
}

.scroll-math {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding: 1em 0;
}

.scroll-math span {
  display: inline-block;
  min-width: max-content;
}

.blog-icon {
  height: 16px;
  vertical-align: middle;
  margin-right: -2px;
}