/* ========================================
   HAKStudio — Design System
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --text: #fafafa;
  --text-muted: #888888;
  --text-dim: #555555;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --white: #ffffff;
  --black: #000000;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  --container: 1120px;
  --nav-h: 64px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(255,255,255,0.15); color: var(--white); }
a { color: var(--text); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--white); }
ul { list-style: none; }
img { max-width:100%; display:block; }

.container { max-width: var(--container); margin:0 auto; padding:0 24px; }

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: fixed; top:0; left:0; right:0;
  height: var(--nav-h);
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: var(--container); margin:0 auto; padding:0 24px;
  height:100%; display:flex; align-items:center; justify-content:space-between;
}

.nav-logo { display:flex; align-items:center; gap:0; }
.nav-logo img { height:28px; width:auto; }

.nav-links { display:flex; align-items:center; gap:32px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  position: relative; letter-spacing: -0.01em;
}
.nav-links a:hover { color: var(--white); }
.nav-links a::after {
  content:''; position:absolute; bottom:-4px; left:0; width:0; height:1px;
  background: var(--white); transition: var(--transition);
}
.nav-links a:hover::after { width:100%; }

.lang-switcher { display:flex; gap:2px; margin-left:8px; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.lang-btn {
  background:transparent; border:none; color:var(--text-dim);
  font-family:var(--font-mono); font-size:11px; padding:6px 10px;
  cursor:pointer; transition:var(--transition); letter-spacing:0.02em;
}
.lang-btn:hover { color:var(--text-muted); background:rgba(255,255,255,0.04); }
.lang-btn.active { color:var(--white); background:rgba(255,255,255,0.08); }

.nav-toggle {
  display:none; flex-direction:column; gap:5px; cursor:pointer;
  background:none; border:none; padding:5px; z-index:1001;
}
.nav-toggle span { width:24px; height:1.5px; background:var(--white); transition:var(--transition); transform-origin:center; }
.nav-toggle.active span:nth-child(1) { transform:rotate(45deg) translate(4.5px,4.5px); }
.nav-toggle.active span:nth-child(2) { opacity:0; }
.nav-toggle.active span:nth-child(3) { transform:rotate(-45deg) translate(4.5px,-4.5px); }

/* ========================================
   HERO
   ======================================== */
.hero {
  min-height: 100vh; display:flex; align-items:center;
  padding-top: var(--nav-h); position:relative; overflow:hidden;
}
.hero-content { max-width:720px; position:relative; z-index:1; }

.hero-logo { width:80px; height:80px; margin-bottom:32px; opacity:0; animation: fadeUp 0.6s ease forwards 0.1s; }

.hero-tagline {
  font-size: clamp(40px, 6vw, 72px); font-weight:800; color:var(--white);
  line-height:1.05; letter-spacing:-0.03em; margin-bottom:24px;
  opacity:0; animation: fadeUp 0.6s ease forwards 0.2s;
}

.hero-desc {
  font-size:18px; line-height:1.7; max-width:520px; margin-bottom:40px;
  opacity:0; animation: fadeUp 0.6s ease forwards 0.35s;
}

.hero-cta { display:flex; gap:16px; flex-wrap:wrap; opacity:0; animation: fadeUp 0.6s ease forwards 0.5s; }

/* Buttons */
.btn {
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--font-body); font-size:14px; font-weight:600;
  padding:14px 28px; border-radius:8px; cursor:pointer;
  transition:var(--transition); text-decoration:none; letter-spacing:-0.01em;
}
.btn-primary { background:var(--white); color:var(--black); border:1px solid var(--white); }
.btn-primary:hover { background:transparent; color:var(--white); }
.btn-secondary { background:transparent; color:var(--text-muted); border:1px solid var(--border); }
.btn-secondary:hover { color:var(--white); border-color:var(--border-hover); }

/* ========================================
   SECTIONS
   ======================================== */
.section { padding:120px 0; }
.section-label {
  font-family:var(--font-mono); font-size:12px; color:var(--text-dim);
  text-transform:uppercase; letter-spacing:0.1em; margin-bottom:16px; display:block;
}
.section-title {
  font-size:clamp(28px,4vw,40px); font-weight:800; color:var(--white);
  letter-spacing:-0.03em; margin-bottom:16px; line-height:1.1;
}
.section-desc { font-size:16px; max-width:560px; margin-bottom:48px; line-height:1.7; }

