/* ==========================================================
   "FUN SIDE OF LIFE" TONE
   Driven by html[data-style="fun"], set by the inline head script
   (to avoid a flash) and by tones.js on switching. The Tone dock,
   toast and confetti are shared and live in tones.css.
   ========================================================== */

.nav-links a, .nav-cta { white-space: nowrap; }

/* Fun-only content is injected by fun-mode.js and hidden otherwise */
html:not([data-style="fun"]) .fun-only { display: none !important; }

/* ==========================================================
   FUN MODE — THEME TOKENS
   ========================================================== */
html[data-style="fun"] {
  --bg-void: #fff7e8;
  --bg-deep: #ffeed0;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fffdf5;
  --accent: #d63c2a;
  --accent-dim: rgba(214, 60, 42, 0.1);
  --accent-mid: rgba(214, 60, 42, 0.4);
  --gold: #5b3fd6;
  --gold-dim: #eee8ff;
  --text-primary: #1d1a2f;
  --text-secondary: #46415e;
  --text-tertiary: #6a6582;
  --border: rgba(29, 26, 47, 0.14);
  --border-bright: #1d1a2f;
  --radius: 18px;
  --radius-sm: 12px;

  --ink: #1d1a2f;
  --sun: #ffd23f;
  --mint: #4ee0a5;
  --sky: #7fd6f5;
  --grape: #b9a6ff;
  --coral: #ff7a6b;
  --pop: 5px 5px 0 var(--ink);
  --pop-hover: 8px 8px 0 var(--ink);
}

html[data-style="fun"] body { background-color: var(--bg-void); }
html[data-style="fun"] body::before {
  background-image:
    radial-gradient(ellipse 70% 50% at 85% -5%, rgba(255,210,63,0.35) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 30%, rgba(127,214,245,0.18) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='14' cy='14' r='1' fill='rgba(29,26,47,0.09)'/%3E%3C/svg%3E");
}
html[data-style="fun"] ::-webkit-scrollbar { width: 8px; }
html[data-style="fun"] ::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 4px; }
html[data-style="fun"] ::selection { background: var(--sun); color: var(--ink); }

/* Typography */
html[data-style="fun"] h1,
html[data-style="fun"] h2,
html[data-style="fun"] h3,
html[data-style="fun"] h4,
html[data-style="fun"] .nav-logo,
html[data-style="fun"] .footer-logo,
html[data-style="fun"] .cap-title,
html[data-style="fun"] .timeline-role,
html[data-style="fun"] .proj-title,
html[data-style="fun"] .rec-name,
html[data-style="fun"] .metric-value,
html[data-style="fun"] .contact-headline {
  font-family: 'Bricolage Grotesque', 'Syne', sans-serif;
  letter-spacing: -0.03em;
}
html[data-style="fun"] .section-title { font-weight: 800; }

/* Nav */
html[data-style="fun"] #nav.scrolled {
  background: rgba(255, 247, 232, 0.92);
  border-bottom: 2px solid var(--ink);
}
html[data-style="fun"] .logo-dot { background: var(--coral); animation: fun-wobble 2.4s ease-in-out infinite; }
html[data-style="fun"] .nav-links a::after { height: 3px; background: var(--sun); bottom: -4px; }

