/* ============================================================
   SINGK MALAYSIA — BASE STYLES
   Reset, typography, global
   ============================================================ */

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

/* --- Smooth scroll (respect motion preference) --- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* --- Root --- */
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-0);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* --- Skip link (accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-6);
  background: var(--neon-pink);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top var(--duration-fast);
}
.skip-link:focus {
  top: var(--space-4);
}

/* --- Page load curtain (GSAP target) --- */
.page-curtain {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  z-index: var(--z-modal);
  pointer-events: none;
}
.js .page-curtain { opacity: 1; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-1);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  word-break: break-word;
}

h1 { font-size: var(--text-4xl); font-weight: 500; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  max-width: 70ch;
  margin-bottom: var(--space-4);
}

p:last-child { margin-bottom: 0; }

/* --- Links --- */
a {
  color: var(--neon-cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast), opacity var(--duration-fast);
}

a:hover, a:focus {
  color: var(--neon-pink);
  text-decoration: none;
}

/* Visible focus ring (WCAG 2.2) */
:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Lists --- */
ul, ol {
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-1);
}

/* --- Images --- */
img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-radius: var(--radius-sm);
}

/* --- Horizontal rule --- */
hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--space-8) 0;
}

/* --- Code --- */
code {
  font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--bg-2);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
  color: var(--neon-cyan);
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

th {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* --- Blockquote --- */
blockquote {
  border-left: 3px solid var(--neon-pink);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  color: var(--text-3);
  font-style: italic;
}

/* --- Strong / em --- */
strong { color: var(--text-1); font-weight: 600; }

/* --- Selection --- */
::selection {
  background: rgba(255, 62, 154, 0.25);
  color: var(--text-1);
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* --- Reduced motion: kill all transitions & animations --- */
@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;
  }
}

/* --- Chinese language body --- */
:lang(zh) {
  font-family: var(--font-zh);
}
