/* =========================================================
   Pixel Indie Profile — styles.css
   Palet & ukuran ada di :root. Ganti di situ kalau mau recolor.
   ========================================================= */

:root {
  --ink: #2b2118;
  --ink-soft: #4a3a2c;
  --paper: #f7ecd7;
  --paper-2: #f1e0c4;
  --cream: #fbf5e6;
  --brown: #6b4f3a;
  --green: #7a9e5f;
  --green-dark: #4f6b3a;
  --green-light: #a8c686;
  --amber: #e8a87c;
  --amber-dark: #c97f4f;
  --rose: #d98b8b;
  --sky: #a9d6e5;
  --night: #3a2e4a;

  --border: 4px;
  --shadow: 6px 6px 0 var(--ink);
  --radius: 2px;

  --font-display: "Press Start 2P", monospace;
  --font-body: "VT323", monospace;

  --header-h: 72px;
  --max: 1080px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--cream);
  border: var(--border) solid var(--ink);
  font-size: 20px;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px dashed var(--amber-dark);
  outline-offset: 4px;
}

/* ---------- Latar kanvas ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding: 0 clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: var(--border) solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.brand-mark {
  width: 16px;
  height: 16px;
  background: var(--amber);
  box-shadow:
    0 0 0 3px var(--ink),
    inset 0 -6px 0 var(--amber-dark);
  image-rendering: pixelated;
}

.brand-dot {
  color: var(--amber-dark);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 28px);
  font-size: 21px;
}

.site-nav a {
  position: relative;
  text-decoration: none;
  padding: 4px 2px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 3px;
  background: var(--amber-dark);
  transition: right 0.18s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  right: 0;
}

.site-nav .nav-cta {
  padding: 8px 14px;
  background: var(--green);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.site-nav .nav-cta::after {
  display: none;
}

.site-nav .nav-cta:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 20px;
  height: 3px;
  background: var(--ink);
  margin: 0 auto;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100svh - var(--header-h));
  padding: 48px 20px 120px;
  text-align: center;
  background: transparent;
}

.hero-inner {
  max-width: 760px;
  animation: rise 0.7s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 12px;
  background: var(--cream);
  border: 3px solid var(--ink);
  font-size: 19px;
}

.blink {
  color: var(--green-dark);
  animation: blink 1.4s steps(1) infinite;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 4.4vw, 40px);
  line-height: 1.5;
  letter-spacing: -0.5px;
  text-shadow: 4px 4px 0 var(--amber);
}

.highlight {
  color: var(--green-dark);
}

.hero-role {
  margin: 18px 0 0;
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--ink-soft);
}

.hero-tagline {
  min-height: 1.6em;
  margin: 10px 0 0;
  font-size: 24px;
  color: var(--brown);
}

.caret {
  display: inline-block;
  margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 34px;
}

.hero-hint {
  margin-top: 54px;
  font-size: 18px;
  color: var(--ink-soft);
  animation: bob 2.4s ease-in-out infinite;
}

.hero-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  overflow: hidden;
  pointer-events: none;
}

.grass {
  position: absolute;
  left: -5%;
  right: -5%;
  height: 74px;
  bottom: -26px;
  border-top: 4px solid var(--ink);
}

.grass-back {
  height: 96px;
  bottom: -44px;
  background: var(--green-light);
  clip-path: polygon(0 40%, 8% 52%, 16% 38%, 24% 55%, 32% 40%, 40% 58%, 48% 42%, 56% 60%, 64% 44%, 72% 58%, 80% 40%, 88% 55%, 96% 42%, 100% 50%, 100% 100%, 0 100%);
  opacity: 0.75;
}

.grass-front {
  background: var(--green);
  clip-path: polygon(0 55%, 6% 42%, 13% 60%, 20% 46%, 27% 62%, 35% 44%, 42% 60%, 50% 46%, 58% 62%, 66% 44%, 73% 60%, 81% 46%, 88% 62%, 95% 45%, 100% 58%, 100% 100%, 0 100%);
}

/* ---------- Tombol ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 22px;
  text-decoration: none;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-primary {
  background: var(--amber);
}

.btn-ghost {
  background: var(--cream);
}

/* ---------- Section umum ---------- */

.section {
  position: relative;
  padding: clamp(64px, 10vw, 110px) clamp(16px, 4vw, 40px);
  background: var(--paper);
  border-top: var(--border) solid var(--ink);
}

.section-alt {
  background: var(--paper-2);
}

.section-head {
  max-width: var(--max);
  margin: 0 auto 48px;
}

.tag {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1px;
}

.section h2 {
  max-width: 720px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(16px, 2.6vw, 24px);
  line-height: 1.6;
}

/* ---------- Tentang ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
}

.about-card {
  padding: 16px;
  background: var(--cream);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow);
  text-align: center;
}

.about-photo {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border: 3px solid var(--ink);
  background: var(--sky);
  animation: bobSlow 5s ease-in-out infinite;
}

.about-caption {
  margin: 12px 0 0;
  font-size: 18px;
  color: var(--brown);
}

.about-copy p {
  margin: 0 0 18px;
  max-width: 62ch;
  font-size: 23px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0 0;
}

.stats div {
  padding: 14px;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.stats dt {
  font-size: 17px;
  color: var(--brown);
}

.stats dd {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--green-dark);
}

/* ---------- Keahlian ---------- */

.skills {
  display: grid;
  gap: 22px;
  max-width: 760px;
  margin: 0 auto;
}

.skill-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 22px;
}

.skill-val {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--brown);
}

.bar {
  height: 26px;
  padding: 3px;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--green) 0 12px,
    var(--green-dark) 12px 16px
  );
  transition: width 1s steps(12) 0.2s;
}

