:root {
  --bg: #FFFFFF;
  --bg-alt: #F4F4F2;
  --surface: #FFFFFF;
  --ink: #111111;
  --border: #111111;
  --text: #111111;
  --text-muted: #6B6B6B;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --font-heading: 'Archivo', sans-serif;
  --font-body: 'Karla', sans-serif;
  --font-hand: 'Caveat', cursive;
  --container-w: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
}

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.01em; }

/* ============ NAVBAR ============ */
header#header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  border: 2px solid var(--ink);
  padding: 4px 12px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.logo:hover { transform: translate(-1px, -1px) rotate(-1deg); box-shadow: 4px 4px 0 var(--ink); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transform: rotate(-1deg);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-ghost {
  background: var(--bg);
  color: var(--ink);
}

.nav-cv { display: inline-flex; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-btn.active {
  background: var(--ink);
  color: var(--bg);
}
.lang-switch-mobile { align-self: flex-start; margin-bottom: 8px; }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.burger span { width: 24px; height: 3px; background: var(--ink); border-radius: 2px; }

/* ============ MOBILE MENU ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 199;
}
.overlay.show { opacity: 1; visibility: visible; }

.mobile-menu {
  position: fixed;
  top: 0; right: -100%;
  width: min(320px, 80%);
  height: 100%;
  background: var(--bg);
  border-left: 2px solid var(--ink);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 80px 32px 32px;
  transition: right 0.35s ease;
}
.mobile-menu.show { right: 0; }
.mobile-menu a { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.mobile-menu .btn { font-family: var(--font-body); }
.mobile-menu .btn-primary { color: var(--bg); }
.close-menu {
  position: absolute;
  top: 24px; right: 24px;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.8rem;
  cursor: pointer;
}

/* ============ HERO ============ */
.hero {
  padding: 60px 0 100px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.hero-inner { max-width: 780px; position: relative; z-index: 2; }

.doodle {
  position: absolute;
  z-index: 1;
  opacity: 0.9;
  pointer-events: none;
}
.doodle-star {
  width: 56px;
  top: 70px; right: 12%;
  animation: floaty 5s ease-in-out infinite, spin-slow 14s linear infinite;
}
.doodle-squiggle {
  width: 120px;
  bottom: 120px; right: 6%;
  animation: floaty 6s ease-in-out infinite reverse;
}
.doodle-circle {
  width: 52px;
  top: 45%; right: 22%;
  animation: spin-slow 20s linear infinite;
}
.doodle-arrow {
  width: 70px;
  top: 120px; right: 30%;
  animation: floaty 7s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.eyebrow {
  font-family: var(--font-hand);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  display: block;
  transform: rotate(-2deg);
  transform-origin: left;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 3.8rem);
  font-weight: 900;
  margin-bottom: 4px;
  position: relative;
  display: inline-block;
}
.squiggle-underline {
  display: block;
  width: min(100%, 340px);
  height: 14px;
  margin-top: 2px;
}
.squiggle-underline path {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw-line 1.2s ease-out 0.4s forwards;
}
@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

.hero-role {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--bg);
  background: var(--ink);
  font-weight: 700;
  display: inline-block;
  padding: 4px 14px;
  transform: rotate(-1deg);
  margin: 10px 0 24px;
  box-shadow: var(--shadow-sm);
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: 32px;
  text-align: justify;
}
.hero-desc strong { color: var(--ink); font-weight: 700; }

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-socials { display: flex; gap: 20px; }
.hero-socials a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease, transform 0.15s ease;
}
.hero-socials a:hover { color: var(--ink); transform: rotate(-2deg) scale(1.05); }

/* ============ MARQUEE ============ */
.marquee {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
}
.marquee-track {
  display: inline-block;
  animation: marquee 22s linear infinite;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
   padding-left: 50%; 
}
.marquee-track span { display: inline-block; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ SECTIONS ============ */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }

.section .eyebrow { font-size: 1.4rem; }

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 900;
  margin-bottom: 48px;
  max-width: 640px;
}

/* ============ HERO STATS ============ */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
}
.stat-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 220px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translate(-2px, -2px) rotate(-0.5deg); box-shadow: 7px 7px 0 var(--ink); }
.stat-number {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--ink);
}
.stat-label { color: var(--text-muted); font-size: 0.88rem; font-weight: 500; }

/* ============ LIVE PREVIEW ============ */
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}
.live-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.live-card:hover { transform: translate(-3px, -3px) rotate(-0.4deg); box-shadow: 8px 8px 0 var(--ink); }

