/* =====================================================
   DESIGN TOKENS — dark terminal/dev theme
   ===================================================== */
:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #161616;
  --border: #2e2e2e;
  --text: #e5e5e5;
  --text-bright: #ffffff;
  --text-dim: #9a9a9a;
  --text-faint: #5a5a5a;
  --accent: #00ff88;
  --accent-ink: #001a0e;
  --accent-dim: rgba(0, 255, 136, 0.12);
  --accent-glow: rgba(0, 255, 136, 0.35);
  --grid-line: rgba(255, 255, 255, 0.05);
  --dot-base: rgba(255, 255, 255, 0.07);
  --dot-bright: var(--accent);

  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --torch-radius: 220px;
  --mx: 50vw;
  --my: 50vh;

  --container: 1100px;
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f4f4f0;
  --border: #e5e3dd;
  --text: #1a1a1a;
  --text-bright: #000000;
  --text-dim: #6b6b6b;
  --text-faint: #b0b0b0;
  --accent: #00a85a;
  --accent-ink: #ffffff;
  --accent-dim: rgba(0, 168, 90, 0.12);
  --accent-glow: rgba(0, 168, 90, 0.3);
  --grid-line: rgba(0, 0, 0, 0.06);
  --dot-base: rgba(0, 0, 0, 0.09);
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
html.theme-fading body::after {
  content: "";
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  animation: theme-fade 0.3s ease forwards;
  pointer-events: none;
}
@keyframes theme-fade {
  0% { opacity: 0.7; }
  100% { opacity: 0; }
}
html.theme-fading { animation: theme-flash 0.3s ease; }
@keyframes theme-flash {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
  100% { filter: brightness(1); }
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 32px);
}

/* =====================================================
   LAYERED BACKGROUND
   ===================================================== */
.bg-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-grid {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-position: -1px -1px;
  background-size: 96px 96px;
}
.bg-dots-base {
  background-image: radial-gradient(circle, var(--dot-base) 1px, transparent 1.4px);
  background-size: 24px 24px;
}
.bg-dots-torch {
  background-image: radial-gradient(circle, var(--dot-bright) 1.4px, transparent 1.8px);
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(circle var(--torch-radius) at var(--mx) var(--my), #000 0%, rgba(0,0,0,0.65) 35%, transparent 75%);
  mask-image: radial-gradient(circle var(--torch-radius) at var(--mx) var(--my), #000 0%, rgba(0,0,0,0.65) 35%, transparent 75%);
  background-size: 24px 24px;
  transition: opacity 0.25s;
}
.bg-vignette {
  background: radial-gradient(ellipse at top, transparent 0%, var(--bg) 78%);
  opacity: 0.8;
}

/* =====================================================
   SKIP LINK
   ===================================================== */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 10px; top: 10px; width: auto; height: auto;
  padding: 10px 16px; background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-sm); z-index: 10000;
}

/* =====================================================
   SCROLL PROGRESS
   ===================================================== */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--accent);
  width: 0; z-index: 9998;
}

/* =====================================================
   NAVBAR
   ===================================================== */
#site-header {
  position: sticky; top: 0; z-index: 500;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.navbar {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-weight: 600; font-size: 0.95rem; color: var(--text);
  flex-shrink: 0;
}
.brand-glyph { color: var(--accent); }

/* Nav links */
.nav-links {
  display: flex; align-items: center; gap: 2px;
  flex: 1; justify-content: center;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-dim);
  padding: 7px 12px; border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text-bright); background: var(--surface-2); }
.nav-links a.active { color: var(--accent); }

/* Nav dropdown (submenu) */
.nav-drop { position: relative; }
.nav-drop-toggle { display: inline-flex; align-items: center; gap: 6px; }
.nav-drop .nav-caret { font-size: 0.62rem; color: var(--text-faint); transition: transform 0.2s ease; }
.nav-drop:hover .nav-caret,
.nav-drop:focus-within .nav-caret,
.nav-drop.open .nav-caret { transform: rotate(180deg); }

.nav-drop-menu {
  display: none;
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 210px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  z-index: 600;
}
.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu,
.nav-drop.open .nav-drop-menu { display: block; }
.nav-drop-menu li { flex: none; }
.nav-drop-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px !important;
  border-radius: var(--radius-sm);
  font-size: 0.78rem !important;
  color: var(--text-dim);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-drop-menu a:hover { color: var(--text-bright); background: var(--surface-2); }
