/* ---------------------------------------------- 
 * Per lo scroll di "readmore"
 /* ---------------------------------------------- */

span#more {
    opacity: 0;
    max-height: 0;
    font-size: 0;
    transition: opacity 0.25s ease, max-height 0.25s ease, font-size 0.25s ease;
    display: inline; /* Mantieni inline per compatibilità con <span> */
    overflow: hidden; /* Evita contenuti che "sbordano" durante la transizione */
}

span#more.active {
    opacity: 1;
    font-size: 20px;
    max-height: 200px; /* Valore massimo stimato, sarà sovrascritto dal JS */
}

/* ---------------------------------------------- 
* Animazione icona con la faccia
/* ---------------------------------------------- */

@-webkit-keyframes hvr-pop {
  50% {
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
  }
}
@keyframes hvr-pop {
  50% {
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
  }
}
.img-fluid.img-thumbnail {
  display: inline-block;
  vertical-align: middle;
  -webkit-transform: perspective(1px) translateZ(0);
  transform: perspective(1px) translateZ(0);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0);
}
.img-fluid.img-thumbnail:hover, .img-fluid.img-thumbnail:focus, .img-fluid.img-thumbnail:active {
  -webkit-animation-name: hvr-pop;
  animation-name: hvr-pop;
  -webkit-animation-duration: 0.3s;
  animation-duration: 0.3s;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  -webkit-animation-iteration-count: 1;
  animation-iteration-count: 1;
}



/* ---------------------------------------------- 
* Animazione con flashing
/* ---------------------------------------------- */

@-webkit-keyframes blinker {
  from { opacity: 1.0; }
  to { opacity: 0.0; }
}


.flashtext {
  animation: blinker 3s linear infinite;
}

@keyframes blinker {
  50% {
    opacity: 0;
  }
}

/* ---------------------------------------------- 
* Icone principalmente adobe
/* ---------------------------------------------- */

.icons-adobe  {
	margin-left: 5px;
}

/* ---------------------------------------------- 
* Traduzione
/* ---------------------------------------------- */

.cambiolingua {
	position: relative;
	padding: 14px 16px;
	text-align: center;
}

/* ---------------------------------------------- 
* Etsy icon
/* ---------------------------------------------- */

.etsy-icon {
	position: relative;
	padding: 14px 16px;
	text-align: center;
}


/* ---------------------------------------------- 
* Cambio linguaggi
/* ---------------------------------------------- */

.change-lang_en {
    background-image: url(../images/united-kingdom-flag-round.svg);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0px 0px 3px 2px #00000085;
}
	
.change-lang_it {
    background-image: url(../images/italy-flag-round.svg);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0px 0px 3px 2px #00000085;
}

.change-lang_es {
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0px 0px 3px 2px #00000085;
}


#more {
    display: none; /* Testo nascosto inizialmente */
}
#dots {
    display: inline; /* Puntini visibili inizialmente */
}
.flashtext {
    cursor: pointer; /* Rende lo span cliccabile come un pulsante */
    display: inline-block; /* Per un layout coerente */
    margin-left: 0.3em; /* space after the about paragraph (labels have no leading space) */
}

/* Read-more control: left edge flush with the about paragraph text */
#about #myBtn.flashtext {
    margin-left: 0;
    padding-left: 0;
}

/* ---------------------------------------------- 
 * Effetto nerd (tremolio, flash e icone 😎)
 /* ---------------------------------------------- */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes emoji-rain {
    0% { transform: translateY(0) translateX(0); opacity: 1; }
    100% { transform: translateY(-100px) translateX(calc(var(--random-x) * 20px)); opacity: 0; }
}

