:root {
  --bg-start: #0a0f1a;
  --bg-end: #0b1220;
  --acc: #7c6cff;
  --acc2: #00d4ff;
  --text: #e6e8ff;
  --muted: #a9accb;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(120deg, var(--bg-start), var(--bg-end));
  overflow-x: hidden;
  font-size: 16px; /* base size up */
  scroll-behavior: smooth;
}

/* Global scale: enlarge all content 1.2x while fitting viewport width */
main, .footer {
  transform: scale(1);
  transform-origin: top center;
  width: calc(100% / 1.2);
  margin: 0 auto;
}

/* Mobile responsive design */
@media (max-width: 768px) {
  /* Remove scaling on mobile to prevent overflow */
  main, .footer {
    transform: scale(1);
    width: 100%;
    padding: 0 16px;
  }
  
  /* Adjust base font size for mobile */
  body {
    font-size: 14px;
  }
  
  /* Hero section mobile optimization */
  .hero-inner h1 {
    font-size: 2.5rem;
  }
  
  .hero-inner p {
    font-size: 1.1rem;
  }
  
  /* Education frame mobile layout */
  .education-frame {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }
  
  .school-logo {
    min-width: 80px;
    height: 80px;
  }
  
  .school-logo-img {
    width: 60px;
    height: 60px;
  }
  
  /* Tech stack grid mobile layout */
  .stack .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .item {
    padding: 16px 20px;
  }
  
  .item i, .item img {
    font-size: 40px;
    width: 40px;
    height: 40px;
  }
  
  .item span {
    font-size: 14px;
  }
  
  /* Form mobile optimization */
  .form {
    max-width: 100%;
  }
  
  .field input, .field textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Guestbook mobile optimization */
  #guestbook {
    padding: 80px 16px;
  }
  
  #guestbook h2 {
    font-size: 2rem;
  }
  
  #guestbook p {
    font-size: 1rem;
  }
  
  /* CTA buttons mobile layout */
  .cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
  
  /* About section mobile optimization */
  .about-point {
    flex-direction: column;
    gap: 16px;
  }
  
  .point-number {
    font-size: 2rem;
  }
  
  .point-content h3 {
    font-size: 1.3rem;
  }
  
  .point-content p {
    font-size: 1rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .hero-inner h1 {
    font-size: 2rem;
  }
  
  .stack .grid {
    grid-template-columns: 1fr;
  }
  
  .education-info h4 {
    font-size: 1.3rem;
  }
  
  .education-info p {
    font-size: 1rem;
  }
}
/* Enhanced starry night sky background */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, #0a0f1a 0%, #0b1220 50%, #0c1425 100%);
  overflow: hidden;
}

.stars {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
}

.star {
  position: absolute;
  border-radius: 50%;
  animation: starTwinkle 3s infinite;
}

.star.small {
  width: 1px;
  height: 1px;
  background: rgba(255, 255, 255, 0.8);
}

.star.medium {
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
}

.star.large {
  width: 3px;
  height: 3px;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.star.purple {
  background: rgba(124, 108, 255, 0.8);
  box-shadow: 0 0 8px rgba(124, 108, 255, 0.4);
}

.star.cyan {
  background: rgba(0, 212, 255, 0.8);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: linear-gradient(45deg, #ffffff, transparent);
  border-radius: 50%;
  animation: shootingStar 4s infinite;
}

@keyframes shootingStar {
  0% {
    opacity: 0;
    transform: translateX(-100px) translateY(-100px);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(100px) translateY(100px);
  }
}
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }
.nav {
  position: sticky; top: 0; display: flex; gap: 20px; padding: 16px 24px;
  backdrop-filter: blur(8px);
  background: rgba(20,20,40,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--text); }
.section { max-width: 1100px; margin: 0 auto; padding: 120px 24px; position: relative; z-index: 1; }
/* Full-screen hero section with scroll behavior */
#hello {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease-out;
}

.hero-inner {
  text-align: center;
  z-index: 2;
  transition: transform 0.1s ease-out;
}

.hero { display: grid; place-items: center; min-height: 70vh; text-align: center; }
.hero h1 { font-size: 64px; letter-spacing: -1px; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0 0 32px; font-size: 22px; }
.cta { display: flex; gap: 12px; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; background: linear-gradient(90deg, var(--acc), var(--acc2)); color: #000; font-weight: 700; text-decoration: none; box-shadow: 0 6px 20px rgba(0,212,255,0.3); }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn.outline { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,0.2); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; box-shadow: 0 0 0 3px rgba(0,212,255,0.35); }
h2 { font-size: 40px; margin: 0 0 16px; }
h3 { font-size: 28px; margin: 48px 0 20px; color: var(--muted); }
/* About section styling */
.about-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  margin-bottom: 40px;
}