.nav-drop-menu .drop-ico {
  width: 16px; text-align: center;
  color: var(--accent); font-size: 0.85rem; flex-shrink: 0;
}
.nav-drop-menu span { display: flex; flex-direction: column; line-height: 1.35; }
.nav-drop-menu small { font-size: 0.68rem; color: var(--text-faint); }

/* Nav buttons */
.nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: transparent; border: 1px solid var(--border);
  padding: 10px; border-radius: var(--radius-sm);
  width: 42px; height: 42px; align-items: center; justify-content: center;
}
.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: var(--transition, all 0.2s ease);
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-mobile-open {
    display: flex; flex-direction: column; gap: 2px;
    position: absolute; top: calc(100% + 8px); left: 16px; right: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    z-index: 400;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  .nav-mobile-open a { padding: 10px 12px; }

  /* Dropdown becomes an inline accordion in the mobile menu */
  .nav-drop { width: 100%; }
  .nav-drop-toggle { width: 100%; justify-content: space-between; padding: 10px 12px !important; }
  .nav-drop:hover .nav-drop-menu,
  .nav-drop:focus-within .nav-drop-menu { display: none; }
  .nav-drop.open .nav-drop-menu { display: block; }
  .nav-drop-menu {
    position: static;
    min-width: 0; margin: 0 0 4px;
    padding: 4px 0 4px 12px;
    background: transparent;
    border: 0; border-top: 1px dashed var(--border);
    border-radius: 0; box-shadow: none;
  }
  .nav-drop-menu a { padding: 8px 12px !important; }
}

/* =====================================================
   HIRE ME
   ===================================================== */
.hire-me {
  position: fixed; bottom: 24px; left: 24px; z-index: 400;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 24px var(--accent-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}
.hire-me:hover { transform: translateY(-2px); box-shadow: 0 10px 32px var(--accent-glow); }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s ease; cursor: pointer;
  white-space: nowrap;
}
.btn.primary {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}
.btn.primary:hover { box-shadow: 0 6px 24px var(--accent-glow); transform: translateY(-1px); }
.btn.ghost {
  background: transparent; border-color: var(--border);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 0.75rem; }
.btn.btn-full { width: 100%; justify-content: center; }

/* =====================================================
   HERO
   ===================================================== */
.hero-section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding: clamp(80px, 12vh, 120px) 0 60px;
  scroll-margin-top: 70px;
}
.hero-content { max-width: 620px; min-width: 0; }

.availability {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  padding: 5px 12px; border-radius: var(--radius-full, 999px);
  margin-bottom: 28px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
  animation: blip-pulse 1.6s ease-in-out infinite;
  display: inline-block; flex-shrink: 0;
}
@keyframes blip-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-prefix {
  font-family: var(--font-mono);
  font-size: 0.9rem; color: var(--text-faint);
  margin-bottom: 10px;
}
.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-bright);
  margin-bottom: 14px;
}
.hero-title .accent { color: var(--accent); }
.hero-role {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600; color: var(--text);
  margin-bottom: 4px;
}
.hero-loc {
  font-family: var(--font-mono);
  font-size: 0.85rem; color: var(--text-faint);
  margin-bottom: 20px;
}
.hero-summary {
  color: var(--text-dim);
  font-size: 0.95rem; line-height: 1.7;
  max-width: 560px; margin-bottom: 24px;
}

