/* ==========================================================================
   PERSONAL PLATFORM — MODERN DESIGN SYSTEM (CSS)
   Aesthetics: Clean, Premium, High-Tech, Dynamic
   ========================================================================== */

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

:root {
  color-scheme: light dark;

  /* Typography */
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-mono-plex: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* Sizing & Spacing */
  --header-h: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Colors (Light Theme Defaults) */
  --bg: #ffffff;
  --bg-subtle: #f3f4f6;
  --bg-elev: #ffffff;
  --bg-elev-card: #ffffff;
  --text: #111827;
  --text-dim: #374151;
  --text-muted: #4b5563;
  --border: #e5e7eb;
  --border-subtle: #f3f4f6;

  --accent: #16a34a;
  --accent-rgb: 22, 163, 74;
  --accent-hover: #15803d;
  --accent-fg: #ffffff;
  --accent-soft: rgba(22, 163, 74, 0.08);
  --accent-border: rgba(22, 163, 74, 0.22);
  --accent-gradient: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  --hero-gradient: linear-gradient(135deg, #16a34a 0%, #22c55e 50%, #4ade80 100%);

  --card-shadow: 0 4px 20px -2px rgba(17, 24, 39, 0.06), 0 2px 6px -1px rgba(17, 24, 39, 0.03);
  --card-shadow-hover: 0 20px 35px -8px rgba(17, 24, 39, 0.12), 0 8px 16px -4px rgba(17, 24, 39, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #18181b;
  --bg-subtle: #27272a;
  --bg-elev: #27272a;
  --bg-elev-card: rgba(39, 39, 42, 0.75);
  --text: #f9fafb;
  --text-dim: #d1d5db;
  --text-muted: #9ca3af;
  --border: #3f3f46;
  --border-subtle: rgba(255, 255, 255, 0.06);

  --accent: #22c55e;
  --accent-rgb: 34, 197, 94;
  --accent-hover: #4ade80;
  --accent-fg: #052e16;
  --accent-soft: rgba(34, 197, 94, 0.14);
  --accent-border: rgba(34, 197, 94, 0.3);
  --accent-gradient: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
  --hero-gradient: linear-gradient(135deg, #22c55e 0%, #4ade80 50%, #86efac 100%);

  --card-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.5);
  --card-shadow-hover: 0 20px 40px -8px rgba(0, 0, 0, 0.7), 0 0 25px -4px rgba(34, 197, 94, 0.25);
  --glass-bg: rgba(24, 24, 27, 0.82);
  --glass-border: rgba(255, 255, 255, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;

    --bg: #18181b;
    --bg-subtle: #27272a;
    --bg-elev: #27272a;
    --bg-elev-card: rgba(39, 39, 42, 0.75);
    --text: #f9fafb;
    --text-dim: #d1d5db;
    --text-muted: #9ca3af;
    --border: #3f3f46;
    --border-subtle: rgba(255, 255, 255, 0.06);

    --accent: #22c55e;
    --accent-rgb: 34, 197, 94;
    --accent-hover: #4ade80;
    --accent-fg: #052e16;
    --accent-soft: rgba(34, 197, 94, 0.14);
    --accent-border: rgba(34, 197, 94, 0.3);
    --accent-gradient: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    --hero-gradient: linear-gradient(135deg, #22c55e 0%, #4ade80 50%, #86efac 100%);

    --card-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.5);
    --card-shadow-hover: 0 20px 40px -8px rgba(0, 0, 0, 0.7), 0 0 25px -4px rgba(34, 197, 94, 0.25);
    --glass-bg: rgba(24, 24, 27, 0.82);
    --glass-border: rgba(255, 255, 255, 0.08);
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.container {
  width: min(1140px, 92%);
  margin-inline: auto;
}

/* ===== Typography Utility ===== */
.text-gradient {
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ===== Site Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  height: 100%;
}

.header-menu {
  display: flex;
  align-items: stretch;
  gap: 0;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.25rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none !important;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: var(--accent-fg);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
  flex-shrink: 0;
}

.brand-icon {
  width: 18px;
  height: 18px;
}

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

.brand-text {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Site Navigation */
.site-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-left: 1px solid var(--border);
}

.nav-link {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 0 0.95rem;
  transition: all 0.2s ease;
}

.nav-link + .nav-link {
  border-left: 1px solid var(--border);
}

.nav-link:hover {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-cta-mobile {
  display: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-left: 1px solid var(--border);
}

.nav-cta-desktop {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-icon-end {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.nav-cta-desktop:hover .btn-icon-end {
  transform: translateX(3px);
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 0 1.1rem;
  border: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-moon {
  display: block;
}

.icon-sun {
  display: none;
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.hamburger-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--accent-fg);
  box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.38);
}

.btn-primary:hover {
  color: var(--accent-fg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.48);
}

.btn-ghost {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  border-radius: var(--radius-pill);
}

.btn-lg {
  padding: 0.95rem 1.8rem;
  font-size: 1.05rem;
  border-radius: var(--radius-pill);
}

/* ===== Hero Section ===== */
.hero {
  --hero-pad-top: 4rem;
  --hero-pad-bottom: 3rem;
  position: relative;
  padding: var(--hero-pad-top) 0 var(--hero-pad-bottom);
  overflow: hidden;
}

.hero-glow-1,
.hero-glow-2 {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.hero-glow-1 {
  top: -60px;
  left: 15%;
  background: var(--accent);
}

.hero-glow-2 {
  top: 40px;
  right: 15%;
  background: #22c55e;
}

:root[data-theme="dark"] .hero-glow-1,
:root[data-theme="dark"] .hero-glow-2 {
  opacity: 0.35;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 2.5rem;
}

.hero-content {
  max-width: 640px;
}

.hero-divider {
  align-self: stretch;
  width: 1px;
  margin-top: calc(-1 * var(--hero-pad-top));
  margin-bottom: calc(-1 * var(--hero-pad-bottom));
  background-image: repeating-linear-gradient(
    to bottom,
    var(--border) 0,
    var(--border) 6px,
    transparent 6px,
    transparent 16px
  );
}

/* Status badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.status-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  display: inline-block;
}

.status-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

.hero-title {
  font-size: clamp(2.4rem, 6.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 2.2rem;
}

.hero-actions {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Quick Stats */
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  backdrop-filter: blur(12px);
  font-family: var(--font-mono-plex);
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* ===== Sections Common ===== */
.section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--border-subtle);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono-plex);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.85rem;
}

.section-title {
  font-size: clamp(1.85rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev-card);
  text-align: center;
}

.empty-icon {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  opacity: 0.6;
}

.section-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Tech Stack ===== */
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.tech-chip:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.tech-chip-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.tech-chip-mono {
  font-family: var(--font-mono-plex);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.tech-chip-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* ===== Portfolio Section ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
}

.portfolio-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-subtle);
}

.portfolio-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-thumb {
  transform: scale(1.03);
}

.portfolio-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-subtle), var(--accent-soft));
  color: var(--accent);
  font-weight: 700;
  gap: 0.5rem;
  letter-spacing: 0.5px;
}

