/* ============================================================
   Sivakumar — Personal Portfolio
   Shared stylesheet for all pages — dark "sunset" theme (dark only,
   no light-mode toggle). Sections: Tokens, Reset, Light Leaks,
   Float Cards, Reveal, Loader, Cursor, Header/Nav, Buttons/Cards,
   Hero + Photo Reveal, Journey, Career Timeline, Certifications,
   Toolkit Carousel, Projects, Editing, Blog, Contact, Footer,
   Responsive
   ============================================================ */

/* ---------- 1. Design tokens (dark sunset — the only theme) ---------- */
:root {
  --bg-1: #0d0b0a;
  --bg-2: #15110e;
  --bg: #0d0b0a;
  --panel: #18130f;
  --card: #1b1612;
  --text: #f3ece2;
  --muted: #b9a998;
  --accent: #f5b83d;      /* golden-yellow */
  --accent-dark: #ff6a2b; /* sunset-orange */
  --accent-soft: rgba(245, 184, 61, 0.13);
  --ink: #1a1206;         /* dark text used on top of bright gold/orange */
  --line: rgba(245, 184, 61, 0.16);
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 184, 61, 0.06);
  --success: #4fc98a;
  --error: #ff6b5b;

  --level-line: rgba(245, 184, 61, 0.32);
  --level-glow: #ffcf7a;

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 10px;

  color-scheme: dark;
}

/* ---------- 2. Reset ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1)) fixed;
  color: var(--text);
  line-height: 1.7;
  position: relative;
}

body.is-loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }

h1, h2, h3, h4 {
  margin-top: 0;
  font-family: "Playfair Display", serif;
  line-height: 1.15;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); margin-bottom: 1.2rem; }
h2 { font-size: clamp(1.9rem, 3vw, 2.8rem); }
h3 { font-size: 1.3rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.lead { max-width: 640px; font-size: 1.08rem; color: var(--muted); }
.section-heading { margin-bottom: 1.8rem; }
.section-heading h2 { width: min(700px, 100%); }
.section-heading.split { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }

section { padding: 3.5rem 0; position: relative; }
section.tight { padding: 2rem 0; }

.skip-link {
  position: absolute;
  left: -999px; top: auto;
  background: var(--accent);
  color: var(--ink);
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  z-index: 999;
  font-weight: 700;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.no-js .reveal { opacity: 1 !important; transform: none !important; }
.no-js #loader { display: none !important; }
.no-js .cursor-firefly { display: none !important; }

/* ---------- 3. Ambient light leaks (fixed, decorative, behind content) ---------- */
.light-leak {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.55;
  will-change: transform;
}
.leak-1 {
  top: -12%; left: -10%;
  width: 46vw; height: 46vw;
  background: radial-gradient(circle, rgba(245, 184, 61, 0.5), transparent 70%);
  animation: leakDrift1 26s ease-in-out infinite alternate;
}
.leak-2 {
  bottom: -18%; right: -12%;
  width: 52vw; height: 52vw;
  background: radial-gradient(circle, rgba(255, 106, 43, 0.42), transparent 70%);
  animation: leakDrift2 32s ease-in-out infinite alternate;
}
.leak-3 {
  top: 38%; left: 50%;
  width: 38vw; height: 38vw;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.28), transparent 72%);
  animation: leakDrift3 22s ease-in-out infinite alternate;
}
@keyframes leakDrift1 { 0% { transform: translate(0, 0); } 100% { transform: translate(4vw, 3vw); } }
@keyframes leakDrift2 { 0% { transform: translate(0, 0); } 100% { transform: translate(-3vw, -4vw); } }
@keyframes leakDrift3 { 0% { transform: translate(-50%, 0); } 100% { transform: translate(-46%, 2vw); } }

@media (prefers-reduced-motion: reduce) {
  .light-leak { animation: none; }
}

