:root {
  --color-bg:      #040810;
  --color-surface: #081018;
  --color-accent:  #6495ed;
  --color-accent2: #4a7bd4;
  --color-text:    #e2e0f0;
  --color-muted:   #9490b0;
  --color-accent-rgb: 100, 149, 237;
  --color-accent2-rgb: 30, 80, 180;
}

* {
  box-sizing: border-box;
}

@font-face {
  font-family: OpenSans;
  font-weight: normal;
  src: url(/font/OpenSans/OpenSans-Regular.ttf);
}

@font-face {
  font-family: OpenSans;
  font-weight: bold;
  src: url(/font/OpenSans/OpenSans-Bold.ttf);
}

@font-face {
  font-family: OpenSans;
  font-weight: normal;
  font-style: italic;
  src: url(/font/OpenSans/OpenSans-Italic.ttf);
}

@font-face {
  font-family: FiraMono;
  font-weight: normal;
  src: url(/font/FiraMono/FiraMono-Regular.ttf);
}

@font-face {
  font-family: Roboto;
  font-weight: normal;
  src: url(/font/Roboto/Roboto-Regular.ttf);
}

@font-face {
  font-family: Roboto;
  font-weight: bold;
  src: url(/font/Roboto/Roboto-Bold.ttf);
}

html {
  min-height: 100%;
  font-family: OpenSans, sans-serif;
  font-size: 1.1rem;
  background: var(--color-bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(10, 35, 90, 0.18), transparent),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(8, 20, 60, 0.12), transparent),
    radial-gradient(ellipse 40% 40% at 50% 10%, rgba(15, 40, 100, 0.06), transparent),
    var(--color-bg);
}

@media screen and (max-width: 48rem) {
  html {
    font-size: 1.0rem;
  }

  .profile-pic img {
    width: min(180px, 100%);
    height: auto !important;
    aspect-ratio: 1;
  }

  h1 {
    font-size: 1.8rem;
  }
}

/*****************************************************************************/
/* stars                                                                     */

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 25% 60%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 40% 8%, rgba(140,180,255,0.6), transparent),
    radial-gradient(1px 1px at 55% 42%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 70% 75%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, rgba(167,139,250,0.5), transparent),
    radial-gradient(1px 1px at 92% 55%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 5% 85%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 35% 95%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1.5px 1.5px at 60% 25%, rgba(140,180,255,0.4), transparent),
    radial-gradient(1px 1px at 78% 48%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 15% 38%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 48% 72%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 88% 88%, rgba(167,139,250,0.4), transparent),
    radial-gradient(1px 1px at 32% 18%, rgba(255,255,255,0.4), transparent);
}

body::after {
  background-image:
    radial-gradient(1px 1px at 18% 52%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 42% 35%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 65% 62%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 8% 70%, rgba(140,180,255,0.3), transparent),
    radial-gradient(1px 1px at 52% 88%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 95% 38%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 73% 12%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 28% 78%, rgba(255,255,255,0.3), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

/*****************************************************************************/
/* particles                                                                 */

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/*****************************************************************************/
/* nav                                                                       */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
  padding: 0.8rem 1rem;
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.1);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.nav-hamburger {
  display: none;
}

.nav-title {
  display: none;
}

nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-family: FiraMono, "Courier New", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.05rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--color-accent);
  text-shadow: 0 0 12px rgba(var(--color-accent-rgb), 0.4);
}

nav a.active {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

@media screen and (max-width: 48rem) {
  nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px 0;
  }

  .nav-title {
    display: block;
    color: var(--color-text);
    font-family: FiraMono, "Courier New", monospace;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 0.8rem;
  }

  .nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-muted);
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0 0.5rem;
    width: 100%;
  }

  #nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  #nav-toggle:checked ~ .nav-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  #nav-toggle:checked ~ .nav-hamburger span:nth-child(2) {
    opacity: 0;
  }

  #nav-toggle:checked ~ .nav-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/*****************************************************************************/
/* main                                                                      */

main {
  color: var(--color-text);
  line-height: 1.80;
  margin: 0 auto;
  max-width: 52rem;
  padding: 2rem 1.5rem;
  padding-top: 5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

main article {
  width: 100%;
}

/*****************************************************************************/
/* fade-in animation                                                         */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

main article {
  animation: fadeIn 0.8s ease-out both;
}

/*****************************************************************************/
/* profile                                                                   */

.profile-pic {
  display: inline-block !important;
}

.profile-pic img {
  border-radius: 50%;
  width: 340px;
  height: 340px;
  object-fit: cover;
  display: block;
  border: 3px solid var(--color-accent);
  transition: box-shadow 0.3s ease;
}

.profile-pic img:hover {
  box-shadow: 0 0 40px rgba(var(--color-accent-rgb), 0.5), 0 0 80px rgba(var(--color-accent2-rgb), 0.25);
}

/*****************************************************************************/
/* social links                                                              */

article figure:not(.profile-pic) {
  margin: 0;
  display: inline-block;
  margin-right: 1.2rem;
  transition: transform 0.2s ease, filter 0.2s ease;
}

article figure:not(.profile-pic):last-of-type {
  margin-right: 0;
}

article figure:not(.profile-pic):hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(var(--color-accent-rgb), 0.6));
}