.placeholder-icon {
  width: 36px;
  height: 36px;
  opacity: 0.8;
}

.portfolio-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.portfolio-badge {
  font-family: var(--font-mono-plex);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

.featured-pill {
  font-family: var(--font-mono-plex);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

.portfolio-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.85rem;
}

.portfolio-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.portfolio-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portfolio-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.portfolio-tech {
  font-family: var(--font-mono-plex);
  font-size: 0.73rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.portfolio-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

/* ===== Experience Timeline ===== */
.timeline {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 13px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--border) 100%);
}

.timeline-item {
  position: relative;
  padding-left: 2.8rem;
}

.timeline-marker {
  position: absolute;
  left: 3px;
  top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  z-index: 1;
}

.timeline-marker-pulse {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.25);
}

.timeline-marker-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse-ring 2.2s infinite;
}

.timeline-content {
  background: var(--bg-elev-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--card-shadow);
  transition: all 0.22s ease;
}

.timeline-item:hover .timeline-content {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.timeline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.timeline-company {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.company-icon {
  width: 16px;
  height: 16px;
}

.timeline-period {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono-plex);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.period-icon {
  width: 14px;
  height: 14px;
}

.timeline-role-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.65rem;
}

.role-label {
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===== Contact Section ===== */
.contact-section {
  padding-bottom: 6rem;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  max-width: 900px;
  margin-inline: auto;
}

.contact-intro {
  text-align: left;
}

.contact-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.contact-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 420px;
  margin-bottom: 0;
}

.contact-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.contact-item:hover {
  color: var(--accent);
  padding-left: 0.75rem;
  text-decoration: none;
}

.contact-item-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--accent);
}

.contact-item-icon svg {
  width: 20px;
  height: 20px;
}

.contact-item-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.contact-item-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.contact-item-value {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-item-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.contact-item:hover .contact-item-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 2.75rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 360px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  margin-left: auto;
  text-align: right;
}

.footer-motto {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono-plex);
  font-size: 0.8rem;
  color: var(--text-dim);
}

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

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

.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.back-to-top svg {
  width: 16px;
  height: 16px;
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Responsive Mobile Styles ===== */
@media (max-width: 820px) {
  .nav-cta-desktop {
    display: none;
  }

  .nav-toggle-label {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-elev);
    border-left: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.2rem;
    gap: 0;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
  }

  .nav-link {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 0;
  }

  .site-nav .nav-link + .nav-link {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .nav-cta-mobile {
    display: inline-flex;
    margin-top: 0.5rem;
    width: 100%;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-divider {
    display: none;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
    padding: 1.5rem;
  }

  .stat-divider {
    display: none;
  }

  .nav-toggle:checked ~ .site-nav {
    max-height: 480px;
    opacity: 1;
    padding: 1.2rem;
  }

  .nav-toggle:checked ~ .nav-toggle-label .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-toggle-label .hamburger-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .nav-toggle-label .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-right {
    align-items: center;
    margin-left: 0;
    text-align: center;
  }

  .footer-tagline {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .hero-stats {
    padding: 1.25rem 1.4rem;
    gap: 1.1rem 1.4rem;
  }

  .timeline-head {
    flex-direction: column;
    gap: 0.4rem;
  }
}

/* ===== A11y: prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   LANGUAGE DROPDOWN
   ========================================================================== */
.lang-menu {
  position: relative;
  align-self: stretch;
}

.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  transition: all 0.2s ease;
}

.lang-toggle::-webkit-details-marker {
  display: none;
}

.lang-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.lang-toggle svg {
  width: 20px;
  height: 20px;
}

.lang-list {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 120;
  min-width: 190px;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.lang-item {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.lang-item:hover {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}

.lang-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ==========================================================================
   PAGE SECTIONS (sub pages)
   ========================================================================== */
.page-section {
  padding: 4rem 0 3rem;
}

.section-cta {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* ==========================================================================
   BLOG CARDS
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  color: var(--text);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: var(--card-shadow-hover);
  text-decoration: none;
}

.blog-thumb-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-subtle);
}

.blog-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-thumb {
  transform: scale(1.04);
}

.blog-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent-fg);
  background: var(--accent-gradient);
}

