/* =====================================================================
   Polish · faint background sketches (signal-processing line art)
   Loaded after the theme, alongside vitae.css.
   ===================================================================== */

/* Each homepage section hosts a faint full-section sketch canvas */
.home-section.has-sketch {
  position: relative;
  overflow: hidden;
}
.home-section.has-sketch > .container {
  position: relative;
  z-index: 1;
}
.sig-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.sig-bg.in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .sig-bg { transition: none; }
}

/* =====================================================================
   Slick, modern presentation of the original project figures.
   The image content is preserved (object-fit: contain); only the
   framing is modernised into a consistent "figure plate".
   ===================================================================== */
.project-showcase .project-item { margin-bottom: 0.4rem; }
.project-showcase .col-12.order-first { padding-top: 0.4rem; padding-bottom: 0.4rem; }
.project-showcase .order-first img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #ffffff;
  padding: 16px;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(24, 32, 52, 0.06);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.project-showcase .project-item:hover .order-first img {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(24, 32, 52, 0.12);
}

/* =====================================================================
   Small special touches (decorations) — clean, but not empty.
   ===================================================================== */

/* (1) Signal-glyph markers before major section headings */
.section-heading h1::before,
h2#about-me::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 0.5rem;
  vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='7.5 7.5 13 13'%3E%3Cdefs%3E%3CradialGradient id='d' cx='0.5' cy='0.5' r='0.62'%3E%3Cstop offset='0' stop-color='%233f66c9'/%3E%3Cstop offset='0.55' stop-color='%232f8a8f'/%3E%3Cstop offset='1' stop-color='%23268b7e'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect x='9.5' y='9.5' width='9' height='9' rx='1.4' fill='url(%23d)' transform='rotate(45 14 14)'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* (1b) Waveform bullets on the Interests list */
.ul-interests {
  list-style: none;
  padding-left: 1.5em;
}
.ul-interests li {
  position: relative;
}
.ul-interests li::before {
  content: "";
  position: absolute;
  left: -1.5em;
  top: 0.5em;
  width: 9px;
  height: 9px;
  top: 0.42em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='7.5 7.5 13 13'%3E%3Cdefs%3E%3CradialGradient id='d' cx='0.5' cy='0.5' r='0.62'%3E%3Cstop offset='0' stop-color='%233f66c9'/%3E%3Cstop offset='0.55' stop-color='%232f8a8f'/%3E%3Cstop offset='1' stop-color='%23268b7e'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect x='9.5' y='9.5' width='9' height='9' rx='1.4' fill='url(%23d)' transform='rotate(45 14 14)'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* (2) Micro-interactions: draw-in underline on content + nav links */
.article-style a {
  text-decoration: none;
  border-bottom: 0;
  padding-bottom: 1px;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  transition: background-size 0.3s ease;
}
.article-style a:hover { background-size: 100% 1.5px; }

.navbar .nav-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 88%;
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  transition: background-size 0.28s ease, color 0.2s ease;
}
.navbar .nav-link:hover { background-size: 100% 1.5px; }

/* (2b) Social icons: gentle lift on hover */
.network-icon a {
  display: inline-block;
  transition: transform 0.25s ease;
}
.network-icon a:hover { transform: translateY(-3px); }

/* (3) Faint paper grain — depth without clutter */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}
@media (prefers-reduced-motion: reduce) {
  .article-style a, .navbar .nav-link, .network-icon a { transition: none; }
}

/* =====================================================================
   Topical background art on inner pages (behind the article content).
   ===================================================================== */
.article.has-sketch { position: relative; overflow: hidden; }
.article.has-sketch .article-container { position: relative; z-index: 1; }
.sig-page-bg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%);
}
.sig-page-bg.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sig-page-bg { transition: none; } }

/* =====================================================================
   Gentle teal accents — teal appears on interaction and in the art,
   while functional links stay blue at rest (no two-accent clash).
   ===================================================================== */
.article-style a:hover { color: #1d7f72; }
.navbar .nav-link:hover { color: #1d7f72; }
.network-icon a:hover { color: #1d7f72; }
.project-showcase .project-item:hover .order-first img { border-color: #bcdfd8; }

/* =====================================================================
   GPU-composited animation of the background sketches (smooth, ~0 CPU).
   Each sketch is a canvas drawn once; only its transform is animated.
   ===================================================================== */
@keyframes sig-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes sig-spin-rev { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@keyframes sig-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.sig-el {
  position: absolute; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity 1.4s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.sig-el.in { opacity: 1; }
.sig-el.spin { transform-origin: 50% 50%; animation: sig-spin var(--dur, 490s) linear infinite; }
.sig-el.spin.rev { animation-name: sig-spin-rev; }
.sig-el.drift { animation: sig-drift var(--dur, 175s) linear infinite; }
.sig-page-wrap {
  position: absolute; top: 0; left: 0; width: 100%; height: 640px;
  z-index: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%);
}
@media (prefers-reduced-motion: reduce) { .sig-el { animation: none !important; } }

