/* ============================================================
   Daniel Rinaldi, CV site
   Clean, readable body type + retro/pixel accents (header,
   footer, mascot, badges). Purple #841AAD lifted straight from
   the original LaTeX CV.
   ============================================================ */

:root {
  --purple:       #841AAD;
  --purple-dark:  #5c1080;
  --purple-mid:   #7c2ab8;
  --pink:         #ff5da2;
  --cyan:         #5be3ff;
  --gold:         #ffd54a;

  --bg:           #faf7f2;
  --bg-alt:       #f1e9fb;
  --surface:      #ffffff;
  --text:         #201a29;
  --text-dim:     #5b5468;
  --border:       #e4dcf5;

  --header-bg:    #1c1027;
  --header-text:  #f6eeff;

  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-pixel: 'Press Start 2P', 'Courier New', monospace;

  --radius: 10px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg:           #16101f;
  --bg-alt:       #1e1530;
  --surface:      #201830;
  --text:         #f1eaff;
  --text-dim:     #b7a9d6;
  --border:       #3a2b57;
  --header-bg:    #0d0714;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* Shown only in the printed / PDF output, see css/print.css */
.print-header { display: none; }

a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }

.section { max-width: 980px; margin: 0 auto; padding: 5rem 1.5rem; }
.section.alt { background: var(--bg-alt); max-width: none; }
.section.alt > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.section.alt > *:not(:last-child) { margin-bottom: 0; }

.section h2 {
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
}

.pixel-bullet {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: var(--purple);
  box-shadow:
    -4px 0 0 var(--gold),
    4px 0 0 var(--pink);
  image-rendering: pixelated;
}

/* ---------- pixel strip (header/footer accent) ---------- */
.pixel-strip {
  height: 6px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--purple) 0 8px,
    var(--pink) 8px 16px,
    var(--cyan) 16px 24px,
    var(--gold) 24px 32px
  );
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  color: var(--header-text);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--header-text) !important;
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none !important;
  white-space: nowrap;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--gold);
  display: inline-block;
}

.brand-blink { animation: blink 1.1s steps(1) infinite; color: var(--pink); }

.site-nav {
  display: flex;
  gap: 1.3rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--header-text) !important;
  opacity: 0.8;
  font-size: 0.9rem;
  font-weight: 600;
}
.site-nav a:hover { opacity: 1; text-decoration: none; border-bottom: 2px solid var(--pink); }

/* ---------- pixel buttons (retro bevel) ---------- */
.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  line-height: 1;
  color: var(--text) !important;
  background: var(--surface);
  border: 2px solid var(--text);
  box-shadow: 3px 3px 0 var(--purple);
  padding: 0.8em 1em;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  white-space: nowrap;
}
.pixel-btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--purple); }
.pixel-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--purple); }
.pixel-btn.primary { background: var(--purple); color: #fff !important; border-color: var(--purple-dark); box-shadow: 3px 3px 0 var(--gold); }
.pixel-btn.primary:hover { box-shadow: 2px 2px 0 var(--gold); }
.pixel-btn.small { font-size: 0.55rem; padding: 0.6em 0.8em; background: transparent; color: var(--header-text) !important; border-color: var(--header-text); box-shadow: 2px 2px 0 var(--pink); flex-shrink: 0; }
.pixel-btn.small:hover { box-shadow: 1px 1px 0 var(--pink); }

/* ============ HERO ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 1.5rem 5rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(132,26,173,0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(91,227,255,0.12), transparent 45%);
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.sparkle {
  position: absolute;
  color: var(--gold);
  font-size: 1.4rem;
  animation: twinkle 2.6s ease-in-out infinite;
}
.s1 { top: 8%; left: 6%; animation-delay: 0s; }
.s2 { top: 20%; right: 10%; animation-delay: 0.6s; color: var(--pink); }
.s3 { bottom: 15%; left: 12%; animation-delay: 1.2s; color: var(--cyan); }
.s4 { top: 60%; right: 6%; animation-delay: 0.3s; }
.s5 { bottom: 8%; right: 30%; animation-delay: 1.8s; color: var(--pink); }

.hero-grid {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

.mascot-wrap { position: relative; width: 144px; }
#wizard-canvas {
  width: 144px;
  height: 184px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.08));
  animation: float 3.2s ease-in-out infinite;
}
.mascot-shadow {
  width: 90px;
  height: 14px;
  margin: 0.4rem auto 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.18), transparent 70%);
  animation: shadow-pulse 3.2s ease-in-out infinite;
}
.mascot-bubble {
  position: absolute;
  top: -0.6rem;
  right: -1.6rem;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  background: var(--surface);
  border: 2px solid var(--text);
  padding: 0.35em 0.5em;
  box-shadow: 2px 2px 0 var(--text);
  opacity: 0;
  animation: bubble-pop 3.2s ease-in-out infinite;
}

.eyebrow {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--purple);
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 0.15em;
}

.role {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--purple);
  margin: 0 0 1rem;
}

.lede {
  max-width: 46ch;
  color: var(--text-dim);
  margin: 0 0 1.5rem;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.8rem; }
.tag {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.35em 0.85em;
  color: var(--text-dim);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.hero-photo-col { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.photo-frame {
  position: relative;
  width: 176px;
  height: 176px;
  padding: 6px;
  background: var(--surface);
  border: 2px solid var(--text);
  box-shadow: 5px 5px 0 var(--purple);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.frame-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border: 2px solid var(--text);
}
.frame-corner.tl { top: -6px; left: -6px; }
.frame-corner.tr { top: -6px; right: -6px; }
.frame-corner.bl { bottom: -6px; left: -6px; }
.frame-corner.br { bottom: -6px; right: -6px; }
.photo-caption { font-size: 0.8rem; color: var(--text-dim); margin: 0; }

/* ============ ABOUT ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p { margin: 0 0 1.1em; color: var(--text-dim); }
.about-text p:first-child::first-letter {
  font-size: 2.4em;
  font-weight: 800;
  color: var(--purple);
  float: left;
  line-height: 1;
  padding-right: 0.08em;
}

.about-side { display: flex; flex-direction: column; gap: 1rem; }
.fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
}
.fact-card h3 {
  font-size: 0.72rem;
  font-family: var(--font-pixel);
  color: var(--purple);
  margin-bottom: 0.9em;
}
.intj-badge {
  display: inline-block;
  font-weight: 800;
  color: var(--text) !important;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  padding: 0.4em 0.8em;
  border-radius: 6px;
}
.intj-badge span { font-weight: 500; opacity: 0.8; }

.stars-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; font-size: 0.9rem; }
.stars-row:last-child { margin-bottom: 0; }
.pixel-stars { display: inline-flex; gap: 3px; }
.pixel-star {
  width: 12px;
  height: 12px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: var(--border);
}
.pixel-star.filled { background: var(--gold); }

/* ============ SKILLS ============ */
.skills-grid { display: flex; flex-direction: column; gap: 1.2rem; }
.skill-bar { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 1rem; }
.skill-label { font-weight: 700; font-size: 0.9rem; }
.skill-num { font-family: var(--font-pixel); font-size: 0.65rem; color: var(--purple); text-align: right; }
.bar-track {
  height: 14px;
  background: var(--surface);
  border: 2px solid var(--text);
  padding: 2px;
  display: flex;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    var(--purple) 0 6px,
    var(--purple-mid) 6px 12px
  );
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ TIMELINE ============ */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-left: 2.2rem; margin-bottom: 2.4rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: 0;
  top: 5px;
  width: 12px;
  height: 12px;
  background: var(--purple);
  border: 2px solid var(--gold);
}
.timeline-item.current .timeline-dot {
  animation: dot-pulse 1.8s ease-in-out infinite;
}
.timeline-item.current .timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: -0.4rem 0 0 -0.2rem;
  box-shadow: 3px 3px 0 rgba(132,26,173,0.15);
}

