/* =====================================================================
   Yotiges — gaya bersama (landing, challenge, admin)
   ===================================================================== */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --text: #111114;
  --muted: #6b6b76;
  --border: #e6e6ea;
  --accent: #111114;
  --brand: #5fdde6;
  --brand-ink: #0e7c86;
  --chip: #f1f1f4;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --doing: #0e7c86;
  --doing-bg: #d9f7f9;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --nav-bg: rgba(247,247,248,.8);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d10; --surface: #16161a; --surface-2: #1a1a1f; --text: #f2f2f5; --muted: #9a9aa6;
    --border: #26262d; --accent: #f2f2f5; --chip: #1f1f25; --brand-ink: #5fdde6;
    --success: #4ade80; --success-bg: rgba(74,222,128,.14);
    --danger: #f87171; --danger-bg: rgba(248,113,113,.14);
    --doing: #5fdde6; --doing-bg: rgba(95,221,230,.14);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --nav-bg: rgba(13,13,16,.75);
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d10; --surface: #16161a; --surface-2: #1a1a1f; --text: #f2f2f5; --muted: #9a9aa6;
  --border: #26262d; --accent: #f2f2f5; --chip: #1f1f25; --brand-ink: #5fdde6;
  --success: #4ade80; --success-bg: rgba(74,222,128,.14);
  --danger: #f87171; --danger-bg: rgba(248,113,113,.14);
  --doing: #5fdde6; --doing-bg: rgba(95,221,230,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --nav-bg: rgba(13,13,16,.75);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.nav-logo { display: flex; align-items: center; background: #000; border-radius: 10px; padding: 4px 10px; }
.nav-logo img { height: 28px; width: auto; display: block; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; color: var(--muted);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--chip); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--chip); }

/* ---------- Hero ---------- */
header.page-head { padding-top: 28px; padding-bottom: 20px; }
.hero {
  position: relative; overflow: hidden;
  background: #000; border-radius: 24px; padding: 52px 24px 40px; text-align: center;
  border: 1px solid #1c1c1c; isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: -40%; z-index: -1;
  background:
    radial-gradient(closest-side, rgba(95,221,230,.22), transparent 70%) 30% 40% / 50% 50% no-repeat,
    radial-gradient(closest-side, rgba(255,70,70,.12), transparent 70%) 70% 60% / 45% 45% no-repeat;
  animation: heroDrift 14s ease-in-out infinite alternate;
}
.hero img { width: min(420px, 80%); height: auto; display: block; margin: 0 auto; animation: logoFloat 6s ease-in-out infinite; }
.hero .pixel-scene {
  display: block; width: min(560px, 94%); height: auto; aspect-ratio: 4 / 1; margin: 22px auto 0;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.hero p { margin-top: 22px; color: #b8b8c0; font-size: 16px; max-width: 480px; margin-inline: auto; }
.hero p strong { color: var(--brand); font-weight: 600; }

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 14px rgba(95,221,230,.25)); }
  50%      { transform: translateY(-8px); filter: drop-shadow(0 0 30px rgba(95,221,230,.5)); }
}
@keyframes heroDrift {
  0%   { transform: translate(-4%, -2%) rotate(0deg); }
  100% { transform: translate(4%, 3%) rotate(8deg); }
}

/* ---------- Sections ---------- */
section { padding: 28px 0; }
.section-head { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.section-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.section-link { font-size: 14px; font-weight: 600; color: var(--muted); }
.section-link:hover { color: var(--text); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), border-color .2s ease, box-shadow .25s ease;
}
a.card:hover { border-color: var(--muted); }
a.card:not(.tilt):hover { transform: translateY(-3px); }
a.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Tilt + glow mengikuti kursor (diaktifkan oleh site.js) */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px)); will-change: transform; }
.tilt.tilting { transition: transform .08s linear, border-color .2s ease, box-shadow .25s ease; --ty: -4px; box-shadow: 0 18px 40px rgba(0,0,0,.12); }
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(95,221,230,.18), transparent 60%);
  transition: opacity .25s ease;
}
.tilt.tilting::after { opacity: 1; }