/* Buttons */
html[data-style="fun"] .btn,
html[data-style="fun"] .btn-visit {
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  border-radius: 100px; font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
html[data-style="fun"] .btn-primary { background: var(--sun); color: var(--ink); }
html[data-style="fun"] .btn-primary:hover { background: #ffdc5e; }
html[data-style="fun"] .btn-ghost { background: #fff; color: var(--ink); }
html[data-style="fun"] .btn-visit { background: var(--mint); color: var(--ink); }
html[data-style="fun"] .btn:hover,
html[data-style="fun"] .btn-visit:hover {
  transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); color: var(--ink);
}
html[data-style="fun"] .btn:active,
html[data-style="fun"] .btn-visit:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* Pills → stickers */
html[data-style="fun"] .tag-pill {
  background: #fff; color: var(--ink); border: 1.5px solid var(--ink);
  font-size: 10.5px;
}
html[data-style="fun"] .tag-pill:nth-child(3n+1) { background: #fff3c4; }
html[data-style="fun"] .tag-pill:nth-child(3n+2) { background: #dcf8ec; }
html[data-style="fun"] .tag-pill:nth-child(3n) { background: #e3f5fd; }
html[data-style="fun"] .tag-pill.gold { background: var(--gold-dim); color: #3b2a99; }
html[data-style="fun"] .hero-credentials .tag-pill:nth-child(odd) { transform: rotate(-1.5deg); }
html[data-style="fun"] .hero-credentials .tag-pill:nth-child(even) { transform: rotate(1.2deg); }
html[data-style="fun"] .tag-pill.fun-sticker { background: var(--coral); color: #fff; }

/* Eyebrows → tilted labels */
html[data-style="fun"] .section-eyebrow {
  display: inline-flex; color: var(--ink);
  background: var(--sun); border: 2px solid var(--ink);
  padding: 5px 12px; border-radius: 6px; transform: rotate(-2deg);
  box-shadow: 3px 3px 0 var(--ink);
}
html[data-style="fun"] .section-eyebrow::before { display: none; }
html[data-style="fun"] .section-header .section-eyebrow,
html[data-style="fun"] .timeline-sticky .section-eyebrow { margin-bottom: 26px; }

/* Hero */
html[data-style="fun"] .hero-badge {
  background: #fff; border: 2px solid var(--ink); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
html[data-style="fun"] .hero-badge-dot { background: var(--mint); }
html[data-style="fun"] .hero-headline em {
  background: linear-gradient(transparent 58%, var(--sun) 58%, var(--sun) 92%, transparent 92%);
  -webkit-background-clip: border-box; background-clip: border-box;
  -webkit-text-fill-color: currentColor; color: var(--ink);
  padding: 0 4px;
}
html[data-style="fun"] .hero-sub { color: var(--text-secondary); font-weight: 400; }

/* Metrics → ink ribbon */
html[data-style="fun"] #metrics {
  background: var(--ink); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
}
html[data-style="fun"] .metric-item { border-right-color: rgba(255,255,255,0.12); }
html[data-style="fun"] .metric-value { color: var(--sun); }
html[data-style="fun"] .metric-item:nth-child(2) .metric-value { color: var(--mint); }
html[data-style="fun"] .metric-item:nth-child(3) .metric-value { color: var(--sky); }
html[data-style="fun"] .metric-item:nth-child(4) .metric-value { color: var(--grape); }
html[data-style="fun"] .metric-item:nth-child(5) .metric-value { color: var(--coral); }
html[data-style="fun"] .metric-label { color: #d8d3ee; text-transform: none; font-size: 12px; letter-spacing: 0.01em; }
@media (max-width: 900px) {
  html[data-style="fun"] .metric-item:nth-child(4),
  html[data-style="fun"] .metric-item:nth-child(5) { border-top-color: rgba(255,255,255,0.12); }
}
@media (max-width: 600px) {
  html[data-style="fun"] .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 0; }
  html[data-style="fun"] .metric-item { padding: 0 10px; min-width: 0; border: none !important; padding-top: 0 !important; }
  html[data-style="fun"] .metric-item:nth-child(5) { grid-column: 1 / -1; }
}

/* Shared "pop" card treatment */
html[data-style="fun"] .timeline-card,
html[data-style="fun"] .insight-card,
html[data-style="fun"] .rec-card,
html[data-style="fun"] .channel-card,
html[data-style="fun"] .proj-figure {
  border: 2px solid var(--ink); box-shadow: var(--pop);
}
html[data-style="fun"] .timeline-card:hover,
html[data-style="fun"] .insight-card:hover,
html[data-style="fun"] .rec-card:hover {
  border-color: var(--ink); transform: translate(-3px, -3px); box-shadow: var(--pop-hover);
}
html[data-style="fun"] .channel-card:hover { border-color: var(--ink); transform: translate(-3px, -3px); box-shadow: var(--pop-hover); }

/* Capabilities */
html[data-style="fun"] .caps-grid { gap: 22px; border: none; overflow: visible; }
html[data-style="fun"] .cap-card {
  background: #fff; border: 2px solid var(--ink) !important; border-radius: var(--radius);
  box-shadow: var(--pop); transition: transform 0.2s, box-shadow 0.2s;
}
html[data-style="fun"] .cap-card::before { display: none; }
html[data-style="fun"] .cap-card:hover { transform: translate(-3px, -3px) rotate(-0.4deg); box-shadow: var(--pop-hover); background: #fff; }
html[data-style="fun"] .cap-icon { border: 2px solid var(--ink); background: var(--sun); border-radius: 14px; }
html[data-style="fun"] .cap-card:nth-child(2) .cap-icon { background: var(--mint); }
html[data-style="fun"] .cap-card:nth-child(3) .cap-icon { background: var(--sky); }
html[data-style="fun"] .cap-card:nth-child(4) .cap-icon { background: var(--grape); }
html[data-style="fun"] .cap-card:hover .cap-icon { transform: rotate(-12deg) scale(1.12); }

/* Timeline */
html[data-style="fun"] .timeline-track::before {
  width: 0; background: none; border-left: 3px dashed var(--ink); opacity: 0.35;
}
html[data-style="fun"] .timeline-dot {
  width: 14px; height: 14px; left: -46px; background: #fff; border: 2px solid var(--ink);
}
html[data-style="fun"] .timeline-entry.current .timeline-dot {
  background: var(--sun); border-color: var(--ink); box-shadow: 0 0 0 5px rgba(255,210,63,0.35);
}
html[data-style="fun"] .current-badge { background: var(--mint); color: var(--ink); border: 1.5px solid var(--ink); }
html[data-style="fun"] .timeline-outcomes li { border-bottom-color: rgba(29,26,47,0.07); }

/* Social links */
html[data-style="fun"] .social-links a { background: #fff; border: 2px solid var(--ink); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
html[data-style="fun"] .social-links a:hover { background: var(--sun); color: var(--ink); border-color: var(--ink); }

/* Lately notes */
html[data-style="fun"] .note-card { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
html[data-style="fun"] .note-card:hover { border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
html[data-style="fun"] .note-card:nth-child(odd) { transform: rotate(-0.4deg); }
html[data-style="fun"] .note-card:nth-child(even) { transform: rotate(0.4deg); }
html[data-style="fun"] .note-avatar { background: var(--sun); border: 2px solid var(--ink); color: var(--ink); }
html[data-style="fun"] #lately { border-top: 2px solid var(--ink); }

/* Insights */
html[data-style="fun"] .insight-card.featured { background: #fff3c4; border-color: var(--ink); }
html[data-style="fun"] .insight-arrow { background: #fff; border: 2px solid var(--ink); color: var(--ink); }
html[data-style="fun"] .insight-card:hover .insight-arrow { background: var(--sun); color: var(--ink); }

/* Projects */
html[data-style="fun"] .proj-row:nth-child(odd) .proj-figure { transform: rotate(-1deg); }
html[data-style="fun"] .proj-row:nth-child(even) .proj-figure { transform: rotate(1deg); }
html[data-style="fun"] .proj-icon { background: var(--sun); border: 2px solid var(--ink); }
html[data-style="fun"] .proj-thumb-mini { border: 2px solid var(--ink); }
html[data-style="fun"] .proj-thumb-mini.active { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
html[data-style="fun"] .proj-features li { border-bottom-color: rgba(29,26,47,0.07); }

/* Recommendations */
html[data-style="fun"] .rec-avatar { background: var(--sky); border: 2px solid var(--ink); color: var(--ink); }
html[data-style="fun"] .rec-card:nth-child(3n+2) .rec-avatar { background: var(--mint); }
html[data-style="fun"] .rec-card:nth-child(3n) .rec-avatar { background: var(--grape); }
html[data-style="fun"] .rec-quote::before { content: '“'; font-family: 'Bricolage Grotesque', serif; font-size: 40px; line-height: 0; vertical-align: -14px; margin-right: 2px; color: var(--accent); }

/* Contact & footer */
html[data-style="fun"] .contact-accent-line { height: 8px; width: 64px; background: var(--sun); border: 2px solid var(--ink); border-radius: 6px; }
html[data-style="fun"] .channel-icon { background: var(--sun); border: 2px solid var(--ink); }
html[data-style="fun"] .channel-card:nth-child(2) .channel-icon { background: var(--sky); }
html[data-style="fun"] .channel-card:nth-child(3) .channel-icon { background: var(--mint); }
html[data-style="fun"] .channel-card:nth-child(4) .channel-icon { background: var(--grape); }
html[data-style="fun"] #contact,
html[data-style="fun"] #timeline,
html[data-style="fun"] #projects { border-top: 2px solid var(--ink); }
html[data-style="fun"] .contact-layout { border-bottom: 2px solid var(--ink); }

/* ==========================================================
   FUN-ONLY CONTENT
   ========================================================== */

/* Handwritten quips on timeline / project cards */
.fun-quip {
  font-family: 'Caveat', cursive; font-size: 23px; line-height: 1.2;
  color: var(--accent); margin: 2px 0 16px; transform: rotate(-1deg);
  display: block;
}
.fun-quip::before { content: '✎ '; font-size: 18px; }
.proj-content .fun-quip { margin-top: -6px; }

/* Hero sticky-note wall (desktop only) */
#hero > .container { position: relative; }
.sticky-wall {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 300px; height: 380px; pointer-events: none;
}
.sticky {
  position: absolute; width: 132px; height: 120px; padding: 14px;
  font-family: 'Caveat', cursive; font-size: 24px; line-height: 1.05; color: var(--ink);
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; text-align: center;
  animation: sticky-in 0.6s cubic-bezier(.2,1.4,.4,1) both;
}
.sticky::before {
  content: ''; position: absolute; top: -9px; left: 50%; width: 46px; height: 16px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255,255,255,0.65); border: 1px solid rgba(29,26,47,0.2);
}
.sticky.s1 { background: var(--sun); top: 0; left: 10px; transform: rotate(-6deg); animation-delay: 0.15s; }
.sticky.s2 { background: var(--mint); top: 20px; left: 160px; transform: rotate(5deg); animation-delay: 0.3s; }
.sticky.s3 { background: var(--sky); top: 150px; left: 40px; transform: rotate(3deg); animation-delay: 0.45s; }
.sticky.s4 { background: var(--coral); top: 170px; left: 172px; transform: rotate(-4deg); animation-delay: 0.6s; }
.sticky.s5 { background: var(--grape); top: 280px; left: 100px; transform: rotate(-2deg); animation-delay: 0.75s; }
@keyframes sticky-in { from { opacity: 0; translate: 0 -30px; } to { opacity: 1; translate: 0 0; } }
@media (min-width: 1181px) {
  html[data-style="fun"] #hero > .container { width: 100%; }
  html[data-style="fun"] .hero-inner { max-width: 760px; }
  html[data-style="fun"] .hero-headline { font-size: clamp(44px, 4.6vw, 64px); }
}
@media (max-width: 1180px) { .sticky-wall { display: none; } }

/* "Numbers that didn't make the CV" */
.fun-stats { padding: 72px 0 24px; position: relative; z-index: 1; }
.fun-stats-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 28px; }
.fun-stats-head h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; }
.fun-stats-head p { font-family: 'Caveat', cursive; font-size: 22px; color: var(--accent); }
.fun-stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.fun-stat {
  background: #fff; border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink); padding: 22px 18px;
}
.fun-stat:nth-child(odd) { transform: rotate(-1deg); }
.fun-stat:nth-child(even) { transform: rotate(1deg); }
.fun-stat-emoji { font-size: 26px; margin-bottom: 6px; }
.fun-stat-num { font-family: 'Bricolage Grotesque', sans-serif; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; margin-bottom: 6px; }
.fun-stat-label { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.fun-stat.real { background: #fff3c4; }
.fun-stat .real-tag {
  display: inline-block; margin-top: 8px; font-family: 'DM Mono', monospace; font-size: 9.5px;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 100px;
  background: var(--mint); border: 1.5px solid var(--ink);
}
@media (max-width: 900px) { .fun-stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* Meme break */
.meme-break { padding: 40px 0 120px; position: relative; z-index: 1; }
.meme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.meme {
  background: #fff; border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: var(--pop); overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.meme:nth-child(3n+1) { transform: rotate(-0.8deg); }
.meme:nth-child(3n+3) { transform: rotate(0.8deg); }
.meme:hover { transform: translate(-3px, -3px) rotate(0deg); box-shadow: var(--pop-hover); }
.meme-panel { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.meme figcaption {
  border-top: 2px solid var(--ink); padding: 12px 18px;
  font-family: 'Caveat', cursive; font-size: 21px; line-height: 1.15; background: #fffaf0;
}
.meme-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 17px; margin-bottom: 12px; letter-spacing: -0.02em; }

/* Meme: expanding brain */
.brain-row {
  display: grid; grid-template-columns: 1fr 64px; align-items: stretch;
  border: 2px solid var(--ink); margin-top: -2px;
}
.brain-row span { padding: 10px 12px; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; border-right: 2px solid var(--ink); }
.brain-row i { font-style: normal; font-size: 28px; display: flex; align-items: center; justify-content: center; }
.brain-row.b1 i { background: #e9e6f3; filter: grayscale(0.6); }
.brain-row.b2 i { background: #cfe9ff; }
.brain-row.b3 i { background: radial-gradient(circle, #fff6b0 0%, #7fd6f5 75%); }
.brain-row.b4 i { background: radial-gradient(circle, #fff 0%, #ffd23f 45%, #ff7a6b 100%); filter: drop-shadow(0 0 6px #ffd23f); }
.brain-row.b4 span { font-weight: 700; }

/* Meme: plan vs reality */
.plan-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-vs div { border: 2px solid var(--ink); border-radius: 10px; padding: 8px; background: #fffaf0; }
.plan-vs b { display: block; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.plan-vs svg { width: 100%; height: auto; display: block; }

/* Meme: pie chart */
.pie-wrap { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; }
.pie {
  width: 120px; height: 120px; border-radius: 50%; border: 2px solid var(--ink);
  background: conic-gradient(
    var(--coral) 0 34%, var(--sky) 34% 54%, var(--grape) 54% 70%,
    var(--mint) 70% 92%, var(--sun) 92% 100%);
}
.pie-legend { list-style: none; font-size: 12.5px; line-height: 1.35; }
.pie-legend li { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.pie-legend i { flex: 0 0 12px; height: 12px; margin-top: 2px; border: 1.5px solid var(--ink); border-radius: 3px; }

/* Meme: nobody / me */
.nobody p { font-size: 15px; margin-bottom: 8px; }
.nobody p b { font-weight: 700; }
.nobody .big {
  margin-top: 8px; font-family: 'Bricolage Grotesque', sans-serif; font-size: 20px; font-weight: 800; line-height: 1.2;
  background: var(--sun); border: 2px solid var(--ink); padding: 10px 12px; border-radius: 10px; transform: rotate(-1deg);
}

/* Meme: two buttons */
.two-buttons { display: flex; justify-content: center; gap: 14px; margin-bottom: 10px; }
.two-buttons span {
  width: 120px; padding: 14px 8px; border-radius: 14px; text-align: center;
  background: var(--coral); color: #fff; font-weight: 700; font-size: 13px; line-height: 1.25;
  border: 2px solid var(--ink); box-shadow: 0 5px 0 #a8382d;
}
.two-buttons span:nth-child(1) { transform: rotate(-4deg); }
.two-buttons span:nth-child(2) { transform: rotate(4deg); }
.sweat { font-size: 54px; text-align: center; line-height: 1; animation: fun-wobble 1.6s ease-in-out infinite; }

/* Meme: this is fine */
.fine { text-align: center; }
.fine .flames { font-size: 30px; letter-spacing: 4px; }
.fine .mug { font-size: 58px; line-height: 1.1; }
.fine .bubble {
  display: inline-block; margin-top: 6px; background: #fff; border: 2px solid var(--ink);
  border-radius: 14px; padding: 6px 14px; font-family: 'Caveat', cursive; font-size: 26px;
}
.fine .board { margin-top: 12px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.fine .board span { font-family: 'DM Mono', monospace; font-size: 10px; padding: 3px 7px; border: 1.5px solid var(--ink); border-radius: 4px; background: #fff3c4; }

@media (max-width: 900px) {
  .meme-grid { grid-template-columns: 1fr; }
  .meme, .meme:nth-child(n) { transform: none; }
}

@keyframes fun-wobble {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-style="fun"] *, .sticky, .sweat { animation: none !important; }
}
