/* ============================================================
   Personal Portfolio — Orange / Light-Dark theme
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Brand — orange */
  --orange:        #f97316;
  --orange-600:    #ea580c;
  --orange-400:    #fb923c;
  --orange-soft:   rgba(249, 115, 22, 0.12);

  /* Light theme (default) */
  --bg:            #ffffff;
  --bg-alt:        #faf7f4;
  --surface:       #ffffff;
  --surface-2:     #f5f2ef;
  --text:          #14100c;
  --text-muted:    #5c554e;
  --border:        #ece7e1;
  --shadow:        0 10px 30px -12px rgba(20, 16, 12, 0.15);
  --shadow-lg:     0 24px 60px -20px rgba(20, 16, 12, 0.25);
  --code-bg:       #1b1712;
  --code-text:     #f4ede4;

  /* Layout */
  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 70px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg:            #0b0a09;
  --bg-alt:        #121010;
  --surface:       #16130f;
  --surface-2:     #1d1915;
  --text:          #f4efe9;
  --text-muted:    #a49b90;
  --border:        #29231d;
  --shadow:        0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg:     0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --orange-soft:   rgba(249, 115, 22, 0.16);
}

/* ---------- Reset / base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

::selection { background: var(--orange); color: #fff; }

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

.section { padding: 96px 0; position: relative; }
.section-alt { background: var(--bg-alt); }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--orange-400), var(--orange-600));
  z-index: 1000; transition: width 0.1s linear;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  z-index: 900;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.navbar.scrolled { border-bottom-color: var(--border); }

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

.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.5px; }
.logo-bracket { color: var(--orange); }

.nav-links { display: flex; gap: 4px; }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: 8px;
  font-weight: 500; font-size: 0.95rem; color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--orange); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle, .menu-toggle {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.theme-toggle:hover, .menu-toggle:hover { border-color: var(--orange); transform: translateY(-1px); }
.theme-toggle svg { position: absolute; transition: opacity 0.3s, transform 0.4s var(--ease); }
[data-theme="light"] .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="light"] .icon-sun  { opacity: 1; transform: rotate(0)      scale(1); }
[data-theme="dark"]  .icon-sun  { opacity: 0; transform: rotate(90deg)  scale(0.5); }
[data-theme="dark"]  .icon-moon { opacity: 1; transform: rotate(0)      scale(1); }
.theme-toggle { position: relative; }

/* hamburger */
.menu-toggle { display: none; flex-direction: column; gap: 4px; }
.menu-toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: var(--text); transition: transform 0.3s var(--ease), opacity 0.2s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s, border-color 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
  color: #fff; box-shadow: 0 8px 20px -8px var(--orange);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px var(--orange); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-2px); }
.btn-link { background: transparent; color: var(--text-muted); padding: 13px 8px; }
.btn-link:hover { color: var(--orange); }
.btn-full { width: 100%; justify-content: center; }