p:has(> .resume-link) {
  font-size: 1.3rem;
}

.resume-link {
  font-size: 1.3rem;
}

.invert img {
  filter: invert(1);
}

.invert:hover img {
  filter: invert(1) drop-shadow(0 0 8px rgba(var(--color-accent-rgb), 0.6));
}

/*****************************************************************************/
/* common tags                                                               */

a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a, a:visited {
  color: var(--color-accent);
}

a:hover, a:focus, a:active {
  color: var(--color-accent2);
  text-shadow: 0 0 12px rgba(var(--color-accent-rgb), 0.4);
  text-decoration-thickness: 2px;
}

.project-card a {
  text-decoration: none;
}

h1, h2, h3, h4 {
  margin: 10px 0 5px 0;
  line-height: 1.42;
  font-weight: bold;
  font-family: FiraMono, "Courier New", monospace;
  letter-spacing: 0.1rem;
  color: #fff;
}

h1 {
  margin-top: 0;
  font-size: 2.5rem;
}

.page-title {
  display: none;
}


p {
  font-size: 1rem;
  margin: 1.3rem 0;
  letter-spacing: 0.03rem;
  color: var(--color-muted);
  font-family: Roboto, sans-serif;
}

img {
  max-width: 100%;
}

hr {
  border: none;
  border-top: 1px solid rgba(var(--color-accent-rgb), 0.15);
  margin: 2.5rem 0;
  width: 100%;
}

/*****************************************************************************/
/* projects                                                                  */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.project-card,
.video-card {
  background: var(--color-surface);
  border: 2px solid rgba(var(--color-accent-rgb), 0.25);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(var(--color-accent-rgb), 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover,
.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--color-accent-rgb), 0.35);
  box-shadow: 0 8px 24px rgba(var(--color-accent2-rgb), 0.15);
}

.project-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.project-card h3 {
  margin: 0.8rem 1rem 0.3rem;
  font-size: 1.1rem;
  text-align: left;
}

.project-card p {
  margin: 0 1rem 0.8rem;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: left;
}

.project-card.no-img h3 {
  margin-top: 1rem;
}

.project-card.no-img p {
  margin-bottom: 1rem;
}

@media screen and (max-width: 48rem) {
  .project-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

/*****************************************************************************/
/* videos                                                                    */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 1.5rem;
}

.video-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
}

.video-card h3 {
  margin: 0.8rem 1.2rem 1rem;
  font-size: 1rem;
  text-align: left;
  line-height: 1.4;
}

@media screen and (max-width: 48rem) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/*****************************************************************************/
/* resume                                                                    */

.resume-entry {
  text-align: left;
  margin-bottom: 1.5rem;
}

.resume-entry h3 {
  margin-bottom: 0;
}

.resume-date {
  display: block;
  font-family: FiraMono, "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--color-accent);
  margin-bottom: 0.8rem;
}

.resume-entry ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}

.resume-entry li {
  color: var(--color-muted);
  font-family: Roboto, sans-serif;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.resume-entry li em {
  color: var(--color-accent);
  font-size: 0.85rem;
}

article ul {
  text-align: left;
}

/*****************************************************************************/
/* 404                                                                       */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/*****************************************************************************/
/* footer                                                                    */

footer {
  text-align: center;
  margin-top: auto;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  font-family: Roboto, sans-serif;
  border-top: 1px solid rgba(var(--color-accent-rgb), 0.15);
  background: var(--color-surface);
  position: relative;
  z-index: 1;
}

footer a {
  text-decoration: none;
}

/*****************************************************************************/
/* print                                                                     */

@media print {
  body {
    background: white;
    min-height: auto;
  }

  nav, footer, .resume-link, #particles {
    display: none !important;
  }

  main {
    color: #111;
    max-width: 100%;
    padding: 0;
    text-align: left;
  }

  h1, h2, h3 {
    color: #111;
    font-family: sans-serif;
  }

  p, li {
    color: #333;
    font-family: sans-serif;
  }

  .resume-date {
    color: #555;
  }

  .resume-entry li em {
    color: #555;
  }

  a {
    color: #111;
    text-decoration: underline;
  }

  hr {
    border-color: #ccc;
  }
}
