:root {
  --bg: #0a0a0b;
  --bg-2: #111114;
  --surface: #16161a;
  --surface-2: #1c1c22;
  --border: #26262e;
  --border-bright: #34343f;
  --text: #f4f4f5;
  --text-dim: #a1a1aa;
  --text-faint: #5b5b66;
  --accent: #5cdb5c;
  --accent-2: #f6b73c;
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Background atmosphere ---------- */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}
.bg-blob {
  position: fixed; border-radius: 50%; filter: blur(120px);
  pointer-events: none; z-index: 0; opacity: 0.35;
  animation: float 18s ease-in-out infinite;
}
.bg-blob-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -120px; left: -160px;
}
.bg-blob-2 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  bottom: -200px; right: -200px;
  animation-delay: -9s;
  opacity: 0.22;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -30px); }
}

/* ---------- Top nav ---------- */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 2rem;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 11, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.topnav-right {
  display: flex; align-items: center; gap: 1.5rem;
}
.topnav-links { display: flex; gap: 1.6rem; }
.topnav-links a {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  transition: color 0.2s;
}
.topnav-links a:hover { color: var(--text); }

/* ---------- Lang switcher ---------- */
.lang-switcher { position: relative; }
.lang-current {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  line-height: 1;
}
.lang-current:hover {
  color: var(--text);
  border-color: var(--border-bright);
}
.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 170px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
  padding: 0.3rem;
}
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.lang-menu button:hover { background: var(--bg-2); color: var(--accent); }
.lang-menu button.active { color: var(--accent); background: var(--bg-2); }
.lang-flag { font-size: 1.1rem; }

@media (max-width: 640px) {
  .topnav-links { display: none; }
  .topnav-right { gap: 0; }
}

/* ---------- Layout ---------- */
main {
  position: relative; z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 4rem 0 6rem;
  min-height: 70vh;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-meta {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.meta-line {
  width: 40px; height: 1px;
  background: var(--accent);
}
.meta-text {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.hero-name {
  font-size: clamp(4rem, 14vw, 9.5rem);
  line-height: 0.95;
  font-weight: 400;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}
.serif-italic {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tagline {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--text-dim);
  max-width: 560px;
  font-weight: 400;
}
.hero-avatar-wrap {
  position: absolute;
  top: 5rem; right: 0;
  width: 180px; height: 180px;
}
.hero-avatar {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  box-shadow: 0 30px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04) inset;
}
.hero-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  padding: 12%;
  background: var(--surface);
}
.hero-avatar.hero-avatar-photo img {
  padding: 0;
}
.hero-avatar-ring {
  position: absolute; inset: -8px;
  border: 1px dashed var(--accent);
  border-radius: 50%;
  opacity: 0.5;
  animation: rotate 30s linear infinite;
}
@keyframes rotate {
  to { transform: rotate(360deg); }
}
@media (max-width: 760px) {
  .hero-avatar-wrap {
    position: relative; top: 0; right: 0;
    margin: 2rem 0 0; width: 130px; height: 130px;
  }
}

/* ---------- Sections ---------- */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}
.section-head {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 2.5rem;
}
.section-num {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-title {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
}
.bio {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text-dim);
  max-width: 680px;
  line-height: 1.7;
}

/* ---------- Socials ---------- */
.socials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.social-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.social-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(92, 219, 92, 0.06) 100%);
  opacity: 0; transition: opacity 0.25s;
}
.social-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}
.social-card:hover::before { opacity: 1; }
.social-card:hover .social-logo { transform: scale(1.08); }

.social-logo {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s;
}
.social-logo img { width: 100%; height: 100%; object-fit: contain; }
.social-logo-fallback {
  width: 100%; height: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.95rem;
  font-family: 'Geist Mono', monospace;
}
.social-info { min-width: 0; flex: 1; }
.social-platform {
  font-size: 0.95rem; font-weight: 500;
  margin-bottom: 0.15rem;
}
.social-handle {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.social-arrow {
  color: var(--text-faint); font-size: 1.1rem;
  transition: transform 0.25s, color 0.25s;
}
.social-card:hover .social-arrow {
  color: var(--accent); transform: translate(2px, -2px);
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
}
.project-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.project-image {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
  position: relative; overflow: hidden;
}
.project-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.project-card:hover .project-image img { transform: scale(1.05); }
.project-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-style: italic; font-size: 3rem;
  color: var(--border-bright);
  background:
    linear-gradient(135deg, transparent 49%, var(--border) 50%, transparent 51%),
    linear-gradient(45deg, transparent 49%, var(--border) 50%, transparent 51%),
    var(--surface-2);
  background-size: 30px 30px;
}
.project-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.project-name {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}
.project-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.project-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  padding: 0.25rem 0.55rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
}
.project-link {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 0.4rem;
  align-self: flex-start;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  width: 100%;
}
.project-link:hover { color: var(--text); }
.project-link::after {
  content: '→';
  transition: transform 0.25s;
}
.project-link:hover::after { transform: translateX(4px); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 5rem; padding: 2rem 0;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.footer-admin {
  text-decoration: none; letter-spacing: 0.1em;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}
.footer-admin:hover {
  color: var(--accent); border-color: var(--accent);
}

/* ---------- Entry animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease forwards;
}
@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}
.hero-meta { animation: fadeIn 0.6s ease forwards; opacity: 0; animation-delay: 0.05s; }
.hero-name { animation: fadeIn 0.8s ease forwards; opacity: 0; animation-delay: 0.15s; }
.hero-tagline { animation: fadeIn 0.8s ease forwards; opacity: 0; animation-delay: 0.3s; }
.hero-avatar-wrap { animation: fadeIn 1s ease forwards; opacity: 0; animation-delay: 0.4s; }