.about-skills { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }

/* ========================================
   STATS STRIP
   ======================================== */
.stats-strip {
  display:grid; grid-template-columns:repeat(4,1fr); gap:1px;
  background:var(--border); border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}
.stat-block { background:var(--bg); padding:48px 32px; text-align:center; }
.stat-number {
  font-size:clamp(32px,4vw,48px); font-weight:800; color:var(--white);
  letter-spacing:-0.03em; line-height:1; font-variant-numeric:tabular-nums;
}
.stat-label { font-size:13px; color:var(--text-dim); margin-top:8px; letter-spacing:0.02em; }

/* ========================================
   APP CARDS
   ======================================== */
.apps-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:1px; background:var(--border); }
.app-card {
  background:var(--bg); padding:40px 32px; display:flex; flex-direction:column;
  transition:var(--transition); position:relative; align-items:flex-start;
}
.app-card:hover { background:var(--bg-card); }

.app-card-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:20px; width:100%; }
.app-card-icon { font-size:32px; line-height:1; }
.app-card-icon-img { width:48px; height:48px; border-radius:12px; object-fit:cover; }
.app-card-links { display:flex; gap:12px; }
.app-card-links a { color:var(--text-dim); transition:var(--transition); }
.app-card-links a:hover { color:var(--white); }

.app-card-badge {
  display:inline-block; font-family:var(--font-mono); font-size:10px;
  padding:3px 8px; border-radius:4px; margin-bottom:12px; letter-spacing:0.05em;
  text-transform:uppercase; font-weight:600; width:fit-content; max-width:fit-content;
}
.badge-active { color:var(--white); background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.16); }
.badge-archived { color:var(--text-dim); background:rgba(255,255,255,0.03); border:1px solid var(--border); }

.app-card-title { font-size:20px; font-weight:700; color:var(--white); margin-bottom:8px; letter-spacing:-0.02em; align-self:stretch; }
.app-card-desc { font-size:14px; line-height:1.7; flex:1; margin-bottom:20px; align-self:stretch; }
.app-card-tech { display:flex; flex-wrap:wrap; gap:6px; align-self:stretch; }
.tech-tag {
  font-family:var(--font-mono); font-size:11px; color:var(--text-dim);
  padding:4px 10px; border:1px solid var(--border); border-radius:4px;
}

/* ========================================
   PROJECTS (Open Source)
   ======================================== */
.projects-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:1px; background:var(--border); }
.project-card {
  background:var(--bg); padding:32px; display:flex; flex-direction:column;
  transition:var(--transition);
}
.project-card:hover { background:var(--bg-card); }
.project-card-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.project-card-title { font-size:18px; font-weight:700; color:var(--white); letter-spacing:-0.02em; }
.project-card-desc { font-size:14px; line-height:1.7; flex:1; margin-bottom:16px; }
.project-card-lang { font-family:var(--font-mono); font-size:12px; color:var(--text-dim); display:flex; align-items:center; gap:6px; }
.lang-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }

/* ========================================
   YOUTUBE SECTION
   ======================================== */
.yt-section { display:flex; gap:48px; align-items:center; }
.yt-info { flex:1; }
.yt-embed { flex:1; aspect-ratio:16/9; border-radius:12px; overflow:hidden; border:1px solid var(--border); }
.yt-embed iframe { width:100%; height:100%; border:0; }

/* ========================================
   CONTACT
   ======================================== */
.contact-section { text-align:center; max-width:560px; margin:0 auto; }
.contact-section .section-label { text-align:center; }
.contact-section .section-title { margin-bottom:24px; }
.contact-section .section-desc { margin:0 auto 40px; }
.contact-email {
  font-family:var(--font-mono); font-size:14px; color:var(--text-muted);
  border:1px solid var(--border); padding:14px 28px; border-radius:8px;
  display:inline-block; transition:var(--transition);
}
.contact-email:hover { color:var(--white); border-color:var(--border-hover); }

/* ========================================
   FOOTER
   ======================================== */