/* Typewriter */
.typewriter {
  font-family: var(--font-mono);
  font-size: 0.9rem; color: var(--text-dim);
  margin-bottom: 28px; min-height: 1.6em;
}
.typewriter .prompt, .typewriter .accent { color: var(--accent); }
.cursor-blink { color: var(--accent); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-ctas {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px;
}

/* Hero social */
.hero-social {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.social-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 7px 12px; border-radius: var(--radius-sm);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.social-link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social-link i { font-size: 0.9rem; }

/* Hero aside */
.hero-aside {
  display: flex; flex-direction: column; align-items: stretch; gap: 28px;
  max-width: 360px;
  min-width: 0;
}

/* Profile frame */
.profile-frame {
  text-align: center;
}
.profile-frame img {
  width: 180px; height: 180px;
  border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 1px solid var(--border);
  margin: 0 auto;
  box-shadow: 0 0 0 1px var(--border), 0 10px 40px rgba(0, 0, 0, 0.4);
}
.profile-caption {
  font-family: var(--font-mono);
  font-size: 0.75rem; color: var(--text-faint);
  margin-top: 10px;
}

/* =====================================================
   ~/ask-me.sh CHAT WIDGET
   ===================================================== */
.chat-widget {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  min-width: 0;
  overflow: hidden;
}
.chat-corner {
  position: absolute; width: 10px; height: 10px;
  border: 1px solid var(--accent); opacity: 0.5; z-index: 1;
}
.chat-corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.chat-corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.chat-corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.chat-corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.chat-titlebar {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-dim);
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.chat-dots { display: inline-flex; gap: 5px; }
.chat-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong, #3a3a3a); }
.chat-dots i:last-child { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.chat-file { font-weight: 600; white-space: nowrap; }
.chat-ready {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--accent);
}
.blip { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); animation: blip-pulse 1.6s ease-in-out infinite; }

/* Log */
.chat-log {
  height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 4px 2px 10px;
  margin-bottom: 12px;
  scroll-behavior: smooth;
}
.chat-log::-webkit-scrollbar { width: 5px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 6px; }

.msg { max-width: 94%; font-size: 13.5px; line-height: 1.55; font-family: var(--font-mono); }
.msg.user { align-self: flex-end; text-align: right; }
.msg-label { font-size: 11px; letter-spacing: 0.04em; margin-bottom: 4px; }
.msg.system .msg-label { color: var(--text-faint); }
.msg.bot .msg-label { color: var(--accent); }
.msg.user .msg-label { color: var(--text-dim); }
.msg-body { color: var(--text); white-space: pre-wrap; word-wrap: break-word; }
.msg.user .msg-body {
  display: inline-block; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px 10px 2px 10px; text-align: left;
}
.msg.system .msg-body { color: var(--text-dim); }

.typing-dots { display: inline-flex; align-items: center; gap: 4px; height: 1em; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: typingBounce 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce { 0%, 60%, 100% { opacity: 0.4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Chips */
.chat-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 0;
  border-top: 1px dashed var(--border);
  margin-bottom: 10px;
}
.chip {
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); transition: color 0.2s, border-color 0.2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: 0.5; cursor: not-allowed; }

/* Form */
.chat-form {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}
.chat-form:focus-within { border-color: var(--accent); }
.chat-prompt { color: var(--accent); font-family: var(--font-mono); }
.chat-form input {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-bright);
  background: transparent; border: none; outline: none;
}
.chat-form input::placeholder { color: var(--text-faint); }
.chat-send {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.chat-send:hover { border-color: var(--accent); color: var(--accent); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* =====================================================
   SECTIONS (shared)
   ===================================================== */
.section {
  position: relative; z-index: 1;
  padding: clamp(64px, 10vw, 110px) 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 70px;
}
.section-head {
  display: flex; align-items: flex-start; gap: 18px;
  margin-bottom: clamp(36px, 6vw, 56px);
}
.section-id {
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700;
  color: var(--text-faint); padding-top: 6px;
}
.section-head h1,
.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700; color: var(--text-bright);
  letter-spacing: -0.02em; line-height: 1.2;
}
.section-path {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--text-faint); margin-top: 4px;
  /* file-path style */
}
.section-path::before { content: "$ cd "; color: var(--text-faint); }

/* =====================================================
   ABOUT
   ===================================================== */
.about-grid {
  display: grid; grid-template-columns: 260px 1fr; gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.about-photo {
  overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--radius);
}
.about-photo img { width: 100%; height: auto; object-fit: cover; aspect-ratio: 3/4; object-position: center top; }

.meta-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.meta-list li {
  display: flex; gap: 16px; padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}
.meta-list .k {
  font-family: var(--font-mono); font-size: 0.78rem; text-transform: lowercase;
  color: var(--text-faint); width: 90px; flex-shrink: 0;
}
.meta-list .k::after { content: ":"; }
.meta-list .v {
  font-size: 0.92rem; color: var(--text);
  display: flex; align-items: center; gap: 8px; word-break: break-word;
}
.meta-list .v .dot { margin-right: 4px; }

.about-text { color: var(--text-dim); font-size: 0.95rem; line-height: 1.8; margin-bottom: 32px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat {
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.stat:hover { border-color: var(--accent); transform: translateY(-3px); }
.stat-num {
  font-family: var(--font-mono); font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 6px;
}
.stat-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); text-transform: lowercase; }

/* =====================================================
   EXPERIENCE
   ===================================================== */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 48px); align-items: start; }
