/* Laman utama & 404 USTP PPD Batu Pahat.
   Sistem visual: skill landing-page-design (Poppins sahaja, skala jenis Tailwind,
   token jarak, latar rata, lengkung gerakan asas). */

@font-face{font-family:'Poppins';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/poppins-latin-400-normal.woff2) format('woff2')}
@font-face{font-family:'Poppins';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/poppins-latin-500-normal.woff2) format('woff2')}
@font-face{font-family:'Poppins';font-style:normal;font-weight:600;font-display:swap;src:url(fonts/poppins-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:'Poppins';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/poppins-latin-700-normal.woff2) format('woff2')}

:root {
  --bg: #000000;
  --surface: rgba(24, 24, 24, .72);   /* #181818 */
  --ink: #FFFFFF;
  --muted: #9B9B9B;
  --faint: rgba(255, 255, 255, .64);
  --line: rgba(255, 255, 255, .12);
  --ok: #34D399;
  --warn: #FBBF24;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Spacing tokens (B2) */
  --s-75: 8px; --s-100: 12px; --s-200: 16px; --s-300: 24px; --s-400: 32px; --s-600: 48px; --s-900: 96px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: 'Poppins', sans-serif; font-size: 16px; line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

/* ---- Named text styles (B1) ---- */
.heading-3 { font-size: 36px; line-height: 40px; font-weight: 600; }
.heading-5 { font-size: 24px; line-height: 32px; font-weight: 600; }
.title-2   { font-size: 18px; line-height: 28px; font-weight: 500; }
.body-6    { font-size: 14px; line-height: 20px; font-weight: 400; }
.button-sm { font-size: 14px; line-height: 20px; font-weight: 600; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; }
.caption-4 { font-size: 12px; line-height: 16px; font-weight: 500; }
.caption-5 { font-size: 12px; line-height: 16px; font-weight: 400; }

h1, .kpm { text-wrap: balance; }
p, footer span { text-wrap: pretty; }

/* ---- Background field ---- */
canvas#medan {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block;
  touch-action: none; mix-blend-mode: screen;
}

/* Giant outlined word behind the content: the "404" of this page. Decorative graphic. */
.latar {
  position: fixed; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none;
  font-weight: 700; letter-spacing: -.04em; line-height: 1;
  font-size: min(34vw, 520px);
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .07);
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform 500ms var(--ease);
}

/* ---- Content ---- */
main {
  position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: var(--s-400) var(--s-200) var(--s-900);
  pointer-events: none;
}
main a { pointer-events: auto; }

.kpm { margin: 0 0 var(--s-300); color: var(--muted); text-transform: uppercase; letter-spacing: .2em; }

.logo {
  width: 160px; height: 160px; margin-bottom: var(--s-400); border-radius: 50%;
  outline: 1px dashed rgba(251, 191, 36, .4); outline-offset: var(--s-75);
  box-shadow: 0 0 64px 8px rgba(168, 85, 247, .32), 0 24px 64px -16px rgba(0, 0, 0, .8);
}
.logo img { width: 100%; height: 100%; display: block; border-radius: 50%; }

h1 {
  margin: 0; max-width: 680px;
  background: linear-gradient(90deg, #FFFFFF, #9B9B9B);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { margin: var(--s-75) 0 0; max-width: 680px; color: var(--muted); }

.status {
  margin-top: var(--s-400); display: inline-flex; align-items: center; gap: var(--s-75);
  padding: var(--s-75) var(--s-100); border-radius: 9999px;
  border: 1px solid var(--line); background: var(--surface);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--muted);
}
.status i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.status.amaran i { background: var(--warn); box-shadow: 0 0 12px var(--warn); }

.nota { margin: var(--s-200) 0 0; max-width: 420px; color: var(--faint); }

/* Main button (404 only): 8px / 12px padding, full state set (B2, B9) */
.butang {
  margin-top: var(--s-300); display: inline-flex; align-items: center; gap: var(--s-75);
  padding: var(--s-75) var(--s-100); border-radius: 8px;
  background: #FFFFFF; color: #000000; text-decoration: none;
  transition: transform 300ms var(--ease), opacity 300ms var(--ease);
}
.butang:hover { transform: translateY(-2px); }
.butang:active { transform: scale(0.98); }
.butang:focus-visible { outline: 2px solid #A855F7; outline-offset: 4px; }

footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  display: flex; justify-content: space-between; gap: var(--s-100); flex-wrap: wrap;
  padding: var(--s-100) var(--s-300) calc(var(--s-100) + env(safe-area-inset-bottom));
  color: rgba(155, 155, 155, .72);
}

/* ---- Entrance (B7 base curve) ---- */
@keyframes naik { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
main > * { animation: naik 700ms var(--ease) both; }
main > :nth-child(2) { animation-delay: 60ms; }
main > :nth-child(3) { animation-delay: 120ms; }
main > :nth-child(4) { animation-delay: 180ms; }
main > :nth-child(5) { animation-delay: 240ms; }
main > :nth-child(6) { animation-delay: 300ms; }
main > :nth-child(7) { animation-delay: 360ms; }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  h1.heading-3 { font-size: 24px; line-height: 32px; }   /* Heading 5 */
  .sub.title-2 { font-size: 16px; line-height: 24px; }   /* Title 3 */
  .logo { width: 128px; height: 128px; margin-bottom: var(--s-300); }
  footer { justify-content: center; text-align: center; }
  footer .hint { display: none; }
}

/* ---- Reduced motion: movement becomes a plain fade ---- */
@keyframes pudar { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  main > * { animation: pudar 500ms var(--ease) both; }
  .latar { transition: none; transform: none; }
  .butang, .butang:hover { transition: opacity 300ms var(--ease); transform: none; }
}