.footer { padding:48px 0; border-top:1px solid var(--border); }
.footer-inner { display:flex; justify-content:space-between; align-items:center; }
.footer-text { font-size:13px; color:var(--text-dim); }
.footer-links { display:flex; gap:24px; }
.footer-links a { color:var(--text-dim); font-size:13px; }
.footer-links a:hover { color:var(--white); }
.footer-socials { display:flex; gap:20px; }
.footer-socials a { color:var(--text-dim); transition:var(--transition); }
.footer-socials a:hover { color:var(--white); }

.icon-svg { width:18px; height:18px; vertical-align:middle; }
.icon-svg[viewBox] { fill:currentColor; }
svg.icon-svg[fill="none"] { fill:none; }

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to { opacity:1; transform:translateY(0); }
}

.reveal { opacity:0; transform:translateY(20px); transition:opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity:1; transform:translateY(0); }

/* ========================================
   MOBILE MENU
   ======================================== */
.mobile-menu {
  display:none; position:fixed; top:0; right:0; width:min(80vw,360px); height:100vh;
  background:var(--bg-card); z-index:999; flex-direction:column;
  align-items:center; justify-content:center; gap:28px;
  transform:translateX(100%); transition:var(--transition-slow);
  border-left:1px solid var(--border);
}
.mobile-menu.open { transform:translateX(0); }
.mobile-menu a { font-size:16px; font-weight:500; color:var(--text-muted); }
.mobile-menu a:hover { color:var(--white); }
.mobile-menu .lang-switcher { margin-left:0; margin-top:16px; }

.mobile-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6);
  z-index:998; opacity:0; transition:var(--transition);
}
.mobile-overlay.open { opacity:1; }

/* ========================================
   APPS PAGE
   ======================================== */
.page-hero { padding-top:calc(var(--nav-h) + 80px); padding-bottom:48px; }
.page-hero h1 {
  font-size:clamp(36px,5vw,56px); font-weight:800; color:var(--white);
  letter-spacing:-0.03em; margin-bottom:16px;
}
.page-hero p { font-size:18px; max-width:560px; line-height:1.7; }

.filter-bar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:48px; }
.filter-btn {
  font-family:var(--font-mono); font-size:12px; padding:8px 16px;
  border:1px solid var(--border); border-radius:20px; background:transparent;
  color:var(--text-dim); cursor:pointer; transition:var(--transition);
}
.filter-btn:hover, .filter-btn.active { color:var(--white); border-color:var(--border-hover); background:rgba(255,255,255,0.04); }

/* ========================================
   PRIVACY & 404
   ======================================== */
.prose { max-width:720px; margin:0 auto; padding:160px 24px 120px; }
.prose h1 { font-size:36px; font-weight:800; color:var(--white); letter-spacing:-0.03em; margin-bottom:32px; }
.prose h2 { font-size:20px; font-weight:700; color:var(--white); margin:40px 0 16px; letter-spacing:-0.02em; }
.prose p { margin-bottom:16px; line-height:1.8; }
.prose a { color:var(--white); text-decoration:underline; text-underline-offset:3px; }
.prose ul { margin:0 0 16px 20px; list-style:disc; }
.prose li { margin-bottom:8px; line-height:1.7; }

.error-page { min-height:100vh; display:flex; align-items:center; justify-content:center; text-align:center; }
.error-code { font-size:clamp(80px,15vw,160px); font-weight:900; color:var(--white); letter-spacing:-0.05em; line-height:1; }
.error-msg { font-size:18px; margin:16px 0 32px; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width:768px) {
  .section { padding:80px 0; }
  .nav-links { display:none; }
  .nav-toggle { display:flex; }
  .mobile-menu { display:flex; }
  .stats-strip { grid-template-columns:repeat(2,1fr); }
  .apps-grid, .projects-grid { grid-template-columns:1fr; }
  .yt-section { flex-direction:column; gap:32px; }
  .footer-inner { flex-direction:column; gap:24px; text-align:center; }
  .footer-links { justify-content:center; }
  .footer-socials { justify-content:center; }
}

@media (max-width:480px) {
  .hero-tagline { font-size:32px; }
  .hero-cta { flex-direction:column; }
  .btn { width:100%; justify-content:center; }
  .stats-strip { grid-template-columns:1fr; }
  .stat-block { padding:32px 24px; }
}
