/* ==========================================================
   PONY LESTARI — PORTFOLIO
   Single clean stylesheet (no overrides, no duplicates)
   ----------------------------------------------------------
   1. Variables & base
   2. Wooden desk + top bar
   3. Desk scene & decorations
   4. The book (cover, rings, pages, flip)
   5. Shared page components
   6. Individual pages
   7. Electrical animations
   8. Controls & footer
   9. Responsive (stacked pages on phones)
   ========================================================== */


/* ---------- 1. VARIABLES & BASE ---------- */

:root {
  --ink: #1f2a3a;
  --ink-soft: #55606f;
  --paper: #f8f1de;
  --paper-2: #efe5cc;
  --line: #d9ccae;
  --blueprint: #4d7aa6;

  --gold: #f2b82e;
  --orange: #f0a037;
  --teal: #4fb0ab;
  --pink: #e8819e;
  --blue: #6c9ad0;
  --gray: #9ba4af;
  --electric: #ffe14d;
  --arc: #bfe9ff;

  --font-ui: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font-mono: "DM Mono", "Consolas", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { display: inline-block; }
ul { margin: 0; padding: 0; list-style: none; }

/* icons from the sprite default to 1em */
.brand-bolt svg, .chip-btn svg, .btn svg, .toc-ico, .toc-chev,
.role-chip svg, .bolt-badge svg, .academic-icon svg, .arc-ico svg,
.c-ico svg, .toc-id svg, .switch-btn svg {
  width: 1em; height: 1em; fill: none;
}


/* ---------- 2. WOODEN DESK + TOP BAR ---------- */


/* ==========================================
   ELECTRONICS LAB WORKBENCH BACKGROUND
========================================== */

body {
  background-color: #102635;

  background-image:

    /* Soft laboratory lighting */
    radial-gradient(
      ellipse at 50% 25%,
      rgba(47, 119, 132, .35),
      transparent 45%
    ),

    radial-gradient(
      ellipse at 10% 85%,
      rgba(242, 184, 46, .13),
      transparent 30%
    ),

    radial-gradient(
      ellipse at 95% 75%,
      rgba(75, 145, 180, .22),
      transparent 32%
    ),

    /* Electronic workbench circuit pattern */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='430' viewBox='0 0 560 430'%3E%3Cg fill='none' stroke='%235b9ca5' stroke-width='1.5' opacity='.48'%3E%3Cpath d='M0 90h70v45h55v-30h75m-200 220h80v-60h55v-45h75m350-150h-75v50h-65v45h-55m195 130h-75v-50h-55v-40h-60M90 0v55h50v45h65m130 330v-70h-55v-45h-65v-55h-45'/%3E%3Cpath d='M10 220h32l12-22 18 44 18-22h45M360 30h25l13-15 15 30 15-15h50' stroke='%23e0ad48' stroke-width='2'/%3E%3C/g%3E%3Cg fill='%23e6b84f' opacity='.8'%3E%3Ccircle cx='70' cy='90' r='4'/%3E%3Ccircle cx='200' cy='105' r='4'/%3E%3Ccircle cx='125' cy='325' r='4'/%3E%3Ccircle cx='435' cy='95' r='4'/%3E%3Ccircle cx='485' cy='345' r='4'/%3E%3C/g%3E%3Cg fill='none' stroke='%2368b6c0' stroke-width='1.5' opacity='.55'%3E%3Crect x='350' y='150' width='90' height='90' rx='6'/%3E%3Cpath d='M360 140v10m15-10v10m15-10v10m15-10v10m15-10v10m-60 100v10m15-10v10m15-10v10m15-10v10m15-10v10M340 165h10m-10 15h10m-10 15h10m-10 15h10m90-45h10m-10 15h10m-10 15h10m-10 15h10'/%3E%3Cpath d='M370 200h12l10-20 12 40 12-20h15' stroke='%23e6b84f' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");

  background-size:
    auto,
    auto,
    auto,
    560px 430px;

  background-position:
    center,
    left bottom,
    right bottom,
    center;

  background-attachment: fixed;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
}


.topbar {
  background: linear-gradient(
    180deg,
    rgba(8, 25, 39, .98),
    rgba(17, 48, 63, .96)
  );

  border-bottom: 1px solid rgba(242,184,46,.45);

  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; color: #fdf1d4; }

.brand-bolt {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 20px;
  animation: boltGlow 2.4s ease-in-out infinite;
}

.brand-text { font-weight: 800; font-size: 12px; letter-spacing: .16em; line-height: 1.1; }
.brand-text small { display: block; margin-top: 4px; font: 9px var(--font-mono); letter-spacing: .15em; color: #d9bf8f; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.power-led {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #4ee27a;
  box-shadow: 0 0 8px 2px rgba(78, 226, 122, .8);
  animation: ledBlink 2.2s steps(1) infinite;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  font: 700 11px var(--font-ui);
  letter-spacing: .04em;
  color: #fdf1d4;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 220, 160, .4);
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.chip-btn b { color: var(--gold); }
.chip-btn:hover { background: rgba(255, 255, 255, .14); box-shadow: 0 0 14px rgba(255, 225, 77, .35); }
.chip-btn-gold { background: var(--gold); color: #2a1b05; border-color: var(--gold); }
.chip-btn-gold:hover { background: #ffd04e; }


/* ---------- 3. DESK SCENE & DECORATIONS ---------- */
/* The scene is designed at 1300 x 720 and scaled to fit by script.js */

.scene-box { width: 1300px; height: 720px; margin: 18px auto 0; position: relative; }

.scene {
  position: absolute;
  left: 0; top: 0;
  width: 1300px; height: 720px;
  transform-origin: top left;
}

.decor { position: absolute; pointer-events: none; }

.decor-mat   { right: -40px; top: 410px; width: 190px; height: 310px; transform: rotate(-4deg); z-index: 0; opacity: .95; }
.decor-pen   { right: 14px; top: 470px; width: 34px; height: 250px; transform: rotate(18deg); z-index: 3; filter: drop-shadow(3px 5px 4px rgba(0, 0, 0, .45)); }
.decor-coil { right: 0; top: 6px; width: 104px; height: 104px; z-index: 3; filter: drop-shadow(4px 7px 6px rgba(0, 0, 0, .5)); }
.decor-coil > svg:first-child { width: 100%; height: 100%; display: block; }
.coil-arc {
  position: absolute;
  left: -34px; top: -12px;
  width: 58px; height: 58px;
  filter: drop-shadow(0 0 5px #7fd3ff) drop-shadow(0 0 12px #5bb8ff);
  animation: arcFlicker 2.6s linear infinite;


/* ELECTRONICS PCB DECORATION */

.decor-electronics {
  position: absolute;
  left: -22px;
  top: -25px;
  width: 225px;
  height: 195px;
  z-index: 12;
  pointer-events: none;

  filter:
    drop-shadow(4px 9px 9px rgba(0,0,0,.45))
    drop-shadow(0 0 8px rgba(75,190,180,.12));
}

.pcb-float {
  transform-origin: 12% 15%;
  animation: pcbFloat 8s ease-in-out infinite;
}

@keyframes pcbFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

}

.decor-meter {
  left: -18px; top: 438px;
  width: 140px; height: 233px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 11;
  transform: rotate(-6deg);
  filter: drop-shadow(6px 10px 9px rgba(0, 0, 0, .5));
  transition: transform .25s;
}
.decor-meter:hover { transform: rotate(-3deg) translateY(-4px); }
.decor-meter svg { width: 100%; height: 100%; display: block; }
.dial { transition: transform .5s cubic-bezier(.3, 1.5, .5, 1); }
#mmValue { animation: lcdFlick 3s steps(1) infinite; }


/* ---------- 4. THE BOOK ---------- */

.book {
  position: absolute;
  left: 100px; top: 30px;
  width: 1100px; height: 660px;
  padding: 16px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .09), transparent 35%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"),
    #16191f;
  box-shadow:
    0 34px 60px rgba(0, 0, 0, .55),
    0 8px 14px rgba(0, 0, 0, .4),
    inset 0 0 0 2px rgba(255, 255, 255, .06);
  z-index: 5;
  animation: powerOn 1.6s ease-out both;
}

/* glowing current that runs around the cover */
.current-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 9; }
.cr { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 5 95; }
.cr-a { stroke: var(--electric); filter: drop-shadow(0 0 5px #ffd633) drop-shadow(0 0 10px #ffb300); animation: runCurrent 6s linear infinite; }
.cr-b { stroke: var(--arc); filter: drop-shadow(0 0 5px #7fd3ff); animation: runCurrent 6s linear infinite; animation-delay: -3s; }

.sheet {
  position: relative;
  width: 100%; height: 100%;
  perspective: 2400px;
  background: var(--paper);
  border-radius: 6px;
  /* stacked paper edges */
  box-shadow:
    0 1px 0 #e9dfc8, 0 3px 0 #d9ceb4, 0 4px 0 #efe6d0, 0 6px 0 #d4c9ae,
    0 7px 0 #ebe2cb, 0 9px 0 #cfc3a6, 0 10px 6px rgba(0, 0, 0, .3);
}

.side { position: absolute; top: 0; bottom: 0; width: 50%; }
.side-left  { left: 0;  border-radius: 6px 0 0 6px; }
.side-right { right: 0; border-radius: 0 6px 6px 0; }

/* Spiral rings */
.rings {
  position: absolute;
  left: 50%; top: 4px; bottom: 4px;
  width: 64px;
  margin-left: -32px;
  z-index: 8;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='46'%3E%3Cdefs%3E%3ClinearGradient id='m' x1='0' x2='0' y1='0' y2='1'%3E%3Cstop offset='0' stop-color='%23f4f6f8'/%3E%3Cstop offset='.5' stop-color='%23a5abb3'/%3E%3Cstop offset='1' stop-color='%2362676f'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='13' cy='27' r='6.5' fill='%231b1d22'/%3E%3Ccircle cx='51' cy='27' r='6.5' fill='%231b1d22'/%3E%3Ccircle cx='13' cy='28.5' r='4' fill='%23000' opacity='.5'/%3E%3Ccircle cx='51' cy='28.5' r='4' fill='%23000' opacity='.5'/%3E%3Cpath d='M8 29C16 4 48 4 56 29' fill='none' stroke='%23181a1e' stroke-width='6.5' stroke-linecap='round' opacity='.35' transform='translate(1 2)'/%3E%3Cpath d='M8 29C16 4 48 4 56 29' fill='none' stroke='url(%23m)' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M13 22C20 9 44 9 51 22' fill='none' stroke='%23fff' stroke-width='1.2' stroke-linecap='round' opacity='.7'/%3E%3C/svg%3E") repeat-y center top;
}

/* Soft shadow at the fold */
.gutter {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 90px;
  margin-left: -45px;
  z-index: 7;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent, rgba(60, 40, 15, .12) 30%, rgba(40, 25, 8, .34) 50%, rgba(60, 40, 15, .12) 70%, transparent);
}

.binder-clip {
  position: absolute;
  left: 50%; top: -22px;
  width: 58px;
  margin-left: -29px;
  z-index: 14;
  filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .5));
  pointer-events: none;
}

/* Right-edge chapter tabs */
.edge-tabs { position: absolute; right: -40px; top: 112px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }

.etab {
  display: block;
  width: 42px; height: 78px;
  padding: 6px 0;
  border-radius: 0 9px 9px 0;
  font: 800 9px var(--font-ui);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(20, 15, 8, .75);
  writing-mode: vertical-rl;
  text-align: center;
  box-shadow: 3px 3px 6px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .22);
  transition: transform .25s, filter .25s, box-shadow .25s;
}
.etab span { display: block; }
.etab:hover { transform: translateX(7px); filter: brightness(1.1); }
.etab.is-active { transform: translateX(9px); filter: brightness(1.08); box-shadow: 4px 4px 9px rgba(0, 0, 0, .4), 0 0 14px rgba(255, 225, 77, .75); }

.c-orange { background: var(--orange); }
.c-teal   { background: var(--teal); }
.c-pink   { background: var(--pink); }
.c-blue   { background: var(--blue); }
.c-gray   { background: var(--gray); }

/* Page-turn leaf */
.flip-leaf {
  display: none;
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  z-index: 12;
  transform-style: preserve-3d;
  pointer-events: none;
}
.flip-leaf.forward  { display: block; left: 50%; transform-origin: left center;  animation: flipForward  .95s cubic-bezier(.55, .05, .25, 1) forwards; }
.flip-leaf.backward { display: block; left: 0;   transform-origin: right center; animation: flipBackward .95s cubic-bezier(.55, .05, .25, 1) forwards; }

.face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--paper); }
.face .page { position: absolute; inset: 0; }
.face-back { transform: rotateY(180deg); }

/* shading that moves across the turning paper */
.face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .0), rgba(30, 18, 4, .35)); opacity: 0; animation: curlShade .95s ease-in-out forwards; }
.face-back::after { background: linear-gradient(270deg, rgba(0, 0, 0, 0), rgba(30, 18, 4, .35)); }