.live-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-bottom: 2px solid var(--ink);
}
.live-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); }
.dot-red { background: var(--ink); }
.dot-yellow { background: #9B9B9B; }
.dot-green { background: var(--bg); }
.live-url {
  margin-left: 10px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  padding: 3px 12px;
  border-radius: 999px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-frame-wrap {
  position: relative;
  height: 300px;
  overflow: hidden;
  background: #fff;
  border-bottom: 2px solid var(--ink);
}
.live-frame-wrap iframe {
  width: calc(100% / 0.6);
  height: calc(100% / 0.6);
  border: none;
  pointer-events: none;
  display: block;
  transform: scale(0.6);
  transform-origin: 0 0;
}
.live-frame-link { position: absolute; inset: 0; }

.live-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.live-info h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }

/* ============ GITHUB ACTIVITY ============ */
.github-activity {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}
.github-chart {
  width: 100%;
  max-width: 100%;
  height: auto;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.github-streak {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  background: #FFFFFF;
}

/* ============ SKILL ============ */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.skill-grid .skill-card:nth-child(odd):hover { transform: translate(-2px, -2px) rotate(-1.2deg); box-shadow: 5px 5px 0 var(--ink); }
.skill-grid .skill-card:nth-child(even):hover { transform: translate(-2px, -2px) rotate(1.2deg); box-shadow: 5px 5px 0 var(--ink); }
.skill-card-etc {
  justify-content: center;
  border-style: dashed;
  box-shadow: none;
  color: var(--text-muted);
}
.skill-card-etc .skill-name { color: var(--text-muted); font-weight: 500; font-family: var(--font-hand); font-size: 1.3rem; }
.skill-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.02rem; }
.skill-tag {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--bg);
  background: var(--ink);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.skill-card .skill-tag[data-i18n="skill_tag_support"] {
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
}

/* ============ PROJECTS ============ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.project-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project-grid .project-card:nth-child(odd):hover { transform: translate(-3px, -3px) rotate(-0.5deg); box-shadow: 8px 8px 0 var(--ink); }
.project-grid .project-card:nth-child(even):hover { transform: translate(-3px, -3px) rotate(0.5deg); box-shadow: 8px 8px 0 var(--ink); }
.project-year {
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 10px;
}
.project-card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.project-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 18px; }
.project-stack { display: flex; gap: 8px; flex-wrap: wrap; }
.project-stack span {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-alt);
  border: 2px solid var(--ink);
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--ink);
}

.project-card-live { background: var(--bg-alt); }

.live-badge {
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  margin-right: 8px;
  animation: blink-badge 1.6s ease-in-out infinite;
}
@keyframes blink-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.project-link {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  transition: transform 0.15s ease;
}
.project-link:hover { transform: translateX(4px); }

/* ============ TIMELINE ============ */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute;
  left: -41px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--ink);
  transition: transform 0.15s ease, background 0.15s ease;
}
.timeline-item:hover .timeline-dot { background: var(--ink); transform: scale(1.25); }
.timeline-year {
  color: var(--bg);
  background: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.timeline-content h3 { font-size: 1.08rem; margin-bottom: 8px; }
.timeline-content p { color: var(--text-muted); font-size: 0.94rem; max-width: 640px; }

/* ============ KONTAK ============ */
.kontak-section { text-align: center; }
.kontak-section .section-title { margin-left: auto; margin-right: auto; }
.kontak-desc {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 48px;
}
.kontak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  text-align: left;
}
.kontak-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kontak-grid .kontak-card:nth-child(odd):hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 5px 5px 0 var(--ink); }
.kontak-grid .kontak-card:nth-child(even):hover { transform: translate(-2px, -2px) rotate(1deg); box-shadow: 5px 5px 0 var(--ink); }
.kontak-card svg { color: var(--ink); flex-shrink: 0; }
.kontak-label { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.kontak-value { display: block; font-weight: 700; font-size: 0.95rem; }

/* ============ FOOTER ============ */
.footer {
  border-top: 2px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ============ SCROLL PROGRESS ============ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 5px;
  width: 0;
  background: var(--ink);
  z-index: 300;
}

/* ============ HERO GRID + TOON ============ */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
}
.hero-text { min-width: 0; }
.hero-stats { grid-column: 1 / -1; }

.hero-toon {
  width: min(340px, 32vw);
  animation: floaty 6s ease-in-out infinite;
}
.hero-toon svg { width: 100%; height: auto; display: block; }

.toon-eye {
  animation: blink 4.5s infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.08); }
}
.pupil { transition: transform 0.08s linear; }

.arm-wave {
  animation: wave 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 8% 92%;
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  45% { transform: rotate(16deg); }
  70% { transform: rotate(-4deg); }
}

.steam {
  animation: steam-rise 2.2s ease-in-out infinite;
}
@keyframes steam-rise {
  0% { opacity: 0.2; transform: translateY(2px); }
  50% { opacity: 1; }
  100% { opacity: 0.2; transform: translateY(-4px); }
}

/* ============ TYPEWRITER ============ */
.type-caret {
  display: inline-block;
  width: 10px;
  height: 1em;
  background: var(--bg);
  margin-left: 6px;
  vertical-align: text-bottom;
  animation: caret-blink 0.9s step-end infinite;
}
@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============ CLICK BURST ============ */
.burst-star {
  position: absolute;
  font-size: 18px;
  color: var(--ink);
  pointer-events: none;
  z-index: 5;
  animation: burst-pop 0.7s ease-out forwards;
}
@keyframes burst-pop {
  0% { opacity: 1; transform: translate(0, 0) scale(0.4) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(var(--rot)); }
}

/* ============ BACK TO TOP ============ */
.back-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { animation: rocket-shake 0.4s ease-in-out; }
.back-top:active { transform: translateY(-6px) scale(0.95); }
@keyframes rocket-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.marquee:hover .marquee-track { animation-play-state: paused; }

/* ============ REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .doodle, .marquee-track, .live-badge, .squiggle-underline path,
  .hero-toon, .toon-eye, .arm-wave, .steam, .type-caret, .back-top:hover { animation: none !important; }
  .squiggle-underline path { stroke-dashoffset: 0; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .nav-links, .nav-cv { display: none; }
  nav > .lang-switch { display: none; }
  .burger { display: flex; }
  .hero { padding: 43px 0 72px; }
  .section { padding: 72px 0; }
  .doodle-circle, .doodle-arrow { display: none; }
  .doodle-star { right: 6%; width: 42px; }
  .doodle-squiggle { right: 4%; bottom: 60px; width: 90px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-toon { width: min(260px, 70vw); margin: 0 auto; order: 2; }
  .hero-stats { order: 3; }
  .back-top { right: 16px; bottom: 16px; width: 46px; height: 46px; }
}
