/* ============================================================
   SIGNAL — design system v2
   Professional dark-first portfolio. Fraunces serif for identity,
   Inter for body, IBM Plex Mono used sparingly for eyebrows/tags/
   timestamps. Soft aurora glow, rounded elevated cards, a Journal
   feed styled after a familiar social timeline.
   ============================================================ */

:root {
  --bg: #0a0b10;
  --surface: #12141c;
  --surface-2: #171a24;
  --border: #242837;
  --border-strong: #333a52;
  --text: #f3f4f7;
  --text-dim: rgba(243, 244, 247, 0.72);
  --text-mute: rgba(243, 244, 247, 0.46);
  --accent: #4f8cff;
  --accent-2: #33d6b6;
  --accent-dim: #3a64d6;
  --emerald: #2ecc8f;
  --red: #ff6b6b;
  --container: 1120px;

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", monospace;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 20px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 8px 28px -8px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px -14px rgba(0,0,0,0.5);
}
html[data-theme="light"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #e1e4ea;
  --border-strong: #c9cedb;
  --text: #12141a;
  --text-dim: rgba(18, 20, 26, 0.72);
  --text-mute: rgba(18, 20, 26, 0.48);
  --accent: #3866e0;
  --accent-2: #0ea98a;
  --accent-dim: #2748a8;
  --emerald: #128a5e;
  --red: #d93b3b;
  --shadow-sm: 0 1px 2px rgba(20,20,30,0.06);
  --shadow-md: 0 8px 28px -8px rgba(20,20,30,0.12);
  --shadow-lg: 0 20px 60px -14px rgba(20,20,30,0.16);
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: background 0.4s ease, color 0.4s ease;
  position: relative;
}
/* Deterrents against casual copy/drag-save of images and body text on
   the public site. Applied only via body.no-select (public pages),
   never in the admin dashboard, so managing your own content stays
   normal. This can't stop a determined visitor (devtools, screenshots
   always work) — it only removes the one-click paths for everyone else. */
