/* ===== CSS Variables ===== */
:root {
  --sky-lightest: #EAF6FF;
  --sky-light: #B8DFF5;
  --sky-medium: #7EC8E8;
  --sky-blue: #4BA3D0;
  --deep-blue: #1E3A5F;
  --white: #FFFFFF;
  --shadow: rgba(30, 58, 95, 0.1);
  --shadow-strong: rgba(30, 58, 95, 0.15);
}

/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--deep-blue);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--deep-blue);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

/* ===== Animated Gradient Background ===== */
.gradient-bg {
  background: radial-gradient(
    circle at 50% 50%,
    var(--sky-lightest) 0%,
    var(--sky-light) 40%,
    var(--sky-blue) 100%
  );
  background-size: 200% 200%;
  background-position: center;
  animation: radialPulse 6s ease-in-out infinite;
}

@keyframes radialPulse {
  0%, 100% {
    background-size: 100% 100%;
  }
  50% {
    background-size: 200% 200%;
  }
}

/* ===== Page Background (non-animated) ===== */
.page-bg {
  background: linear-gradient(
    180deg,
    var(--sky-lightest) 0%,
    var(--sky-light) 50%,
    var(--sky-medium) 100%
  );
  min-height: 100vh;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(224, 244, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  display: none;
}

.nav-links a:hover {
  color: var(--sky-blue);
  opacity: 1;
}

/* ===== Hero Section (Landing) ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 300;
  margin-bottom: 1rem;
  text-transform: lowercase;
}

.hero-nav {
  display: flex;
  gap: 3rem;
  list-style: none;
}

.hero-nav a {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  padding: 0.5rem 0;
  position: relative;
}

.hero-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--deep-blue);
  transition: width 0.3s ease;
}

.hero-nav a:hover::after {
  width: 100%;
}

.hero-nav a:hover {
  opacity: 1;
}

.nav-button {
  display: inline-block;
  width: 7rem;
  padding: 0.6rem 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 12px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-button::after {
  display: none;
}

.nav-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-strong);
  background: var(--white);
  opacity: 1;
}

/* ===== Hero Previews ===== */
.hero-previews {
  display: flex;
  gap: 4rem;
  margin-top: 3rem;
}

.preview-group {
  text-align: center;
}

.preview-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-bottom: 0.75rem;
  text-transform: lowercase;
}

.preview-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preview-list a {
  font-size: 0.95rem;
  font-weight: 400;
}

/* ===== Main Content Area ===== */
.main-content {
  padding: 6rem 2rem 3rem;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100vh;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 3rem;
  text-align: center;
}

/* ===== Cards (Projects) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 24px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--shadow-strong);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card-description {
  font-size: 0.95rem;
  color: var(--deep-blue);
  opacity: 0.8;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.card-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: var(--deep-blue);
  color: var(--white);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.card-link:hover {
  background: #2a4d73;
  opacity: 1;
}

/* ===== Blog List ===== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-item {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 24px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
}

.blog-item:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 28px var(--shadow-strong);
  opacity: 1;
}

.blog-item-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.blog-item-date {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ===== About Content ===== */
.about-content {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 4px 24px var(--shadow);
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-content p {
  margin-bottom: 1.5rem;
}

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

/* ===== Contact ===== */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.contact-item {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 24px var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-item:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 28px var(--shadow-strong);
  opacity: 1;
}

.contact-label {
  font-weight: 600;
  min-width: 80px;
}

.contact-value {
  opacity: 0.8;
}

/* ===== Project/Post Detail Page ===== */
.detail-content {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 4px 24px var(--shadow);
}

.detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(30, 58, 95, 0.1);
}

.detail-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.detail-meta {
  font-size: 0.9rem;
  opacity: 0.6;
}

.detail-body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.detail-body p {
  margin-bottom: 1.5rem;
}

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

.detail-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
}

.detail-body ul, .detail-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.detail-body li {
  margin-bottom: 0.5rem;
}

.detail-body code {
  background: rgba(30, 58, 95, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.detail-body pre {
  background: rgba(30, 58, 95, 0.08);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.detail-body pre code {
  background: none;
  padding: 0;
}

.detail-links {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(30, 58, 95, 0.1);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: var(--deep-blue);
  color: var(--white);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.detail-link:hover {
  background: #2a4d73;
  opacity: 1;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  opacity: 0.7;
}

.back-link:hover {
  opacity: 1;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav {
    padding: 0.5rem 1rem;
  }

  .nav-brand {
    font-size: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .hero-nav {
    flex-direction: column;
    gap: 1.5rem;
  }

  .main-content {
    padding: 5rem 1.5rem 3rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .about-content {
    padding: 2rem;
  }

  .hero-previews {
    flex-direction: column;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 0.75rem;
  }

  .nav-button {
    width: 6rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
  }
}