/* ---------- Section headings ---------- */
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-kicker {
  font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; font-weight: 500;
  color: var(--orange); letter-spacing: 1px; text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -1px;
  margin-top: 8px; line-height: 1.15;
}
.section-sub { color: var(--text-muted); margin-top: 12px; }
.section-sub a { color: var(--orange); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; display: flex; align-items: center; padding-top: var(--nav-h);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -20%; right: -10%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, var(--orange-soft), transparent 70%);
  filter: blur(20px); z-index: 0; pointer-events: none;
}
.hero-inner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
  position: relative; z-index: 1;
}
.hero-greeting {
  font-family: 'JetBrains Mono', monospace; color: var(--orange);
  font-weight: 500; margin-bottom: 12px;
}
.hero-name {
  font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 800; letter-spacing: -2px;
  line-height: 1.05;
}
.hero-role {
  font-size: clamp(1.3rem, 3.5vw, 2rem); font-weight: 700; margin: 6px 0 18px;
  color: var(--text-muted); min-height: 1.4em;
}
.typed { color: var(--text);
  background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.cursor { color: var(--orange); font-weight: 400; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-tagline { color: var(--text-muted); font-size: 1.1rem; max-width: 480px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }

.hero-socials { display: flex; gap: 10px; }
.social-link {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  transition: transform 0.2s var(--ease), color 0.2s, border-color 0.2s, background 0.2s;
}
.social-link:hover {
  color: var(--orange); border-color: var(--orange); transform: translateY(-3px);
  background: var(--orange-soft);
}

/* code window */
.hero-visual { display: flex; justify-content: center; }
.code-window {
  width: 100%; max-width: 420px; border-radius: var(--radius);
  background: var(--code-bg); box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.06); overflow: hidden;
  transform: perspective(1000px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.5s var(--ease);
}
.code-window:hover { transform: perspective(1000px) rotateY(0) rotateX(0); }
.code-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  background: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f56; } .dot-yellow { background: #ffbd2e; } .dot-green { background: #27c93f; }
.code-title {
  margin-left: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  color: #9a8f82;
}
.code-body {
  padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: 0.86rem;
  line-height: 1.9; color: var(--code-text); overflow-x: auto;
}
.c-key { color: #ff9d5c; } .c-var { color: #82d0f2; } .c-prop { color: #e6c07b; }
.c-str { color: #98c379; } .c-bool { color: #d19a66; }

.scroll-down {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--text-muted); animation: bounce 2s infinite; z-index: 2;
}
@keyframes bounce { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,10px);} }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: start; }
.about-text p { color: var(--text-muted); margin-bottom: 16px; }
.about-facts { display: flex; gap: 32px; margin-top: 32px; flex-wrap: wrap; }
.fact { display: flex; flex-direction: column; }
.fact-value { display: flex; align-items: baseline; gap: 1px; line-height: 1; }
.fact-num { font-size: 2.2rem; font-weight: 800; color: var(--orange); }
.fact-plus { font-size: 2.2rem; font-weight: 800; color: var(--orange); }
.fact-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

.about-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.about-card h3 { font-size: 1.15rem; margin-bottom: 16px; }
.about-list li {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 0;
  color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: 0.95rem;
}
.about-list li:last-child { border-bottom: none; }
.li-icon {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px;
  color: var(--orange); transition: transform 0.2s var(--ease);
}
.about-list li:hover .li-icon { transform: scale(1.12); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--orange); box-shadow: var(--shadow); }
.skill-cat {
  font-size: 1.05rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.skill-cat::before { content: ''; width: 6px; height: 20px; border-radius: 3px;
  background: linear-gradient(var(--orange-400), var(--orange-600)); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.85rem; font-weight: 500; padding: 6px 12px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tag:hover { color: var(--orange); border-color: var(--orange); background: var(--orange-soft); }
.tag-sm { font-size: 0.78rem; padding: 4px 10px; }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
  position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--orange-400), var(--orange-600));
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.project-card:hover { transform: translateY(-6px); border-color: var(--orange); box-shadow: var(--shadow-lg); }
.project-card:hover::before { transform: scaleX(1); }
.project-top { display: flex; align-items: center; justify-content: space-between; }
.project-folder { color: var(--orange); }
.project-links { display: flex; gap: 10px; }
.project-links a {
  color: var(--text-muted); transition: color 0.2s, transform 0.2s;
}
.project-links a:hover { color: var(--orange); transform: translateY(-2px); }
.project-title { font-size: 1.25rem; font-weight: 700; }
.project-desc { color: var(--text-muted); font-size: 0.95rem; flex-grow: 1; }
.projects-more { text-align: center; margin-top: 40px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 760px; margin: 0 auto; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--orange), transparent);
}
.timeline-item { position: relative; padding-bottom: 36px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -28px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--orange); border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
.timeline-content {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; transition: border-color 0.25s, transform 0.25s;
}
.timeline-content:hover { border-color: var(--orange); transform: translateX(4px); }
.timeline-date {
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--orange); font-weight: 500;
}
.timeline-role { font-size: 1.15rem; font-weight: 700; margin-top: 4px; }
.timeline-company { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; }
.timeline-content p { color: var(--text-muted); font-size: 0.93rem; margin-top: 10px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 40px; align-items: start; }
.contact-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.88rem; font-weight: 500; }
.form-group input, .form-group textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft);
}
.form-note { margin-top: 14px; font-size: 0.9rem; text-align: center; }
.form-note.success { color: #27c93f; }
.form-note.error { color: #ff5f56; }

.contact-side { display: flex; flex-direction: column; gap: 8px; }
.contact-item {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.contact-icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--orange); }
.contact-item > div { display: flex; flex-direction: column; }
.contact-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.contact-item a { font-weight: 600; }
.contact-item a:hover { color: var(--orange); }
.status-badge {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.9rem; color: #27c93f;
}
.status-badge::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: #27c93f;
  box-shadow: 0 0 0 3px rgba(39,201,63,0.2); animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(39,201,63,0.2);} 50% { box-shadow: 0 0 0 6px rgba(39,201,63,0);} }
