/* ==========================================================================
   Rizky Pratama — Portfolio Website
   HTML + CSS + Vanilla JavaScript (tanpa framework, tanpa build step)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);

  --bg: #080b13;
  --bg-alt: #0b101b;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-solid: #0f1524;
  --surface-2: #151d30;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #e9edf7;
  --text-muted: #9aa6bd;
  --text-dim: #6b7894;

  --primary: #7c5cff;
  --secondary: #22d3ee;
  --success: #34d399;
  --danger: #f87171;

  --gradient: linear-gradient(115deg, #8b5cf6 0%, #6366f1 38%, #22d3ee 100%);
  --gradient-soft: linear-gradient(
    135deg,
    rgba(124, 92, 255, 0.16),
    rgba(34, 211, 238, 0.1)
  );

  --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.75);

  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  --container: 1160px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-alt: #eef1f8;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-2: #eef2f9;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);

  --text: #0f172a;
  --text-muted: #55637c;
  --text-dim: #7c879c;

  --primary: #6d4aff;
  --secondary: #0891b2;
  --gradient-soft: linear-gradient(
    135deg,
    rgba(109, 74, 255, 0.12),
    rgba(8, 145, 178, 0.08)
  );

  --shadow-sm: 0 8px 24px -14px rgba(15, 23, 42, 0.25);
  --shadow: 0 30px 70px -30px rgba(15, 23, 42, 0.3);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
}

p {
  margin: 0;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

strong {
  color: var(--text);
  font-weight: 700;
}

::selection {
  background: rgba(124, 92, 255, 0.4);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Background glow */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 600px at 10% 6%, rgba(124, 92, 255, 0.16), transparent 70%),
    radial-gradient(700px 700px at 92% 10%, rgba(34, 211, 238, 0.1), transparent 70%),
    radial-gradient(700px 700px at 50% 105%, rgba(124, 92, 255, 0.08), transparent 70%);
}

[data-theme="light"] .bg-glow {
  opacity: 0.6;
}

/* Utilities */
.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.gradient-text {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 7s linear infinite;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.25s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   3. Buttons, badges, pills
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease,
    background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  color: #fff;
  background: var(--gradient);
  background-size: 160% auto;
  box-shadow: 0 14px 30px -12px rgba(124, 92, 255, 0.75);
}

.btn--primary:hover {
  box-shadow: 0 18px 40px -12px rgba(124, 92, 255, 0.9);
  background-position: right center;
}

.btn--primary:hover svg {
  transform: translateX(3px);
}

.btn--ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn--block {
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.status-dot,
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.2s infinite;
}

/* --------------------------------------------------------------------------
   4. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease,
    box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--gradient);
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 10px 22px -10px rgba(124, 92, 255, 0.9);
}

.logo__dot {
  color: var(--secondary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav__link:hover {
  color: var(--text);
}

.nav__link.is-active {
  color: var(--text);
}

.nav__link.is-active::after {
  transform: scaleX(1);
}

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

.theme-toggle,
.nav-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.25s ease, color 0.25s ease,
    background-color 0.25s ease, transform 0.25s ease;
}

.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon--sun,
.theme-toggle .icon--moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon--sun,
[data-theme="light"] .theme-toggle .icon--moon {
  display: block;
}

.nav-toggle {
  display: none;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 2px auto;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s ease;
}

body.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + 66px);
  padding-bottom: 0;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: clamp(32px, 6vw, 76px);
}

.hero__title {
  margin-top: 22px;
  font-size: clamp(2.5rem, 5.4vw, 4.35rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.hero__role {
  display: flex;
  align-items: center;
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
  color: var(--secondary);
  letter-spacing: 0.01em;
  min-height: 1.7em;
}

.typed-cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 3px;
  background: var(--secondary);
  animation: blink 1s step-end infinite;
}

.hero__desc {
  max-width: 520px;
  margin-top: 20px;
  font-size: 1.03rem;
  color: var(--text-muted);
}

.hero__desc strong {
  font-weight: 700;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.socials a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: transform 0.3s var(--ease), color 0.25s ease,
    border-color 0.25s ease, background 0.25s ease;
}

.socials a:hover {
  transform: translateY(-3px);
  color: var(--text);
  border-color: var(--primary);
  background: var(--gradient-soft);
}

.socials svg {
  width: 17px;
  height: 17px;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin: 44px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.stat dt {
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stat dd {
  display: flex;
  align-items: baseline;
  gap: 1px;
  margin: 0;
  font-family: var(--font-display);
  line-height: 1;
}

.stat__num {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat__suffix {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
}

.stat__unit {
  margin-left: 5px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-dim);
}

/* Hero visual */
.hero__visual {
  display: flex;
  justify-content: center;
  width: 100%;
}

