/* pawanbk.io — core styles */
:root {
  --bg: #141110;
  --surface: rgba(28, 24, 21, 0.78);
  --surface-solid: #1c1815;
  --border: rgba(201, 168, 108, 0.18);
  --text: #f0ebe4;
  --muted: #9a9289;
  --accent: #e8a87c;
  --accent-2: #c9784e;
  --accent-brass: #c9a86c;
  --glow: 0 0 24px rgba(232, 168, 124, 0.22);
  --radius: 12px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --container: min(1100px, 92vw);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

body.page-post #reading-progress {
  display: block;
}

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

a:hover {
  color: #f0bc96;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(20, 17, 16, 0.88);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

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

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

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
}

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

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}

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

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

/* Hero */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.75rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  min-height: 1.5em;
  margin: 0 0 1.25rem;
}

.hero-tagline .cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-bio {
  max-width: 42ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.75rem;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #141110;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  color: #141110;
  box-shadow: 0 0 32px rgba(232, 168, 124, 0.35);
}

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

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

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

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-header h2,
.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0;
}

.section-sub {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.link-arrow {
  font-size: 0.95rem;
}

.page-header {
  padding: 3rem 0 1rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 0.5rem;
}

.page-lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 50ch;
  margin: 0;
}

/* Glass panels */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--glow);
}

@supports not (backdrop-filter: blur(12px)) {
  .glass-panel {
    background: var(--surface-solid);
  }
}

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

.post-card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 168, 124, 0.32);
  box-shadow: var(--glow);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.level-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.level-beginner { background: rgba(61, 214, 140, 0.15); color: #3dd68c; }
.level-intermediate { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.level-advanced { background: rgba(201, 168, 108, 0.15); color: var(--accent-brass); }

.post-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.post-card h3 a {
  color: var(--text);
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card-excerpt {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.75rem;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(201, 120, 78, 0.1);
  color: var(--accent-2);
  border: 1px solid rgba(201, 120, 78, 0.22);
}

/* Filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.filter-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover,
.filter-chip.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(232, 168, 124, 0.1);
}

.filter-empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.filter-empty.hidden,
.post-card.hidden {
  display: none;
}

/* Post article */
.post-header {
  padding-top: 2rem;
  padding-bottom: 1.5rem;
}

.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
}

.post-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.post-content {
  padding-bottom: 4rem;
}

/* Prose */
.prose {
  max-width: 68ch;
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  margin-top: 2rem;
}

.prose p,
.prose li {
  color: #d8d0c6;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(232, 168, 124, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose pre {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose blockquote {
  border-left: 3px solid var(--accent-2);
  margin-left: 0;
  padding-left: 1rem;
  color: var(--muted);
}

.takeaway {
  background: rgba(232, 168, 124, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.takeaway-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.35rem;
}

.takeaway p {
  margin: 0;
}

/* About focus */
.focus-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.focus-node {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.focus-node:hover,
.focus-node.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(232, 168, 124, 0.12);
  box-shadow: var(--glow);
}

.focus-panel {
  display: none;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.focus-panel.active {
  display: block;
}

.focus-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
  margin-left: 0.5rem;
}

.timeline-item {
  padding-left: 1.5rem;
  padding-bottom: 1.75rem;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.25rem;
}

.timeline-body strong {
  font-family: var(--font-display);
  display: block;
  margin-bottom: 0.25rem;
}

.timeline-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Projects */
.project-card {
  perspective: 1000px;
}

.project-card-inner {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}

.project-card-glow {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(232, 168, 124, 0.28), rgba(201, 168, 108, 0.18));
  opacity: 0.5;
  z-index: -1;
  animation: borderPulse 4s ease-in-out infinite;
}

@keyframes borderPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.65; }
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-header h2 {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
}

.project-tagline {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin: 0;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(201, 120, 78, 0.15);
  color: var(--accent-2);
  border: 1px solid rgba(201, 120, 78, 0.28);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.project-desc {
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 60ch;
}

.project-bullets {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: #d8d0c6;
}

.project-links {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.project-accordion h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
  background: rgba(20, 17, 16, 0.45);
}

.accordion-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  padding: 0.85rem 0;
  list-style: none;
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

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

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

.footer-copy,
.footer-tag {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-solid);
  border: 1px solid var(--accent);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 200;
  pointer-events: none;
}

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

/* Progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 300;
  transition: width 0.1s linear;
}

/* Reveal (initial state — motion.js toggles) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .nav-links {
    position: fixed;
    top: 60px;
    right: 0;
    left: 0;
    flex-direction: column;
    background: rgba(20, 17, 16, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 1rem 4vw;
    gap: 0;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

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

  .nav-links li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-tagline .cursor,
  .pulse-dot,
  .project-card-glow {
    animation: none;
  }

  .post-card:hover,
  .btn-primary:hover {
    transform: none;
  }
}