/* ---------- 4. Float cards (reusable, used across the home page) ---------- */
.float-card {
  position: relative;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(245, 184, 61, 0.10),
    0 0 90px rgba(255, 106, 43, 0.06);
  animation: floatCard 6s ease-in-out infinite;
  transition: box-shadow 0.35s ease;
}
.float-card:hover {
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.55),
    0 0 55px rgba(245, 184, 61, 0.22),
    0 0 130px rgba(255, 106, 43, 0.14);
}
.float-card:nth-of-type(2n) { animation-delay: -2s; }
.float-card:nth-of-type(3n) { animation-delay: -4s; }
@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .float-card { animation: none; }
}

/* ---------- 5. Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 6. Firefly (shared by the loader + custom cursor) ----------
   Built entirely in SVG/CSS — a small glowing insect: two fluttering
   wings, a dark body, and a bioluminescent "light" at the back of the
   abdomen that flashes on and off like a real firefly. */
.firefly { position: relative; width: 100%; height: 100%; }
.firefly-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.firefly-wing ellipse { fill: rgba(255, 255, 255, 0.5); }
.firefly-wing.wing-l { transform-origin: 20px 17px; animation: wingFlapL 0.14s ease-in-out infinite; }
.firefly-wing.wing-r { transform-origin: 20px 17px; animation: wingFlapR 0.14s ease-in-out infinite; }
@keyframes wingFlapL { 0%, 100% { transform: rotate(-10deg) scaleY(1); } 50% { transform: rotate(-32deg) scaleY(0.55); } }
@keyframes wingFlapR { 0%, 100% { transform: rotate(10deg) scaleY(1); }  50% { transform: rotate(32deg) scaleY(0.55); } }
.firefly-body { fill: #2b2118; }
.firefly-stripe { fill: #f5c344; }
.firefly-head { fill: #2b2118; }
.firefly-antenna { stroke: #2b2118; stroke-width: 0.9; stroke-linecap: round; }

/* The glowing "back" light — a plain div (not SVG) so its box-shadow
   can bloom softly without relying on SVG blur filters. */
.firefly-light {
  position: absolute;
  left: 50%; top: 68%;
  width: 24%; height: 24%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ffe27a;
  animation: fireflyBlink 2.2s ease-in-out infinite;
}
@keyframes fireflyBlink {
  0%   { opacity: 0.12; box-shadow: 0 0 2px 1px rgba(255, 226, 122, 0.3); }
  8%   { opacity: 1;    box-shadow: 0 0 10px 5px rgba(255, 226, 122, 1), 0 0 22px 11px rgba(255, 196, 61, 0.55); }
  20%  { opacity: 0.14; box-shadow: 0 0 2px 1px rgba(255, 226, 122, 0.3); }
  100% { opacity: 0.12; box-shadow: 0 0 2px 1px rgba(255, 226, 122, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
  .firefly-wing, .firefly-light { animation: none; opacity: 1; box-shadow: 0 0 8px 4px rgba(255, 226, 122, 0.7); }
}

/* ---------- 7. Loader: firefly flying along a loading bar ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  transition: opacity 0.5s ease;
}
#loader.is-hidden { opacity: 0; pointer-events: none; }

.loading-bar-wrap { position: relative; width: min(280px, 72vw); padding: 1.6rem 0; }
.loading-bar-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(245, 184, 61, 0.14);
  box-shadow: inset 0 0 0 1px rgba(245, 184, 61, 0.1);
  overflow: visible;
}
.loading-bar-glow {
  position: absolute;
  inset: -10px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(245, 184, 61, 0.25), transparent);
  filter: blur(10px);
  animation: barGlowSweep 2.2s linear infinite;
}
@keyframes barGlowSweep {
  0%   { transform: translateX(-40%); opacity: 0.4; }
  50%  { opacity: 0.9; }
  100% { transform: translateX(40%); opacity: 0.4; }
}

.loader-firefly {
  position: absolute;
  top: 50%;
  left: 0;
  width: 30px; height: 30px;
  transform: translateY(-58%);
  animation: fireflyFly 2.4s linear infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}
@keyframes fireflyFly {
  0%   { left: 0%; }
  100% { left: calc(100% - 30px); }
}

.loader-text {
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: flex;
  gap: 0.15rem;
}
.loader-text .dots span { animation: dotBlink 1.4s infinite; opacity: 0.2; }
.loader-text .dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-text .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .loader-firefly, .loading-bar-glow { animation: none; left: 50%; transform: translate(-50%, -58%); }
}

/* ---------- 8. Custom cursor: firefly (desktop only) ----------
   Idle (no mouse movement): a gentle hover bob, wings and light keep
   going the whole time. Moving: the hover stops and the firefly tilts
   toward the direction of movement instead (--tilt, set by main.js). */
.cursor-firefly {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 34px; height: 34px;
  pointer-events: none;
  z-index: 2147483647; /* above every modal/overlay */
  transform: translate(var(--cx, 50vw), var(--cy, 50vh)) scale(var(--cscale, 1));
  will-change: transform;
}
body.custom-cursor-active .cursor-firefly { display: block; }
body.custom-cursor-active,
body.custom-cursor-active a,
body.custom-cursor-active button,
body.custom-cursor-active input,
body.custom-cursor-active textarea,
body.custom-cursor-active label {
  cursor: none;
}
.cursor-firefly.hover { --cscale: 1.3; }

.cursor-firefly .firefly {
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.15s ease-out;
}
.cursor-firefly.idle .firefly {
  animation: fireflyHover 2.4s ease-in-out infinite;
  transition: none;
}
@keyframes fireflyHover {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-5px) rotate(0deg); }
}

@media (hover: none), (pointer: coarse) {
  .cursor-firefly { display: none !important; }
}

/* ---------- 9. Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(13, 11, 10, 0.55);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.nav { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 1rem; }
.brand { font-family: "Playfair Display", serif; font-size: 1.6rem; font-weight: 700; color: var(--text); }

.main-nav { display: flex; gap: 1.9rem; color: var(--muted); font-size: 0.95rem; }
.main-nav a { position: relative; padding: 0.3rem 0; }
.main-nav a:hover { color: var(--accent); }
.main-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.main-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 2px;
}

.nav-actions { display: flex; align-items: center; gap: 0.9rem; }
.brand-monogram {
  font-family: "Times New Roman", Times, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
  line-height: 1;
  user-select: none;
}

.sound-toggle, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  cursor: pointer; transition: 0.2s ease; font-size: 1.05rem;
}
.sound-toggle:hover, .icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }

.hamburger {
  display: none; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; position: relative;
}
.hamburger span, .hamburger::before, .hamburger::after {
  content: ""; position: absolute; left: 11px; right: 11px; height: 2px;
  background: var(--text); transition: 0.25s ease;
}
.hamburger::before { top: 15px; }
.hamburger span { top: 20px; }
.hamburger::after { top: 25px; }
.hamburger.is-active::before { transform: translateY(5px) rotate(45deg); }
.hamburger.is-active::after { transform: translateY(-5px) rotate(-45deg); }
.hamburger.is-active span { opacity: 0; }

.mobile-nav {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(320px, 80vw);
  background: var(--panel);
  box-shadow: -14px 0 40px rgba(0, 0, 0, 0.4);
  z-index: 600;
  padding: 6rem 2rem 2rem;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  display: flex; flex-direction: column; gap: 1.6rem;
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav a { font-size: 1.2rem; font-family: "Playfair Display", serif; color: var(--text); }
.mobile-nav a[aria-current="page"] { color: var(--accent); }
.nav-scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 550;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.nav-scrim.is-open { opacity: 1; pointer-events: auto; }

/* ---------- 10. Buttons / badges / cards / tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.9rem 1.5rem; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: 0.25s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(255, 106, 43, 0.18);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(245, 184, 61, 0.4), 0 14px 34px rgba(255, 106, 43, 0.35), 0 0 40px rgba(245, 184, 61, 0.3);
}
.btn-secondary { border-color: var(--line); background: transparent; color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.78rem; font-weight: 700; padding: 0.45rem 0.85rem; border-radius: 999px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 0.3rem 0.7rem; border-radius: 999px;
}

/* ---------- 11. Hero + photo reveal ---------- */
.hero { padding: 4.5rem 0 3rem; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 3rem; }
.hero-copy .greeting { color: var(--accent); font-weight: 600; margin-bottom: 0.3rem; }
.hero-copy h1 { margin-bottom: 0.4rem; }
.hero-copy .role { font-size: 1.15rem; color: var(--muted); font-weight: 600; margin-bottom: 1rem; }
.hero-copy .lead { margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-visual { display: flex; justify-content: center; }
.profile-card { width: min(100%, 400px); padding: 1rem; }
.profile-photo-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  min-height: 420px;
  background: linear-gradient(160deg, var(--accent-soft), var(--line));
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.profile-photo-frame img {
  width: 100%; height: 100%; object-fit: cover; min-height: 420px;
  filter: blur(14px);
  transition: filter 1s ease;
}
.profile-photo-frame.is-revealed img { filter: blur(0); }
.avatar-fallback {
  width: 100%; min-height: 420px; display: none;
  align-items: center; justify-content: center;
  font-family: "Playfair Display", serif; font-size: 4rem; font-weight: 700; color: var(--accent);
}

.photo-hint {
  position: absolute;
  left: 50%; bottom: 1rem;
  transform: translateX(-50%);
  background: rgba(13, 11, 10, 0.72);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.photo-hint.is-visible { opacity: 1; animation: hintPulse 1.8s ease-in-out infinite; }
@keyframes hintPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.04); }
}

.butterfly-layer { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.butterfly {
  position: absolute;
  left: var(--bx); top: var(--by);
  width: 32px; height: 32px;
  opacity: 0;
  color: var(--bcolor, #ffb14a);
  animation: butterflyFly 1.5s ease-out forwards;
}
.butterfly svg { width: 100%; height: 100%; }
.butterfly .wing { fill: currentColor; animation: flap 0.16s ease-in-out infinite; }
.butterfly .wing-l { transform-origin: 62% 50%; }
.butterfly .wing-r { transform-origin: 38% 50%; }
@keyframes flap { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.4); } }
@keyframes butterflyFly {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.5) rotate(0deg); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), -150px) scale(1) rotate(var(--rot)); }
}
@media (prefers-reduced-motion: reduce) {
  .photo-hint.is-visible { animation: none; }
  .butterfly .wing { animation: none; }
}

