:root {
  --navy: #0f172a;
  --light-navy: #112240;
  --lightest-navy: #233554;
  --white: #e6f1ff;
  --slate: #8892b0;
  --light-slate: #ccd6f6;
  --accent: #7db5ff;
  --cursor-x: 50vw;
  --cursor-y: 50vh;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--navy);
  /* subtle geometric background */
  background-attachment: fixed;
  color: var(--white);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 500px at var(--cursor-x) var(--cursor-y), rgba(125, 181, 255, 0.106), transparent 60%);
  mix-blend-mode: screen;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon fill='%23ffffff' points='50,5 90,30 90,70 50,95 10,70 10,30'/%3E%3C/svg%3E") no-repeat center/80vmin;
  opacity: 0.06;
  transform: scale(1.1) rotate(5deg);
  z-index: -2;
  background-attachment: fixed;
}

header {
  position: fixed;
  top: 0;
  width: 100%;
  backdrop-filter: blur(10px);
  background-color: rgba(15, 23, 42, 0.5);
  z-index: 100;
}

nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 2rem 1rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  padding: 0;
  margin: 0;
}

nav a {
  color: var(--light-slate);
  text-decoration: none;
  font-weight: 500;
}

nav a:hover,
nav a:focus {
  color: var(--accent);
}

.toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.toggle span {
  width: 24px;
  height: 2px;
  background: var(--light-slate);
}

section {
  padding: 80px 20px;
  max-width: 800px;
  margin: 0 auto 60px auto;
}

.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  margin-top: 40px;
}

.hero .profile-img {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  object-position: 50% 10%;
  margin: 0 auto 1rem;
}

.hero h1 {
  color: var(--accent);
  margin: 0 0 20px 0;
}

.hero h2 {
  font-size: clamp(40px, 8vw, 80px);
  margin: 0 0 20px 0;
}

.hero .social {
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover,
.btn:focus {
  background: rgba(125, 181, 255, 0.1);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.vertical {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-item {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.project-img {
  flex-basis: 33%;
  max-width: 250px;
  border-radius: 4px;
}

.project-text {
  flex: 1;
  text-align: left;
}

.card {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  width: auto;
  max-width: 100%;
  transition: all 0.3s ease;
}

.card .date {
  font-size: 0.95em;
  color: var(--slate);
  margin-bottom: 0em;   /* h3와의 간격을 좁게 */
  margin-top: 0;
  display: block;
  line-height: 1.2;
}

.degree-tgpa-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2em;
}
.degree-tgpa-row .degree {
  text-align: left;
}
.degree-tgpa-row .tgpa {
  text-align: right;
  color: #b7b7b7;
}

.card.active .date {
  color: #ffffff; /* 또는 원하는 색상 */
}

.card p {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.15em;
}

.card:hover,
.card.active {
  transform: scale(1.015);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.card.active h3,
.card:hover h3 {
  color: var(--accent);
}

.card.faded {
  opacity: 0.5;
}

.social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 2rem;
}

.social a {
  color: var(--light-slate);
  transition: color 0.2s, transform 0.2s;
}

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

@media (max-width: 600px) {
  .toggle {
    display: flex;
  }

  section {
    padding: 60px 15px;
    margin: 0 auto 40px auto;
  }

  .project-item {
    flex-direction: column;
    text-align: center;
  }

  .project-img {
    flex-basis: auto;
    max-width: 100%;
    width: 100%;
  }

  body::before {
    display: none;
  }

  nav ul {
    position: absolute;
    top: 60px;
    right: 20px;
    flex-direction: column;
    background: rgba(15,23,42,0.9);
    padding: 1rem;
    border-radius: 8px;
    display: none;
  }

  nav.open ul {
    display: flex;
  }

  .card {
    width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }
}

footer {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--slate);
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

.date {
  font-size: 0.85rem;
  opacity: 0.8;
}