body.no-select { -webkit-user-select: none; user-select: none; }
body.no-select .field,
body.no-select input,
body.no-select textarea,
body.no-select .contact-form { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; user-drag: none; pointer-events: auto; }
#app { position: relative; z-index: 1; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 400; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
code { font-family: var(--font-mono); }
::selection { background: var(--accent); color: #fff; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--font-mono); }
.grad-text { background: linear-gradient(95deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s cubic-bezier(.16,.8,.3,1), transform 0.7s cubic-bezier(.16,.8,.3,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(12px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- Status strip (only shown when open to work) ---------- */
.statusbar { position: relative; z-index: 3; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 11.5px; color: var(--emerald); }
.statusbar-inner { max-width: var(--container); margin: 0 auto; padding: 8px 32px; display: flex; align-items: center; gap: 8px; }
.statusbar-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); animation: dotPulse 1.8s ease-in-out infinite; flex-shrink: 0; }
@keyframes dotPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---------- Sticky compact nav ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid transparent;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.navbar.scrolled { opacity: 1; transform: translateY(0); pointer-events: auto; border-color: var(--border); }
.navbar-inner { max-width: var(--container); margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; justify-content: space-between; }
.nav-identity { display: flex; align-items: center; gap: 10px; }
.nav-identity img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.nav-identity span { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); color: var(--text); transition: border-color 0.2s, transform 0.15s, color .2s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.pill-link { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; background: var(--surface); transition: border-color 0.2s, color 0.2s, transform .15s; }
.pill-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ---------- Hero: aurora glow + asymmetric layout ---------- */
.hero { position: relative; padding: 68px 32px 110px; overflow: hidden; }
.hero-aurora { position: absolute; inset: -10% -10% auto -10%; height: 640px; z-index: 0; pointer-events: none; filter: blur(90px); opacity: 0.5; }
.hero-aurora .blob { position: absolute; border-radius: 50%; }
.hero-aurora .b1 { width: 480px; height: 480px; top: -140px; left: 4%; background: var(--accent); opacity: 0.28; animation: driftA 16s ease-in-out infinite; }
.hero-aurora .b2 { width: 420px; height: 420px; top: -80px; right: 6%; background: var(--accent-2); opacity: 0.22; animation: driftB 20s ease-in-out infinite; }
@keyframes driftA { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px, 30px) scale(1.12); } }
@keyframes driftB { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-30px, 40px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .hero-aurora .blob { animation: none !important; } }

.hero-inner { max-width: var(--container); margin: 0 auto; position: relative; z-index: 2; display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 880px) {
  .hero { padding: 44px 20px 80px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-side { order: -1; }
  .hero-photo-plate img { aspect-ratio: 16/10; }
}
@media (max-width: 480px) {
  .hero-name { font-size: clamp(38px, 12vw, 52px); }
}

.hero-eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12.5px; color: var(--emerald); margin-bottom: 24px; }
.hero-eyebrow .dot-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); animation: dotPulse 1.6s ease-in-out infinite; }

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(48px, 7.4vw, 88px);
  line-height: 1.02;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 20px;
  min-height: 1.1em;
}
.hero-name .cursor { display: inline-block; width: 2px; margin-left: 3px; background: var(--accent); animation: caretBlink 1s step-end infinite; }
@keyframes caretBlink { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
.hero-underline { width: 92px; height: 4px; border-radius: 999px; margin-bottom: 26px; background: linear-gradient(95deg, var(--accent), var(--accent-2)); }

.hero-bio { font-size: 16.5px; line-height: 1.75; color: var(--text-dim); max-width: 46ch; margin-bottom: 30px; }
.hero-tagline { font-size: 15px; color: var(--text-dim); font-weight: 500; margin-bottom: 10px; }

.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 42px; }
.hero-nav-links { display: flex; gap: 26px; flex-wrap: wrap; font-size: 13.5px; }
.hero-nav-links a { display: inline-flex; align-items: baseline; gap: 5px; color: var(--text-dim); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: color 0.2s, border-color 0.2s; }
.hero-nav-links a:hover { color: var(--accent); border-color: var(--accent); }
.hero-nav-links .idx { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); }

/* photo plate */
.hero-photo-wrap { position: relative; }
.hero-photo-plate {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-lg); transition: box-shadow .3s ease;
}
.hero-photo-plate:hover { box-shadow: var(--shadow-lg), 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.hero-photo-plate img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; }
.hero-figcaption { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-mute); padding: 10px 3px 0; letter-spacing: 0.03em; }

.hero-social-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-social-pill { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); background: var(--surface); padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); transition: border-color .2s, color .2s, transform .15s; }
.hero-social-pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.hero-social-pill img { width: 12px; height: 12px; }

.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(95deg, var(--accent), var(--accent-dim)); color: #fff; border: none; border-radius: 999px; padding: 13px 24px; font-size: 14px; font-weight: 600; transition: filter 0.2s, transform 0.15s; box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-secondary { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 13px 24px; font-size: 14px; font-weight: 600; transition: border-color 0.2s, color 0.2s, transform 0.15s; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ---------- Section framing ---------- */
.section { padding: 0 32px 100px; position: relative; }
.section-inner { max-width: var(--container); margin: 0 auto; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 40px; }
.section-index { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); flex-shrink: 0; }
.section-title { font-family: var(--font-display); font-size: 34px; font-weight: 400; }
.section-head-meta { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mute); white-space: nowrap; }
.section-rule { height: 1px; background: linear-gradient(90deg, var(--border), transparent); margin-bottom: 40px; margin-top: -18px; }

