/* ==========================================================================
   Anomali Gaming — Theme
   Order: reset → tokens → base → components → layout → utilities
   (layout comes after components so header/footer context rules can override
    generic components without specificity hacks)
   Breakpoints: 40em (640px) · 60em (960px = desktop two-tier header) · 75em (1200px)
   ========================================================================== */

@layer reset, tokens, base, components, layout, utilities;

/* --------------------------------------------------------------------------
   Fonts (self-hosted, variable 200–800, latin subset ≈27 KB)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans-var-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched fallback → minimal layout shift (CLS) while the font loads.
   Values measured against Arial at weight 400 (body text). */
@font-face {
  font-family: "Jakarta Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Roboto");
  size-adjust: 102.2%;
  ascent-override: 101.8%;
  descent-override: 21.5%;
  line-gap-override: 0%;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  img, video { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
}

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
@layer tokens {
  :root {
    color-scheme: dark;

    /* Surfaces */
    --bg-0: #0a121c;
    --bg-1: #0f1a27;
    --bg-glow: #14304a;
    --surface-1: #16202d;
    --surface-2: #1c2838;
    --surface-3: #223044;
    --surface-glass: rgb(20 30 44 / 0.62);
    --line: #223044;
    --line-soft: rgb(148 178 214 / 0.1);

    /* Text (all ≥ 4.5:1 on --bg-1) */
    --text-1: #f2f6fb;
    --text-2: #b6c2d3;
    --text-3: #8494ab;

    /* Brand */
    --primary: #0b6fe8;          /* buttons / fills (white text 4.7:1) */
    --primary-hi: #2e8bff;       /* hover, focus ring */
    --primary-text: #4da2ff;     /* links & blue text on dark */
    --primary-rgb: 11 111 232;
    --accent: #ff5b2e;           /* hot accent: active marks, highlights */
    --accent-hi: #ff7a52;
    --accent-ink: #1a0d08;       /* text on accent (5.7:1) */
    --accent-rgb: 255 91 46;
    --gold: #f5b53b;
    --gold-rgb: 245 181 59;
    --success: #1db954;
    --success-rgb: 29 185 84;
    --danger: #ff4d5e;

    /* Typography */
    --font-sans: "Plus Jakarta Sans", "Jakarta Fallback", system-ui, -apple-system,
      "Segoe UI", Roboto, Arial, sans-serif;
    --fs-2xs: 0.6875rem;  /* 11 */
    --fs-xs: 0.75rem;     /* 12 */
    --fs-sm: 0.875rem;    /* 14 */
    --fs-base: 1rem;      /* 16 */
    --fs-md: 1.125rem;    /* 18 */
    --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --fs-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
    --fs-2xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
    --fs-display: clamp(2.25rem, 1.5rem + 3.4vw, 4rem);
    --lh-tight: 1.1;
    --lh-snug: 1.3;
    --lh-base: 1.65;
    --tracking-tight: -0.02em;
    --tracking-caps: 0.08em;

    /* Spacing (4px base) */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;

    /* Shape */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-pill: 999px;
    --chamfer: 9px;              /* signature cut corner */

    /* Layout */
    --container: 1240px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --header-h: 72px;            /* header row 1 */
    --nav-h: 50px;               /* header row 2 (desktop nav) */

    /* Motion */
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --dur-fast: 140ms;
    --dur: 220ms;

    /* Elevation */
    --shadow-1: 0 12px 32px -14px rgb(0 0 0 / 0.65);
    --shadow-2: 0 18px 48px -18px rgb(0 0 0 / 0.75);

    /* Layers */
    --z-header: 50;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
@layer base {
  html {
    scroll-padding-top: calc(var(--header-h) + var(--sp-4));
  }
  @media (min-width: 60.0625em) {
    html { scroll-padding-top: calc(var(--header-h) + var(--nav-h) + var(--sp-4)); }
  }
  html {
    -webkit-tap-highlight-color: transparent;
  }

  html[data-nav-open] { overflow: hidden; }

  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--text-2);
    background-color: var(--bg-0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Sky: layered glow gradients + vignette (no image request). */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
      radial-gradient(140% 100% at 50% 35%, transparent 55%, rgb(0 0 0 / 0.5)),
      radial-gradient(120% 70% at 12% -10%, rgb(20 48 74 / 0.95), transparent 62%),
      radial-gradient(70% 55% at 95% 8%, rgb(var(--primary-rgb) / 0.13), transparent 65%),
      radial-gradient(80% 60% at 50% 115%, rgb(var(--accent-rgb) / 0.045), transparent 70%),
      linear-gradient(180deg, var(--bg-1), var(--bg-0) 75%);
  }

  /* Thin drifting clouds: 6 KB opaque WebP, screen-blended (black = transparent). */
  body::after {
    content: "";
    position: fixed;
    inset: -6% -5%;
    z-index: -1;
    pointer-events: none;
    background: url("/assets/img/bg-clouds.webp") center top / cover no-repeat;
    mix-blend-mode: screen;
    opacity: 0.6;
    -webkit-mask-image: radial-gradient(130% 95% at 50% 25%, #000 40%, transparent 100%);
    mask-image: radial-gradient(130% 95% at 50% 25%, #000 40%, transparent 100%);
    animation: sky-drift 80s ease-in-out infinite alternate;
    will-change: transform;
  }

  /* Portrait phones: `cover` would crop the wisps away — anchor them top-left. */
  @media (max-aspect-ratio: 4/5) {
    body::after { background-size: auto 62%; background-position: 18% 0; }
  }

  @keyframes sky-drift {
    from { transform: translate3d(0, 0, 0) scale(1.02); }
    to   { transform: translate3d(-3%, 1.5%, 0) scale(1.07); }
  }

  h1, h2, h3, h4 {
    color: var(--text-1);
    font-weight: 800;
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
  }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
  h4 { font-size: var(--fs-md); line-height: var(--lh-snug); }

  p { text-wrap: pretty; }
  strong, b { color: var(--text-1); font-weight: 700; }

  a { color: var(--primary-text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
  a:hover { color: var(--primary-hi); }

  :focus-visible {
    outline: 2px solid var(--primary-hi);
    outline-offset: 3px;
    border-radius: var(--r-xs);
  }

  ::selection { background: rgb(var(--primary-rgb) / 0.55); color: #fff; }

  hr { border: 0; border-top: 1px solid var(--line-soft); }

  @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;
    }
  }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
@layer layout {
  .container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
  }

  .site-main { flex: 1 0 auto; outline: none; }

  .section { padding-block: clamp(2.5rem, 6vw, 5rem); }

  .stack > * + * { margin-block-start: var(--stack-gap, var(--sp-4)); }

  .cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cluster-gap, var(--sp-3));
  }

  .grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 260px)), 1fr));
    gap: var(--grid-gap, var(--sp-5));
  }

  /* ---------- Header (two tiers) ----------
     Row 1: [search | menu] · centered logo · [cart · Masuk]  (height --header-h)
     Row 2: centered nav with icons                           (height --nav-h, ≥ 961px)
     ≤ 960px: row 2 becomes the hamburger panel (with search field on top). */
  .site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    border-bottom: 1px solid var(--line-soft);
    transition: box-shadow var(--dur) var(--ease-out);
  }
  /* Glass layer lives on a pseudo-element: backdrop-filter on the header itself
     would become the containing block of the fixed mobile nav panel. */
  .site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgb(10 18 28 / 0.55);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    transition: background-color var(--dur) var(--ease-out);
  }
  .site-header[data-scrolled] { box-shadow: var(--shadow-1); }
  .site-header[data-scrolled]::before { background: rgb(10 18 28 / 0.86); }

  /* Row 1: three equal side columns keep the logo exactly centered. */
  .site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: var(--sp-4);
    min-height: var(--header-h);
  }
  .site-header__inner .brand { justify-self: center; }
  .brand__mark { flex-shrink: 0; }

  .header-start,
  .header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
  }
  .header-start { justify-self: start; }
  .header-actions { justify-self: end; }
  .header-actions .btn { margin-inline-start: var(--sp-2); }

  .nav-toggle { display: none; }
  .nav-search { display: none; }   /* search field lives in the mobile panel only */

  /* Row 2: navigation */
  .site-nav { border-top: 1px solid var(--line-soft); }

  .site-nav__list {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 2.6vw, 2.5rem);
    list-style: none;
    padding: 0;
    margin-block: 0;
  }

  .site-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: var(--nav-h);
    font-size: 0.78125rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase; /* HTML stays Title Case: better for SEO & screen readers */
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .site-nav__link .icon {
    width: 18px;
    height: 18px;
    color: inherit;   /* same tone as the label → icon and text read as one unit */
    opacity: 0.9;
  }
  .site-nav__link:hover { color: var(--text-1); }

  .site-nav__link[aria-current="page"] { color: var(--text-1); }
  .site-nav__link[aria-current="page"] .icon { color: var(--accent); opacity: 1; }
  .site-nav__link[aria-current="page"]::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 14px rgb(var(--accent-rgb) / 0.7);
  }

  /* ≤ 960px: search becomes an icon, nav becomes the drop-down panel. */
  @media (max-width: 60em) {
    .nav-toggle { display: inline-grid; }
    .header-search-btn { display: none; }
    .js .nav-search { display: block; padding-bottom: var(--sp-4); }

    .js .site-nav {
      position: fixed;
      inset: var(--header-h) 0 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding: var(--sp-4) 0 var(--sp-8);
      background: linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
      opacity: 0;
      visibility: hidden;
      transform: translateY(-8px);
      transition:
        opacity var(--dur) var(--ease-out),
        transform var(--dur) var(--ease-out),
        visibility 0s linear var(--dur);
    }
    .js .site-nav[data-open] {
      opacity: 1;
      visibility: visible;
      transform: none;
      transition-delay: 0s;
    }
    .js .site-nav__list { flex-direction: column; gap: 0; }
    .js .site-nav__link {
      min-height: 56px;
      padding-inline: var(--sp-4);
      font-size: 0.9375rem;
      letter-spacing: 0.07em;
      border-bottom: 1px solid var(--line-soft);
    }
    .js .site-nav__link .icon { width: 20px; height: 20px; }
    .js .site-nav__link[aria-current="page"] {
      background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.1), transparent 70%);
    }
    .js .site-nav__link[aria-current="page"]::after {
      inset: 0 auto 0 0;
      width: 3px;
      height: auto;
    }

    /* No-JS fallback: row 2 stays visible and scrolls sideways. */
    html:not(.js) .site-nav { overflow-x: auto; }
    html:not(.js) .site-nav__list { justify-content: flex-start; width: max-content; }
    html:not(.js) .nav-toggle { display: none; }
    html:not(.js) .header-search-btn { display: inline-grid; }
  }

  @media (max-width: 40em) {
    .header-login .btn__label {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
    .header-login { padding-inline: 0; width: 40px; }
    .header-login .icon { margin: 0; }
  }

  /* Phones (≤ 400px): slightly smaller wordmark + tighter actions so the
     centered logo keeps clear space on both sides. */
  @media (max-width: 25em) {
    .site-header__inner { gap: var(--sp-2); }
    .site-header__inner .brand { gap: var(--sp-2); }
    .site-header__inner .brand__name { font-size: 0.9375rem; letter-spacing: 0.14em; }
    .site-header__inner .brand__sub { letter-spacing: 0.5em; }
    .header-actions { gap: 0; }
    .header-actions .btn { margin-inline-start: var(--sp-1); }
    .site-header .icon-btn,
    .header-login { width: 36px; }
  }
  @media (max-width: 22.5em) {
    .site-header__inner .brand__mark { width: 30px; height: 32px; }
    .site-header__inner .brand__name { font-size: 0.875rem; letter-spacing: 0.12em; }
    .site-header__inner .brand__sub { font-size: 0.5rem; letter-spacing: 0.46em; }
  }

  /* ---------- Footer ---------- */
  .site-footer {
    margin-top: auto;
    padding-block: var(--sp-12) var(--sp-6);
    border-top: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgb(10 18 28 / 0.2), rgb(10 18 28 / 0.88) 45%);
    font-size: var(--fs-sm);
  }

  .footer-grid {
    display: grid;
    gap: var(--sp-8);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-brand { grid-column: 1 / -1; }

  @media (min-width: 60em) {
    .footer-grid { grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); }
    .footer-brand { grid-column: auto; }
  }

  .footer-title {
    margin-bottom: var(--sp-4);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--text-3);
  }

  .footer-links { list-style: none; padding: 0; display: grid; gap: var(--sp-1); }
  .footer-links a {
    display: inline-block;
    padding-block: var(--sp-1);
    color: var(--text-2);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .footer-links a:hover { color: var(--text-1); }

  .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-top: var(--sp-10);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--line-soft);
    font-size: var(--fs-xs);
    color: var(--text-3);
  }
}

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */
@layer components {
  /* ---------- Icon ---------- */
  .icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
  }

  /* ---------- Brand ---------- */
  .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    color: var(--text-1);
    text-decoration: none;
  }
  .brand:hover { color: var(--text-1); }
  /* Logo: folded "A" mark + stacked wordmark (ANOMALI / G A M I N G). */
  .brand__mark { width: 34px; height: 36px; }
  .brand__name {
    display: grid;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }
  .brand__sub {
    margin-top: 5px;
    font-size: 0.5625rem;
    font-weight: 500;
    letter-spacing: 0.62em;
    color: var(--text-3);
  }

  /* ---------- Buttons ----------
     Solid CTAs use the signature chamfer (cut top-left & bottom-right).
     Focus ring is drawn inside, because clip-path would hide an outline. */
  .btn {
    --btn-h: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: var(--btn-h);
    padding-inline: var(--sp-5);
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition:
      background-color var(--dur-fast) var(--ease-out),
      color var(--dur-fast) var(--ease-out),
      border-color var(--dur-fast) var(--ease-out),
      box-shadow var(--dur-fast) var(--ease-out),
      transform var(--dur-fast) var(--ease-out);
  }
  .btn .icon { width: 18px; height: 18px; }
  .btn:active { transform: translateY(1px); }
  .btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

  .btn--primary,
  .btn--accent,
  .btn--success {
    border: 0;
    border-radius: 0;
    clip-path: polygon(
      var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)),
      calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer)
    );
  }
  .btn--primary:focus-visible,
  .btn--accent:focus-visible,
  .btn--success:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px rgb(0 0 0 / 0.35);
  }

  .btn--primary {
    color: #fff;
    background: linear-gradient(180deg, #0e70ea, #0a66d8); /* white text ≥ 4.6:1 */
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2);
  }
  .btn--primary:hover {
    color: #fff;
    background: linear-gradient(180deg, #0a66d8, #085bc4);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), inset 0 -2px 0 rgb(0 0 0 / 0.2);
  }

  .btn--accent {
    color: var(--accent-ink);
    background: linear-gradient(180deg, var(--accent-hi), var(--accent));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3);
  }
  .btn--accent:hover {
    color: var(--accent-ink);
    background: var(--accent-hi);
  }

  .btn--success {
    color: #fff;
    background: linear-gradient(180deg, #15873d, #127534); /* white text ≥ 4.5:1 */
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2);
  }
  .btn--success:hover {
    color: #fff;
    background: linear-gradient(180deg, #127534, #106a2e);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), inset 0 -2px 0 rgb(0 0 0 / 0.2);
  }

  .btn--secondary {
    color: var(--text-1);
    background: var(--surface-2);
    border-color: var(--line);
  }
  .btn--secondary:hover {
    color: var(--text-1);
    background: var(--surface-3);
    border-color: rgb(var(--primary-rgb) / 0.45);
  }

  .btn--ghost {
    color: var(--text-2);
    background: transparent;
  }
  .btn--ghost:hover {
    color: var(--text-1);
    background: rgb(255 255 255 / 0.05);
  }

  .btn--sm { --btn-h: 36px; --chamfer: 6px; padding-inline: var(--sp-4); font-size: var(--fs-xs); }
  .btn--sm .icon { width: 16px; height: 16px; }
  .btn--lg { --btn-h: 52px; padding-inline: var(--sp-8); font-size: var(--fs-sm); }
  .btn--block { width: 100%; }

  /* ---------- Icon button ---------- */
  .icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    text-decoration: none;
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  }
  .icon-btn .icon { width: 22px; height: 22px; }
  .icon-btn:hover { color: var(--text-1); background: rgb(255 255 255 / 0.06); }

  .count-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding-inline: 4px;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }

  /* ---------- "Lihat semua ▸" link ---------- */
  .link-more {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--primary-text);
    text-decoration: none;
    white-space: nowrap;
  }
  .link-more .icon { width: 14px; height: 14px; transition: transform var(--dur-fast) var(--ease-out); }
  .link-more:hover .icon { transform: translateX(3px); }

  /* ---------- Section heading (kicker + title) ---------- */
  .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--sp-3) var(--sp-6);
    margin-bottom: var(--sp-6);
  }
  .kicker {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-1);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-3);
  }
  .kicker::before {
    content: "";
    width: 14px;
    height: 2px;
    background: var(--primary-hi);
  }
  .section-title { font-size: var(--fs-xl); }

  /* ---------- Tags ---------- */
  .tag {
    --tone: var(--primary-rgb);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 24px;
    padding-inline: 0.625rem;
    border-radius: var(--r-xs);
    font-size: var(--fs-2xs);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgb(var(--tone));
    background: rgb(var(--tone) / 0.14);
    box-shadow: inset 0 0 0 1px rgb(var(--tone) / 0.32);
  }
  .tag .icon { width: 13px; height: 13px; }
  .tag--primary { --tone: 77 162 255; }
  .tag--success { --tone: 61 220 122; }
  .tag--accent  { --tone: 255 138 102; }
  .tag--gold    { --tone: 247 195 95; }

  .tag--solid { box-shadow: none; }
  .tag--solid.tag--primary { background: var(--primary); color: #fff; }
  .tag--solid.tag--success { background: var(--success); color: #04140a; }
  .tag--solid.tag--accent  { background: var(--accent); color: var(--accent-ink); }
  .tag--solid.tag--gold    { background: var(--gold); color: #1c1203; }

  /* ---------- Stat pill ---------- */
  .stat {
    --tone: var(--primary-rgb);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-5) var(--sp-2) var(--sp-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-pill);
    background: var(--surface-glass);
  }
  .stat__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: rgb(var(--tone));
    background: rgb(var(--tone) / 0.14);
  }
  .stat__icon .icon { width: 20px; height: 20px; }
  .stat__value {
    display: block;
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-1);
    font-variant-numeric: tabular-nums;
  }
  .stat__label { display: block; font-size: var(--fs-xs); line-height: 1.3; color: var(--text-3); }
  .stat--primary { --tone: 77 162 255; }
  .stat--gold    { --tone: var(--gold-rgb); }
  .stat--success { --tone: 61 220 122; }
  .stat--accent  { --tone: 255 138 102; }

  /* ---------- Card ---------- */
  .card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    background: linear-gradient(180deg, rgb(28 40 56 / 0.78), rgb(20 30 44 / 0.78));
    box-shadow: var(--shadow-1);
    overflow: hidden;
    transition:
      transform var(--dur) var(--ease-out),
      border-color var(--dur) var(--ease-out),
      box-shadow var(--dur) var(--ease-out);
  }
  .card__body { display: grid; gap: var(--sp-3); padding: var(--sp-5); }
  .card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-top: auto;
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--line-soft);
  }
  .card__title { font-size: var(--fs-md); }

  @media (hover: hover) {
    .card--interactive:hover {
      transform: translateY(-3px);
      border-color: rgb(var(--primary-rgb) / 0.4);
      box-shadow: var(--shadow-2);
    }
  }

  /* ---------- Hex badge (rank / achievement) ---------- */
  .hex {
    --tone: var(--primary-rgb);
    --size: 46px;
    position: relative;
    display: inline-grid;
    place-items: center;
    width: var(--size);
    height: calc(var(--size) * 1.1547);
    font-size: calc(var(--size) * 0.3);
    font-weight: 800;
    color: var(--text-1);
    font-variant-numeric: tabular-nums;
    isolation: isolate;
  }
  .hex::before,
  .hex::after {
    content: "";
    position: absolute;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    z-index: -1;
  }
  .hex::before { inset: 0; background: rgb(var(--tone)); }
  .hex::after {
    inset: 2px;
    background: linear-gradient(160deg, rgb(var(--tone) / 0.28), var(--surface-1) 70%);
  }
  .hex .icon { width: 45%; height: 45%; color: rgb(var(--tone)); }
  .hex--gold   { --tone: var(--gold-rgb); }
  .hex--accent { --tone: var(--accent-rgb); }
  .hex--muted  { --tone: 60 78 102; }

  /* ---------- Tabs (text + accent underline) ---------- */
  .tabs {
    display: flex;
    gap: var(--sp-6);
    overflow-x: auto;
    border-bottom: 1px solid var(--line-soft);
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs__item {
    position: relative;
    flex-shrink: 0;
    padding-block: var(--sp-3);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-3);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .tabs__item:hover { color: var(--text-1); }
  .tabs__item[aria-current="true"],
  .tabs__item[aria-selected="true"] { color: var(--text-1); }
  .tabs__item[aria-current="true"]::after,
  .tabs__item[aria-selected="true"]::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
  }

  /* ---------- Form field ---------- */
  .field {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: 44px;
    padding-inline: var(--sp-3);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: rgb(15 26 39 / 0.8);
    color: var(--text-3);
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  }
  .field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.25);
  }
  .field .icon { width: 18px; height: 18px; }
  .field__input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border: 0;
    background: none;
    color: var(--text-1);
    font-size: 1rem; /* ≥16px: prevents iOS zoom on focus */
    outline: none;
  }
  .field__input::placeholder { color: var(--text-3); opacity: 1; }
  @media (min-width: 60em) { .field__input { font-size: var(--fs-sm); } }

  /* ---------- Skip link ---------- */
  .skip-link {
    position: absolute;
    top: var(--sp-2);
    left: var(--sp-2);
    z-index: 100;
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--r-sm);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform var(--dur-fast) var(--ease-out);
  }
  .skip-link:focus { transform: none; color: #fff; }
}