.timeline-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6em;
  margin-bottom: 0.5em;
}
.level-badge {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: #fff;
  background: var(--purple);
  border: 2px solid var(--purple-dark);
  padding: 0.3em 0.5em;
  flex-shrink: 0;
}
.level-badge.save { background: var(--gold); color: #4a3400; border-color: #c9a218; }
.timeline-date {
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  color: var(--purple);
  margin: 0;
}
.duration { color: var(--text-dim); }
.current-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1a8f4c;
  background: rgba(26,143,76,0.12);
  border-radius: 999px;
  padding: 0.25em 0.7em;
}
.role-icon { margin-right: 0.3em; }
.timeline-content h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.15em; }
.timeline-org { font-weight: 600; color: var(--text-dim); margin: 0 0 0.6em; }
.timeline-content ul { margin: 0 0 0.7em; padding-left: 1.15em; color: var(--text-dim); }
.timeline-content li { margin-bottom: 0.3em; }

.stack-chips { display: flex; flex-wrap: wrap; gap: 0.4em; }
.stack-chips .chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25em 0.7em;
}
html[data-theme="dark"] .stack-chips .chip { color: var(--cyan); }
.stack-chips .chip.loot {
  color: #7a5a00;
  background: linear-gradient(135deg, var(--gold), #ffe9a3);
  border-color: #c9a218;
  font-weight: 700;
}
html[data-theme="dark"] .stack-chips .chip.loot { color: #4a3400; }

/* ============ FOOTER ============ */
.site-footer { background: var(--header-bg); color: var(--header-text); margin-top: 4rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 0 3rem; }

.footer-ticker {
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 0.7rem 0;
  margin-bottom: 2.5rem;
}
.ticker-track { display: inline-block; animation: ticker 26s linear infinite; }
.ticker-track span {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--cyan);
  padding-right: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 0 1.5rem;
  margin-bottom: 2.5rem;
}
.footer-block h3 {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--gold);
  margin-bottom: 0.9em;
}
.footer-block a, .footer-block p { display: block; color: var(--header-text); opacity: 0.85; margin-bottom: 0.4em; }
.footer-block a:hover { opacity: 1; }

.odometer { display: inline-flex; gap: 3px; }
.odometer span {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  background: #000;
  color: #4dff88;
  padding: 0.4em 0.35em;
  border-radius: 2px;
  border: 1px solid #333;
}

.footer-credit {
  text-align: center;
  font-size: 0.78rem;
  color: var(--header-text);
  opacity: 0.55;
  padding: 0 1.5rem;
  margin: 0;
}

/* ============ ANIMATIONS ============ */
@keyframes blink { 50% { opacity: 0; } }
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(132,26,173,0.35); }
  50% { box-shadow: 0 0 0 5px rgba(132,26,173,0); }
}
@keyframes twinkle { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shadow-pulse { 0%, 100% { transform: scaleX(1); opacity: 0.5; } 50% { transform: scaleX(0.75); opacity: 0.3; } }
@keyframes bubble-pop {
  0%, 15% { opacity: 0; transform: translateY(4px); }
  25%, 40% { opacity: 1; transform: translateY(0); }
  55%, 100% { opacity: 0; transform: translateY(4px); }
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .lede { max-width: 100%; }
  .tag-row, .cta-row { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .skill-bar { grid-template-columns: 90px 1fr 34px; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .header-inner { justify-content: space-between; }
  .section { padding: 3.5rem 1.2rem; }
}