.avatar-wrap {
  position: relative;
  width: 100%;
  max-width: 430px;
}

.avatar-ring {
  position: absolute;
  inset: -26px;
  border-radius: 48px;
  background: conic-gradient(
    from 90deg,
    rgba(139, 92, 246, 0.95),
    rgba(34, 211, 238, 0.75),
    rgba(139, 92, 246, 0.95)
  );
  filter: blur(38px);
  opacity: 0.42;
  animation: spin 16s linear infinite;
}

.avatar-card {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.avatar-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 600;
  object-fit: cover;
}

.avatar-card__badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 11, 19, 0.68);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.float-card {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  animation: float 6s ease-in-out infinite;
}

.float-card__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--gradient-soft);
  font-size: 0.9rem;
}

.float-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.1;
}

.float-card span:not(.float-card__icon) {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.float-card--1 {
  top: 13%;
  left: -28px;
}

.float-card--2 {
  right: -26px;
  bottom: 15%;
  animation-delay: -3s;
}

/* Tech marquee */
.marquee {
  position: relative;
  margin-top: 82px;
  padding: 19px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  gap: 54px;
  width: max-content;
  animation: marquee 36s linear infinite;
}

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

.marquee__track span {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-dim);
}

.marquee__track span::after {
  content: "•";
  position: absolute;
  right: -32px;
  color: var(--primary);
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   6. Sections
   -------------------------------------------------------------------------- */
.section {
  position: relative;
  padding-block: 100px;
}

.section--alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 700px;
  margin-bottom: 54px;
}

.section-head .eyebrow {
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  letter-spacing: -0.035em;
}

.section-desc {
  margin-top: 14px;
  max-width: 640px;
  font-size: 1.01rem;
  color: var(--text-muted);
}

/* Scroll reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   7. About
   -------------------------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
}

.about__card {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.about__avatar {
  width: 124px;
  height: 124px;
  margin-inline: auto;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--surface-2);
  box-shadow: 0 0 0 1px var(--border);
}

.about__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.about__card h3 {
  margin-top: 20px;
  font-size: 1.3rem;
}

.about__role {
  margin-top: 4px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--secondary);
}

.about__info {
  margin-top: 24px;
  text-align: left;
}

.about__info li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.about__label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.about__info a:hover {
  color: var(--secondary);
}

.badge-available {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-available::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.about__card .btn {
  margin-top: 24px;
}

.about__text h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  letter-spacing: -0.03em;
}

.about__text p {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.check-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.check-list li {
  position: relative;
  padding-left: 30px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  font-size: 0.66rem;
  font-weight: 700;
}

.about__highlight {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.about__highlight > div {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.about__highlight strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.42rem;
  letter-spacing: -0.02em;
}

.about__highlight span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   8. Services
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

.service {
  padding: 30px;
  transition: transform 0.4s var(--ease), border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.service:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: var(--shadow);
}

.service__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--gradient-soft);
  color: var(--secondary);
}

.service__icon svg {
  width: 26px;
  height: 26px;
}

.service h3 {
  margin-top: 22px;
  font-size: 1.2rem;
}

.service p {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.service__list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.service__list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.service__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient);
}

/* --------------------------------------------------------------------------
   9. Skills
   -------------------------------------------------------------------------- */
.skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(28px, 5vw, 56px);
}

.skills__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 1.08rem;
}

.skills__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.8);
}

.skills__dot--back {
  background: linear-gradient(135deg, #22d3ee, #34d399);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
}

.skill {
  margin-bottom: 21px;
}

.skill:last-child {
  margin-bottom: 0;
}

.skill__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 0.87rem;
  font-weight: 600;
}

.skill__head span:last-child {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.5);
  transition: width 1.5s var(--ease);
}