/* ---------- Social ---------- */
.social-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .social-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .social-grid { grid-template-columns: 1fr; } }
.social { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 20px 22px; }
.social .platform { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; color: var(--muted); }
.avatar { width: 84px; height: 84px; border-radius: 50%; background: #000; border: 1px solid var(--border); overflow: hidden; transition: transform .3s ease; }
a.card:hover .avatar { transform: scale(1.06); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar img.fallback { object-fit: contain; padding: 10px; }
.social .name { margin-top: 14px; font-weight: 700; font-size: 17px; }
.social .handle { color: var(--muted); font-size: 14px; }
.social .count { margin-top: 14px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.social .count-label { color: var(--muted); font-size: 13px; }
.social .cta { margin-top: 16px; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px; background: var(--chip); width: 100%; transition: background .2s, color .2s; }
a.card:hover .cta { background: var(--accent); color: var(--bg); }

/* ---------- Business ---------- */
.biz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .biz-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .biz-grid { grid-template-columns: 1fr; } }
.biz { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.biz-top { display: flex; align-items: center; gap: 14px; }
.logo { width: 64px; height: 64px; border-radius: 14px; flex-shrink: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo.mono { background: var(--accent); color: var(--bg); font-weight: 800; font-size: 20px; border: 0; }
.biz-name { font-weight: 700; font-size: 17px; line-height: 1.25; }
.biz-meta { color: var(--muted); font-size: 14px; }
.biz-meta a:hover { color: var(--text); text-decoration: underline; }
.biz-desc { color: var(--muted); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); margin-top: 4px; }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.links.single { grid-template-columns: 1fr; }
.link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--chip); font-size: 14px; font-weight: 500; border: 1px solid transparent; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
a.link:hover { border-color: var(--border); background: var(--surface); transform: translateY(-1px); }
a.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link svg { width: 16px; height: 16px; flex-shrink: 0; }
.link.off { opacity: .45; cursor: default; }
.link .soon { margin-left: auto; font-size: 11px; color: var(--muted); }

footer.site-foot { padding-top: 40px; padding-bottom: 40px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Status badges ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-upcoming { background: var(--chip); color: var(--muted); }
.st-ongoing  { background: var(--doing-bg); color: var(--doing); }
.st-ongoing::before { animation: pulseDot 1.6s ease-in-out infinite; }
.st-finished { background: var(--chip); color: var(--text); }
.st-finished::before { content: "\2713"; width: auto; height: auto; background: none; border-radius: 0; font-size: 12px; color: var(--brand-ink); }
.st-success  { background: var(--success-bg); color: var(--success); }
.st-failed   { background: var(--danger-bg); color: var(--danger); }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 currentColor; } 50% { box-shadow: 0 0 0 4px transparent; opacity: .6; } }

/* ---------- Progress ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; display: flex; }
.progress > span { display: block; height: 100%; width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.progress .p-done { background: var(--success); }
.progress .p-failed { background: var(--danger); }
.progress.sm { height: 6px; }

/* ---------- Active challenge card (landing) ---------- */
.active-ch { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center; padding: 24px; }
.active-ch .ac-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); display: flex; align-items: center; gap: 8px; }
.active-ch .ac-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.25; }
.active-ch .ac-meta { color: var(--muted); font-size: 14px; margin-top: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.active-ch .ac-progress { grid-column: 1 / -1; }
.active-ch .ac-progress-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.active-ch .ac-progress-top b { color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--bg); border: 0; cursor: pointer; transition: transform .15s ease, opacity .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: var(--chip); color: var(--text); }
.btn.yt { background: #e62117; color: #fff; }
@media (max-width: 600px) { .active-ch { grid-template-columns: 1fr; } .active-ch .btn { width: 100%; } }

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease var(--d, 0s), transform .7s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .tilt[data-reveal].in { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