/* ---------- 12. Journey story ---------- */
.journey-box { padding: 2.2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.journey-box p { color: var(--muted); margin: 0 0 1rem; }
.journey-box p:last-child { margin-bottom: 0; }
.journey-highlights { display: grid; gap: 0.8rem; align-content: start; }
.journey-highlights li {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: var(--accent-soft); border-radius: 14px; padding: 0.85rem 1rem;
  font-size: 0.92rem;
}
.journey-highlights .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 0.5rem; flex-shrink: 0;
}

/* ---------- 13. Career timeline: continuous climb ---------- */
.career-section { position: relative; }
.timeline-grid { display: grid; grid-template-columns: 130px 1fr; gap: 2rem; }

.level-map { position: relative; }
.level-path {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3px;
  background: repeating-linear-gradient(to bottom, var(--level-line) 0 10px, transparent 10px 18px);
  transform: translateX(-50%);
  border-radius: 4px;
}
.level-marker {
  position: absolute; left: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--level-line);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.level-marker.is-active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

/* A glowing abstract gem climbs the ladder instead of a literal figure
   — no face or limbs to get wrong, just a faceted badge with a spark
   inside and a soft pulsing glow (same box-shadow-glow technique as
   the firefly's light). Built entirely in SVG/CSS by career.js. */