.skills__col:nth-child(2) .bar__fill {
  background: linear-gradient(90deg, #22d3ee, #34d399);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.4);
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 50px;
}

.tool-chips li {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.25s ease, color 0.25s ease,
    transform 0.25s ease;
}

.tool-chips li:hover {
  border-color: var(--secondary);
  color: var(--text);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   10. Portfolio
   -------------------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 34px;
}

.filter {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.25s ease, border-color 0.25s ease,
    background 0.25s ease, transform 0.25s ease;
}

.filter:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.filter.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--gradient);
  box-shadow: 0 10px 24px -12px rgba(124, 92, 255, 0.8);
}

.portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.work {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.work:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  box-shadow: var(--shadow);
}

.work.is-hidden {
  display: none;
}

.work.is-appearing {
  animation: card-in 0.45s var(--ease) both;
}

.work__button {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
}

.work__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}

.work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.75s var(--ease);
}

.work:hover .work__media img {
  transform: scale(1.055);
}

.work__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(5, 8, 15, 0.82), rgba(5, 8, 15, 0.1));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.work:hover .work__overlay,
.work:focus-within .work__overlay {
  opacity: 1;
}

.work__view {
  padding: 10px 20px;
  border-radius: 999px;
  background: #fff;
  color: #0b0f19;
  font-size: 0.8rem;
  font-weight: 700;
  transform: translateY(8px);
  transition: transform 0.35s var(--ease);
}

.work:hover .work__view,
.work:focus-within .work__view {
  transform: translateY(0);
}

.work__body {
  display: block;
  padding: 20px 22px 24px;
}

.work__cat {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--secondary);
}

.work__title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.work__desc {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. Contact
   -------------------------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(28px, 4vw, 44px);
  align-items: start;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.25s ease, transform 0.25s ease,
    background 0.25s ease;
}

a.contact__item:hover {
  border-color: var(--primary);
  background: var(--gradient-soft);
  transform: translateX(4px);
}

.contact__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--gradient-soft);
  color: var(--secondary);
}

.contact__icon svg {
  width: 20px;
  height: 20px;
}

.contact__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.contact__value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.contact__note {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--secondary);
  background: var(--gradient-soft);
}

.contact__note strong {
  display: block;
  font-size: 0.82rem;
}

.contact__note p {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.contact__form {
  padding: 32px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.field {
  margin-bottom: 17px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.81rem;
  font-weight: 600;
}

.field label span {
  color: var(--danger);
}

.field input,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    background-color 0.25s ease;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-dim);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.14);
}

.field__error {
  display: block;
  margin-top: 5px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--danger);
}