.nerd-effect {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.nerd-effect:hover {
    animation: shake 0.5s ease infinite, flash 0.5s ease infinite;
}

.nerd-effect.nerd-active {
    animation: shake 0.5s ease infinite, flash 0.5s ease infinite;
}

.nerd-emoji {
    position: absolute;
    font-size: 12px;
    pointer-events: none;
    animation: emoji-rain 1.5s linear forwards;
}

@media (max-width: 767px) {
    .nerd-effect:hover {
        animation: none; /* Disabilita :hover su mobile */
    }
}


/* --- resume date/company badges: stay inside the card; JS scrolls only if text overflows --- */
#resume .resume-list {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
#resume .resume-list h6.badge.resume-dates,
#resume .resume-list h6.badge.text-overflow {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: top;
}
#resume .resume-dates-track,
#resume .text-overflow__inner {
  display: inline-block;
  white-space: nowrap;
  /* transform is animated only when .is-overflow is set */
  backface-visibility: hidden;
}
#resume .resume-dates.is-overflow .resume-dates-track,
#resume .text-overflow.is-overflow .text-overflow__inner,
#resume .text-overflow.is-overflow .resume-dates-track {
  animation: resume-dates-scroll var(--resume-duration, 8s) ease-in-out infinite;
  will-change: transform;
}
/* Pause the scroll so the line can be read */
#resume .resume-dates.is-overflow:hover .resume-dates-track,
#resume .resume-dates.is-overflow:focus-within .resume-dates-track,
#resume .text-overflow.is-overflow:hover .resume-dates-track,
#resume .text-overflow.is-overflow:focus-within .resume-dates-track,
#resume .text-overflow.is-overflow:hover .text-overflow__inner,
#resume .text-overflow.is-overflow:focus-within .text-overflow__inner {
  animation-play-state: paused;
}
@keyframes resume-dates-scroll {
  0%, 12% { transform: translate3d(0, 0, 0); }
  50%, 62% { transform: translate3d(var(--resume-shift, 0px), 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
/* Accessibility: no motion — show the full string wrapped, never scroll or ellipsis-cut */
@media (prefers-reduced-motion: reduce) {
  #resume .resume-list h6.badge.resume-dates.is-overflow,
  #resume .resume-list h6.badge.resume-dates.is-wrapped,
  #resume .resume-list h6.badge.text-overflow.is-overflow,
  #resume .resume-list h6.badge.text-overflow.is-wrapped {
    white-space: normal;
    overflow: visible;
    height: auto;
    width: 100%;
    max-width: 100%;
  }
  #resume .resume-dates.is-overflow .resume-dates-track,
  #resume .resume-dates.is-wrapped .resume-dates-track,
  #resume .text-overflow.is-overflow .resume-dates-track,
  #resume .text-overflow.is-wrapped .resume-dates-track,
  #resume .text-overflow.is-overflow .text-overflow__inner,
  #resume .text-overflow.is-wrapped .text-overflow__inner {
    animation: none !important;
    transform: none !important;
    will-change: auto;
    display: inline;
    white-space: normal;
    overflow: visible;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Contact form (Justin markup + privacy, honeypot, Turnstile, status) */
.contact-form .mz-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-form .form-consent {
  text-align: left;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.contact-form .form-consent input[type="checkbox"] {
  margin-right: 0.5rem;
  vertical-align: middle;
}
.contact-form #mz-turnstile {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}
.contact-form-status {
  margin-top: 1rem;
  min-height: 1.4em;
}
.contact-form-status.is-success { color: #3dd68c; }
.contact-form-status.is-error { color: #ff6b6b; }

/* ----------------------------------------------
 * About (home): desktop width = full-width resume-list boxes;
 * photo stays top-aligned with the opening text when the bio expands.
 * ---------------------------------------------- */
@media (min-width: 992px) {
  /* color-dark/light.css load after custom.css and set max-width: 950px; override them here. */
  section.section-about {
    max-width: calc(960px - 30px) !important;
    width: 100%;
  }
}
@media (min-width: 1200px) {
  section.section-about {
    max-width: calc(1140px - 30px) !important;
    width: 100%;
  }
}

#about .section-about-wrap > .row {
  align-items: flex-start !important;
}
#about .section-about-wrap > .row > [class*="col-"] {
  align-self: flex-start;
}

/* ---- Mobile bio justify + resume marquee containment (2026-11-10) ---- */
@media (max-width: 767.98px) {
    /* Bio paragraphs only; desktop typography stays untouched. lang is inherited from <html>. */
    #about .about-bio,
    #about .about-bio p,
    #about .about-bio span {
        text-align: justify;
        text-justify: inter-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
        hyphenate-limit-chars: 6 3 3;
        overflow-wrap: break-word;
        word-break: normal;
    }
    /* Read-more stays flush left with the paragraph, never justified. */
    #about .about-desc-content > p.mb-0,
    #about #myBtn.flashtext {
        text-align: left;
        hyphens: none;
        -webkit-hyphens: none;
        margin-left: 0;
        padding-left: 0;
    }

    /* Hero greeting/subtitle: no overflow or layout jump on small screens. */
    .section-home .overlay-wrap {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        padding-left: 16px;
        padding-right: 16px;
        text-align: center;
        overflow-x: hidden;
        min-height: 6.5rem;
    }
    .section-home .overlay h1 {
        font-size: clamp(2.4rem, 12vw, 3.4rem);
        line-height: 1.15;
        letter-spacing: 0.04em;
        overflow-wrap: anywhere;
        max-width: 100%;
    }
    .section-home .overlay span,
    .section-home .overlay p {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        white-space: normal;
        overflow-wrap: break-word;
        font-size: 1.05rem;
        line-height: 1.4;
        letter-spacing: 0.04em;
    }

    /* Resume date badges: cap at the card; do not force width:100% (that can collapse scrollWidth). */
    #resume .resume-list {
        overflow: hidden;
        max-width: 100%;
        min-width: 0;
    }
    #resume .resume-list h6.badge.resume-dates,
    #resume .resume-list h6.badge.text-overflow {
        width: fit-content;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
}


/* ----------------------------------------------
 * About heading: animated "HEY!" (.fx-loud)
 * At rest the glyph is flush with the column text; as it shouts, a
 * layout margin (synced to the scale) pushes the heading right, then back.
 * Tokens stay on .fx-loud, not :root.
 * ---------------------------------------------- */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-800-hey.woff") format("woff");
  unicode-range: U+0021, U+0045, U+0048, U+0059;
}