.tester-character {
  position: absolute;
  left: 50%;
  width: 46px;
  transform: translate(-50%, -100%);
}
.tester-character svg { width: 100%; display: block; overflow: visible; }
.gem-shape { transform-origin: 20px 20px; }
.gem-spark { fill: #2b2118; opacity: 0.85; }

/* The glow sits behind the gem (a plain div, not SVG, so its
   box-shadow can bloom softly) and breathes continuously — slower and
   steadier than the firefly's blink, so the two read as different. */
.gem-glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 70%; height: 70%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #f5b83d;
  animation: gemBreathe 2.6s ease-in-out infinite;
  z-index: -1;
}
@keyframes gemBreathe {
  0%, 100% { opacity: 0.45; box-shadow: 0 0 10px 4px rgba(245, 184, 61, 0.45); }
  50%      { opacity: 0.85; box-shadow: 0 0 22px 10px rgba(245, 184, 61, 0.7), 0 0 40px 18px rgba(255, 138, 61, 0.35); }
}

/* Climbing: the gem stretches slightly along the direction of travel
   and spins gently, instead of a figure leaning (set by career.js via
   .dir-up / .dir-down). */
.tester-character.is-moving:not(.dir-up):not(.dir-down) { animation: gemSway 0.6s ease-in-out infinite; }
@keyframes gemSway {
  0%, 100% { transform: translate(-50%, -100%) rotate(-6deg); }
  50%      { transform: translate(-50%, -100%) rotate(6deg); }
}
.tester-character.is-moving.dir-up { animation: gemClimbUp 0.6s ease-in-out infinite; }
@keyframes gemClimbUp {
  0%, 100% { transform: translate(-50%, -100%) rotate(-8deg) scaleY(1.05); }
  50%      { transform: translate(-50%, -100%) rotate(8deg) scaleY(1.1); }
}
.tester-character.is-moving.dir-down { animation: gemClimbDown 0.6s ease-in-out infinite; }
@keyframes gemClimbDown {
  0%, 100% { transform: translate(-50%, -100%) rotate(8deg) scaleY(0.95); }
  50%      { transform: translate(-50%, -100%) rotate(-8deg) scaleY(0.9); }
}