/* ---------- Skills: two-row animated marquee, sized by proficiency ---------- */
.skills-rows { display: flex; flex-direction: column; gap: 14px; max-width: 960px; margin: 0 auto; }
.marquee-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 14px; width: max-content; will-change: transform; }
.marquee-track.dir-left { animation: marqueeLeft linear infinite; }
.marquee-track.dir-right { animation: marqueeRight linear infinite; }
.marquee-viewport:hover .marquee-track { animation-play-state: paused; }
@keyframes marqueeLeft { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marqueeRight { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none !important; } }
.skill-chip {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--border); border-radius: 999px; padding: 11px 18px;
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, color 0.2s, transform 0.15s, box-shadow .2s;
}
.skill-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.skill-chip img, .skill-chip .chip-fallback { width: 1.1em; height: 1.1em; display: flex; align-items: center; justify-content: center; font-size: 0.6em; font-family: var(--font-mono); flex-shrink: 0; }
.skill-chip.active { border-color: var(--accent); color: var(--accent); }
.skill-panel { max-width: 700px; margin: 34px auto 0; min-height: 0; overflow: hidden; max-height: 0; transition: max-height 0.35s ease; }
.skill-panel.open { max-height: 220px; }
.skill-panel-card { border: 1px solid var(--border); border-radius: var(--radius-m); padding: 20px 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.skill-panel-card .level-badge { font-family: var(--font-mono); font-size: 11px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); border-radius: 999px; padding: 3px 10px; margin-left: 10px; }
.skill-panel-card p { margin-top: 10px; font-size: 14px; color: var(--text-dim); line-height: 1.7; }
.skill-panel-empty { text-align: center; color: var(--text-mute); font-size: 13.5px; }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 780px) { .projects-grid { grid-template-columns: 1fr; } }
.project-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow 0.25s ease, transform .25s ease, border-color .25s; }
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.project-img-wrap { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.project-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.project-card:hover .project-img-wrap img { transform: scale(1.05); }
.project-body { padding: 24px 26px 26px; }
.project-top-row { margin-bottom: 10px; }
.project-index { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.project-body h3 { font-family: var(--font-display); font-size: 23px; font-weight: 400; margin-bottom: 10px; }
.project-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 18px; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tech-tag { font-family: var(--font-mono); font-size: 10.5px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; color: var(--text-mute); background: var(--surface-2); }
.project-links { display: flex; gap: 20px; }
.project-links a { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .2s, color .2s; }
.link-live { color: var(--accent); }
.link-code { color: var(--text-dim); }
.link-live:hover, .link-code:hover { border-color: currentColor; }

/* ---------- Certificates ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 720px) { .cert-grid { grid-template-columns: repeat(2, 1fr); } }
.cert-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius-m); overflow: hidden; text-align: left; background: var(--surface); color: var(--text); padding: 0; box-shadow: var(--shadow-sm); transition: box-shadow 0.25s, transform 0.2s, border-color .2s; }
.cert-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.cert-img-wrap { aspect-ratio: 4/3; background: var(--surface-2); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--text-mute); position: relative; }
.cert-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cert-meta { padding: 14px 16px; }
.cert-meta p:first-child { font-size: 13.5px; font-weight: 600; }
.cert-meta p:last-child { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); margin-top: 4px; }
.pdf-badge { position: absolute; margin: 8px; background: var(--red); color: #fff; font-size: 9.5px; font-family: var(--font-mono); padding: 2px 7px; border-radius: 999px; z-index: 2; }

/* ---------- Lightbox / modal ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 85%, black); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox-card { max-width: 720px; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.lightbox-card img { width: 100%; max-height: 62vh; object-fit: contain; background: #000; }
.lightbox-card iframe { width: 100%; height: 62vh; border: none; background: #fff; }
.contact-modal-card { max-width: 460px; }
.contact-modal-card .contact-form { max-width: none; }
.lightbox-footer { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); }
.lightbox-close { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text); flex-shrink: 0; transition: border-color .2s, color .2s; }
.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Journal — Facebook-style profile header + feed
   ============================================================ */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(95deg, var(--accent), var(--accent-2)); z-index: 90; width: 0%; transition: width 0.1s linear; }

.notes-page-header { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(16px); background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--border); }
.notes-page-header-inner { max-width: var(--container); margin: 0 auto; padding: 12px 32px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.notes-back-link { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-dim); background: none; border: none; white-space: nowrap; }
.notes-back-link:hover { color: var(--accent); }
.notes-header-mini { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; }
.notes-header-mini-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.notes-header-mini-avatar-fallback { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 13px; color: var(--text-mute); flex-shrink: 0; }
.notes-header-mini-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.journal-banner { height: 168px; border-radius: var(--radius-l); background: linear-gradient(120deg, var(--accent), var(--accent-2)); position: relative; margin: 28px 32px 0; max-width: calc(var(--container) - 64px); margin-left: auto; margin-right: auto; overflow: hidden; }
.journal-banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.25), transparent 55%); }
.journal-header-body { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.journal-identity { display: flex; align-items: flex-end; gap: 18px; margin-top: -46px; padding: 0 8px; position: relative; z-index: 2; }
.journal-avatar { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--bg); object-fit: cover; background: var(--surface-2); box-shadow: var(--shadow-md); flex-shrink: 0; }
.journal-avatar-fallback { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--bg); background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 34px; color: var(--text-mute); flex-shrink: 0; }
.journal-identity-text { padding-bottom: 8px; }
.journal-name { font-family: var(--font-display); font-size: 28px; font-weight: 400; }
.journal-sub { font-size: 13.5px; color: var(--text-mute); margin-top: 2px; }
.journal-stats { display: flex; gap: 22px; margin: 20px 0 22px; padding: 0 8px; font-size: 13px; color: var(--text-dim); flex-wrap: wrap; }
.journal-stats strong { color: var(--text); font-weight: 700; }