/* lightning that jumps along the spine when a page turns */
.arc-flash {
  position: absolute;
  left: 50%; top: 0;
  width: 40px; height: 100%;
  margin-left: -20px;
  z-index: 13;
  opacity: 0;
  pointer-events: none;
  overflow: visible;
}
.arc-flash path {
  fill: none;
  stroke: var(--arc);
  stroke-width: 2.4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px #7fd3ff) drop-shadow(0 0 10px #4aa8ff);
}
.arc-flash.fire { animation: arcZap .6s linear; }



/* ---------- 5. SHARED PAGE COMPONENTS ---------- */

.page {
  position: absolute;
  inset: 0;
  display: none;
  padding: 36px 42px 40px;
  overflow: hidden;
  background-color: var(--paper);
}
.page.on { display: block; }

/* graph-paper look */
.page {
  background-image:
    linear-gradient(rgba(77, 122, 166, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 122, 166, .08) 1px, transparent 1px);
  background-size: 24px 24px;
}
/* ruled, notebook-like pages */
.page-lined {
  background-image:
    linear-gradient(90deg, transparent 0 46px, rgba(214, 100, 100, .22) 46px 47px, transparent 47px),
    repeating-linear-gradient(to bottom, transparent 0 29px, rgba(77, 122, 166, .16) 29px 30px);
  background-size: auto;
}