.exp-col { display: flex; flex-direction: column; gap: 24px; }
.exp-col-title {
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
  text-transform: lowercase; letter-spacing: 0.04em;
  color: var(--accent); display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.exp-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.exp-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.exp-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.exp-card h4 { font-size: 1.05rem; font-weight: 600; color: var(--text-bright); line-height: 1.3; }
.exp-company { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); margin-top: 3px; }
.exp-date {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint);
  white-space: nowrap; padding-top: 2px;
}
.exp-tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.68rem; text-transform: lowercase;
  color: var(--accent); border: 1px solid var(--accent-dim);
  background: var(--accent-dim); padding: 2px 8px; border-radius: 4px;
  margin: 6px 0 14px;
}
.exp-card ul { display: flex; flex-direction: column; gap: 8px; }
.exp-card ul li {
  position: relative; padding-left: 18px;
  color: var(--text-dim); font-size: 0.88rem; line-height: 1.6;
}
.exp-card ul li::before {
  content: "›"; position: absolute; left: 0;
  color: var(--accent); font-family: var(--font-mono);
}

/* =====================================================
   SKILLS
   ===================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.skills-group {
  padding: 24px;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.skills-group h3 {
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600;
  text-transform: lowercase; letter-spacing: 0.04em;
  color: var(--accent); padding-bottom: 12px; margin-bottom: 18px;
  border-bottom: 1px dashed var(--border);
}
.skill-list { display: flex; flex-direction: column; gap: 16px; }
.skill-name {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.87rem; font-weight: 500; color: var(--text); margin-bottom: 7px;
  min-width: 0;
}
.skill-name span:not(.skill-ico):not(.pct) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.skill-ico { color: var(--accent); font-size: 0.9rem; width: 16px; text-align: center; }
.skill-name .pct { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.skill-bar { height: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.skill-fill {
  height: 100%; width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 7px 12px; border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s;
}
.tool-chip:hover { color: var(--accent); border-color: var(--accent); }
.tool-chip i { color: var(--accent); font-size: 0.85rem; }

.learning {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 18px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.learning-label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); margin-right: 6px; }

/* =====================================================
   PROJECTS
   ===================================================== */
.project-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter {
  font-family: var(--font-mono); font-size: 0.78rem;
  padding: 7px 16px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); transition: all 0.2s;
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.project-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
.project-num {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700;
  color: var(--accent); margin-bottom: 14px;
}
.project-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; }
.project-title h3 { font-size: 1.05rem; font-weight: 600; color: var(--text-bright); flex: 1 1 100%; min-width: 0; }
.project-lang { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-faint); white-space: nowrap; }
.project-card > p { color: var(--text-dim); font-size: 0.88rem; line-height: 1.7; margin-bottom: 16px; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border); padding: 3px 8px; border-radius: 4px;
}
.tag i { color: var(--accent); font-size: 0.7rem; }
.project-ctas { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* =====================================================
   MUSIC
   ===================================================== */
.music-intro {
  color: var(--text-dim); font-size: 0.95rem; line-height: 1.8;
  max-width: 620px; margin-bottom: 28px;
}
.music-empty {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-faint);
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 24px;
}
.music-empty[hidden] { display: none; }

.music-shell { display: flex; flex-direction: column; gap: 20px; }
.music-shell[hidden] { display: none; }

.music-player {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
}
.player-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; min-width: 0;
}
.player-toggle {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent); font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.player-toggle:hover {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 6px var(--accent-dim); transform: scale(1.05);
}
.player-ctl {
  width: 38px; height: 38px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim); font-size: 0.85rem;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.player-ctl:hover { color: var(--accent); border-color: var(--accent); }
