/* ==========================================================================
   base.css — Reset, defaults, typography for kai.research.my v2
   ========================================================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
  tab-size: 4;
}

body {
  background-color: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Scrollbar (WebKit) ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-black);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) var(--bg-black);
}

/* ---- Selection ---- */
::selection {
  background-color: rgba(29, 158, 117, 0.3);
  color: var(--text-white);
}

/* ---- Links ---- */
a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

/* ---- Lists ---- */
ul, ol {
  list-style: none;
}

/* ---- Buttons & Inputs ---- */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* ---- Table ---- */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ---- Typography Scale ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-white);
}

h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
h5 { font-size: 15px; }
h6 { font-size: 13px; }

p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-gray);
}

small {
  font-size: 12px;
  color: var(--text-muted);
}

code,
pre {
  font-family: var(--font-mono);
}

code {
  font-size: 13px;
  color: var(--accent-teal);
  background: var(--bg-elevated);
  padding: 2px 6px;
}

pre {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  padding: var(--space-16);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

/* ---- Utility text classes ---- */
.text-white  { color: var(--text-white); }
.text-gray   { color: var(--text-gray); }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-teal   { color: var(--accent-teal); }
.text-blue   { color: var(--accent-blue); }
.text-error  { color: var(--color-error); }
.text-success{ color: var(--color-success); }

.font-heading { font-family: var(--font-heading); }
.font-body    { font-family: var(--font-body); }
.font-mono    { font-family: var(--font-mono); }

/* ---- Visually hidden (screen readers) ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  html { font-size: 15px; }
}

@media (max-width: 768px) {
  html { font-size: 14px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  h3 { font-size: 18px; }
}