/* Arrival: a bright flash + pop the instant a new level is reached —
   overrides whatever climb animation is mid-swing (!important is
   scoped to this one brief 0.5s celebratory beat). */
.tester-character.is-arriving { animation: gemArrive 0.5s ease !important; }
@keyframes gemArrive {
  0%   { transform: translate(-50%, -100%) rotate(0deg) scale(1); }
  40%  { transform: translate(-50%, -100%) rotate(0deg) scale(1.25); }
  100% { transform: translate(-50%, -100%) rotate(0deg) scale(1); }
}
.tester-character.is-arriving .gem-glow { animation: gemFlash 0.5s ease; }
@keyframes gemFlash {
  0%   { opacity: 0.6; box-shadow: 0 0 14px 6px rgba(245, 184, 61, 0.6); }
  35%  { opacity: 1;   box-shadow: 0 0 36px 16px rgba(245, 184, 61, 0.95), 0 0 60px 26px rgba(255, 138, 61, 0.55); }
  100% { opacity: 0.6; box-shadow: 0 0 14px 6px rgba(245, 184, 61, 0.6); }
}

/* Idle "live wallpaper" action: once scrolling stops, he keeps a slow
   continuous spin instead of standing frozen — loops until scrolling
   resumes (the glow's own breathing animation never stops). */
.tester-character.is-idle-active .gem-shape { animation: gemIdleSpin 4s linear infinite; }
@keyframes gemIdleSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tester-character, .gem-shape, .gem-glow { animation: none !important; opacity: 0.85; box-shadow: 0 0 14px 6px rgba(245, 184, 61, 0.5); }
}

.level-up-popup {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -100%);
  font-family: "Press Start 2P", "Playfair Display", serif;
  font-size: 0.6rem;
  color: var(--level-glow);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  z-index: 6;
}
.level-up-popup.is-showing { animation: popUp 1.3s ease forwards; }
@keyframes popUp {
  0%   { opacity: 0; transform: translate(-50%, -80%) scale(0.7); }
  20%  { opacity: 1; transform: translate(-50%, -160%) scale(1); }
  75%  { opacity: 1; transform: translate(-50%, -180%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -210%) scale(0.9); }
}

