/* ==========================================================================
   GLOBAL.CSS — Reset, Design Tokens, Base Typography, Layout Primitives
   Alfiz Ilham Portfolio
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Reset
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

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

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* --------------------------------------------------------------------------
   2. Design Tokens
   -------------------------------------------------------------------------- */

:root {
  --panel-open-dur: 400ms;
  --panel-close-dur: 350ms;
  --panel-translate-y: 35px;
  --panel-blur: 2px;
  --panel-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --text-swap-dur: 200ms;
  --text-swap-translate-y: 8px;
  --text-swap-blur: 2px;
  --text-swap-ease: ease-out;
  /* --- Colors (pure white / pure black monochrome) --- */
  --color-bg: #ffffff;
  --color-bg-soft: #f2f2f2;
  --color-bg-dark: #000000;
  --color-text: #000000;
  --color-text-muted: #5a5a5a;
  --color-text-faint: #a3a3a3;
  --color-border: #d6d6d6;
  --color-border-dark: #2a2a2a;

  --color-accent: #000000;
  --color-white: #ffffff;
  --color-black: #000000;

  --color-live-green: #22c55e;

  --color-footer-bg: #000000;
  --color-footer-text: #ffffff;
  --color-footer-muted: #8a8a8a;

  /* --- Neumorphism shadows --- */
  /* Extruded (convex) resting surfaces */
  --neu-shadow-out-sm:
    -4px -4px 8px rgba(255, 255, 255, 0.7),
    4px 4px 8px rgba(0, 0, 0, 0.12);
  --neu-shadow-out:
    -6px -6px 12px rgba(255, 255, 255, 0.8),
    6px 6px 12px rgba(0, 0, 0, 0.16);
  --neu-shadow-out-lg:
    -8px -8px 18px rgba(255, 255, 255, 0.85),
    8px 8px 18px rgba(0, 0, 0, 0.18);
  /* Inset (concave) pressed / input surfaces */
  --neu-shadow-in-sm:
    inset -4px -4px 8px rgba(255, 255, 255, 0.7),
    inset 4px 4px 8px rgba(0, 0, 0, 0.12);
  --neu-shadow-in:
    inset -6px -6px 12px rgba(255, 255, 255, 0.8),
    inset 6px 6px 12px rgba(0, 0, 0, 0.16);
  /* Dark-surface neumorphism (footer / dark marquee accents) */
  --neu-dark-out:
    -4px -4px 10px rgba(255, 255, 255, 0.05),
    4px 4px 10px rgba(0, 0, 0, 0.55);
  --neu-dark-in:
    inset -4px -4px 10px rgba(255, 255, 255, 0.04),
    inset 4px 4px 10px rgba(0, 0, 0, 0.6);

  /* --- Neumorphism radii --- */
  --neu-radius-sm: 12px;
  --neu-radius: 16px;
  --neu-radius-lg: 24px;

  /* --- Typography --- */
  --font-family: "Plus Jakarta Sans", sans-serif;

  --fs-hero: clamp(48px, 10vw, 120px);
  --fs-h1: clamp(36px, 5vw, 64px);
  --fs-h2: clamp(30px, 3.5vw, 44px);
  --fs-h3: clamp(22px, 2.2vw, 28px);
  --fs-h4: clamp(18px, 1.6vw, 20px);
  --fs-body-lg: clamp(16px, 1.4vw, 18px);
  --fs-body: clamp(15px, 1.2vw, 16px);
  --fs-body-sm: clamp(13px, 1.1vw, 14px);
  --fs-caption: clamp(11px, 0.9vw, 12px);

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fw-black: 900;

  --lh-tight: 0.95;
  --lh-snug: 1.05;
  --lh-close: 1.1;
  --lh-normal: 1.2;
  --lh-relaxed: 1.3;
  --lh-body: 1.5;
  --lh-loose: 1.6;

  --ls-tight: -0.02em;
  --ls-normal: 0;
  --ls-wide: 0.05em;
  --ls-wider: 0.08em;

  /* --- Spacing Scale --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* --- Border Radius --- */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
  --shadow-icon-badge: 0 2px 8px rgba(0, 0, 0, 0.12);

  /* --- Transitions --- */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* --- Z-Index --- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-tooltip: 500;
}