.field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.field--checkbox input {
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.field--checkbox label {
  margin: 0;
  font-size: 0.79rem;
  font-weight: 400;
  color: var(--text-muted);
}

.field--checkbox .field__error {
  flex-basis: 100%;
  margin-left: 27px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact__form .btn {
  margin-top: 6px;
  min-height: 48px;
}

.btn__loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn.is-loading .btn__label {
  display: none;
}

.btn.is-loading .btn__loader {
  display: inline-block;
}

.form-status {
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 500;
}

.form-status.is-success {
  color: var(--success);
}

.form-status.is-error {
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding-top: 60px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 40px;
  align-items: start;
  padding-bottom: 42px;
}

.footer__brand p {
  max-width: 310px;
  margin-top: 14px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding-top: 8px;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.footer__nav a {
  transition: color 0.25s ease;
}

.footer__nav a:hover {
  color: var(--secondary);
}

.socials--sm {
  margin-top: 0;
  padding-top: 4px;
}

.socials--sm a {
  width: 38px;
  height: 38px;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-block: 20px 26px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.heart {
  color: #fb7185;
}

/* --------------------------------------------------------------------------
   13. Back to top
   -------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 55;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease,
    transform 0.3s var(--ease), background 0.3s ease, color 0.3s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
}

.to-top svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   14. Modal
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.74);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: 90dvh;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  transform: translateY(18px) scale(0.985);
  transition: transform 0.38s var(--ease);
}

.modal.is-open .modal__panel {
  transform: none;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 11, 19, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  transition: background 0.25s ease, transform 0.25s ease;
}

.modal__close:hover {
  background: rgba(248, 113, 113, 0.75);
  transform: rotate(90deg);
}

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.modal__body {
  padding: 28px 30px 32px;
}

.modal__body h3 {
  margin-top: 4px;
  font-size: 1.55rem;
}

.modal__body > p {
  margin-top: 12px;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.modal__tags span {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal__body .btn {
  margin-top: 24px;
}

body.modal-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   15. Toast notifications
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  line-height: 1.5;
  animation: toast-in 0.35s var(--ease);
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toast-out 0.3s ease forwards;
}

.toast--success {
  border-color: rgba(52, 211, 153, 0.45);
}

.toast--error {
  border-color: rgba(248, 113, 113, 0.45);
}

.toast__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.toast--success .toast__icon {
  background: var(--success);
  color: #052e1c;
}

.toast--error .toast__icon {
  background: var(--danger);
  color: #3b0a0a;
}

.toast--info .toast__icon {
  background: var(--secondary);
  color: #062b33;
}

/* --------------------------------------------------------------------------
   16. Animations
   -------------------------------------------------------------------------- */
@keyframes gradient-shift {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   17. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .about,
  .contact {
    grid-template-columns: 300px 1fr;
  }

  .nav {
    gap: 16px;
  }

  .hero__stats {
    gap: 26px;
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 55;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    max-height: calc(100dvh - var(--header-h));
    padding: 24px;
    overflow-y: auto;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease,
      transform 0.3s var(--ease);
  }

  body.nav-open .nav {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav__link {
    display: block;
    padding: 13px 16px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .nav__link::after {
    display: none;
  }

  .nav__link.is-active {
    background: var(--gradient-soft);
    color: var(--text);
  }

  .nav__cta {
    width: 100%;
  }

  body.nav-open {
    overflow: hidden;
  }

  .hero {
    padding-top: calc(var(--header-h) + 52px);
  }

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__desc {
    margin-inline: auto;
  }

  .hero__actions,
  .socials,
  .hero__stats {
    justify-content: center;
  }

  .hero__stats {
    width: 100%;
    gap: 40px;
  }

  .hero__visual {
    order: 2;
  }

  .avatar-wrap {
    max-width: 390px;
  }

  .marquee {
    margin-top: 64px;
  }

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

  .about__card {
    max-width: 430px;
    margin-inline: auto;
  }

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

  .contact__info {
    order: 2;
  }

  .contact__form {
    order: 1;
  }

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

  .socials--sm {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .skills {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .section {
    padding-block: 80px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 68px;
  }

  .container {
    width: calc(100% - 32px);
  }

  .hero {
    padding-top: calc(var(--header-h) + 44px);
  }

  .hero__title {
    font-size: clamp(2.1rem, 9.5vw, 2.75rem);
  }

  .hero__stats {
    gap: 18px;
    justify-content: space-between;
    margin-top: 36px;
  }

  .stat__num {
    font-size: 1.6rem;
  }

  .stat__unit {
    display: none;
  }

  .avatar-wrap {
    max-width: 330px;
  }

  .float-card {
    padding: 9px 12px;
    transform: scale(0.9);
  }

  .float-card--1 {
    left: -12px;
  }

  .float-card--2 {
    right: -12px;
  }

  .marquee {
    margin-top: 54px;
  }

  .section {
    padding-block: 72px;
  }

  .section-head {
    margin-bottom: 40px;
  }

  .about__card,
  .contact__form {
    padding: 24px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 32px;
  }

  .socials--sm {
    grid-column: auto;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
  }

  .hero__actions {
    width: 100%;
    max-width: 320px;
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .toast-stack {
    bottom: 16px;
  }
}

@media (max-width: 380px) {
  .float-card--1 {
    display: none;
  }

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

/* --------------------------------------------------------------------------
   18. Accessibility & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .to-top,
  .marquee,
  .socials,
  .filters,
  .contact__form,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .section {
    padding-block: 24px;
  }

  .bg-glow {
    display: none;
  }

  .about__card,
  .work,
  .service,
  .contact__item {
    border-color: #ddd;
    box-shadow: none;
  }
}

/* --------------------------------------------------------------------------
   19. Halaman 404
   -------------------------------------------------------------------------- */
.error-page {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + 48px) 0 64px;
  text-align: center;
}

.error-page__inner {
  max-width: 620px;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 24vw, 13rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.error-page h2 {
  margin-top: 10px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.error-page p {
  max-width: 480px;
  margin: 16px auto 0;
  color: var(--text-muted);
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.error-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.error-header .header__inner {
  height: var(--header-h);
}

@media (max-width: 640px) {
  .error-page__actions .btn {
    width: 100%;
  }

  .error-page__actions {
    max-width: 320px;
    margin-inline: auto;
    flex-direction: column;
  }
}