.sound-toggle-row { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.sound-toggle { position: sticky; top: 96px; }

.level-cards { display: grid; gap: 1.6rem; }
.level-card {
  padding: 1.6rem 1.8rem;
  opacity: 0.55;
  transform: scale(0.98);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.4s ease;
}
.level-card.is-active { opacity: 1; transform: scale(1); border-color: var(--accent); }
.level-card-header { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.level-number {
  font-family: "Playfair Display", serif; font-weight: 700; font-size: 0.85rem;
  color: var(--ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  padding: 0.3rem 0.8rem; border-radius: 999px;
}
.level-card h3 { margin: 0; }
.level-company { color: var(--accent); font-weight: 600; }
.level-card ul { display: grid; gap: 0.4rem; margin: 0.7rem 0; color: var(--muted); }
.level-card ul li { padding-left: 1.1rem; position: relative; }
.level-card ul li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.level-skills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0 0; }

/* ---------- 14. Certifications ---------- */
.certs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.cert-card { padding: 1.5rem; }
.cert-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 1rem;
  overflow: hidden;
}
.cert-icon img { width: 28px; height: 28px; object-fit: contain; }
.cert-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.cert-card p.cert-desc { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- 15. Toolkit carousel: 3D cube rotation ---------- */
.carousel { position: relative; max-width: 460px; margin: 0 auto; }
.carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--radius-lg); }

.cube-scene {
  position: relative;
  width: min(380px, 85vw);
  aspect-ratio: 380 / 440;
  margin: 0 auto;
  perspective: 1200px;
  --cube-half: min(190px, 42.5vw);
  touch-action: pan-y;
}
.cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.65, 0.05, 0.36, 1);
  transform: translateZ(calc(-1 * var(--cube-half))) rotateY(0deg);
  cursor: grab;
}
.cube.is-dragging { transition: none; cursor: grabbing; }

.cube-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cube-face:nth-child(1) { transform: rotateY(0deg) translateZ(var(--cube-half)); }
.cube-face:nth-child(2) { transform: rotateY(90deg) translateZ(var(--cube-half)); }
.cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(var(--cube-half)); }
.cube-face:nth-child(4) { transform: rotateY(270deg) translateZ(var(--cube-half)); }

/* Depth shadow along the side edges while the cube is actively rotating */
.cube-face::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.4), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.4));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.cube.is-rotating .cube-face::after { opacity: 1; }

.tool-card--cube {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.6rem; padding: 2rem 1.5rem; text-align: center; box-sizing: border-box;
  user-select: none;
}
.tool-icon--lg { width: 92px; height: 92px; border-radius: 22px; margin-bottom: 0.4rem; }
.tool-icon--lg img, .tool-icon--lg svg { width: 56px; height: 56px; }
.tool-type {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 700; color: var(--accent);
}
.tool-card--cube h3 { font-size: 1.2rem; margin: 0; }
.tool-card--cube p { color: var(--muted); font-size: 0.92rem; margin: 0; }

.tool-icon {
  width: 58px; height: 58px; margin: 0 auto 1rem; border-radius: 16px;
  background: #fffaf2; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tool-icon img { width: 34px; height: 34px; object-fit: contain; }
.tool-icon svg { width: 34px; height: 34px; color: #2b2118; } /* hand-drawn icons (Protractor, Claude) */
.tool-fallback {
  display: none; width: 100%; height: 100%; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: var(--accent); background: var(--accent-soft);
}

.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: 0.2s ease;
  z-index: 2;
}
.carousel-arrow:hover { border-color: var(--accent); color: var(--accent); }
.carousel-arrow.prev { left: -14px; }
.carousel-arrow.next { right: -14px; }

.carousel-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.4rem; }
.carousel-dot {
  width: 9px; height: 9px; border-radius: 50%; border: none;
  background: var(--line); cursor: pointer; padding: 0; transition: 0.2s ease;
}
.carousel-dot.is-active { background: var(--accent); transform: scale(1.2); }

