/* ============================================
   Personal Site — Modern Minimal
   ============================================ */

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

:root {
  --bg: #fafafa;
  --bg-secondary: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --blue: #1764ff;
  --lime: #b7ff00;
  --magenta: #ff0077;
  --border: #e5e5e5;
  --card-bg: #ffffff;
  --nav-bg: rgba(250, 250, 250, 0.85);
  --font-heading: 'Geist Pixel', var(--font-sans);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Fira Code', monospace;
  --container: 1200px;
  --transition: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bg-secondary: #141414;
    --text: #f0f0f0;
    --text-secondary: #aaa;
    --text-muted: #666;
    --border: #222;
    --card-bg: #111;
    --nav-bg: rgba(10, 10, 10, 0.85);
  }
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--border) 0.75px, transparent 0.75px);
  background-size: 28px 28px;
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Left margin guide line — subtle vertical line */
body::before {
  content: '';
  position: fixed;
  left: 2rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 10%, var(--border) 90%, transparent);
  z-index: 0;
  pointer-events: none;
}

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

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

/* --- Canvas Background --- */
#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero {
  overflow: hidden;
  position: relative;
}

/* Pure CSS glass effect for low-significance elements (skills, filters) */
.glass-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s var(--transition);
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(23, 100, 255, 0.03) 100%
  );
  z-index: -1;
  pointer-events: none;
}

.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.8) 30%,
    rgba(255, 255, 255, 0.8) 70%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .glass-card {
    border-color: rgba(255, 255, 255, 0.08);
  }

  .glass-card::before {
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.02) 50%,
      rgba(23, 100, 255, 0.04) 100%
    );
  }

  .glass-card::after {
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.12) 30%,
      rgba(255, 255, 255, 0.12) 70%,
      transparent 100%
    );
  }
}

.glass-card:hover {
  border-color: rgba(23, 100, 255, 0.3);
  box-shadow: 0 8px 32px rgba(23, 100, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transform: translateY(-4px);
}

/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
}

/* Static guide lines — left and right edges of content area */
.container::before,
.container::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  z-index: 0;
  pointer-events: none;
}

.container::before {
  left: calc(50% - var(--container) / 2 - 1px);
}

.container::after {
  right: calc(50% - var(--container) / 2 - 1px);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: all 0.4s var(--transition);
}

.nav.scrolled {
  padding: 0.75rem 2rem;
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  transition: opacity 0.3s;
}

.nav-logo:hover {
  opacity: 0.8;
}

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

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--blue);
  transition: width 0.3s var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--blue);
}

.nav-link.active::after,
.nav-link:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--transition);
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-link {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.mobile-link:hover {
  color: var(--blue);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .mobile-menu {
    display: flex;
  }
  /* Mobile: ensure liquid glass content stays above glass layer */
  liquid-glass .project-card-image,
  liquid-glass .project-card-body,
  liquid-glass .news-date,
  liquid-glass .news-content,
  liquid-glass .contact-link,
  liquid-btn span {
    z-index: 10 !important;
  }
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 calc((100vw - var(--container)) / 2 + 2rem);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.hero .reveal,
.hero .container {
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--blue);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.accent {
  color: var(--blue);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-scroll-indicator span {
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--blue);
  writing-mode: vertical-lr;
  letter-spacing: 0.1em;
}

.scroll-line {
  width: 2px;
  height: 80px;
  background: var(--blue);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--blue);
  animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.3s var(--transition);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(23, 100, 255, 0.15);
}

.btn-primary:hover {
  background: #1454d4;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(23, 100, 255, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* --- Sections --- */
.section {
  padding: 6rem 0;
  position: relative;
}

/* Horizontal guide line between sections */
.section + .section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--container), calc(100% - 4rem));
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-cta {
  text-align: center;
  margin-top: 3rem;
}