/* Shared across pages: status pill, image-free artwork, 00:00 WIB countdown */
@layer components {
  .status {
    --tone: 61 220 122;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding-inline: 8px;
    border-radius: var(--r-pill);
    background: rgb(var(--tone) / 0.12);
    color: rgb(var(--tone));
    font-size: var(--fs-2xs);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
  }
  .status--update { --tone: 247 195 95; }
  .status--down { --tone: 255 110 120; }

  /* ---------- Image-free artwork (.art) ----------
     Category-tinted gradient + faint hex pattern + custom SVG icon.
     One template for script cards, article thumbnails and char cards. */
  .art {
    --tone: 46 139 255;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6%;
    overflow: hidden;
    background:
      radial-gradient(90% 70% at 50% 42%, rgb(var(--tone) / 0.34), transparent 70%),
      radial-gradient(120% 90% at 100% 100%, rgb(var(--tone) / 0.16), transparent 60%),
      linear-gradient(165deg, #16243a, #0b131e 75%);
  }
  .art::before {                 /* faint hex pattern, fading out to the edges */
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48.5' viewBox='0 0 28 48.5'%3E%3Cpath d='M14 0l14 8.1v16.2l-14 8.1L0 24.3V8.1zM14 32.4v16.1' fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 28px 48.5px;
    -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent 85%);
    mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent 85%);
  }
  .art__icon {
    position: relative;
    width: 38%;
    height: auto;
    aspect-ratio: 1;
    color: rgb(var(--tone));
    filter: drop-shadow(0 0 18px rgb(var(--tone) / 0.55));
    transition: transform 500ms var(--ease-out);
  }
  .art--duo .art__icon { width: 30%; }

  .art--exp, .art--tutorial, .art--guide, .art--junior { --tone: 77 162 255; }
  .art--title, .art--tips                               { --tone: 245 190 70; }
  .art--kill, .art--general                             { --tone: 255 90 105; }
  .art--clan, .art--update, .art--senior                { --tone: 45 212 191; }
  .art--assist                                          { --tone: 167 139 250; }
  .art--absen                                           { --tone: 61 220 122; }
  .art--enlisted                                        { --tone: 160 170 182; }
  .art--nco                                             { --tone: 196 140 92; }


  @media (hover: hover) {
    a:hover .art__icon,
    .card--interactive:hover .art__icon,
    .article-lead:hover .art__icon { transform: scale(1.06); }
  }

  /* ---------- Countdown to 00:00 WIB (assets/js/countdown.js) ---------- */
  .countdown { display: grid; gap: var(--sp-2); justify-items: end; }
  .countdown__label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--tracking-caps);
    text-transform: uppercase; color: var(--accent-hi);
  }
  .countdown__label .icon { width: 16px; height: 16px; }
  .countdown__time { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
  .countdown__seg {
    display: grid; justify-items: center; min-width: 60px; padding: 8px 6px;
    border: 1px solid rgb(var(--accent-rgb) / 0.3); border-radius: var(--r-sm);
    background: rgb(10 18 28 / 0.6);
  }
  .countdown__seg b { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--text-1); }
  .countdown__seg small { margin-top: 4px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
  .countdown__sep { font-size: 1.5rem; font-weight: 800; color: var(--accent); }

}