/* prefers-reduced-motion: the cube becomes a plain crossfade, no 3D at all */
@media (prefers-reduced-motion: reduce) {
  .cube-scene { perspective: none; }
  .cube { transform: none !important; transition: none; cursor: default; }
  .cube-face {
    opacity: 0; transition: opacity 0.5s ease; pointer-events: none;
    transform: none !important;
  }
  .cube-face.is-front { opacity: 1; pointer-events: auto; }
  .cube-face::after { display: none; }
}

@media (max-width: 560px) {
  .carousel-arrow.prev { left: 0; }
  .carousel-arrow.next { right: 0; }
}

/* ---------- 16. Projects page ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 2rem; }
.filter-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 0.6rem 1.2rem; border-radius: 999px; font-weight: 600; font-size: 0.88rem;
  cursor: pointer; transition: 0.2s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent; color: var(--ink);
}

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.6rem; }
.project-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: 1.6rem; display: flex; flex-direction: column; gap: 0.7rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.project-card.is-hidden { display: none; }
.project-card-top { display: flex; justify-content: space-between; gap: 0.6rem; align-items: flex-start; }
.project-domain { color: var(--muted); font-size: 0.82rem; }
.project-card h3 { font-size: 1.25rem; margin-bottom: 0.1rem; }
.project-role { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.project-card p { color: var(--muted); margin: 0; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.3rem 0; }
.project-results {
  margin-top: auto; background: var(--accent-soft); border-radius: 12px; padding: 0.8rem 1rem;
  font-size: 0.88rem; color: var(--accent); font-weight: 600;
}

/* ---------- 17. Editing page ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: 1.5rem; text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* :not(.float-card) — carousel slides carry .float-card, which already
   drives their own transform (bob + glow); this hover lift is only for
   the plain (non-carousel) tool cards on the Editing page. */
.tool-card:not(.float-card):hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(0, 0, 0, 0.4); }

.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.6rem; }
.video-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow); transition: transform 0.25s ease;
}
.video-card:hover { transform: translateY(-6px); }
.video-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--accent-soft); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-duration {
  position: absolute; right: 0.6rem; bottom: 0.6rem; background: rgba(0, 0, 0, 0.7);
  color: #fff; font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 6px;
}
.play-btn {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.92); color: var(--accent-dark); font-size: 1.3rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}
.play-btn:hover { transform: scale(1.1); background: #fff; }
.video-info { padding: 1.1rem 1.2rem 1.3rem; }
.video-info h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.video-info p { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 0; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(5, 4, 3, 0.85);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem; z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal { width: min(880px, 100%); background: #000; border-radius: 18px; overflow: hidden; position: relative; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16/9; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal-close {
  position: absolute; top: -46px; right: 0; width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.92); cursor: pointer; font-size: 1.1rem;
}

.workflow-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.4rem; }
.workflow-step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.4rem; }
.workflow-step .step-num { font-family: "Playfair Display", serif; font-size: 1.8rem; color: var(--accent); font-weight: 700; }

/* ---------- 18. Blog page ---------- */
.blog-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.category-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.search-box { position: relative; min-width: 240px; flex: 1; max-width: 320px; }
.search-box input {
  width: 100%; padding: 0.75rem 1rem 0.75rem 2.4rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit;
}
.search-box .search-icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }

.featured-post {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 2.5rem;
}
.featured-post img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.featured-post-content { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.featured-post-content .post-meta { margin-bottom: 0.6rem; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow); transition: opacity 0.3s ease, transform 0.3s ease;
}
.post-card.is-hidden { display: none; }
.post-card img { width: 100%; height: 170px; object-fit: cover; }
.post-content { padding: 1.4rem 1.4rem 1.6rem; }
.post-meta {
  margin: 0 0 0.8rem; color: var(--accent); font-size: 0.76rem; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 700; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
}
.post-meta .dim { color: var(--muted); text-transform: none; font-weight: 500; letter-spacing: 0; }
.post-content h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.post-content p { margin: 0; color: var(--muted); }
.read-more { display: inline-block; margin-top: 1rem; font-weight: 700; color: var(--accent); }
.no-results { color: var(--muted); text-align: center; padding: 2rem 0; display: none; }
.no-results.is-visible { display: block; }

