:root {
  --bg: #0a192f;
  --bg-light: #112240;
  --bg-lightest: #233554;
  --text: #ccd6f6;
  --text-light: #a8b2d1;
  --text-lightest: #8892b0;
  --accent: #64ffda;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-lightest);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

strong {
  color: var(--text);
  font-weight: 500;
}

/* ===== LAYOUT ===== */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 6rem;
  display: flex;
  gap: 4rem;
  min-height: 100vh;
}

/* ===== HEADER / SIDEBAR ===== */
.header {
  width: 48%;
  max-width: 480px;
  flex-shrink: 0;
  position: relative;
}

.header__inner {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  padding: clamp(2.5rem, 6vh, 4.5rem) 0 clamp(1.5rem, 4vh, 3rem);
}

.header__top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}

.header h1 a {
  color: inherit;
  text-decoration: none;
}

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

.header h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 0.25rem;
}

.header__subtitle {
  font-size: 1rem;
  color: var(--text-lightest);
  max-width: 32ch;
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ===== NAVIGATION ===== */
.nav {
  margin-top: 2.5rem;
}

.nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-lightest);
  transition: var(--transition);
}

.nav__indicator {
  display: block;
  width: 2rem;
  height: 1px;
  background-color: var(--text-lightest);
  transition: var(--transition);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--text);
}

.nav__link:hover .nav__indicator,
.nav__link.is-active .nav__indicator {
  width: 4rem;
  background-color: var(--text);
}

.nav__link.is-active {
  color: var(--accent);
}

.nav__link.is-active .nav__indicator {
  background-color: var(--accent);
}

/* ===== SOCIAL ===== */
.social {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.social a {
  color: var(--text-lightest);
  transition: var(--transition);
}

.social a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.social svg {
  display: block;
}

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  padding: 6rem 0;
}

.section {
  margin-bottom: 9rem;
  scroll-margin-top: 6rem;
}

.section__header-mobile {
  display: none;
}

.section__content p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.7;
}

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

.section__footer {
  margin-top: 3rem;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

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

.inline-link svg {
  transition: transform 0.2s ease;
}

.inline-link:hover svg {
  transform: translate(3px, -3px);
}

/* ===== EXPERIENCE LIST ===== */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.experience-item {
  position: relative;
}

.experience-item__header {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.experience-item__header:hover {
  background-color: rgba(100, 255, 218, 0.03);
  border-color: rgba(100, 255, 218, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.certification-item__header {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.certification-item__header .experience-item__date {
  padding-top: 0;
}

.experience-item__date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-lightest);
  padding-top: 0.35rem;
  white-space: nowrap;
}

.experience-item__info h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.experience-item__header:hover h3 {
  color: var(--accent);
}

.experience-item__company {
  font-weight: 500;
}

.experience-item__info p {
  font-size: 0.9rem;
  color: var(--text-lightest);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.certification-item__content {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.certification-item__media {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--bg-lightest);
  background-color: rgba(255, 255, 255, 0.98);
  overflow: hidden;
}

.certification-item__media img {
  display: block;
  width: 100%;
  height: auto;
}

.certification-item__body {
  min-width: 0;
}

/* ===== TAG LIST ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background-color: rgba(100, 255, 218, 0.1);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.certification-link {
  margin-top: 1rem;
}

/* ===== PROJECTS LIST ===== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.project-item__inner {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.project-item__inner:hover {
  background-color: rgba(100, 255, 218, 0.03);
  border-color: rgba(100, 255, 218, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.project-item__image-wrap {
  width: 120px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--bg-lightest);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.project-item__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-item__info h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.project-item__inner:hover h3 {
  color: var(--accent);
}

.project-item__info h3 svg {
  transition: transform 0.2s ease;
}

.project-item__inner:hover h3 svg {
  transform: translate(3px, -3px);
}

.project-item__info p {
  font-size: 0.9rem;
  color: var(--text-lightest);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* Projects without image */
.project-item__inner:not(:has(.project-item__image-wrap)) {
  grid-template-columns: 1fr;
}

/* ===== FOOTER ===== */
.footer {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-lightest);
  line-height: 1.7;
}

.footer a {
  color: var(--text);
  transition: var(--transition);
}

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

/* ===== CURSOR GLOW (like Brittany Chiang) ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(29, 78, 216, 0.07),
    transparent 40%
  );
  z-index: 1;
}

.layout {
  position: relative;
  z-index: 2;
}

/* ===== RESPONSIVE ===== */

/* Tablets and smaller desktops */
@media (max-width: 1080px) {
  .layout {
    padding: 0 3rem;
    gap: 3rem;
  }

  .header {
    width: 42%;
  }

  .header h1 {
    font-size: 2.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    padding: 0 1.5rem;
    gap: 0;
  }

  .header {
    width: 100%;
    max-width: none;
  }

  .header__inner {
    position: static;
    height: auto;
    padding: 3rem 0 1rem;
    justify-content: flex-start;
    gap: 1rem;
  }

  .header h1 {
    font-size: 2.5rem;
  }

  /* Hide nav on mobile */
  .nav {
    display: none;
  }

  .social {
    margin-top: 1rem;
  }

  .main {
    padding: 2rem 0 4rem;
  }

  .section {
    margin-bottom: 5rem;
    scroll-margin-top: 4rem;
  }

  /* Show section headers on mobile */
  .section__header-mobile {
    display: block;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 1rem 0;
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
  }

  .section__header-mobile h2 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
  }

  /* Experience layout for mobile */
  .experience-item__header {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  .experience-item__date {
    margin-bottom: 0.25rem;
  }

  .certification-item__content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .certification-item__media {
    width: min(220px, 100%);
  }

  /* Projects layout for mobile */
  .project-item__inner {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  .project-item__image-wrap {
    width: 100%;
    height: 120px;
    order: -1;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .layout {
    padding: 0 1rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .header__inner {
    padding: 2rem 0 0.5rem;
  }

  .section__header-mobile {
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}