.reveal.is-visible .bar-fill {
  width: var(--value);
}

/* ---------- Proyek ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  max-width: var(--max);
  margin: 0 auto;
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--ink);
}

.project-art {
  position: relative;
  height: 158px;
  overflow: hidden;
  border-bottom: 3px solid var(--ink);
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.project-body h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.6;
}

.project-body p {
  margin: 0 0 16px;
  font-size: 21px;
  color: var(--ink-soft);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 2px 8px;
  font-size: 17px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
}

.project-link {
  margin-top: auto;
  font-size: 21px;
  text-decoration: none;
  color: var(--green-dark);
}

.project-link:hover {
  text-decoration: underline;
}

.project-link.is-soon {
  color: var(--brown);
  cursor: default;
}

.project-link.is-soon:hover {
  text-decoration: none;
}

/* Mini landscape pixel untuk kartu proyek */
.art-coffee {
  background: linear-gradient(#ffb27a 0 58%, var(--green-light) 58% 100%);
}

.art-photo {
  background: linear-gradient(var(--night) 0 62%, #5b4a6e 62% 100%);
}

.art-game {
  background: linear-gradient(#263b2e 0 60%, #35543c 60% 100%);
}

.pixel-sun,
.pixel-moon {
  position: absolute;
  top: 28px;
  right: 52px;
  width: 26px;
  height: 26px;
  background: #fff1b8;
  box-shadow: 0 0 0 6px #ffe08a;
  animation: bob 5s ease-in-out infinite;
}

.pixel-moon {
  background: #f4ecd8;
  box-shadow: 0 0 0 6px rgba(244, 236, 216, 0.18);
}

.pixel-cloud {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  opacity: 0.9;
  box-shadow:
    12px 0 #fff,
    24px 0 #fff,
    -12px 12px #fff,
    0 12px #fff,
    12px 12px #fff,
    24px 12px #fff,
    36px 12px #fff,
    0 -12px #fff,
    12px -12px #fff;
  animation: drift 14s linear infinite;
}

.pixel-cloud.c1 {
  top: 34px;
  left: -40px;
}

.pixel-cloud.c2 {
  top: 70px;
  left: 40%;
  transform: scale(0.7);
  animation-duration: 20s;
  animation-delay: -6s;
}

.pixel-hill {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 54px;
  background: var(--green);
  border-top: 4px solid var(--ink);
  clip-path: polygon(0 70%, 20% 30%, 40% 62%, 60% 24%, 80% 58%, 100% 34%, 100% 100%, 0 100%);
}

.pixel-star {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff;
  animation: twinkle 2.6s steps(1) infinite;
}

.pixel-star.s1 { top: 26px; left: 30px; }
.pixel-star.s2 { top: 52px; left: 88px; animation-delay: 0.8s; }
.pixel-star.s3 { top: 18px; left: 150px; animation-delay: 1.5s; }

.pixel-tree {
  position: absolute;
  left: 40px;
  bottom: 0;
  width: 18px;
  height: 26px;
  background: #3f2b1d;
  box-shadow:
    -18px -18px 0 0 #4f7a45,
    0 -18px 0 0 #5d8c50,
    18px -18px 0 0 #4f7a45,
    -9px -34px 0 0 #5d8c50,
    9px -34px 0 0 #4f7a45,
    0 -50px 0 0 #5d8c50;
}

.pixel-firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #ffe08a;
  box-shadow: 0 0 8px 2px rgba(255, 224, 138, 0.7);
  animation: floaty 4s ease-in-out infinite;
}

.pixel-firefly.f1 { top: 40px; left: 30%; }
.pixel-firefly.f2 { top: 78px; left: 62%; animation-delay: -1.4s; }
.pixel-firefly.f3 { top: 56px; left: 82%; animation-delay: -2.6s; }

/* ---------- Kontak ---------- */

.section-contact {
  background: var(--ink);
  color: var(--cream);
  border-top: var(--border) solid var(--ink);
}

.contact-box {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px);
  text-align: center;
  background: #352a1f;
  border: var(--border) solid var(--cream);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}

.section-contact .tag {
  background: var(--amber);
  color: var(--ink);
}

.contact-box h2 {
  max-width: none;
  margin: 0 auto 16px;
  color: var(--cream);
}

.contact-box p {
  max-width: 46ch;
  margin: 0 auto;
  font-size: 23px;
  color: #d8cbb4;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.contact-actions .btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.45);
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding: 24px clamp(16px, 4vw, 40px);
  background: var(--paper-2);
  border-top: var(--border) solid var(--ink);
  font-size: 19px;
  color: var(--brown);
}

.site-footer p {
  margin: 0;
}

.footer-note {
  opacity: 0.8;
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Animasi ---------- */

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes bobSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes drift {
  from { translate: 0 0; }
  to { translate: 320px 0; }
}

@keyframes twinkle {
  0%, 60%, 100% { opacity: 0.25; }
  20%, 40% { opacity: 1; }
}

@keyframes floaty {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  50% { transform: translate(14px, -12px); opacity: 1; }
}

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

/* ---------- Responsif ---------- */

@media (max-width: 820px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-card {
    max-width: 300px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 4px);
    right: clamp(16px, 4vw, 40px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 200px;
    padding: 8px;
    background: var(--cream);
    border: var(--border) solid var(--ink);
    box-shadow: var(--shadow);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 14px;
  }

  .site-nav a::after {
    display: none;
  }

  .site-nav .nav-cta {
    text-align: center;
    box-shadow: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 21px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .bar-fill {
    width: var(--value);
  }
}
