/* Keep legacy theme accents aligned with the redesigned cyan palette.
   .btn-primary is deliberately left out here: critical.css already owns
   its full rest/hover styling (gradient background, text color) and
   redeclaring a flat color for only some of its states caused the
   button to visibly snap between two different looks on hover/unhover. */
a:hover,
a:focus,
.text-primary,
.icon-primary,
.icon-primary.icon-hover:hover,
.icon-primary.icon-hover:focus {
  color: #2fb6e5;
}

.bg-primary,
.icon-primary.icon-filled,
.icon-primary.icon-hover:hover,
.icon-primary.icon-hover:focus {
  background-color: #2fb6e5;
}

/* Hobbies & Interests icons: no color change on hover/focus, just the
   existing lift + shake/bounce/swing motion. The legacy theme forces a
   white-background + recolored-icon swap here (with !important), so it
   has to be cancelled explicitly rather than just left undeclared. */
#resume .list-inline .icon-circle.icon-hover:hover,
#resume .list-inline .icon-circle.icon-hover:focus {
  background: linear-gradient(145deg, #3bb4e3, #258fbe) !important;
  color: #effbff !important;
}
#resume .list-inline .icon-circle.icon-hover:hover .st0,
#resume .list-inline .icon-circle.icon-hover:focus .st0 {
  fill: #fff !important;
  stroke: #fff !important;
}

/* Mobile nav close button: the legacy .icon-circle centering trick
   (absolute + translate(-50%,-50%) on the child) leaves the fa-times
   glyph visibly off-center at this small icon-xs size. Flexbox centers
   the icon's actual box reliably regardless of size. */
#mobile-nav .mobile-nav-close.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
}
#mobile-nav .mobile-nav-close.icon-circle > * {
  position: static;
  transform: none;
}

/* The legacy theme forces a white circle background on any .icon-circle
   hover (theme.css: .icon-circle.icon-hover:hover { background-color:
   #fff !important }), which would leave the white "x" invisible. Keep
   the blue circle on hover and swap the affordance for a lift + glow
   and a quarter-turn of the "x" instead. */
#mobile-nav .mobile-nav-close.icon-circle {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#mobile-nav .mobile-nav-close.icon-circle.icon-hover.icon-primary:hover,
#mobile-nav .mobile-nav-close.icon-circle.icon-hover.icon-primary:focus {
  background-color: #2fb6e5 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(47, 182, 229, 0.45);
}
#mobile-nav .mobile-nav-close.icon-circle:hover i,
#mobile-nav .mobile-nav-close.icon-circle:focus i {
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

/* Headline tagline: small terminal-prompt line under the (now static)
   job title, cycling extra nerdy detail via typewriter. The real text
   lives in a visually-hidden span so screen readers and no-JS/reduced-
   motion users always get the plain, complete line; the typed span is
   aria-hidden and purely decorative. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.headline-tagline {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  color: rgba(210, 235, 245, 0.62);
  /* This is a *fallback* reservation only, for the brief moment before
     headline-typed.js measures the real worst case and for no-JS/reduced-
     motion users (who render a single line and never need it). Most
     viewports only ever need one line here; JS overrides this with the
     actual tallest wrap so we don't permanently reserve a second line
     that's almost never used. */
  line-height: 1.4;
  min-height: 1.4em;
}
@media only screen and (max-width: 480px) {
  .headline-tagline {
    min-height: 2.8em;
  }
}
.headline-tagline-prompt {
  color: #2fb6e5;
  margin-right: 6px;
}
.headline-typed {
  color: rgba(210, 235, 245, 0.85);
}
.headline-cursor {
  /* Drawn as a plain block rather than a "_" glyph: a font's underscore
     sits at a different baseline/weight per typeface, and blurring that
     thin glyph with text-shadow produced a ghosted double-line artifact.
     A solid box with box-shadow glows cleanly at any size/zoom. */
  display: inline-block;
  width: 0.55em;
  height: 0.14em;
  margin-left: 2px;
  background: #2fb6e5;
  vertical-align: -0.05em;
  box-shadow: 0 0 6px rgba(47, 182, 229, 0.75);
  animation: headline-pulse 1.1s ease-in-out infinite;
}
@keyframes headline-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}
@media (prefers-reduced-motion: reduce) {
  .headline-cursor {
    animation: none;
  }
}

/* Mobile-nav scrollspy: the legacy theme's default .active state is a
   floating pill (sized/positioned for a different, padded nav style)
   filled with the old template blue (#3aa8db) - it looked like a stray,
   misaligned shape sitting on top of this plain divided list. Drop the
   pill and show a "-> " prompt-arrow prefix instead, echoing the "//"
   and "$" motifs used elsewhere.
   First attempt absolutely-positioned the arrow assuming the anchor's
   negative-margin/padding hit-area trick left empty visual space to the
   left of the text - it doesn't (that trick only extends the hover/tap
   target, not the rendered layout), so the arrow sat on top of the
   letters. Using flex + a fixed-width slot for the arrow instead: it's
   a real layout column reserved for every item (opacity-toggled, not
   inserted/removed), so it can never overlap the label text. */