.player-ctl.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.player-ctl.active-off { color: var(--text-faint); border-color: var(--border); }
.player-ctl.is-one { position: relative; }
.player-ctl.is-one::after {
  content: "1";
  position: absolute; right: 2px; bottom: 1px;
  width: 11px; height: 11px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 0.55rem; font-weight: 700;
}
.player-main { min-width: 0; flex: 1 1 240px; }
.player-title {
  font-size: 0.95rem; font-weight: 600; color: var(--text-bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-time {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint);
  margin-top: 3px; display: flex; gap: 6px; align-items: center;
}
.player-sep { opacity: 0.5; }

.player-volume { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.player-volume input[type="range"] {
  width: 96px;
  accent-color: var(--accent);
  cursor: pointer;
  background: transparent;
}

.player-progress {
  cursor: pointer; padding: 8px 0 4px;
  outline: none;
}
.player-progress .player-progress-track {
  height: 6px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; position: relative;
  transition: height 0.15s;
}
.player-progress:hover .player-progress-track,
.player-progress:focus .player-progress-track { height: 8px; }
.player-progress-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  border-radius: 999px;
}

.music-status {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--accent);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.music-status[hidden] { display: none; }
.music-hint {
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-faint); text-align: center;
}

.music-list { display: flex; flex-direction: column; gap: 8px; }
.music-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-sans); font-size: 0.9rem;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.music-row:hover { border-color: var(--accent); background: var(--surface-2); color: var(--text-bright); }
.music-row.active { border-color: var(--accent); background: var(--accent-dim); }
.music-row-play {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); font-size: 0.7rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.music-row:hover .music-row-play { border-color: var(--accent); color: var(--accent); }
.music-row.active .music-row-play { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.music-row-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); width: 22px; flex-shrink: 0; }
.music-row-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-row-dur { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }

/* ── Music background layer (clean fretboard band + tuner dial + notes) ── */
.music-bg { overflow: hidden; }

/* Horizontal fretboard band, centered behind the content */
.music-fretboard-bg {
  position: absolute; left: 50%; top: 54%;
  width: min(1120px, 96vw);
  height: clamp(130px, 24vh, 250px);
  transform: translate(-50%, -50%);
  opacity: 0.055;
  border-radius: 16px;
  background-color: var(--surface);
  border-block: 1px solid var(--accent);
  background-image:
    radial-gradient(circle at 8% 50%, var(--accent) 0 2.5px, transparent 3px),
    radial-gradient(circle at 24% 50%, var(--accent) 0 2.5px, transparent 3px),
    radial-gradient(circle at 40% 50%, var(--accent) 0 2.5px, transparent 3px),
    radial-gradient(circle at 56% 50%, var(--accent) 0 2.5px, transparent 3px),
    radial-gradient(circle at 72% 50%, var(--accent) 0 2.5px, transparent 3px),
    radial-gradient(circle at 87% 50%, var(--accent) 0 2.5px, transparent 3px),
    repeating-linear-gradient(0deg, transparent 0 calc(16.66% - 0.5px), var(--accent) calc(16.66% - 0.5px) calc(16.66% + 0.5px)),
    repeating-linear-gradient(90deg, transparent 0 calc(8.33% - 0.5px), var(--accent) calc(8.33% - 0.5px) calc(8.33% + 0.5px));
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 14% 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 14% 86%, transparent 100%);
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.5),
    0 0 70px rgba(0, 0, 0, 0.3);
}

/* Six strings with a cascading strum + travelling pick-sweep highlight */
.music-strums {
  position: absolute; left: 50%; top: 56%;
  width: clamp(150px, 24vw, 300px);
  height: clamp(140px, 22vh, 240px);
  transform: translate(-50%, -50%);
  opacity: 0.09;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 13% 87%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 13% 87%, transparent 100%);
}
.music-strum-string {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--i, 0) / 5 * 100%);
  width: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: music-strum 4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.55s);
}
@keyframes music-strum {
  /* ambient shimmer */
  0%   { transform: translateX(-50%); }
  10%  { transform: translateX(calc(-50% - 1.2px)); }
  14%  { transform: translateX(calc(-50% + 1.2px)); }
  18%  { transform: translateX(calc(-50% - 0.8px)); }
  22%  { transform: translateX(calc(-50% + 0.6px)); }
  26%  { transform: translateX(-50%); }
  /* calm before the strum */
  55%  { transform: translateX(-50%); }
  /* pluck: wide offset, decaying */
  58%  { transform: translateX(calc(-50% - 10px)); }
  61%  { transform: translateX(calc(-50% + 8px)); }
  64%  { transform: translateX(calc(-50% - 6px)); }
  68%  { transform: translateX(calc(-50% + 4px)); }
  72%  { transform: translateX(calc(-50% - 2.5px)); }
  77%  { transform: translateX(calc(-50% + 1.5px)); }
  83%  { transform: translateX(calc(-50% - 0.8px)); }
  90%  { transform: translateX(-50%); }
  100% { transform: translateX(-50%); }
}
.music-strum-sweep {
  position: absolute; top: 5%; bottom: 5%;
  left: 0%; width: 7px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  filter: blur(2px);
  opacity: 0;
  animation: music-sweep 4s ease-in-out infinite;
}
@keyframes music-sweep {
  0%, 10%  { left: 0%;   opacity: 0; }
  18%      { left: 0%;   opacity: 0.85; }
  60%      { left: 100%; opacity: 0.9; }
  72%      { opacity: 0; }
  100%     { left: 100%; opacity: 0; }
}

