/* ============================================
   umay.dev - Minimal Portfolio
   Vanilla CSS, zero dependencies
   ============================================ */

/* --- CSS Custom Properties (Dark default) --- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --max-width: 800px;
  --nav-height: 60px;

  --radius: 10px;
  --radius-sm: 6px;

  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --border: #2a2a2a;
  --text: #e5e5e5;
  --text-secondary: #888;
  --text-muted: #555;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --tag-bg: #1e293b;
  --tag-text: #94a3b8;
  --nav-bg: rgba(10, 10, 10, 0.85);
  --code-bg: #1e1e2e;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-secondary: #f0f0f0;
  --bg-card: #fff;
  --bg-card-hover: #f5f5f5;
  --border: #e5e5e5;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --tag-bg: #e0e7ff;
  --tag-text: #3730a3;
  --nav-bg: rgba(250, 250, 250, 0.85);
  --code-bg: #f1f5f9;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

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

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

strong {
  color: var(--accent);
  font-weight: 600;
}

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-logo .accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

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

/* --- Hero --- */
.hero {
  padding-top: calc(var(--nav-height) + 80px);
  padding-bottom: 80px;
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero-row {
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-links {
  display: flex;
  gap: 16px;
}

.hero-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.hero-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* --- Sections --- */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 40px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-title::before {
  content: '# ';
  color: var(--accent);
}

/* --- About --- */
.about-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
  max-width: 600px;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

/* --- Projects Grid --- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--transition);
  cursor: pointer;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.project-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
}

.project-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.project-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.project-tags {
  display: flex;
  gap: 6px;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-weight: 500;
}

/* --- Inactive Projects --- */
.project-card.project-inactive {
  opacity: 0.45;
  position: relative;
}

.project-card.project-inactive:hover {
  opacity: 0.7;
}

.project-card.project-inactive .project-icon img {
  filter: grayscale(100%);
}

.project-card.project-inactive:hover .project-icon img {
  filter: grayscale(50%);
}

.badge-inactive {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--text-muted);
}

/* --- Blog Grid --- */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.blog-card {
  display: block;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--transition);
}

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

.blog-card-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.blog-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.blog-empty {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* --- Blog Post Page --- */
.blog-post {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 80px;
}

.blog-post-header {
  margin-bottom: 48px;
}

.blog-post-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.blog-post-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.blog-post-content {
  max-width: 680px;
}

.blog-post-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.blog-post-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.blog-post-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
  line-height: 1.8;
}

.blog-post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.blog-post-content pre {
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.blog-post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.blog-post-content ul, .blog-post-content ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 24px;
}

.blog-post-content li {
  margin-bottom: 8px;
}

.blog-post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.blog-post-content img {
  border-radius: var(--radius);
  margin: 24px 0;
}

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

.blog-post-content a:hover {
  color: var(--accent-hover);
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  transition: color var(--transition);
}

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

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

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

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

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: color var(--transition);
}

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

/* --- App Page --- */
.app-page {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 80px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.app-logo {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.app-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-meta h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.app-meta p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.app-buttons {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.app-buttons a {
  display: inline-block;
  height: 40px;
}

.app-buttons a img {
  height: 100%;
  width: auto;
}

.app-screenshots {
  margin-bottom: 48px;
}

.app-screenshots-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.app-screenshots-list::-webkit-scrollbar {
  height: 6px;
}

.app-screenshots-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.app-screenshots-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.app-screenshot {
  flex-shrink: 0;
  width: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  scroll-snap-align: start;
  transition: transform var(--transition);
}

.app-screenshot:hover {
  transform: scale(1.02);
}

.app-description {
  max-width: 680px;
}

.app-description h2 {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.app-description h2::before {
  content: '## ';
  color: var(--accent);
}

.app-description p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.8;
}

.app-description ul, .app-description ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 24px;
  line-height: 1.8;
}

.app-description li {
  margin-bottom: 8px;
}

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

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

.app-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  transition: color var(--transition);
}

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

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

.hero-greeting,
.hero-name,
.hero-tagline,
.hero-links {
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
}

.hero-greeting { animation-delay: 0.1s; }
.hero-name { animation-delay: 0.2s; }
.hero-tagline { animation-delay: 0.3s; }
.hero-links { animation-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 640px) {
  .hero {
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 48px;
    min-height: auto;
  }

  .hero-row {
    flex-direction: column;
    text-align: center;
  }

  .hero-avatar {
    width: 80px;
    height: 80px;
  }

  .hero-links {
    justify-content: center;
  }

  .section {
    padding: 48px 0;
  }

  .section-title {
    margin-bottom: 24px;
  }

  .nav-links {
    gap: 16px;
  }

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

  .project-card {
    padding: 16px;
    gap: 14px;
  }

  .project-icon {
    width: 48px;
    height: 48px;
  }

  .project-info h3 {
    font-size: 1rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

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

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

  .project-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .project-icon {
    width: 56px;
    height: 56px;
  }
}