/* --- Page Header --- */
.page-header {
  padding: 10rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.page-header .reveal,
.page-header .container {
  position: relative;
  z-index: 1;
}

.page-header .hero-glass {
  z-index: 0;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.about-text p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

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

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--blue);
  font-family: var(--font-mono);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* --- Skills --- */
.skills-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.skill-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.4s var(--transition);
}

.skill-card:hover {
  border-color: var(--lime);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(183, 255, 0, 0.08);
}

.skill-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.skill-card h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.skill-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-stats {
    flex-direction: row;
    gap: 3rem;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Projects Grid --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s var(--transition);
  position: relative;
}

.project-card:hover {
  border-color: var(--blue);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(23, 100, 255, 0.1);
}

.project-card-image {
  width: 100%;
  height: 200px;
  background: var(--bg-secondary);
  overflow: hidden;
  position: relative;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--transition);
}

.project-card:hover .project-card-image img {
  transform: scale(1.05);
}

.project-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--border));
}

.project-card-body {
  padding: 1.5rem;
}

.project-card-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  background: rgba(23, 100, 255, 0.1);
  color: var(--blue);
  font-weight: 500;
}

.project-card-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s;
}

.project-link:hover {
  color: var(--blue);
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* --- News List --- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.4s var(--transition);
}

.news-item:hover {
  border-color: var(--blue);
  transform: translateX(8px);
  box-shadow: 0 8px 30px rgba(23, 100, 255, 0.1);
}

.news-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 100px;
  padding-top: 0.25rem;
}

.news-content {
  flex: 1;
}

.news-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.news-item:hover .news-title {
  color: var(--blue);
}

.news-summary {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.news-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .news-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  .news-date {
    min-width: auto;
  }
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s var(--transition);
}

.filter-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* --- Contact Section --- */
.contact {
  position: relative;
  overflow: hidden;
}

.contact-canvas {
  position: absolute;
  top: 0;
  height: 100%;
  /* Centered, width matches container content area (container - 4rem padding) */
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--container) - 4rem);
  max-width: calc(100vw - 4rem);
  z-index: 0;
  pointer-events: none;
}

.contact-content {
  max-width: 600px;
  position: relative;
  z-index: 1;
}

.contact-content > p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: none;
  border-radius: 10px;
  transition: all 0.3s var(--transition);
}

.contact-link:hover {
  transform: translateX(8px);
}

.contact-icon {
  font-weight: 600;
  font-size: 0.9375rem;
  min-width: 80px;
  color: var(--blue);
}

.contact-handle {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* --- Footer --- */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
}

.footer-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-year {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--transition), transform 0.8s var(--transition);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Loading State --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* --- Liquid Glass Overrides --- */
liquid-glass {
  display: block;
  width: 100%;
}

liquid-btn {
  display: inline-block;
}

/* Liquid-glass project cards */
liquid-glass.project-card {
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s var(--transition);
  /* Content behind glass — children render below glass-inner */
}

liquid-glass.project-card .project-card-image,
liquid-glass.project-card .project-card-body {
  position: relative;
  z-index: 1;
}

liquid-glass.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(23, 100, 255, 0.12);
}

/* Liquid-glass news items */
liquid-glass.news-item {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.75rem 2rem;
  border-radius: 12px;
  transition: all 0.4s var(--transition);
  width: 100%;
}

liquid-glass.news-item .news-date,
liquid-glass.news-item .news-content {
  position: relative;
  z-index: 1;
}

liquid-glass.news-item:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 30px rgba(23, 100, 255, 0.1);
}

/* Liquid-glass contact links */
liquid-glass .contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: none;
  border-radius: 10px;
  transition: all 0.3s var(--transition);
  position: relative;
  z-index: 1;
}

liquid-glass .contact-link:hover {
  transform: translateX(8px);
}

/* Contact glass button — centered */
.contact-btn-glass {
  margin: 1rem 0;
}

/* Liquid-btn primary buttons */
liquid-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* --- Selection --- */
::selection {
  background: var(--blue);
  color: #fff;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