.tag-filter-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 8px; margin-bottom: 30px; }
.tag-chip { font-size: 12.5px; font-weight: 500; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); background: var(--surface); transition: border-color .2s, color .2s, background .2s; }
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-pill { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 999px; padding: 3px 10px; }

.journal-feed { max-width: 640px; margin: 0 auto; padding: 0 32px 110px; display: flex; flex-direction: column; gap: 18px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; text-align: left; width: 100%; color: var(--text); }
.post-card:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
.post-card-header { display: flex; align-items: center; gap: 11px; padding: 16px 18px 12px; }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.post-avatar-fallback { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 16px; color: var(--text-mute); flex-shrink: 0; }
.post-header-text { min-width: 0; }
.post-header-name { font-size: 13.5px; font-weight: 600; }
.post-header-meta { font-size: 11.5px; color: var(--text-mute); display: flex; align-items: center; gap: 5px; }
.post-body { padding: 2px 18px 14px; }
.post-title { font-family: var(--font-display); font-size: 21px; font-weight: 400; margin-bottom: 8px; }
.post-excerpt { font-size: 14px; color: var(--text-dim); line-height: 1.65; }
.post-image-wrap { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); border-top: 1px solid var(--border); }
.post-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.post-tags-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px 0; }
.post-actions { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 16px; margin-top: 8px; border-top: 1px solid var(--border); }
.post-action-left { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-mute); }
.post-action-btn { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px; transition: border-color .2s, color .2s; }
.post-action-btn:hover { border-color: var(--accent); color: var(--accent); }

.journal-toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; padding: 11px 20px; border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 200; opacity: 0; transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.journal-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.note-detail-wrap { max-width: 680px; margin: 0 auto; padding: 40px 32px 110px; }
.note-detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-md); }
.note-detail img.note-detail-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.note-detail-body { padding: 26px 30px 32px; }
.note-detail h1 { font-family: var(--font-display); font-size: 34px; font-weight: 400; margin: 4px 0 16px; }
.note-detail-content { font-size: 15.5px; line-height: 1.9; color: var(--text-dim); white-space: pre-wrap; margin-top: 20px; }
.note-detail-meta-row { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; margin-top: 22px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-mute); font-size: 14px; }