.contact-socials { display: flex; gap: 10px; margin-top: 8px; }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.blog-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.blog-card:hover { transform: translateY(-6px); border-color: var(--orange); box-shadow: var(--shadow-lg); }
.blog-thumb {
  position: relative; display: grid; place-items: center; height: 150px; overflow: hidden;
  background: linear-gradient(135deg, var(--orange-soft), transparent), var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.blog-thumb-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(16px) brightness(0.85); transform: scale(1.25); z-index: 0;
}
.blog-thumb-img {
  position: relative; z-index: 1; max-width: 100%; max-height: 100%;
  transition: transform 0.4s var(--ease);
}
.blog-card:hover .blog-thumb-img { transform: scale(1.04); }
.blog-thumb .blog-cat { z-index: 2; }
.blog-emoji { font-size: 3rem; transition: transform 0.3s var(--ease); }
.blog-card:hover .blog-emoji { transform: scale(1.15) rotate(-6deg); }
.blog-cat {
  position: absolute; top: 12px; left: 12px; font-size: 0.72rem; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; background: var(--orange); color: #fff; letter-spacing: 0.3px;
}
.blog-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.blog-meta { display: flex; gap: 8px; font-size: 0.8rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; align-items: center; }
.blog-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.blog-title { font-size: 1.15rem; font-weight: 700; line-height: 1.35; }
.blog-title a:hover { color: var(--orange); }
.blog-excerpt { color: var(--text-muted); font-size: 0.92rem; flex-grow: 1; }
.blog-read {
  display: inline-flex; align-items: center; gap: 6px; color: var(--orange);
  font-weight: 600; font-size: 0.9rem; margin-top: 4px;
}
.blog-read svg { transition: transform 0.2s var(--ease); }
.blog-card:hover .blog-read svg { transform: translateX(4px); }

/* ---------- Article page (post.html) ---------- */
.article-nav {
  position: sticky; top: 0; z-index: 900; height: var(--nav-h); display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.article-nav .container { display: flex; align-items: center; justify-content: space-between; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-muted); }