#about .about-desc-content h2 {
  overflow: visible;
  max-width: 100%;
  line-height: 1.25; /* lock the line box so the shout cannot shift the bio */
}

#about .about-desc-content h2 .fx-loud-slot {
  display: inline-block;
  vertical-align: baseline;
  padding: 0;
  margin: 0;
}

#about .about-desc-content h2 .fx-loud {
  --ink: currentColor;
  --ink-2: #FF4FD8;
  --ink-3: #4FF8FF;
  --hey-gap: 0.3em;
  --hey-scale: 1.75;
  /* "HEY!" is 4 mono characters + letter-spacing .06em between them */
  --hey-advance: calc(4ch + 0.18em);
  --hey-push: calc(var(--hey-gap) + (var(--hey-scale) - 1) * var(--hey-advance));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 800;
  font-size: 1em;
  line-height: inherit;
  letter-spacing: 0.06em;
  color: var(--ink);
  display: inline-block;
  vertical-align: baseline;
  margin-right: var(--hey-gap);
  transform-origin: left center;
  animation: fx-loud 3s infinite;
}

@keyframes fx-loud {
  0%, 12% {
    transform: scale(1);
    margin-right: var(--hey-gap);
    color: var(--ink);
    text-shadow: none;
    animation-timing-function: cubic-bezier(.2, 1.5, .4, 1);
  }
  20% {
    transform: scale(var(--hey-scale));
    margin-right: var(--hey-push);
    color: var(--ink-2);
    text-shadow: 0 0 18px color-mix(in srgb, var(--ink-2) 55%, transparent);
  }
  23% {
    transform: translate(-5px, 2px) rotate(-3deg) scale(var(--hey-scale));
    margin-right: var(--hey-push);
  }
  26% {
    transform: translate(5px, -2px) rotate(3deg) scale(var(--hey-scale));
    margin-right: var(--hey-push);
  }
  29% {
    transform: translate(-4px, -1px) rotate(-2deg) scale(var(--hey-scale));
    margin-right: var(--hey-push);
  }
  32% {
    transform: translate(4px, 1px) rotate(2deg) scale(var(--hey-scale));
    margin-right: var(--hey-push);
  }
  35% {
    transform: translate(-2px, 2px) rotate(-1deg) scale(var(--hey-scale));
    margin-right: var(--hey-push);
  }
  38% {
    transform: translate(2px, -1px) rotate(1deg) scale(var(--hey-scale));
    margin-right: var(--hey-push);
  }
  44% {
    transform: scale(var(--hey-scale));
    margin-right: var(--hey-push);
    color: var(--ink-2);
    text-shadow: 0 0 18px color-mix(in srgb, var(--ink-2) 55%, transparent);
    animation-timing-function: cubic-bezier(.3, 1.6, .5, 1);
  }
  54%, 100% {
    transform: scale(1);
    margin-right: var(--hey-gap);
    color: var(--ink);
    text-shadow: none;
  }
}

@media (max-width: 767.98px) {
  /* Own line, left-aligned with the justified bio; no horizontal overflow. */
  #about .about-desc-content h2 {
    text-align: left;
  }
  #about .about-desc-content h2 .fx-loud-slot {
    display: block;
    margin: 0 0 0.15em 0;
    /* Room under HEY! for the downward half of scale(1.75); not transformed. */
    padding-bottom: 0.65em;
  }
  #about .about-desc-content h2 .fx-loud {
    margin-right: 0;
    --hey-gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #about .about-desc-content h2 .fx-loud {
    animation: none;
    transform: none;
    text-shadow: none;
    color: var(--ink);
    margin-right: var(--hey-gap);
  }
}

/* ----------------------------------------------
 * About photo: keep a perfect circle on every breakpoint.
 * Bootstrap .img-fluid { max-width:100% } was shrinking the width
 * while theme .section-about img { height:300px } stayed fixed,
 * stretching the 50% radius into an oval on mobile and some tablets.
 * ---------------------------------------------- */
#about .about-photo {
  width: 300px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0 auto;
  box-sizing: border-box;
  display: block;
}
#about .section-about-wrap .about-photo img.img-fluid.img-thumbnail,
#about .about-photo img {
  width: 300px;
  max-width: 100%;
  height: auto !important;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  margin: 0;
  box-sizing: border-box;
  padding: 0;
}
@media (max-width: 991.98px) {
  #about .section-about-wrap > .row > [class*="col-"]:has(.about-photo) {
    display: flex;
    justify-content: center;
  }
}