/* ---------- Skeleton loaders ---------- */
.skeleton { background: linear-gradient(100deg, var(--surface-2) 8%, var(--border) 18%, var(--surface-2) 33%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--radius-s); }
@keyframes shimmer { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.skeleton-hero { max-width: var(--container); margin: 0 auto; padding: 90px 32px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; }
@media (max-width: 880px) { .skeleton-hero { grid-template-columns: 1fr; padding: 44px 20px 80px; } .skeleton-hero > *:last-child { order: -1; } }
.skeleton-line { height: 16px; margin-bottom: 12px; }
.skeleton-photo { aspect-ratio: 4/5; border-radius: var(--radius-l); }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Back to top ---------- */
.back-to-top { position: fixed; bottom: 26px; right: 26px; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); z-index: 50; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .25s, transform .25s, border-color .2s, color .2s; }
.back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Contact ---------- */
.contact-form { max-width: 480px; display: flex; flex-direction: column; gap: 13px; }
.field { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px 15px; font-size: 14px; color: var(--text); font-family: inherit; width: 100%; transition: border-color 0.2s; }
.field:focus { outline: none; border-color: var(--accent); }
.field::placeholder { color: var(--text-mute); }
textarea.field { resize: none; }
.form-msg-success { color: var(--emerald); font-size: 14px; }
.form-msg-error { color: var(--red); font-size: 14px; }

/* ---------- Footer ---------- */
.footer { padding: 60px 32px 44px; border-top: 1px solid var(--border); }
.footer-inner { max-width: var(--container); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.social-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; max-width: 760px; }
.social-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface); border-radius: 50%; box-shadow: var(--shadow-sm); transition: border-color 0.2s, transform 0.2s, color .2s; }
.social-icon:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.social-icon img { width: 16px; height: 16px; }
.footer-note { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-mute); letter-spacing: 0.02em; }

.spinner-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Mobile tuning — public-facing pages
   ============================================================ */
@media (max-width: 640px) {
  .navbar-inner { padding: 10px 16px; }
  .nav-identity span { display: none; }
  .pill-link span, .pill-link { font-size: 12px; padding: 8px 12px; }
  .statusbar-inner { padding: 7px 16px; font-size: 11px; }

  .notes-page-header-inner { padding: 10px 16px; gap: 8px; }
  .notes-back-link .back-label { display: none; }
  .notes-header-mini-name { max-width: 120px; font-size: 12px; }

  .section { padding: 0 18px 64px; }
  .section-head { margin-bottom: 28px; gap: 10px; flex-wrap: wrap; }
  .section-title { font-size: 26px; }
  .section-head-meta { display: none; }

  .cert-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .projects-grid { gap: 16px; }
  .project-body { padding: 20px 18px 22px; }

  .journal-banner { margin: 20px 16px 0; height: 120px; }
  .journal-header-body { padding: 0 16px; }
  .journal-identity { gap: 12px; margin-top: -36px; }
  .journal-avatar, .journal-avatar-fallback { width: 72px; height: 72px; font-size: 26px; }
  .journal-name { font-size: 22px; }
  .journal-stats { gap: 14px; font-size: 12px; margin: 16px 0 18px; }
  .journal-feed { padding: 0 16px 80px; }
  .post-card-header { padding: 14px 14px 10px; }
  .post-body { padding: 2px 14px 12px; }
  .post-image-wrap { }
  .post-tags-row { padding: 10px 14px 0; }
  .post-actions { padding: 10px 14px 14px; flex-wrap: wrap; gap: 10px; }
  .post-action-btn { padding: 6px 11px; font-size: 12px; }

  .note-detail-wrap { padding: 20px 14px 80px; }
  .note-detail-body { padding: 20px 18px 24px; }
  .note-detail h1 { font-size: 26px; }
  .note-detail-meta-row { flex-direction: column; align-items: flex-start; gap: 12px; }

  .footer { padding: 44px 18px 32px; }
  .back-to-top { bottom: 18px; right: 18px; width: 40px; height: 40px; }
  .journal-toast { width: calc(100% - 32px); text-align: center; }
}

