/* =========================================================
   ALZAI7 LAYOUT, TYPOGRAPHY & RESPONSIVE STYLING
   ========================================================= */

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

html {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-base);
  overflow-x: hidden;
}

.mono {
  font-family: var(--font-mono);
}

.text-accent {
  color: var(--accent);
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* Preloader + CSS Failsafe Exit (Anti-Stuck) */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: preloaderSafeExit 0.45s ease 2.2s forwards;
}

@keyframes preloaderSafeExit {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.preloader-box {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  background: var(--bg-base);
  display: grid;
  place-items: center;
  padding: 16px;
  box-shadow: 0 0 0 transparent, 0 0 0 transparent;
}

.preloader-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-fallback {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent);
}

.preloader-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* Navbar */
.navbar-wrap {
  position: sticky;
  top: 16px;
  z-index: 100;
  padding-inline: 16px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  max-width: 1120px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 42px;
  height: 42px;
  padding: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-fallback {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

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

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
}

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

.menu-toggle {
  display: none;
}

/* Hero Section */
.hero {
  padding-top: 48px;
  padding-bottom: 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 44px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 20px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.hero-title {
  font-size: clamp(2.05rem, 4.1vw, 3.15rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 28px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 34px;
}

.hero-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 20px;
  border-top: 1px solid rgba(194, 205, 223, 0.6);
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.metric-divider {
  width: 1px;
  height: 28px;
  background: var(--shadow-dark);
}

/* Profile Photo Visual */
.hero-visual {
  display: flex;
  justify-content: center;
}

.profile-card-wrap {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.profile-outer {
  width: 100%;
  aspect-ratio: 1 / 1.04;
  padding: 16px;
}

.profile-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

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

.profile-placeholder {
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.profile-stack-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.dock-pill {
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Sections General */
.section {
  padding-block: 60px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 34px;
}

.section-kicker {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.section-title {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.section-sub {
  max-width: 440px;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

/* Tech Stack Grid */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stack-group {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stack-group-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stack-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stack-cat {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.stack-group-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tech-tag {
  padding: 7px 11px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Filter Tabs */
.filter-group {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 5px;
  gap: 4px;
}

.filter-btn {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 13px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: var(--bg-base);
  color: var(--accent);
  box-shadow:
    3px 3px 6px var(--shadow-dark),
    -3px -3px 6px var(--shadow-light);
}

/* Projects Grid (8 Proyek) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.project-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  will-change: transform, opacity;
}


.project-card.hidden {
  display: none;
}

.project-thumb {
  padding: 13px;
  margin-bottom: 18px;
}

.thumb-mockup {
  background: #DCE5F2;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.mockup-top {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(194, 205, 223, 0.5);
}

.mockup-top span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #B0BDD1;
}

.mockup-url {
  margin-left: 6px;
  font-size: 0.66rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mockup-body {
  padding: 16px 14px;
}

.mockup-badge {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.mockup-body h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.mockup-body p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
/* Auto Website Screenshot Thumbnail */
.mockup-preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #D4DFEE;
  overflow: hidden;
}

.mockup-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease;
}

.project-card:hover .mockup-screenshot {
  transform: scale(1.03);
}


.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.project-title {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-desc {
  font-size: 0.89rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.service-card {
  padding: 28px 24px;
}

.service-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.service-tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.service-card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.service-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.service-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  padding-top: 14px;
  border-top: 1px solid rgba(194, 205, 223, 0.6);
}

.service-list li::before {
  content: "— ";
  color: var(--accent);
  font-weight: 700;
}

/* Contact Section */
.contact-wrap {
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.contact-desc {
  color: var(--text-secondary);
  margin-top: 12px;
  margin-bottom: 28px;
}

.contact-direct {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.direct-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.direct-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.direct-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.direct-val {
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.direct-val:hover {
  color: var(--accent);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-feedback {
  font-size: 0.76rem;
  color: var(--accent);
  min-height: 1.2em;
}

/* Footer */
.footer {
  padding-top: 20px;
  padding-bottom: 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(194, 205, 223, 0.7);
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.footer-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.footer-socials {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.15s ease;
}

.social-pill:hover {
  color: var(--accent);
}

.social-pill:active {
  transform: scale(0.97);
  box-shadow:
    inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
}


/* Live Preview Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(228, 235, 245, 0.86);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-window {
  width: 100%;
  max-width: 1040px;
  height: 85vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.modal-title-wrap h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-title-wrap span {
  font-size: 0.74rem;
  color: var(--accent);
}

.device-switcher {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
}

.device-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.device-btn.active {
  background: var(--bg-base);
  color: var(--accent);
  box-shadow:
    3px 3px 6px var(--shadow-dark),
    -3px -3px 6px var(--shadow-light);
}

.modal-stage {
  flex: 1;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.iframe-frame {
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  transition: width 0.3s ease;
}

.iframe-frame.mobile {
  width: 375px;
  max-width: 100%;
  border: 6px solid #1E293B;
  border-radius: 26px;
}

.iframe-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.preview-fallback {
  max-width: 480px;
  text-align: center;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.fallback-badge {
  padding: 6px 12px;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

.preview-fallback p {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* =========================================================
   MEDIA SHIELD (ANTI-DOWNLOAD & ANTI-LONG-PRESS)
   ========================================================= */
img,
.protected-media {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.profile-img,
.brand-logo img,
.preloader-logo,
.footer-logo {
  pointer-events: none;
}

/* Lapisan transparan pelindung di atas bingkai foto */
.profile-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .hero-grid,
  .contact-wrap {
    grid-template-columns: 1fr;
  }

  .stack-grid,
  .projects-grid,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-visual {
    order: -1;
  }

  .profile-card-wrap {
    max-width: 290px;
  }
}

@media (max-width: 680px) {
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    background: var(--bg-base);
    padding: 18px;
    border-radius: var(--radius-md);
    box-shadow:
      8px 8px 16px var(--shadow-dark),
      -8px -8px 16px var(--shadow-light);
  }

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .stack-grid,
  .projects-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }

  .contact-wrap {
    padding: 24px 20px;
  }
}

/* Perbaikan Navbar Mobile (320px - 480px) */
@media (max-width: 480px) {
  .navbar-wrap {
    top: 10px;
    padding-inline: 12px;
  }

  .navbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .brand-name {
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .brand-sub {
    font-size: 0.6rem;
    white-space: nowrap;
  }

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

  .nav-actions .btn-sm {
    padding: 8px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .nav-actions .btn-sm svg {
    display: none;
  }
}

/* Pastikan Semua Kartu & Grid Presisi di Tengah Layar Mobile */
.stack-group,
.project-card,
.service-card,
.contact-wrap {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 680px) {
  .container {
    padding-inline: 18px;
  }

  .stack-grid,
  .projects-grid,
  .services-grid {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .project-card {
    padding: 16px;
  }
}