.icon-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 16px; }
.icon-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; background: rgba(255,255,255,0.03); text-decoration: none; color: var(--text); transition: transform .15s ease, background .2s ease; }
.icon-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.06); }
.icon-card:focus-visible { outline: 2px solid rgba(255,255,255,0.35); outline-offset: 2px; }
.icon-card i, .icon-card svg, .icon-card img { font-size: 64px; width: 64px; height: 64px; }

/* New About Me section with scroll reveal */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 0;
}

.about-point {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 80px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

.about-point.revealed {
  opacity: 1;
  transform: translateY(0);
}

.point-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  min-width: 60px;
  line-height: 1;
}

.point-content h3 {
  font-size: 32px;
  margin: 0 0 16px 0;
  color: var(--text);
}

.point-content p {
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* Glass-style education frame */
.education-frame {
  display: flex;
  gap: 24px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.education-frame.has-bg {
  position: relative;
  overflow: hidden;
}

.education-frame.has-bg::before {
  content: "";
  position: absolute;
  inset:0;
  transform: translateY(-20px);
  background: url('/icons/background.svg') center/cover no-repeat;
  opacity: 0.15;
  z-index: 0;
  background-position: right -80px top 0px;
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.education-frame.has-bg > * {
  position: relative;
  z-index: 1;
}

.school-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.school-logo-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.logo-placeholder {
  font-size: 32px;
  font-weight: 700;
  color: var(--acc);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.education-info h4 {
  font-size: 24px;
  margin: 0 0 16px 0;
  color: var(--text);
}

.education-info p {
  font-size: 18px;
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.5;
}
.stack .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 32px; border-radius: 16px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); }
.item i, .item img { font-size: 56px; width: 56px; height: 56px; }
.item span { font-size: 18px; color: var(--text); margin-top: 8px; }
.item:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(124,108,255,0.12); }
.form { display: grid; gap: 12px; max-width: 560px; }
.field { display: grid; gap: 8px; }
.field input, .field textarea { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.25); color: var(--text); }
.status { min-height: 24px; font-size: 14px; color: var(--muted); }
.footer { padding: 32px; text-align: center; color: var(--muted); }
.reveal { opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .6s ease, transform .6s ease; }
.reveal.show { opacity: 1; transform: translateY(0) scale(1); }

#guestbook { display: grid; place-items: center; text-align: center; padding: 160px 24px; }
.form { margin: 0 auto; justify-self: center; max-width: 700px; width: 100%; }
.field input, .field textarea { padding: 16px 18px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.25); color: var(--text); font-size: 18px; font-family: inherit; }
.field input::placeholder, .field textarea::placeholder { font-family: inherit; }
.field label { font-family: inherit; }
.field textarea { min-height: 120px; }
#guestbook h2 { font-size: 48px; margin-bottom: 24px; }
#guestbook p { font-size: 20px; margin-bottom: 40px; }
#guestbook .btn { padding: 16px 24px; font-size: 18px; }

/* Blog page mobile optimization */
@media (max-width: 768px) {
  /* Blog container mobile optimization */
  .blog-container {
    padding: 20px 16px;
  }
  
  .blog-header {
    padding: 24px 16px;
  }
  
  .blog-header h1 {
    font-size: 2rem;
  }
  
  .blog-header p {
    font-size: 1rem;
  }
  
  /* Post list mobile layout */
  .post-list {
    padding: 0 16px;
  }
  
  .post-item {
    padding: 20px;
    margin-bottom: 16px;
  }
  
  .post-title {
    font-size: 1.3rem;
  }
  
  .post-excerpt {
    font-size: 0.95rem;
  }
  
  .post-meta {
    font-size: 0.85rem;
  }
  
  /* Blog post content mobile optimization */
  .markdown-body {
    padding: 0 16px 80px !important;
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .markdown-body h1 {
    font-size: 1.8rem;
  }
  
  .markdown-body h2 {
    font-size: 1.5rem;
  }
  
  .markdown-body h3 {
    font-size: 1.3rem;
  }
  
  .markdown-body pre {
    font-size: 0.85rem;
    padding: 16px;
    overflow-x: auto;
  }
  
  .markdown-body code {
    font-size: 0.85rem;
  }
  
  .markdown-body img {
    max-width: 100%;
    height: auto;
  }
  
  .markdown-body table {
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* Language selector mobile optimization */
  .lang-selector {
    top: 20px;
    right: 16px;
    font-size: 0.9rem;
  }
  
  /* Back button mobile optimization */
  .back-btn {
    top: 20px;
    left: 16px;
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .blog-header h1 {
    font-size: 1.7rem;
  }
  
  .post-title {
    font-size: 1.2rem;
  }
  
  .markdown-body h1 {
    font-size: 1.5rem;
  }
  
  .markdown-body h2 {
    font-size: 1.3rem;
  }
  
  .markdown-body {
    font-size: 0.95rem;
  }
}
