/**
 * About page styles — loaded on about.html only.
 * Strength card accordions, portrait flip + RGB glitch, timeline.
 */

/**
 * About Strengths Cards
 * Expand/collapse behavior and body-font title styling
 */
.strength-card-toggle {
  cursor: pointer;
}

.strength-card-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
  border-radius: 0.75rem;
}

.strength-card-title {
  font-family: var(--font-body);
}

.strength-card-indicator {
  transition: transform 0.2s ease;
}

.strength-card-panel {
  overflow: hidden;
  height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: height 0.3s ease, opacity 0.28s ease, transform 0.3s ease;
}

.strength-card.is-expanded .strength-card-indicator {
  transform: rotate(180deg);
}

.strength-card.is-expanded .strength-card-panel {
  height: auto;
  opacity: 1;
  transform: translateY(0);
}

/**
 * About portrait flip card
 * focus-within flips to reveal alt-text (keyboard accessibility).
 * Hover triggers glitch instead of flip.
 */
.about-portrait-flip {
  perspective: 1400px;
}

.about-portrait-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.about-portrait-flip:focus-within .about-portrait-flip-inner {
  transform: rotateY(180deg);
}

/* === Portrait: border-trace load animation + RGB glitch hover === */

@property --portrait-trace {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}

/* Animated green border that draws itself on page load */
.portrait-border-animate::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2rem;
  padding: 1px;
  background: conic-gradient(
    from -90deg,
    var(--color-primary) var(--portrait-trace),
    transparent var(--portrait-trace)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: portrait-border-trace 2.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  pointer-events: none;
  z-index: 20;
}

/* Image fades in after the border finishes drawing */
.portrait-border-animate img {
  animation: portrait-image-reveal 0.5s ease both;
  animation-delay: 0.25s;
}

@keyframes portrait-border-trace {
  from { --portrait-trace: 0%; }
  to   { --portrait-trace: 100%; }
}

@keyframes portrait-image-reveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* After load animation ends, freeze opacity and disable the load animation */
.portrait-border-animate img.portrait-reveal-done {
  animation: none;
  opacity: 1;
}

/* RGB glitch pulse fires once on hover entry */
.about-portrait-flip:hover .portrait-border-animate img {
  opacity: 1;
  animation: portrait-glitch 0.42s step-start 1 forwards;
}

@keyframes portrait-glitch {
  0%   { filter: none;                                            transform: translate(0,    0   ); }
  12%  { filter: saturate(3)   hue-rotate(80deg)  contrast(1.3); transform: translate(-4px,  1px); }
  25%  { filter: saturate(2.5) hue-rotate(-60deg) contrast(1.2); transform: translate( 4px, -2px); }
  37%  { filter: saturate(4)   hue-rotate(160deg) contrast(1.4); transform: translate(-3px,  2px); }
  50%  { filter: saturate(3)   hue-rotate(-30deg) contrast(1.2); transform: translate( 3px, -1px); }
  62%  { filter: saturate(2)   hue-rotate(40deg);                transform: translate(-2px,  1px); }
  75%  { filter: saturate(1.5) hue-rotate(-20deg);               transform: translate( 1px,  0   ); }
  87%  { filter: saturate(1.2);                                   transform: translate(-1px,  0   ); }
  100% { filter: none;                                            transform: translate(0,    0   ); }
}

/* Reduced motion: skip animations, show final state immediately */
@media (prefers-reduced-motion: reduce) {
  .portrait-border-animate::before {
    animation: none;
    --portrait-trace: 100%;
  }
  .portrait-border-animate img {
    animation: none;
    opacity: 1;
  }
  .about-portrait-flip:hover .portrait-border-animate img {
    animation: none;
  }
}

.about-portrait-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.about-portrait-face-front {
  z-index: 2;
}

.about-portrait-face-back {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background-color: var(--color-card-bg);
  color: white;
  border: 1px solid var(--color-border);
  transform: rotateY(180deg);
}

.about-portrait-alt-text {
  margin: 0;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-medium);
  max-width: 90%;
}

/**
 * About page vertical timeline (My UX Journey)
 * Typography uses design tokens; layout matches former Tailwind grid.
 */
.about-timeline-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) minmax(1.75rem, auto) 1fr;
  column-gap: 1.25rem;
  row-gap: 0.5rem;
}

@media (min-width: 768px) {
  .about-timeline-row {
    column-gap: 1.25rem;
  }
}

.about-timeline-period {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  line-height: var(--line-height-none);
  transform: translateY(15px);
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-widest);
  color: #94a3b8;
}