.side-left .page  { border-radius: 6px 0 0 6px; box-shadow: inset -26px 0 30px -22px rgba(60, 40, 15, .38); }
.side-right .page { border-radius: 0 6px 6px 0; box-shadow: inset 26px 0 30px -22px rgba(60, 40, 15, .38); }
.side-left  .page-lined { padding-left: 62px; padding-right: 58px; }
.side-right .page-lined { padding-left: 62px; padding-right: 36px; }

.hand { font-family: var(--font-hand); }
.mono-tag { font: 500 10px var(--font-mono); letter-spacing: .12em; color: #8f7d5b; }

.sec-label {
  display: inline-block;
  padding: 7px 18px;
  font: 700 10px var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #3a2d10;
  border-radius: 3px;
  transform: rotate(-2deg);
  box-shadow: 2px 3px 6px rgba(60, 40, 10, .25);
}
.sec-yellow { background: #f6d56a; }
.sec-teal   { background: #a9d9d3; }
.sec-pink   { background: #f0b6c3; }
.sec-blue   { background: #b4cdea; }
.sec-gray   { background: #cfd5dc; }

.small-script { margin: 14px 0 0; font-size: 26px; font-weight: 700; color: #b0623a; line-height: 1; }
.h2 { margin: 6px 0 14px; font: 800 38px/1.1 var(--font-ui); letter-spacing: -.02em; color: var(--ink); }
.h2 em { font: 700 1.12em var(--font-hand); font-style: normal; color: #b0623a; letter-spacing: 0; }
.h3 { margin: 8px 0 4px; font: 800 19px/1.25 var(--font-ui); color: var(--ink); }
.body { margin: 0 0 12px; max-width: 420px; font-size: 14px; line-height: 1.75; color: var(--ink-soft); }
.muted { margin: 0; font-size: 13px; line-height: 1.6; color: #7b766b; }
.eyebrow { display: block; font: 500 10px var(--font-mono); letter-spacing: .15em; color: #8f7650; }
.divider { margin: 22px 0; border-top: 1.5px dashed #c8b894; }

.folio { position: absolute; bottom: 14px; font: 500 10px var(--font-mono); letter-spacing: .1em; color: #a89572; }
.side-left  .folio { left: 62px; }
.side-right .folio { right: 36px; }
.side-left .page-hello .folio { left: 42px; }
.page-hello .folio, .page-toc .folio, .page-profile .folio { }
.side-right .page-toc .folio, .side-right .page-profile .folio { right: 42px; }
.side-left .page-hello .folio { left: 42px; }

.margin-note {
  position: absolute;
  right: 60px; bottom: 44px;
  padding: 12px 14px;
  background: #f1dfae;
  font: 500 10px/1.7 var(--font-mono);
  color: #7a6a44;
  transform: rotate(4deg);
  box-shadow: 2px 3px 7px rgba(60, 40, 10, .2);
}

.stamp-round {
  position: absolute;
  right: 62px; bottom: 44px;
  display: grid;
  place-content: center;
  width: 92px; height: 92px;
  border: 2.5px solid #b0623a;
  border-radius: 50%;
  color: #b0623a;
  text-align: center;
  font: 500 11px/1.5 var(--font-mono);
  letter-spacing: .06em;
  transform: rotate(-14deg);
  opacity: .85;
  box-shadow: inset 0 0 0 4px rgba(176, 98, 58, .12);
}
.stamp-red { border-color: #c0504a; color: #c0504a; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font: 800 11px var(--font-ui);
  letter-spacing: .03em;
  border-radius: 7px;
  border: 1.5px solid var(--ink);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(30, 20, 5, .22), 0 0 14px rgba(255, 225, 77, .5); }
.btn-dark  { background: var(--ink); color: #fff; }
.btn-dark svg { color: var(--gold); }
.btn-ghost { background: transparent; color: var(--ink); }


/* ---------- 6. INDIVIDUAL PAGES ---------- */

/* ===== Cover — left page ===== */
.hello-head { display: flex; align-items: center; gap: 12px; }
.bolt-badge {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--gold);
  color: #2a1b05;
  font-size: 22px;
  box-shadow: 0 3px 8px rgba(120, 80, 0, .35);
  animation: boltGlow 2.4s ease-in-out infinite;
}
.hello-title { margin: 0; font: 800 15px/1.2 var(--font-ui); letter-spacing: -.005em; }
.hello-head .mono-tag { margin-left: auto; }

.hello-main { display: flex; gap: 24px; margin-top: 16px; }

.polaroid {
  position: relative;
  flex: none;
  width: 190px;
  margin: 8px 0 0 2px;
  padding: 10px 10px 34px;
  background: #fffdf6;
  border: 1px solid #e3d8bd;
  box-shadow: 0 10px 22px rgba(60, 40, 10, .3);
  transform: rotate(-4deg);
}
.polaroid img { display: block; width: 100%; height: 188px; object-fit: cover; object-position: 38% 12%; transform-origin: center; filter: saturate(.92); }
.polaroid figcaption { position: absolute; left: 14px; bottom: 11px; font: 500 9px var(--font-mono); letter-spacing: .12em; color: #8a7a58; }
.tape {
  position: absolute;
  left: -22px; top: -12px;
  width: 78px; height: 24px;
  background: rgba(246, 213, 106, .85);
  border: 1px solid rgba(190, 150, 40, .35);
  transform: rotate(-32deg);
  box-shadow: 0 2px 4px rgba(60, 40, 10, .18);
}

.hello-text { flex: 1; min-width: 0; padding-top: 6px; }
.hello-small { margin: 0; font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1; }
.hello-name { margin: 0; font-size: 54px; font-weight: 700; line-height: 1; color: var(--ink); letter-spacing: -.005em; }
.hello-name span { display: inline-block; }
.underline-swoosh { display: block; width: 230px; height: 16px; margin: -3px 0 0 2px; }
.underline-swoosh path { stroke-dasharray: 300; stroke-dashoffset: 300; animation: drawLine 1.4s .6s ease-out forwards; }

.role { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.role-chip {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  font-size: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, .5);
  animation: chipPulse 2.8s ease-in-out infinite;
}
.role-text { font: 800 14px/1.3 var(--font-ui); }

.hello-copy { margin: 12px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--ink-soft); }

.hello-actions { display: flex; gap: 10px; margin-top: 14px; padding-left: 2px; }

.hello-bench {
  position: absolute;
  left: 40px; right: 34px; bottom: 32px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
}
.scope { width: 170px; height: auto; flex: none; margin-left: 0; filter: drop-shadow(2px 4px 5px rgba(0, 0, 0, .3)); }
.sketch-circuit { width: 236px; height: auto; flex: none; }
.page-hello .folio { left: auto; right: 36px; }

/* ===== Cover — right page (table of contents) ===== */
.page-toc { padding-top: 54px; }
.doodles { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .3; pointer-events: none; }

.toc-label {
  position: relative;
  display: inline-block;
  margin-left: 8px;
  padding: 9px 22px;
  background: var(--electric);
  background: linear-gradient(180deg, #ffe566, #f8cf3f);
  font: 800 15px var(--font-ui);
  color: #2a1b05;
  border-radius: 5px;
  transform: rotate(-1.5deg);
  box-shadow: 2px 4px 9px rgba(120, 80, 0, .3);
}
.toc-label::before, .toc-label::after {
  content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
  background: rgba(120, 80, 0, .35);
}
.toc-label::before { left: 7px; } .toc-label::after { right: 7px; }

.toc { position: relative; margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }

.toc-row {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px 10px 10px;
  background: #fffdf6;
  border: 1px solid #e3d8bd;
  border-radius: 10px;
  box-shadow: 0 3px 7px rgba(60, 40, 10, .13);
  overflow: hidden;
  transition: transform .22s, box-shadow .22s;
}
/* electric sweep on hover */
.toc-row::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -40%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 225, 77, .55), transparent);
  transform: skewX(-18deg);
  transition: none;
}
.toc-row:hover { transform: translateX(7px); box-shadow: 0 6px 16px rgba(60, 40, 10, .22), 0 0 0 2px rgba(255, 225, 77, .75), 0 0 18px rgba(255, 225, 77, .5); }
.toc-row:hover::before { animation: sweep .8s ease-out; }

.toc-no {
  display: grid; place-items: center;
  width: 38px; height: 36px;
  border-radius: 7px;
  font: 700 14px var(--font-mono);
  color: #2b2b2b;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.toc-row.c-orange .toc-no { background: var(--orange); }
.toc-row.c-teal   .toc-no { background: var(--teal); }
.toc-row.c-pink   .toc-no { background: var(--pink); }
.toc-row.c-blue   .toc-no { background: var(--blue); }
.toc-row.c-gray   .toc-no { background: var(--gray); }
.toc-row { background-image: none; }

.toc-ico { font-size: 22px; color: var(--ink); }
.toc-name { flex: 1; font: 700 15px var(--font-ui); color: var(--ink); }
.toc-chev { font-size: 15px; color: var(--ink); transition: transform .2s; }
.toc-row:hover .toc-chev { transform: translateX(4px); animation: chevPush .7s ease-in-out infinite; }

.toc-hint { position: absolute; left: 50px; bottom: 56px; margin: 0; font-size: 24px; color: #b0623a; transform: rotate(-3deg); }

.toc-id {
  position: absolute;
  right: 36px; bottom: 36px;
  display: flex; align-items: center; gap: 10px;
  font: 500 10px/1.5 var(--font-mono);
  color: #7e6d4a;
  text-align: right;
}
.toc-id svg { font-size: 22px; color: var(--gold); animation: boltGlow 2.4s ease-in-out infinite; }
.toc-id small { font-size: 9px; letter-spacing: .1em; color: #a08c60; }

/* ===== About ===== */
.signature { margin-top: 18px; font: 700 34px var(--font-hand); color: #b0623a; }
.signature span { font: 12px var(--font-mono); color: #9b7955; }

.page-profile .sec-label { margin-bottom: 4px; }
.academic-icon { margin: 24px 0 18px; font-size: 44px; color: var(--ink); width: 1em; height: 1em; }
.academic-icon svg { width: 1em; height: 1em; }
.academic-icon { animation: chipPulse 3s ease-in-out infinite; border-radius: 12px; }

.gpa { display: flex; align-items: center; gap: 14px; margin: 18px 0 0; }
.gpa strong { font: 800 66px/1 var(--font-ui); letter-spacing: -.03em; color: #b0623a; }
.gpa span { font: 500 11px/1.6 var(--font-mono); color: #7b766b; }

/* ===== Skills ===== */
.skill-list { margin-top: 22px; }
.skill-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1.5px dashed #d4c5a4;
}
.skill-no { font: 500 12px var(--font-mono); color: #b0623a; }
.skill-list div { flex: 1; }
.skill-list b { display: block; font-size: 14px; font-weight: 800; }
.skill-list small { display: block; margin-top: 3px; font-size: 12px; color: #7b766b; }
.pulse { width: 56px; height: 20px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 90; stroke-dashoffset: 90; animation: pulseDraw 2.6s linear infinite; }
.skill-list li:nth-child(2) .pulse { animation-delay: -.6s; }
.skill-list li:nth-child(3) .pulse { animation-delay: -1.2s; }
.skill-list li:nth-child(4) .pulse { animation-delay: -1.8s; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin: 22px 0 0; }
.chips span {
  padding: 9px 13px;
  font: 700 12px var(--font-ui);
  background: #fffdf6;
  border: 1.5px solid #d9c9a4;
  border-radius: 6px;
  box-shadow: 0 2px 0 #d9c9a4;
  transition: .2s;
}
.chips span:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 5px 0 var(--gold), 0 0 12px rgba(255, 225, 77, .55); }

.check-list { margin-top: 12px; }
.check-list li { position: relative; padding: 5px 0 5px 28px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.check-list li::before {
  content: ""; position: absolute; left: 4px; top: 8px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.sticky {
  position: absolute;
  right: 34px; bottom: 44px;
  padding: 16px 20px;
  background: #f7d868;
  font: 500 12px/1.5 var(--font-mono);
  color: #4d3a0c;
  transform: rotate(5deg);
  box-shadow: 2px 5px 10px rgba(60, 40, 10, .25);
}

/* ===== Experience ===== */
.timeline { position: relative; margin-top: 18px; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: repeating-linear-gradient(to bottom, #c8b88f 0 6px, transparent 6px 10px);
}
/* current flowing down the wire */
.timeline::after {
  content: ""; position: absolute; left: 4px; top: 0; width: 6px; height: 34px; border-radius: 3px;
  background: linear-gradient(to bottom, transparent, var(--electric), transparent);
  filter: drop-shadow(0 0 6px #ffd633);
  animation: wireDown 3.2s linear infinite;
}
.timeline-right { margin-top: 2px; }

.job { position: relative; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1.5px dashed #d4c5a4; }
.job:last-child { border: 0; margin-bottom: 0; padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -27px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--paper); box-shadow: 0 0 0 1.5px #b79a52;
  animation: nodePulse 2.4s ease-in-out infinite;
}
.job:nth-child(2)::before { animation-delay: .5s; } .job:nth-child(3)::before { animation-delay: 1s; }
.job-date { font: 500 10px var(--font-mono); letter-spacing: .1em; color: #a0784e; }
.job h3 { margin: 4px 0 2px; font: 800 18px/1.25 var(--font-ui); }
.company { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: #b0623a; }
.job ul { padding-left: 17px; list-style: disc; font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); }
.job li { margin-bottom: 2px; }
.job li::marker { color: var(--gold); }

/* ===== Portfolio / archive ===== */
.transformer { display: block; width: 250px; margin-top: 18px; }
.archive-list { margin-top: 18px; }
.archive-list li { display: flex; align-items: center; gap: 14px; padding: 17px 0; border-bottom: 1.5px dashed #d4c5a4; }
.arc-ico {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 50%;
  background: #f1e4c4;
  color: #b0623a;
  font-size: 22px;
  transition: .25s;
}
.archive-list li:hover .arc-ico { background: var(--gold); color: #2a1b05; box-shadow: 0 0 16px rgba(255, 225, 77, .8); }
.archive-list div { flex: 1; }
.archive-list b { display: block; font-size: 14px; font-weight: 800; }
.archive-list small { display: block; margin-top: 3px; font-size: 12px; color: #7b766b; }
.record-tag { font: 500 11px var(--font-mono); color: #a17b50; }
.archive-note { margin: 22px 0 0; font-size: 22px; line-height: 1.2; color: #a0784e; }

/* ===== Contact ===== */
.switch-box { margin-top: 12px; }
.switch-svg { display: block; width: 300px; max-width: 100%; }
.switch-btn {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 6px; padding: 11px 17px;
  font: 800 12px var(--font-ui);
  background: #fffdf6;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  cursor: pointer;
  transition: .2s;
}
.switch-btn svg { font-size: 17px; }
.switch-btn:hover { box-shadow: 0 0 14px rgba(255, 225, 77, .6); transform: translateY(-2px); }
.switch-btn[aria-pressed="true"] { background: var(--electric); border-color: #a07800; box-shadow: 0 0 20px rgba(255, 225, 77, .85); }

.contact-list { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.contact-card {
  display: flex; align-items: center; gap: 15px;
  padding: 15px 16px;
  background: #fffdf6;
  border: 1px solid #e3d8bd;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(60, 40, 10, .13);
  transition: .22s;
}
.contact-card:hover { transform: translateX(7px); box-shadow: 0 6px 16px rgba(60, 40, 10, .22), 0 0 0 2px rgba(255, 225, 77, .75), 0 0 18px rgba(255, 225, 77, .45); }
.c-ico { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 10px; font-size: 24px; color: #2b2b2b; }
.contact-card small { display: block; font: 500 10px var(--font-mono); letter-spacing: .12em; color: #9b7955; margin-bottom: 4px; }
.contact-card b { display: block; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.end-mark { position: absolute; left: 62px; bottom: 40px; font: 500 10px var(--font-mono); letter-spacing: .14em; color: #8f7d5b; }


/* ---------- 7. ELECTRICAL ANIMATIONS ---------- */

/* hand-drawn technical lines */
.ink { stroke: #3d5f86; stroke-width: 2; }

/* electrons flowing along a wire */
.flow {
  stroke: var(--electric);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 2 16;
  filter: drop-shadow(0 0 3px #ffb300);
  animation: electrons 1.1s linear infinite;
}
.flow-faint { stroke-width: 2.4; }
.hand-svg text { font: 700 17px var(--font-hand); fill: #b0623a; }

.led-glow { fill: rgba(255, 225, 77, .7); filter: blur(7px); animation: ledPulse 1.8s ease-in-out infinite; }
.node { fill: #fffdf6; stroke: #3d5f86; stroke-width: 2; }

/* oscilloscope */
.wave { fill: none; stroke-linecap: round; }
.wave-1 { stroke: #5dffb2; stroke-width: 2.4; filter: drop-shadow(0 0 3px #5dffb2); animation: waveMove 2.2s linear infinite; }
.wave-2 { stroke: #ffe14d; stroke-width: 1.6; opacity: .7; animation: waveMove 3.4s linear infinite reverse; }

/* contact switch */
.sw-arm { stroke: #3d5f86; stroke-width: 2.5; transform-box: view-box; transform-origin: 90px 30px; transition: transform .5s cubic-bezier(.4, 1.6, .5, 1); }
.flow-switch { opacity: 0; transition: opacity .3s; }
.led-switch { opacity: .1; animation: none; transition: opacity .3s; }
.switch-box.closed .sw-arm { transform: rotate(22deg); }
.switch-box.closed .flow-switch { opacity: 1; }
.switch-box.closed .led-switch { opacity: 1; animation: ledPulse 1s ease-in-out infinite; }

/* click sparks (created by script.js) */
.zap {
  position: fixed;
  z-index: 200;
  width: 3px; height: 16px;
  margin: -8px 0 0 -1.5px;
  border-radius: 2px;
  background: linear-gradient(to bottom, #fff, var(--electric));
  box-shadow: 0 0 8px 2px rgba(255, 220, 60, .9);
  pointer-events: none;
  animation: zapOut .55s ease-out forwards;
}

@keyframes boltGlow   { 0%, 100% { box-shadow: 0 0 0 rgba(255, 225, 77, 0); filter: none; } 50% { box-shadow: 0 0 14px 3px rgba(255, 225, 77, .75); filter: brightness(1.1); } }
@keyframes chipPulse  { 0%, 100% { box-shadow: 0 0 0 rgba(79, 176, 171, 0); } 50% { box-shadow: 0 0 14px 2px rgba(79, 176, 171, .55); } }
@keyframes ledBlink   { 0%, 100% { opacity: 1; } 55% { opacity: .25; } }
@keyframes ledPulse   { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes electrons  { to { stroke-dashoffset: -36; } }
@keyframes waveMove   { to { transform: translateX(100px); } }
@keyframes pulseDraw  { 0% { stroke-dashoffset: 90; } 60%, 100% { stroke-dashoffset: -90; } }
@keyframes runCurrent { to { stroke-dashoffset: -100; } }
@keyframes drawLine   { to { stroke-dashoffset: 0; } }
@keyframes sweep      { to { left: 130%; } }
@keyframes chevPush   { 50% { transform: translateX(8px); } }
@keyframes wireDown   { from { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { top: calc(100% - 34px); opacity: 0; } }
@keyframes nodePulse  { 0%, 100% { box-shadow: 0 0 0 1.5px #b79a52; } 50% { box-shadow: 0 0 0 1.5px #b79a52, 0 0 12px 4px rgba(255, 225, 77, .85); } }
@keyframes sway       { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(1.6deg); } }
@keyframes lcdFlick   { 0%, 92%, 100% { opacity: 1; } 94% { opacity: .55; } }
@keyframes arcFlicker { 0%, 100% { opacity: 0; } 4% { opacity: 1; } 8% { opacity: .2; } 11% { opacity: 1; } 16% { opacity: 0; } 55% { opacity: 0; } 58% { opacity: .9; } 62% { opacity: 0; } }
@keyframes arcZap     { 0% { opacity: 0; } 10% { opacity: 1; } 20% { opacity: .3; } 32% { opacity: 1; } 48% { opacity: .2; } 62% { opacity: .9; } 100% { opacity: 0; } }
@keyframes zapOut     { from { transform: translate(0, 0) rotate(var(--a)) scaleY(1); opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(var(--a)) scaleY(.2); opacity: 0; } }
@keyframes flipForward  { from { transform: rotateY(0deg); }  to { transform: rotateY(-180deg); } }
@keyframes flipBackward { from { transform: rotateY(0deg); }  to { transform: rotateY(180deg); } }
@keyframes curlShade  { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes powerOn {
  0%   { opacity: 0; transform: translateY(14px) scale(.985); filter: brightness(.4); }
  35%  { opacity: 1; }
  45%  { filter: brightness(1.7); }
  55%  { filter: brightness(.8); }
  70%  { filter: brightness(1.35); }
  100% { opacity: 1; transform: none; filter: none; }
}


/* ---------- 8. CONTROLS & FOOTER ---------- */

.controls {
  position: relative;
  z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 22px;
  width: min(720px, 92%);
  margin: 6px auto 0;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(28, 17, 8, .88), rgba(28, 17, 8, .72));
  border: 1px solid rgba(255, 205, 120, .3);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .4);
  backdrop-filter: blur(8px);
}
.page-btn {
  min-width: 128px;
  padding: 11px 16px;
  font: 800 11px var(--font-ui);
  letter-spacing: .03em;
  color: #fdf1d4;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 220, 160, .4);
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}
.page-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .15); box-shadow: 0 0 14px rgba(255, 225, 77, .45); transform: translateY(-2px); }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-btn-next { background: var(--gold); border-color: var(--gold); color: #2a1b05; }
.page-btn-next:hover:not(:disabled) { background: #ffd04e; }
.progress { flex: 1; max-width: 230px; }
.progress-caption { margin-bottom: 7px; text-align: center; font: 500 9px var(--font-mono); letter-spacing: .13em; color: #d9bf8f; }
.progress-track { height: 4px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .15); }
.progress-track span { display: block; width: 16.66%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--electric)); box-shadow: 0 0 10px var(--electric); transition: width .5s ease; }

.footer {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 22px max(4vw, 20px) 26px;
  font: 500 9px var(--font-mono);
  letter-spacing: .13em;
  color: #e0c796;
}


/* ---------- 9. RESPONSIVE — stacked pages on phones / small tablets ---------- */

@media (max-width: 860px) {

  .scene-box { width: 100% !important; height: auto !important; margin: 14px 0 0; }
  .scene { position: relative; width: 100% !important; height: auto !important; transform: none !important; }

  .decor, .binder-clip, .rings, .gutter, .flip-leaf, .arc-flash { display: none !important; }

  .book { position: relative; left: auto; top: auto; width: 94%; height: auto; margin: 0 auto; padding: 9px; border-radius: 10px; }
  .sheet { height: auto; perspective: none; }
  .side { position: relative; width: 100%; }
  .page { position: relative; inset: auto; min-height: 400px; padding: 30px 22px 44px !important; border-radius: 4px !important; margin-bottom: 8px; }
  .page.on { animation: pageIn .45s ease both; }
  .side-left .page, .side-right .page { box-shadow: inset 0 0 22px rgba(60, 40, 15, .12); }

  /* tabs become a horizontal strip above the book */
  .edge-tabs { position: relative; right: auto; top: auto; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
  .etab { width: auto; height: auto; padding: 8px 12px; writing-mode: horizontal-tb; border-radius: 8px; box-shadow: 1px 2px 4px rgba(0, 0, 0, .3); }
  .etab:hover, .etab.is-active { transform: translateY(-2px); }
  .book { display: flex; flex-direction: column-reverse; }
  .book .sheet { order: 2; }
  .edge-tabs { order: 1; }

  .folio { display: none; }
  .h2 { font-size: 31px; }
  .hello-main { flex-direction: column; align-items: center; gap: 22px; }
  .hello-text { width: 100%; }
  .hello-name { font-size: 54px; }
  .hello-actions { padding-left: 0; flex-wrap: wrap; }
  .hello-bench { position: relative; left: auto; right: auto; bottom: auto; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
  .scope { margin-left: 0; }
  .toc-hint { position: relative; left: auto; bottom: auto; margin-top: 22px; }
  .toc-id { position: relative; right: auto; bottom: auto; margin-top: 18px; justify-content: flex-end; }
  .margin-note, .sticky, .stamp-round { position: relative; right: auto; bottom: auto; display: inline-block; margin-top: 20px; }
  .stamp-round { display: grid; }
  .end-mark { position: relative; left: auto; bottom: auto; margin-top: 24px; }
  .switch-svg { width: 100%; }
  .controls { width: 94%; gap: 8px; padding: 10px 8px; }
  .page-btn { min-width: 0; padding: 10px 11px; font-size: 10px; }
  .progress { min-width: 70px; }
  .progress-caption { font-size: 7.5px; }
  .brand-text small { display: none; }
  .top-actions { gap: 6px; }
  .chip-btn { padding: 8px 10px; font-size: 10px; }
}

@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .underline-swoosh path { stroke-dashoffset: 0; }
}


/* =====================================
   HEADER ALIGNMENT FIX
===================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;

  width: 100%;
  min-height: 72px;
  height: 72px;

  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;

  padding: 0 32px;

  background: linear-gradient(
    100deg,
    #102a3a,
    #193d4d 55%,
    #102a3a
  );

  border-bottom: 1px solid rgba(222,177,80,.55);
  box-sizing: border-box;

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Logo kiri */

.topbar .brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 11px;

  flex-shrink: 0;
  white-space: nowrap;

  margin: 0;
}

/* Tombol logo listrik */

.topbar .brand-bolt {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

/* Nama portfolio */

.topbar .brand-text {
  display: block;
  line-height: 1.2;
  font-size: 12px;
  letter-spacing: .15em;
}

.topbar .brand-text small {
  display: block;
  margin-top: 4px;
  font-size: 9px;
}

/* Tombol kanan */

.topbar .top-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;

  gap: 12px;
  margin-left: auto;

  flex-shrink: 0;
  white-space: nowrap;
}

/* Power LED */

.topbar .power-led {
  flex-shrink: 0;
  margin-right: 2px;
}

/* Language dan Download */

.topbar .chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;

  min-height: 38px;
  padding: 0 15px;

  white-space: nowrap;
  line-height: 1;
  box-sizing: border-box;
}

.topbar .chip-btn-gold {
  background: #f4b829;
  color: #182b39;
  border-color: #f4b829;
}

/* Mobile header */

@media (max-width: 650px) {

  .topbar {
    height: auto;
    min-height: 65px;
    padding: 9px 12px;
    gap: 8px;
  }

  .topbar .brand {
    gap: 7px;
  }

  .topbar .brand-bolt {
    width: 34px;
    height: 34px;
  }

  .topbar .brand-text {
    font-size: 9px;
    letter-spacing: .09em;
  }

  .topbar .brand-text small {
    font-size: 7px;
  }

  .topbar .top-actions {
    gap: 6px;
  }

  .topbar .chip-btn {
    min-height: 33px;
    padding: 0 9px;
    font-size: 9px;
  }

  .topbar .power-led {
    display: none;
  }
}

@media (max-width: 370px) {

  .topbar .brand-text small {
    display: none;
  }

  .topbar .brand-bolt {
    width: 30px;
    height: 30px;
  }

  .topbar .chip-btn {
    padding: 0 7px;
    font-size: 8px;
  }
}


/* =================================
   MOBILE ELECTRIC CURRENT RESTORE
================================= */

@media (max-width: 860px) {

  .book {
    isolation: isolate;
  }

  /* Restore animated current around book */
  .book > .current-ring {
    display: block !important;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    overflow: visible;
  }

  /* Make yellow current more visible */
  .current-ring .cr-a {
    stroke: #ffe14d;
    stroke-width: 3.5;
    filter:
      drop-shadow(0 0 5px #ffe14d)
      drop-shadow(0 0 12px #ffb300);
    animation: runCurrent 4.8s linear infinite;
  }

  /* Blue current follows behind */
  .current-ring .cr-b {
    stroke: #bfe9ff;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 7px #7fd3ff);
    animation: runCurrent 4.8s linear infinite;
    animation-delay: -2.4s;
  }

  /* Keep electricity effects smooth */
  .timeline::after {
    display: block;
    animation: wireDown 3.2s linear infinite;
  }

  .job::before {
    animation: nodePulse 2.4s ease-in-out infinite;
  }

}


/* ==========================================
   LEFT & RIGHT ELECTRICAL VOLTAGE FLOW
========================================== */

.side-voltage-flow {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  z-index: 2;
  pointer-events: none;

  overflow: visible;
}

/* Static PCB tracks */

.voltage-base path {
  fill: none;
  stroke: #58a9b4;
  stroke-width: 2;
  stroke-opacity: .4;

  stroke-linecap: round;
  stroke-linejoin: round;

  vector-effect: non-scaling-stroke;
}

/* Moving electrical current */

.voltage-pulse {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;

  vector-effect: non-scaling-stroke;

  stroke-dasharray: 13 87;
  stroke-dashoffset: 0;
}

/* Gold current */

.voltage-gold {
  stroke: #ffe14d;
  stroke-width: 3.2;

  filter: url(#voltageGlow);

  animation: electricalFlow 3.2s linear infinite;
}

/* Blue current */

.voltage-blue {
  stroke: #bfeaff;
  stroke-width: 2.5;

  filter:
    drop-shadow(0 0 5px #62d7ff)
    drop-shadow(0 0 10px #62d7ff);

  stroke-dasharray: 5 95;

  animation: electricalFlow 4.2s linear infinite;
}

/* Left: current travels downward */

.flow-left {
  animation-direction: normal;
}

/* Right: current travels upward */

.flow-right {
  animation-direction: reverse;
}

/* Second moving pulse */

.delay-one {
  animation-delay: -2s;
}

/* Flow animation */

@keyframes electricalFlow {
  from {
    stroke-dashoffset: 100;
    opacity: .35;
  }

  20% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  to {
    stroke-dashoffset: 0;
    opacity: .35;
  }
}

/* Connection nodes */

.voltage-nodes circle {
  fill: #ffe14d;
  stroke: #fff5be;
  stroke-width: 1.5;

  vector-effect: non-scaling-stroke;

  filter:
    drop-shadow(0 0 5px #ffe14d)
    drop-shadow(0 0 9px #e9a92b);

  animation: electricalNode 2s ease-in-out infinite;
}

.voltage-nodes circle:nth-child(even) {
  animation-delay: -1s;
}

@keyframes electricalNode {
  0%, 100% {
    opacity: .4;
    r: 3;
  }

  50% {
    opacity: 1;
    r: 5;
  }
}

/* Mobile: preserve the current on both sides */

@media (max-width: 860px) {

  .side-voltage-flow {
    display: block !important;
    z-index: 2;
  }

  .voltage-base path {
    stroke-width: 1.6;
    stroke-opacity: .55;
  }

  .voltage-gold {
    stroke-width: 3;
  }

  .voltage-blue {
    stroke-width: 2.5;
  }

}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {

  .voltage-pulse,
  .voltage-nodes circle {
    animation: none;
  }

}


/* ============================================
   MOBILE REDESIGN — PONY LAB
   Desktop design remains untouched
============================================ */

@media (max-width: 860px) {

  body {
    overflow-x: hidden;
    min-width: 320px;
  }

  /* HEADER */

  .topbar {
    min-height: 60px;
    height: auto;
    padding: 9px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .brand {
    gap: 8px;
    flex-shrink: 0;
  }

  .top-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .brand-text {
    font-size: 10px;
  }

  .brand-text small {
    display: none;
  }

  .chip-btn {
    padding: 8px 9px;
    font-size: 9px;
  }


  /* SCENE BACKGROUND */

  .scene-box {
    width: 100% !important;
    height: auto !important;
    margin: 12px auto 0;
    padding: 0 7px;
    box-sizing: border-box;
  }

  .scene {
    position: relative;
    left: auto;
    top: auto;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    overflow: visible;
  }


  /* BOOK FRAME */

  .book {
    position: relative;
    left: auto;
    top: auto;

    width: 100%;
    max-width: 520px;
    height: auto;

    margin: 0 auto;
    padding: 7px;

    display: flex;
    flex-direction: column;

    gap: 0;
    border-radius: 12px;

    box-sizing: border-box;

    background:
      linear-gradient(
        135deg,
        #253c4a,
        #111d29
      );

    border: 1px solid #d8ad45;

    box-shadow:
      0 18px 35px rgba(0,0,0,.35),
      inset 0 0 0 2px rgba(255,255,255,.05);
  }


  /* TABS — HORIZONTAL MOBILE NAVIGATION */

  .edge-tabs {
    position: relative;

    order: 1;

    left: auto;
    right: auto;
    top: auto;

    width: 100%;
    height: auto;

    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;

    justify-content: flex-start;
    align-items: center;

    gap: 6px;

    margin: 0 0 8px;
    padding: 6px;

    overflow-x: auto;
    overflow-y: hidden;

    background: #102b39;
    border: 1px solid rgba(225,183,83,.3);
    border-radius: 7px;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .edge-tabs::-webkit-scrollbar {
    display: none;
  }

  .etab {
    flex: 0 0 auto;

    width: auto;
    height: auto;

    padding: 9px 12px;

    writing-mode: horizontal-tb;
    white-space: nowrap;

    border-radius: 5px;
    font-size: 10px;

    transform: none !important;
  }

  .etab.is-active {
    outline: 1px solid #f2b82e;
    box-shadow: 0 0 10px rgba(242,184,46,.25);
  }


  /* NOTEBOOK SHEET */

  .book .sheet {
    order: 2;

    position: relative;

    display: flex;
    flex-direction: column;

    width: 100%;
    height: auto !important;
    min-height: 0;

    overflow: hidden;

    border-radius: 5px;
    perspective: none;

    background: #f7f0df;

    box-shadow:
      0 2px 0 #e4d8bd,
      0 4px 0 #cfc1a3,
      0 6px 8px rgba(0,0,0,.25);
  }


  /* TWO PAGES BECOME ONE VERTICAL MOBILE BOOK */

  .side {
    position: relative;

    top: auto;
    left: auto;
    right: auto;
    bottom: auto;

    width: 100%;
    height: auto;
    flex: 0 0 auto;
  }

  .page {
    position: relative;

    inset: auto;

    display: none;

    width: 100%;
    height: auto !important;

    min-height: 0 !important;

    margin: 0 !important;

    padding: 25px 19px 32px !important;

    overflow: visible;

    border-radius: 0 !important;

    background-color: #f7f0df;

    box-shadow: none !important;

    box-sizing: border-box;
  }

  .page.on {
    display: block;
    animation: mobilePageReveal .4s ease both;
  }

  /* Page divider */

  .side-left .page.on {
    border-radius: 4px 4px 0 0 !important;
    border-bottom: 1px dashed #c8b88f;
  }

  .side-right .page.on {
    border-radius: 0 0 4px 4px !important;
  }

  @keyframes mobilePageReveal {
    from {
      opacity: 0;
      transform: translateY(8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }


  /* PAPER DETAILS */

  .side-left .page-lined,
  .side-right .page-lined {
    padding-left: 34px !important;
    padding-right: 19px !important;
  }

  .folio {
    display: none;
  }

  .margin-note,
  .sticky,
  .stamp-round {
    position: relative;
    right: auto;
    bottom: auto;
    display: inline-block;
    margin-top: 16px;
  }


  /* COVER CONTENT */

  .hello-main {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .hello-text {
    width: 100%;
  }

  .hello-name {
    font-size: clamp(38px, 11vw, 50px);
  }

  .hello-actions {
    flex-wrap: wrap;
    padding-left: 0;
  }

  .hello-bench {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;

    margin-top: 20px;

    flex-wrap: wrap;
    justify-content: center;
  }

  .scope {
    margin-left: 0;
    max-width: 100%;
  }


  /* TITLES AND TEXT */

  .h2 {
    font-size: clamp(25px, 7.5vw, 32px);
    line-height: 1.15;
  }

  .h3 {
    font-size: 17px;
  }

  .small-script {
    font-size: 23px;
  }

  .body {
    font-size: 13px;
    line-height: 1.7;
  }

  .skill-list {
    margin-top: 18px;
  }

  .skill-list li {
    gap: 10px;
    padding: 12px 0;
  }

  .skill-list b {
    font-size: 13px;
  }

  .skill-list small {
    font-size: 11px;
    line-height: 1.5;
  }


  /* EXPERIENCE */

  .timeline {
    margin-top: 18px;
  }

  .job {
    padding-bottom: 19px;
  }

  .job h3 {
    font-size: 16px;
  }

  .job li {
    font-size: 12px;
    line-height: 1.65;
  }


  /* ELECTRIC CURRENT */

  .current-ring {
    display: block !important;
    z-index: 10;
    pointer-events: none;
  }

  .cr-a {
    stroke-width: 3.5;
  }

  .cr-b {
    stroke-width: 2.5;
  }


  /* HIDE DESKTOP-ONLY OBJECTS */

  .decor,
  .binder-clip,
  .rings,
  .gutter,
  .flip-leaf,
  .arc-flash {
    display: none !important;
  }


  /* PAGE NAVIGATION */

  .controls {
    width: calc(100% - 20px);
    max-width: 520px;

    gap: 8px;

    margin: 14px auto 0;
    padding: 10px 8px;
  }

  .page-btn {
    min-width: 0;
    padding: 10px 9px;
    font-size: 10px;
  }

  .progress {
    flex: 1;
    min-width: 65px;
  }

  .progress-caption {
    font-size: 7px;
    letter-spacing: .06em;
  }


  /* FOOTER */

  .footer {
    padding: 20px 14px;
    font-size: 8px;
    flex-wrap: wrap;
  }

}


/* EXTRA SMALL PHONES */

@media (max-width: 390px) {

  .topbar {
    padding: 8px 9px;
  }

  .brand {
    gap: 6px;
  }

  .brand-bolt {
    width: 31px;
    height: 31px;
  }

  .brand-text {
    font-size: 9px;
  }

  .chip-btn {
    padding: 7px;
    font-size: 8px;
  }

  .page {
    padding: 22px 15px 28px !important;
  }

  .side-left .page-lined,
  .side-right .page-lined {
    padding-left: 27px !important;
    padding-right: 15px !important;
  }

}


/* CURRENT EXPERIENCE HIGHLIGHT */

.job-current {
  border-left: 3px solid #d9a83f;
  padding-left: 12px;
  margin-left: -12px;

  background: linear-gradient(
    90deg,
    rgba(217,168,63,.09),
    transparent
  );
}

.job-current h3 {
  color: #263a54;
}

.job-current .job-date {
  color: #a16a32;
  font-weight: 700;
}

.job-current ul {
  font-size: 11.5px;
  line-height: 1.5;
}

.job-current li {
  margin-bottom: 4px;
}


/* ==========================================
   OUTER HIGH VOLTAGE ELECTRIC ANIMATION
========================================== */

.side-voltage-flow {
  overflow: visible;
  pointer-events: none;
}

/* Circuit track */

.outer-electrical-system {
  pointer-events: none;
}

.outer-trace {
  fill: none;
  stroke: #55aeb9;
  stroke-width: 2.2;
  stroke-opacity: .55;
  stroke-linecap: round;
  stroke-linejoin: round;

  vector-effect: non-scaling-stroke;

  filter: drop-shadow(0 0 3px #42a8ad);
}

/* Moving electricity */

.outer-current {
  fill: none;

  stroke-linecap: round;
  stroke-linejoin: round;

  stroke-dasharray: 7 93;

  vector-effect: non-scaling-stroke;

  pointer-events: none;
}

/* Gold high voltage */

.outer-gold {
  stroke: #ffe14d;
  stroke-width: 4;

  filter:
    drop-shadow(0 0 4px #ffe14d)
    drop-shadow(0 0 9px #ffbe24)
    drop-shadow(0 0 17px rgba(255,190,36,.7));

  animation: outerVoltageFlow 3.2s linear infinite;
}

/* Blue secondary current */

.outer-blue {
  stroke: #b9edff;
  stroke-width: 2.5;

  stroke-dasharray: 4 96;

  filter:
    drop-shadow(0 0 5px #76dfff)
    drop-shadow(0 0 12px #76dfff);

  animation: outerVoltageFlow 4.5s linear infinite;
}

/* Opposite direction */

.outer-right {
  animation-direction: reverse;
}

/* Delayed electrical pulse */

.delay-blue {
  animation-delay: -2.2s;
}

/* Main traveling animation */

@keyframes outerVoltageFlow {

  0% {
    stroke-dashoffset: 100;
    opacity: .15;
  }

  15% {
    opacity: 1;
  }

  75% {
    opacity: 1;
  }

  100% {
    stroke-dashoffset: 0;
    opacity: .2;
  }

}

/* Glowing electrical terminals */

.outer-terminals circle {
  fill: #ffe45a;

  stroke: #fff5b8;
  stroke-width: 1.5;

  vector-effect: non-scaling-stroke;

  filter:
    drop-shadow(0 0 4px #ffe45a)
    drop-shadow(0 0 10px #ffbd26);

  animation: outerTerminalPulse 1.7s ease-in-out infinite;
}

.outer-terminals circle:nth-child(even) {
  animation-delay: -.85s;
}

@keyframes outerTerminalPulse {

  0%, 100% {
    opacity: .3;
  }

  50% {
    opacity: 1;
  }

}

/* Keep effects outside book */

.book {
  position: relative;
  z-index: 5;
}

.side-voltage-flow {
  z-index: 2;
}

/* Mobile */

@media(max-width: 860px) {

  .side-voltage-flow {
    display: block !important;
  }

  .outer-gold {
    stroke-width: 3;
  }

  .outer-blue {
    stroke-width: 2;
  }

  .outer-trace {
    stroke-width: 1.5;
  }

}


/* =================================
   EXPERIENCE PAGE SPACE OPTIMIZATION
================================= */

.page[data-spread="3"] > .h2 {
  font-size: 34px;
  line-height: 1.08;
  margin-bottom: 14px;
}

.page[data-spread="3"] > .timeline {
  margin-top: 12px;
}

.page[data-spread="3"] .job-current {
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px dashed #cfbc91;
}

.page[data-spread="3"] .job-current .job-date {
  font-size: 9px;
  margin-bottom: 4px;
}

.page[data-spread="3"] .job-current h3 {
  font-size: 16px;
  margin: 4px 0;
}

.page[data-spread="3"] .job-current ul {
  margin: 5px 0 0;
  padding-left: 16px;
}

.page[data-spread="3"] .job-current li {
  font-size: 10.5px;
  line-height: 1.35;
  margin-bottom: 4px;
}

.page[data-spread="3"] .job:not(.job-current) {
  margin-top: 8px;
}

@media(max-width:860px) {
  .page[data-spread="3"] > .h2 {
    font-size: 29px;
  }

  .page[data-spread="3"] .job-current li {
    font-size: 11px;
    line-height: 1.5;
  }
}