#mobile-nav .nav-vertical > li.active > a:before,
#mobile-nav .nav-vertical > li > a.active:before {
  content: none;
}
#mobile-nav .nav-vertical > li > a {
  display: flex;
  align-items: center;
}
#mobile-nav .nav-vertical > li.active > a,
#mobile-nav .nav-vertical > li > a.active {
  color: #158bb0 !important;
  font-weight: 700;
}
#mobile-nav .nav-vertical > li > a:after {
  content: '->';
  order: -1;
  flex: 0 0 auto;
  width: 18px;
  opacity: 0;
  transform: translateX(-4px);
  color: #2fb6e5;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#mobile-nav .nav-vertical > li.active > a:after,
#mobile-nav .nav-vertical > li > a.active:after {
  opacity: 1;
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  #mobile-nav .nav-vertical > li > a:after {
    transition: none;
  }
}

/* Section eyebrow prefix: small "//" before eyebrow labels (Resume,
   Recommendations, ...), echoing the hero's terminal-comment motif.
   Reveal is handled by the site's existing .animated/appear() scroll
   system (core.js) via data-animation="fadeIn" - no new JS needed. */
.section-eyebrow-prefix {
  color: #2fb6e5;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-weight: 400;
  margin-right: 2px;
}

/* Skill tags: stagger the chips in as the group scrolls into view,
   triggered the same way (see index.php .skill-tags data-animation). */
.skill-tags.skill-tags-reveal span {
  opacity: 0;
  transform: translateY(6px);
  animation: skill-tag-in 0.4s ease forwards;
}
@keyframes skill-tag-in {
  to { opacity: 1; transform: translateY(0); }
}
.skill-tags.skill-tags-reveal span:nth-child(1) { animation-delay: 0ms; }
.skill-tags.skill-tags-reveal span:nth-child(2) { animation-delay: 45ms; }
.skill-tags.skill-tags-reveal span:nth-child(3) { animation-delay: 90ms; }
.skill-tags.skill-tags-reveal span:nth-child(4) { animation-delay: 135ms; }
.skill-tags.skill-tags-reveal span:nth-child(5) { animation-delay: 180ms; }
.skill-tags.skill-tags-reveal span:nth-child(6) { animation-delay: 225ms; }
.skill-tags.skill-tags-reveal span:nth-child(7) { animation-delay: 270ms; }
.skill-tags.skill-tags-reveal span:nth-child(8) { animation-delay: 315ms; }
.skill-tags.skill-tags-reveal span:nth-child(9) { animation-delay: 360ms; }
@media (prefers-reduced-motion: reduce) {
  .skill-tags.skill-tags-reveal span {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Portfolio hover: layer a brand-cyan glow + subtle image zoom onto the
   existing dark-overlay hover effect, and restyle the plain "Tech stack:
   X, Y, Z" sentence as chips (tech-chips.js) matching the skill-tag
   chips used in the Resume section, so the same "list of tech" language
   reads consistently across the page. */
.item-photo img {
  transition: transform 0.5s ease;
}
.gallery-item:hover .item-photo img {
  transform: scale(1.05);
}
.item-photo:after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0 rgba(47, 182, 229, 0.9), 0 0 0 rgba(47, 182, 229, 0);
  transition: box-shadow 0.35s ease;
  pointer-events: none;
}
.gallery-item:hover .item-photo:after {
  box-shadow: inset 0 0 0 2px rgba(47, 182, 229, 0.9), 0 0 22px rgba(47, 182, 229, 0.45);
}
@media (prefers-reduced-motion: reduce) {
  .item-photo img,
  .item-photo:after {
    transition: none;
  }
}
.view-project-label {
  display: block;
  color: #2fb6e5;
  font-weight: 600;
  font-size: 15px;
}
.tech-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}
.tech-chip {
  padding: 4px 10px;
  border: 1px solid rgba(122, 190, 219, 0.4);
  border-radius: 999px;
  color: #cfe9f2;
  font-size: 11px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  line-height: 1.2;
}

/* Prevent the deferred legacy theme from collapsing contact actions into a stack. */
.contact-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr) !important;
  gap: 8px !important;
  align-items: stretch !important;
}
.contact-actions a.btn {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 10px 5px !important;
  min-height: 42px !important;
  font-size: 11px !important;
  gap: 4px !important;
}
#headline .btn-primary {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}
#headline .btn-primary span,
#headline .btn-primary i {
  display: inline-block !important;
  width: auto !important;
  margin: 0 !important;
  transform: none !important;
  white-space: nowrap !important;
}
/* Move the contact card to the right side of the map instead of the left. */
#contact .contact-box {
  margin-left: auto !important;
  margin-right: 10%;
}
@media only screen and (max-width: 1480px) {
  #contact .contact-box {
    margin-right: 5%;
  }
}
@media only screen and (max-width: 1199px) {
  #contact .contact-box {
    margin-right: 1%;
  }
}
@media only screen and (max-width: 468px) {
  #contact .contact-box {
    margin-left: 1% !important;
    margin-right: 1%;
  }
}

@media only screen and (max-width: 480px) {
  .contact-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr) !important;
    gap: 6px !important;
  }
  .contact-actions a.btn {
    min-height: 40px !important;
    padding: 9px 5px !important;
  }
}