.about-timeline-period--accent {
  color: var(--color-primary);
}

.about-timeline-rail {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  align-self: stretch;
  justify-self: center;
  width: 100%;
  min-width: 0;
  min-height: 100%;
}

.about-timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--color-border);
}

.about-timeline-marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0.375rem;
  z-index: 10;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-timeline-marker--featured {
  background-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(54, 226, 123, 0.4);
}

/* Same pulse as footer status dot (Tailwind animate-ping), without conflicting position utilities */
.about-timeline-marker-ping {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  opacity: 0.75;
  animation: about-timeline-marker-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
}

.about-timeline-marker--featured .about-timeline-icon {
  position: relative;
  z-index: 1;
}

@keyframes about-timeline-marker-ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-timeline-marker-ping {
    animation: none;
    opacity: 0;
  }
}

.about-timeline-marker--muted {
  background-color: var(--color-card-bg);
  border: 1px solid rgba(54, 226, 123, 0.3);
}

.about-timeline-icon {
  font-size: var(--font-size-sm);
  line-height: 1;
}

.about-timeline-icon--filled {
  font-variation-settings: "FILL" 1;
  color: var(--color-bg-darker);
}

.about-timeline-icon--outline {
  color: var(--color-primary);
}

.about-timeline-title {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
  color: #f1f5f9;
  min-width: 0;
  font-weight: var(--font-weight-medium);
}

.about-timeline-title--emphasis {
  font-weight: var(--font-weight-bold);
}

.about-timeline-spacer {
  grid-column: 1;
  grid-row: 2;
}

.about-timeline-subtitle {
  grid-column: 3;
  grid-row: 2;
  margin: 0;
  font-size: var(--font-size-md);
  line-height: var(--line-height-tight);
  color: #94a3b8;
}

/**
 * About page timeline — NNg badge gutter (Option C)
 * Desktop: badge floats in the unused space to the right of the max-w-2xl list.
 * Mobile: reflowed below the list via flex-direction column.
 */
.about-timeline-wrapper {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
}

.about-timeline-badge-col {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

/* Keep badge visible while scrolling through milestones */
.about-timeline-badge {
  position: sticky;
  top: 6rem;
  cursor: pointer;
  outline: none;
}

.about-timeline-badge-img {
  width: 150px;
  height: auto;
  display: block;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-timeline-badge:hover .about-timeline-badge-img,
.about-timeline-badge:focus-visible .about-timeline-badge-img {
  transform: rotate(6deg) scale(1.1);
}

.about-timeline-badge-callout {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.4rem 0.7rem;
  font-size: var(--font-size-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Small triangle pointer */
.about-timeline-badge-callout::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-border);
}

.about-timeline-badge:hover .about-timeline-badge-callout,
.about-timeline-badge:focus-visible .about-timeline-badge-callout {
  opacity: 1;
}

/* Mobile: reflow badge below the timeline list, right-aligned */
@media (max-width: 767px) {
  .about-timeline-wrapper {
    flex-direction: column;
  }

  .about-timeline-badge-col {
    justify-content: flex-center;
    width: 100%;
  }

  .about-timeline-badge {
    position: static;
  }
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrolling-wrapper {
    animation: scroll 40s linear infinite;
}
.scrolling-wrapper.is-paused {
    animation-play-state: paused;
}
.scrolling-wrapper .interest-card {
    transition: filter 280ms ease, opacity 280ms ease, transform 280ms ease;
}
.scrolling-wrapper:hover .interest-card {
    filter: blur(4px);
    opacity: 0.6;
    transform: scale(0.98);
}
.scrolling-wrapper:hover .interest-card:hover {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
}
@media (prefers-reduced-motion: reduce) {
    .scrolling-wrapper {
        animation-play-state: paused;
    }
    .scrolling-wrapper.interests-motion-opt-in {
        animation-play-state: running;
    }
    .scrolling-wrapper .interest-card {
        transition: none;
    }
    .scrolling-wrapper:hover .interest-card,
    .scrolling-wrapper:hover .interest-card:hover {
        filter: none;
        opacity: 1;
        transform: none;
    }
}
/* Scroll mode: suppress hover-blur so it doesn't fight the grab cursor */
.scrolling-wrapper.interests-scroll-mode:hover .interest-card,
.scrolling-wrapper.interests-scroll-mode:hover .interest-card:hover {
    filter: none;
    opacity: 1;
    transform: none;
}
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