/* 404 page */
@layer components {
  .nf { display: grid; justify-items: center; gap: var(--sp-4); padding-block: clamp(4rem, 12vw, 8rem); text-align: center; }
  .nf__code { font-size: var(--fs-sm); font-weight: 800; letter-spacing: 0.2em; color: var(--primary-text); }
  .nf__text { max-width: 44ch; margin-bottom: var(--sp-4); color: var(--text-2); }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .text-1 { color: var(--text-1); }
  .text-3 { color: var(--text-3); }
  .text-accent { color: var(--accent); }
  .text-gold { color: var(--gold); }
  .tabular { font-variant-numeric: tabular-nums; }
}

/* ---------- Footer: deskripsi brand + halaman legal + halaman cari (18-11-2026) ---------- */
.footer-desc { margin-top: var(--sp-4); max-width: 38ch; color: var(--text-3); line-height: var(--lh-base); }
.footer-bottom p { margin: 0; }
.legal { padding-block: var(--sp-10) var(--sp-12); }
.legal__isi { max-width: 780px; }
.legal h1 { font-size: var(--fs-2xl); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); margin: 0 0 var(--sp-3); }
.legal h2 { font-size: var(--fs-lg); line-height: var(--lh-snug); margin: var(--sp-8) 0 var(--sp-3); color: var(--text-1); }
.legal p, .legal li { color: var(--text-2); line-height: var(--lh-base); }
.legal p { margin: 0 0 var(--sp-3); }
.legal ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--sp-2); }
.legal b { color: var(--text-1); }
.legal a { color: var(--primary-text); }
.legal__tgl { color: var(--text-3); font-size: var(--fs-sm); margin-bottom: var(--sp-6); }
.cari__form { margin: var(--sp-4) 0 var(--sp-3); }
.cari__hasil { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.cari__hasil a { display: grid; gap: var(--sp-1); padding: var(--sp-4) var(--sp-5); border-radius: 8px; background: var(--surface-1); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.15s ease; }
.cari__hasil a:hover { border-color: var(--primary); }
.cari__hasil b { color: var(--text-1); }
.cari__hasil span { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-snug); }
/* logo pixel classic (2026-11-27) */
.brand__px{display:block;width:195px;height:40px;max-width:none;image-rendering:pixelated;image-rendering:crisp-edges}
@media (max-width:22em){.brand__px{width:146px;height:30px}}