/* Tuner dial with soft glow, tick ring + sweeping needle */
.music-tuner-bg {
  position: absolute;
  right: clamp(14px, 5vw, 60px);
  bottom: clamp(12px, 6vh, 60px);
  width: clamp(130px, 18vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.12;
  pointer-events: none;
}
.music-tuner-bg::before {
  content: "";
  position: absolute; inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 68%);
}
.music-tuner-bg::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from -90deg, var(--accent) 0deg 1deg, transparent 1deg 6deg);
  -webkit-mask-image: radial-gradient(circle, transparent 0 72%, #000 73%);
  mask-image: radial-gradient(circle, transparent 0 72%, #000 73%);
}
.music-needle {
  position: absolute; left: 50%; bottom: 50%;
  width: 2px; height: 34%;
  transform-origin: 50% 100%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: tuner-sweep 6s ease-in-out infinite alternate;
}
.music-dot {
  position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow), 0 0 0 4px var(--accent-dim);
}
@keyframes tuner-sweep {
  from { transform: rotate(15deg); }
  to   { transform: rotate(55deg); }
}

/* Floating music notes */
.music-bg-note {
  position: absolute; bottom: -2.5rem; left: var(--l, 10%);
  font-size: calc(0.9rem * var(--s, 1));
  color: var(--accent); opacity: 0;
  text-shadow: 0 0 14px var(--accent-glow);
  animation: note-float calc(10s / var(--s, 1)) linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes note-float {
  0%   { opacity: 0; transform: translateY(0)    rotate(0deg)    translateX(0); }
  15%  { opacity: 0.22; }
  55%  { opacity: 0.45; }
  100% { opacity: 0; transform: translateY(-72vh) rotate(var(--r, 26deg)) translateX(3.5rem); }
}

@media (max-width: 480px) {
  .music-fretboard-bg { opacity: 0.04; }
  .music-strums { opacity: 0.05; }
  .music-tuner-bg { width: 110px; }

  .music-player { padding: 16px; }
  .player-row { gap: 8px; }
  .player-ctl { width: 34px; height: 34px; font-size: 0.78rem; }
  .player-toggle { width: 46px; height: 46px; }
  .player-volume input[type="range"] { display: none; }
  .player-main { flex-basis: 100%; }
}

/* ── Tuner-style equalizer in the player ── */
.player-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-title-row .player-title { flex: 1; min-width: 0; }
.player-eq {
  display: inline-flex; align-items: flex-end; gap: 2.5px;
  height: 16px; flex-shrink: 0; visibility: hidden;
}
.music-player.playing .player-eq { visibility: visible; }
.player-eq i {
  width: 3px; height: 4px; border-radius: 2px;
  background: var(--accent); opacity: 0.6;
  animation: eq-bounce 0.9s ease-in-out infinite;
}
.player-eq i:nth-child(2) { animation-delay: 0.12s; }
.player-eq i:nth-child(3) { animation-delay: 0.24s; }
.player-eq i:nth-child(4) { animation-delay: 0.36s; }
@keyframes eq-bounce {
  0%, 100% { height: 4px; opacity: 0.55; }
  50%      { height: 16px; opacity: 1; }
}

/* Tuner-scale tick marks on the progress bar */
.player-progress .player-progress-track {
  background:
    var(--surface-2)
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 5%);
}