/* ============================================================
   Admin — same token system, quieter chrome
   ============================================================ */
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.admin-login-form { width: 100%; max-width: 360px; border: 1px solid var(--border); border-radius: var(--radius-l); padding: 32px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.admin-login-form h1 { font-family: var(--font-display); font-size: 28px; }
.admin-shell { min-height: 100vh; }
.admin-topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.admin-topbar-inner { max-width: 1100px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-brand { font-family: var(--font-mono); font-size: 13px; font-weight: 500; margin-right: 6px; white-space: nowrap; color: var(--text-mute); }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; overflow-x: auto; }
.admin-tab-btn { position: relative; text-align: center; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--text-dim); white-space: nowrap; transition: background 0.15s, color 0.15s, border-color .15s; }
.admin-tab-btn.active { border-color: var(--border); background: var(--surface); color: var(--accent); }
.admin-tab-btn:hover:not(.active) { background: color-mix(in srgb, var(--text) 6%, transparent); }
.tab-badge { position: absolute; top: 1px; right: 2px; background: var(--red); color: white; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.admin-topbar-actions { display: flex; align-items: center; gap: 6px; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; }

.admin-form-card { border: 1px solid var(--border); border-radius: var(--radius-m); padding: 22px; max-width: 560px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; background: var(--surface); box-shadow: var(--shadow-sm); }
.admin-form-card h3 { font-family: var(--font-display); font-size: 19px; font-weight: 400; }
.admin-label { font-size: 12.5px; color: var(--text-mute); margin-bottom: -6px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 11px 16px; max-width: 560px; margin-bottom: 8px; background: var(--surface); transition: border-color 0.15s; }
.admin-row:hover { border-color: var(--border-strong); }
.admin-row-actions { display: flex; gap: 14px; }
.link-btn { background: none; border: none; font-size: 12.5px; font-weight: 500; padding: 0; }
.link-accent { color: var(--accent); }
.link-danger { color: var(--red); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip { font-size: 11.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-mute); background: var(--surface); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); }
.msg-card { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 15px 17px; max-width: 560px; margin-bottom: 10px; background: var(--surface); }
.msg-card.unread { border-color: var(--accent); }
.msg-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; gap: 10px; }
.msg-type { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); white-space: nowrap; }
.msg-body { font-size: 14px; color: var(--text-dim); margin-bottom: 10px; }
.error-text { color: var(--red); font-size: 13px; }
.success-text { color: var(--emerald); font-size: 13px; }

/* ---------- Upload box ---------- */
.upload-box { display: flex; align-items: center; gap: 14px; border: 1.5px dashed var(--border); border-radius: var(--radius-m); padding: 14px 16px; cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; max-width: 460px; background: var(--surface); }
.upload-box:hover, .upload-box:focus-visible, .upload-box.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); outline: none; }
.upload-thumb { width: 48px; height: 48px; border-radius: var(--radius-s); object-fit: cover; background: var(--surface-2); flex-shrink: 0; color: var(--accent); }
.upload-thumb-circle { border-radius: 50%; }
.upload-text { font-size: 13px; color: var(--text-dim); }
.upload-text strong { color: var(--accent); }
.upload-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.status-msg { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 6px; }
.status-msg.error { color: var(--red); }
.status-msg.success { color: var(--emerald); }
.btn-loading { opacity: 0.65; cursor: default; }
.icon-toggle-row { display: flex; gap: 8px; }
.icon-toggle-btn { flex: 1; font-size: 12.5px; font-weight: 500; padding: 8px; border-radius: var(--radius-s); border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); transition: border-color 0.2s, color 0.2s; }
.icon-toggle-btn.active { border-color: var(--accent); color: var(--accent); }