.blog-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem 1.35rem 1.4rem;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.blog-category {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.blog-date {
  color: var(--text-muted);
}

.blog-title {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}

.blog-excerpt {
  font-size: 0.9rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.blog-more .btn-icon {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.blog-card:hover .blog-more .btn-icon {
  transform: translateX(3px);
}

/* ==========================================================================
   BLOG DETAIL
   ========================================================================== */
.blog-detail-container {
  max-width: 780px;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.blog-back:hover {
  color: var(--accent);
}

.blog-back .btn-icon {
  width: 16px;
  height: 16px;
}

.blog-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.blog-reading {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.blog-detail-title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.blog-detail-excerpt {
  margin-top: 0.85rem;
  font-size: 1.05rem;
  color: var(--text-dim);
}

.blog-detail-cover {
  width: 100%;
  height: auto;
  margin: 1.75rem 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.blog-tag {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.blog-detail-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ===== Article content (rich text) ===== */
.blog-content {
  margin-top: 1.75rem;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-dim);
}

.blog-content > * + * {
  margin-top: 1.1rem;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  color: var(--text);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 2rem;
}

.blog-content h1 {
  font-size: 1.7rem;
}
.blog-content h2 {
  font-size: 1.45rem;
}
.blog-content h3 {
  font-size: 1.2rem;
}

.blog-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-content ul,
.blog-content ol {
  padding-left: 1.4rem;
}

.blog-content li + li {
  margin-top: 0.4rem;
}

.blog-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.blog-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius-md);
}

.blog-content pre {
  background: #0d1117;
  color: #e6edf3;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.blog-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.blog-content :not(pre) > code {
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.blog-content th,
.blog-content td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.blog-content th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text);
}

.blog-content hr {
  border: 0;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   SERIES
   ========================================================================== */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.series-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  color: var(--text);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.series-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--card-shadow-hover);
  text-decoration: none;
}

.series-thumb-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-subtle);
}

.series-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.series-card:hover .series-thumb {
  transform: scale(1.04);
}

.series-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent-fg);
  background: var(--accent-gradient);
}

.series-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.25rem 1.35rem 1.4rem;
}

.series-count {
  font-family: var(--font-mono-plex);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.series-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}

.series-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.series-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.series-more .btn-icon {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.series-card:hover .series-more .btn-icon {
  transform: translateX(3px);
}

/* Series detail */
.series-detail-container {
  max-width: 820px;
}

.series-detail-head {
  margin-bottom: 2.5rem;
}

.series-detail-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 0.85rem;
  color: var(--text);
}

.series-detail-desc {
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 620px;
  margin-bottom: 0.85rem;
}

.series-detail-count {
  font-family: var(--font-mono-plex);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.series-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.series-step {
  border-bottom: 1px solid var(--border);
}

.series-step-link {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.2rem 0.5rem;
  color: var(--text);
  transition: padding-left 0.2s ease, color 0.2s ease;
}

.series-step-link:hover {
  padding-left: 1rem;
  color: var(--accent);
  text-decoration: none;
}

.series-step-num {
  font-family: var(--font-mono-plex);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.series-step-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.series-step-title {
  font-weight: 700;
  font-size: 1rem;
  color: inherit;
}

.series-step-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.series-step-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.series-step-link:hover .series-step-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.series-empty {
  color: var(--text-muted);
  padding: 1rem 0;
}

/* Blog detail: series badge + prev/next */
.blog-series-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.blog-series-badge:hover {
  text-decoration: none;
}

.blog-series-part {
  font-family: var(--font-mono-plex);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.blog-series-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.series-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
}

.series-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.series-nav-link:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  text-decoration: none;
}

.series-nav-next {
  text-align: right;
}

.series-nav-label {
  font-family: var(--font-mono-plex);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.series-nav-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 640px) {
  .series-nav {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   NOT FOUND
   ========================================================================== */
.not-found-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding-block: 3rem;
}

.not-found-code {
  font-family: var(--font-mono-plex);
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 1;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.not-found-inner .btn {
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .blog-detail-title {
    font-size: 1.6rem;
  }
}