/* =====================================================
   CONTACT
   ===================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.contact-intro {
  font-size: 1rem; color: var(--text-dim); line-height: 1.8; margin-bottom: 28px;
}
.contact-intro .accent { color: var(--accent); }
.contact-list { display: flex; flex-direction: column; }
.contact-list li {
  display: flex; gap: 20px; padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}
.contact-key {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint);
  width: 90px; flex-shrink: 0;
}
.contact-key::after { content: ":"; }
.contact-val {
  font-size: 0.92rem; color: var(--text); word-break: break-word;
  transition: color 0.2s;
}
a.contact-val:hover { color: var(--accent); }

/* Form */
.contact-form {
  padding: 28px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim);
}
.field label::after { content: " →"; color: var(--accent); }
.field input, .field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-mono); font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%; outline: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field textarea { resize: vertical; min-height: 120px; background: var(--surface-2); }
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--surface-2) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
.field-actions { flex-direction: column; align-items: flex-start; gap: 12px; display: flex; }
#form-status { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 500; }

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.9rem; color: var(--text);
}
.footer-brand .brand-glyph { color: var(--accent); }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-nav a {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 1rem;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  touch-action: manipulation;
}
.footer-social a:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim); transform: translateY(-3px);
}
.footer-meta {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint);
  display: flex; align-items: center; gap: 8px;
}
.footer-meta .separator { opacity: 0.5; }

/* Back to top */
.back-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 400;
  width: 42px; height: 42px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim);
  font-size: 0.95rem;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s, border-color 0.2s, color 0.2s;
  touch-action: manipulation;
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
}
.back-top.is-visible {
  opacity: 1; visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.back-top:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* =====================================================
   FOCUS & MISC
   ===================================================== */
.focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =====================================================
   BLOG
   ===================================================== */
.blog-intro { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 28px; max-width: 620px; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.post-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
.post-date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }
.post-title { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.post-title a { color: var(--text-bright); text-decoration: none; }
.post-title a:hover { color: var(--accent); }
.post-excerpt { color: var(--text-dim); font-size: 0.88rem; line-height: 1.7; flex: 1; }
.post-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); margin-bottom: 24px; }
.back-home { margin-top: 28px; }
.back-link { margin-bottom: 24px; }

.post-article {
  max-width: 760px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--bg); /* placeholder; body bg already layered */
  min-width: 0;
  overflow: hidden;
}
.post-header h1 { font-size: 1.7rem; line-height: 1.25; margin: 12px 0 8px; color: var(--text-bright); }
.post-body { color: var(--text-dim); font-size: 1rem; line-height: 1.8; }
.post-body p { margin-bottom: 18px; }
.post-body h2 { font-family: var(--font-mono); font-size: 1.05rem; color: var(--accent); margin: 28px 0 10px; }
.post-body ul { margin: 0 0 18px; padding-left: 20px; }
.post-body li { margin-bottom: 8px; }
.post-body strong { color: var(--text-bright); }

/* Post prev/next navigation */
.post-nav {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.post-nav-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.post-nav-link:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface-2); }
.post-nav-link.next { text-align: right; align-items: flex-end; }
.post-nav-label {
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-faint); letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 6px;
}
.post-nav-link.next .post-nav-label { flex-direction: row-reverse; }
.post-nav-title {
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600;
  color: var(--text-bright); line-height: 1.4;
  transition: color 0.2s;
}
.post-nav-link:hover .post-nav-title { color: var(--accent); }