.newsletter-box {
  margin-top: 3rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 2rem; display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center; gap: 1.2rem;
}
.newsletter { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.newsletter input {
  flex: 1; min-width: 220px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.9rem 1rem; font: inherit; color: var(--text);
}

/* ---------- 19. Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 2rem; align-items: start; }
.contact-info-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 2rem; }
.info-item { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 1.4rem; }
.info-item .info-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-item h4 { margin: 0 0 0.2rem; font-family: "Inter", sans-serif; font-size: 0.95rem; }
.info-item p { margin: 0; color: var(--muted); }

.contact-form-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.4rem; }
.form-group input, .form-group textarea {
  width: 100%; padding: 0.85rem 1rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; resize: vertical;
}
.form-group input:invalid[data-touched="true"], .form-group textarea:invalid[data-touched="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: 0.8rem; margin-top: 0.35rem; display: none; }
.field-error.is-visible { display: block; }
.form-success {
  display: none; align-items: center; gap: 0.6rem;
  background: rgba(79, 201, 138, 0.14); color: var(--success);
  border: 1px solid rgba(79, 201, 138, 0.35); padding: 1rem 1.1rem; border-radius: 14px;
  margin-bottom: 1.2rem; font-weight: 600;
}
.form-success.is-visible { display: flex; }

.resume-box {
  margin-top: 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--radius-md); padding: 1.4rem 1.6rem;
}
.resume-box p { margin: 0; color: var(--accent); font-weight: 600; }

/* ---------- 20. Social icons (footer + contact page) ---------- */
.social-list { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.5rem; }
.social-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.social-icon:hover, .social-icon:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.social-icon img { width: 18px; height: 18px; object-fit: contain; }
.social-icon .icon-hover { position: absolute; opacity: 0; transition: opacity 0.2s ease; }
.social-icon:hover .icon-hover, .social-icon:focus-visible .icon-hover { opacity: 1; }
.social-icon:hover .icon-default, .social-icon:focus-visible .icon-default { opacity: 0; }
.social-icon svg { width: 19px; height: 19px; color: var(--muted); transition: color 0.2s ease; }
.social-icon:hover svg, .social-icon:focus-visible svg { color: var(--accent); }
.social-fallback { display: none; font-size: 0.66rem; font-weight: 800; color: var(--accent); }
.social-icon.icon-broken img { display: none; }
.social-icon.icon-broken .social-fallback { display: block; }

/* ---------- 21. Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); margin-top: 3rem; }
.footer-inner { padding: 2.8rem 0; display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 2rem; align-items: center; }
.footer-brand .brand { display: block; margin-bottom: 0.6rem; }
.footer-brand p { color: var(--muted); max-width: 320px; margin: 0 0 0.6rem; }
.footer-focus { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.footer-slogan { display: flex; align-items: center; justify-content: center; text-align: center; }
.footer-slogan p {
  font-family: "Playfair Display", serif; font-style: italic; color: var(--accent);
  font-size: 1.15rem; max-width: 300px; margin: 0; line-height: 1.5;
}
.footer-connect { display: flex; flex-direction: column; align-items: flex-start; }
.footer-connect h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; color: var(--muted); }
.footer-bottom {
  border-top: 1px solid var(--line); padding: 1.2rem 0; text-align: center;
  color: var(--muted); font-size: 0.85rem;
}

/* ---------- 22. Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner, .journey-box, .contact-grid, .featured-post { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-slogan { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .hamburger { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .timeline-grid { grid-template-columns: 56px 1fr; gap: 1rem; }
  .tester-character { width: 32px; }
  .sound-toggle { top: 84px; }
}

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-brand, .footer-connect { align-items: center; }
  .footer-brand p { max-width: none; }
  .social-list { justify-content: center; }
  section { padding: 2.5rem 0; }
  .carousel { max-width: 320px; }
}
