/* tashi.engineer — dark technical theme
   Inspired by NASA JPL / Boston Dynamics / SpaceX / GitHub / Linear */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --card: #151515;
  --card-hover: #1a1a1a;
  --border: #222222;
  --border-subtle: #1a1a1a;
  --text: #ffffff;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-muted: rgba(139, 92, 246, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --header-h: 60px;
  --max-w: 1100px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; border-radius: var(--radius); }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Layout */
.container {
  width: min(var(--max-w), 92%);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  /* SVG stroke/fill use currentColor */
  color: var(--text);
}

.logo-text { line-height: 1; }
.logo-domain { color: var(--text-muted); font-weight: 400; }

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

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

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

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

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

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 550;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* Hero */
.hero {
  padding: 5.5rem 0 4.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-greeting {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero-desc {
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

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

.hero-grid {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3rem;
}

.hero-text {
  flex: 1 1 0;
  min-width: 0;
}

.hero-photo {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

.avatar {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--card);
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 520px;
}

/* Project cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: #333;
  background: var(--card-hover);
}

.project-card-img {
  aspect-ratio: 16/10;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.project-card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-muted);
  color: var(--accent);
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-badge {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.skill-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* About preview */
.about-preview {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.about-preview p {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.about-preview p:last-of-type { margin-bottom: 0; }

/* Page content (About, Resume, Contact, Blog posts, Projects) */
.page-header {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-header .meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.content {
  max-width: 720px;
}

.content h2 {
  font-size: 1.35rem;
  font-weight: 650;
  margin: 2.5rem 0 0.85rem;
  letter-spacing: -0.015em;
}

.content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
}

.content p {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.content ul, .content ol {
  color: var(--text-muted);
  margin: 0 0 1.25rem 1.25rem;
}

.content ul { list-style: disc; }
.content ol { list-style: decimal; }
.content li { margin-bottom: 0.35rem; }

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

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

/* Buttons inside markdown content must keep their own colours
   (otherwise .content a makes primary button text purple-on-purple) */
.content a.btn {
  text-decoration: none;
}

.content a.btn-primary {
  color: #fff;
}

.content a.btn-primary:hover {
  color: #fff;
  background: var(--accent-hover);
}

.content a.btn-ghost {
  color: var(--text-muted);
}

.content a.btn-ghost:hover {
  color: var(--text);
}

.content img {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.1rem;
  margin: 1.5rem 0;
  background: var(--accent-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}

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

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

.content th {
  background: var(--card);
  font-weight: 600;
  color: var(--text);
}

.content td { color: var(--text-muted); }

.content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.content code {
  font-family: var(--mono);
  font-size: 0.875em;
}

.content p code, .content li code {
  background: var(--card);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Project detail extras */
.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}

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

/* Blog list */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-item {
  display: block;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.blog-item:first-child { border-top: 1px solid var(--border); }

.blog-item:hover { background: var(--card); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; }

.blog-item h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.blog-item .date {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.blog-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2.5rem;
}

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

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}

.contact-link:hover { color: var(--accent); }

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

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

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

/* Resume page */
.resume-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.resume-embed {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    gap: 0.85rem;
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .about-preview {
    grid-template-columns: 1fr;
  }

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

  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3.25rem 0; }

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

  .hero-desc {
    margin-inline: auto;
  }

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

  /* Keep photo below text on small screens; remove this rule if you prefer photo on top */
  .avatar {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.1rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
}