/* --------------------------------------------------------------------------
   2b. Keyframe Animations
   -------------------------------------------------------------------------- */

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }
}

/* --------------------------------------------------------------------------
   3. Base Typography
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font-family);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
}

h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
}

p {
  line-height: var(--lh-body);
}

a {
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-text-muted);
}

strong,
b {
  font-weight: var(--fw-bold);
}

small {
  font-size: var(--fs-body-sm);
}

/* --------------------------------------------------------------------------
   4. Layout Primitives
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

section {
  scroll-margin-top: 88px;
}

.section-padding {
  padding-top: 120px;
  padding-bottom: 120px;
}

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--space-5);
}

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

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Flex helpers */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-5 {
  gap: var(--space-5);
}

.gap-6 {
  gap: var(--space-6);
}

/* Text alignment */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

/* --------------------------------------------------------------------------
   5. Utility Classes
   -------------------------------------------------------------------------- */

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

/* Eyebrow / badge labels */
.eyebrow {
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Section divider */
.divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
}

/* --------------------------------------------------------------------------
   6. Reduced Motion
   -------------------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Marquee tetap berjalan walau reduce-motion aktif */
  .intro-marquee-left,
  .intro-marquee-right {
    animation-duration: 22s !important;
    animation-iteration-count: infinite !important;
  }

  .tech-ticker-track,
  .marquee-left,
  .marquee-right {
    animation-duration: 30s !important;
    animation-iteration-count: infinite !important;
  }
}

/* --------------------------------------------------------------------------
   7. Hidden Scrollbar + Scroll Progress Bar
   -------------------------------------------------------------------------- */

/* Sembunyikan scrollbar native (tetap bisa scroll) */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html::-webkit-scrollbar {
  display: none;
}

html {
  scrollbar-width: none;
}

/* Scroll progress bar — 2px, hitam, di atas navbar */
#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: calc(var(--z-sticky) + 10);
  background: var(--color-accent);
  transition: width 0.08s linear;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   8. Lenis Smooth Scroll
   -------------------------------------------------------------------------- */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* Discourage casual text selection; form controls remain interactive. */
body {
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea,
select,
button,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

/* Full-page loading state. */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: var(--color-bg-dark, #0a0a0a);
  opacity: 1;
  transition: opacity 320ms ease;
}

.loading-overlay.is-ready {
  opacity: 0;
  pointer-events: none;
}

.honeycomb {
  position: relative;
  width: 24px;
  height: 24px;
}

.honeycomb div {
  position: absolute;
  width: 24px;
  height: 12px;
  margin-top: 6px;
  background: #f3f3f3;
  animation: honeycomb 2.1s infinite backwards;
}

.honeycomb div::before,
.honeycomb div::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
}

.honeycomb div::after {
  top: -6px;
  border-bottom: 6px solid #f3f3f3;
}

.honeycomb div::before {
  bottom: -6px;
  border-top: 6px solid #f3f3f3;
}

.honeycomb div:nth-child(1) {
  animation-delay: 0s;
  left: -28px;
  top: 0;
}

.honeycomb div:nth-child(2) {
  animation-delay: .1s;
  left: -14px;
  top: 22px;
}

.honeycomb div:nth-child(3) {
  animation-delay: .2s;
  left: 14px;
  top: 22px;
}

.honeycomb div:nth-child(4) {
  animation-delay: .3s;
  left: 28px;
  top: 0;
}

.honeycomb div:nth-child(5) {
  animation-delay: .4s;
  left: 14px;
  top: -22px;
}

.honeycomb div:nth-child(6) {
  animation-delay: .5s;
  left: -14px;
  top: -22px;
}

.honeycomb div:nth-child(7) {
  animation-delay: .6s;
  left: 0;
  top: 0;
}

@keyframes honeycomb {

  0%,
  20%,
  80%,
  100% {
    opacity: 0;
    transform: scale(0);
  }

  30%,
  70% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-overlay {
    transition: none;
  }

  .honeycomb div {
    animation: none;
    opacity: 1;
    transform: scale(1);
  }
}