.back-link:hover { color: var(--orange); }
.article { max-width: 760px; margin: 0 auto; padding: 56px 24px 96px; }
.article-cat {
  display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 4px 12px;
  border-radius: 20px; background: var(--orange); color: #fff; margin-bottom: 16px;
}
.article-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -1px; line-height: 1.12; }
.article-meta {
  display: flex; gap: 12px; margin-top: 16px; color: var(--text-muted);
  font-size: 0.9rem; font-family: 'JetBrains Mono', monospace; flex-wrap: wrap; align-items: center;
}
.article-meta > span { display: inline-flex; align-items: center; gap: 7px; }
.meta-icon { color: var(--orange); flex-shrink: 0; }
.meta-sep { color: var(--border); }
.article-cover {
  position: relative;
  height: 300px; border-radius: var(--radius); display: grid; place-items: center; font-size: 5rem;
  background: linear-gradient(135deg, var(--orange-soft), transparent), var(--surface-2);
  border: 1px solid var(--border); margin: 32px 0 40px; overflow: hidden;
}
.article-cover-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(24px) brightness(0.8); transform: scale(1.25); z-index: 0;
}
.article-cover-img { position: relative; z-index: 1; max-width: 100%; max-height: 100%; }
.article-body { font-size: 1.08rem; line-height: 1.8; }
.article-body h2 { font-size: 1.6rem; font-weight: 700; margin: 42px 0 14px; letter-spacing: -0.5px; }
.article-body h3 { font-size: 1.25rem; font-weight: 700; margin: 28px 0 10px; }
.article-body p { color: var(--text-muted); margin-bottom: 18px; }
.article-body ul { margin: 0 0 18px 22px; list-style: disc; color: var(--text-muted); }
.article-body li { margin-bottom: 8px; }
.article-body a { color: var(--orange); font-weight: 600; text-decoration: underline; }
.article-body blockquote {
  border-left: 3px solid var(--orange); padding: 10px 20px; margin: 24px 0;
  background: var(--orange-soft); border-radius: 0 10px 10px 0; font-style: italic;
}
.article-body pre {
  background: var(--code-bg); color: var(--code-text); padding: 20px; border-radius: var(--radius-sm);
  overflow-x: auto; margin: 0 0 20px; font-family: 'JetBrains Mono', monospace; font-size: 0.88rem; line-height: 1.7;
}
.article-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.9em;
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px;
}
.article-body pre code { background: none; padding: 0; }

/* Code block with copy button + language badge */
.code-block { position: relative; margin: 0 0 20px; }
.code-block pre { margin: 0; }
.code-block.has-lang pre { padding-top: 36px; }
.code-lang {
  position: absolute; top: 11px; left: 20px; pointer-events: none;
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 500;
  color: #8b8175; text-transform: uppercase; letter-spacing: 0.6px;
}
.code-copy {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 0.76rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.07); color: #cfc6ba;
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0; transition: opacity 0.2s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
}
.code-block:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
.code-copy.copied { opacity: 1; background: #27c93f; color: #fff; border-color: #27c93f; }
.code-copy.failed { opacity: 1; background: #ff5f56; color: #fff; border-color: #ff5f56; }
.code-copy svg { width: 14px; height: 14px; flex-shrink: 0; }
/* Touch devices have no hover — always show the button */
@media (hover: none) { .code-copy { opacity: 1; } }
.article-author {
  display: flex; align-items: center; gap: 14px; margin-top: 40px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.article-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; border: 2px solid var(--orange);
}
.article-avatar--fallback {
  display: grid; place-items: center; border: none;
  background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
  color: #fff; font-size: 1.4rem; font-weight: 700;
}
.article-author strong { display: block; }
.article-author span { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Contact form states ---------- */
.hp-field { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.field-error { color: #ff5f56; font-size: 0.82rem; margin-top: 2px; display: block; }

/* ---------- Blog filter / search / chips ---------- */
.blog-filter { display: flex; gap: 10px; margin-bottom: 16px; }
.blog-search {
  flex: 1; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.95rem;
}
.blog-search:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { color: var(--orange); border-color: var(--orange); }
.chip-active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 40px; }
.page-link {
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.page-link:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-2px); }
.page-info { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Related posts ---------- */
.related-section { padding-top: 0; }
.related-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; letter-spacing: -0.5px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-text { color: var(--text-muted); font-size: 0.9rem; }
.back-to-top {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.back-to-top:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-3px); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .code-window { transform: none; }
  .section { padding: 72px 0; }
}

@media (max-width: 720px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 12px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    transform: translateY(-140%); transition: transform 0.35s var(--ease);
    box-shadow: var(--shadow);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-link { padding: 14px; border-radius: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .about-facts { gap: 24px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