@media (max-width: 560px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-link.next { text-align: left; align-items: flex-start; }
  .post-nav-link.next .post-nav-label { flex-direction: row; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* ── Tablet (≤ 960px) ── */
@media (max-width: 960px) {
  .hero-section { grid-template-columns: 1fr; }
  .hero-content { max-width: 100%; }
  .hero-aside { max-width: 380px; margin: 0 auto; width: 100%; }

  .about-grid { grid-template-columns: 200px 1fr; }
  .exp-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

/* ── Small tablet (≤ 768px) ── */
@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    padding: 80px 0 48px;
    text-align: left;
  }
  .hero-aside { max-width: 340px; }
  .about-grid { grid-template-columns: 180px 1fr; gap: 24px; }
  .about-photo img { aspect-ratio: 1; }
  .exp-card { padding: 20px; }
  .skills-grid { gap: 16px; }
  .skills-group { padding: 20px; }
  .contact-form { padding: 22px; }
  .post-article { padding: 24px; }
}

/* ── Mobile (≤ 680px) ── */
@media (max-width: 680px) {
  .hero-section { padding: 60px 0 40px; text-align: left; }
  .hero-aside { max-width: 100%; }
  .profile-frame img { width: 150px; height: 150px; }
  .profile-frame { text-align: left; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .hero-ctas { flex-direction: column; }

  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-photo { max-width: 220px; }
  .about-photo img { aspect-ratio: 3/4; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stat { padding: 14px 12px; }
  .skills-grid { grid-template-columns: 1fr; gap: 14px; }
  .skills-group { padding: 18px; }
  .skill-name { font-size: 0.82rem; }
  .meta-list li, .contact-list li { gap: 12px; }
  .meta-list .k, .contact-key { width: 76px; }

  .chat-log { height: 160px; }
  .chat-titlebar { font-size: 11px; }
  .msg { font-size: 12.5px; }

  .hire-me { bottom: 16px; left: 16px; padding: 9px 14px; }
  .hire-me span { display: none; }
  .back-top { bottom: 16px; right: 16px; }
  .section { padding: 56px 0; }

  .field-actions { align-items: stretch; }
  .btn.btn-full { width: 100%; }

  .post-article { padding: 20px; border-radius: var(--radius-sm); }
  .post-header h1 { font-size: 1.4rem; }
  .post-body { font-size: 0.92rem; }
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-section { padding: 52px 0 36px; }
  .hero-title { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .hero-summary { font-size: 0.9rem; }
  .profile-frame img { width: 130px; height: 130px; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .stat { padding: 12px 14px; text-align: left; }
  .exp-card { padding: 18px; }
  .exp-card-head { flex-direction: column; gap: 6px; }
  .exp-date { white-space: normal; }
  .contact-form { padding: 18px; }
  .field input, .field textarea { padding: 10px 12px; font-size: 0.82rem; }
  .chat-widget { padding: 12px; }
  .chat-log { height: 140px; }
  .chat-form { padding: 6px 8px; }
  .chat-form input { font-size: 12px; }
  .blog-grid { gap: 14px; }
  .post-card { padding: 18px; }
}

/* ── Very small mobile (≤ 400px) ── */
@media (max-width: 400px) {
  .navbar { gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .brand { font-size: 0.88rem; }
  .brand-name { white-space: nowrap; }
  .nav-btn { width: 36px; height: 36px; }
  .hamburger { width: 38px; height: 38px; padding: 9px; }
  .container { padding: 0 14px; }
  .hero-section { padding: 44px 0 32px; }
  .hero-title { font-size: clamp(1.4rem, 6vw, 1.8rem); }
  .hero-loc { font-size: 0.78rem; }
  .hero-summary { font-size: 0.85rem; line-height: 1.65; }
  .profile-frame img { width: 110px; height: 110px; }
  .about-photo { max-width: 180px; }
  .meta-list .k, .contact-key { width: 64px; font-size: 0.72rem; }
  .meta-list .v, .contact-val { font-size: 0.85rem; }
  .exp-card { padding: 16px; }
  .exp-card h4 { font-size: 0.95rem; }
  .exp-card ul li { font-size: 0.82rem; }
  .skills-group { padding: 16px; }
  .skill-name { font-size: 0.78rem; }
  .skill-bar { height: 4px; }
  .tool-chip { font-size: 0.72rem; padding: 6px 10px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-social { gap: 8px; }
  .footer-social a { width: 36px; height: 36px; }
  .footer-meta { flex-wrap: wrap; gap: 4px; }
  .hire-me { bottom: 12px; left: 12px; padding: 8px 12px; font-size: 0.75rem; }
  .back-top { bottom: 12px; right: 12px; width: 38px; height: 38px; }
  .chat-log { height: 120px; }
  .chat-form input { font-size: 11px; }
  .chat-send { font-size: 0.65rem; padding: 4px 8px; }
  .btn { padding: 9px 14px; font-size: 0.78rem; }
  .btn.small { padding: 5px 10px; font-size: 0.72rem; }
}

/* ── Safe areas (notched devices) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .hire-me { bottom: calc(16px + env(safe-area-inset-bottom)); left: calc(16px + env(safe-area-inset-left)); }
  .back-top { bottom: calc(16px + env(safe-area-inset-bottom)); right: calc(16px + env(safe-area-inset-right)); }
  @media (max-width: 400px) {
    .hire-me { bottom: calc(12px + env(safe-area-inset-bottom)); left: calc(12px + env(safe-area-inset-left)); }
    .back-top { bottom: calc(12px + env(safe-area-inset-bottom)); right: calc(12px + env(safe-area-inset-right)); }
  }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
