/* ==========================================================================
   rpx-base.css — Replixa base styles, design tokens, typography
   ========================================================================== */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* === CSS Custom Properties === */
:root {
  /* Backgrounds */
  --bg-ink:     #0E0F14;
  --bg-deep:    #13141A;
  --bg-surface: #1A1C24;
  --bg-raised:  #20222C;
  --bg-light:   #F4F5F7;
  --bg-white:   #FFFFFF;
  --bg-cream:   #FAFAF9;

  /* Foregrounds */
  --text-primary:         #ECEDF2;
  --text-secondary:       #A8B0C0;
  --text-muted:           #636B7A;
  --text-on-light:        #0E0F14;
  --text-on-light-muted:  #4A5261;
  --text-on-light-subtle: #7A8394;

  /* Brand */
  --amber-500:      #E8872B;
  --amber-400:      #F0A04E;
  --amber-300:      #F7BF7A;
  --amber-600:      #C96E18;
  --amber-bg-subtle: rgba(232,135,43,0.10);

  /* Utility */
  --border-dark:  rgba(255,255,255,0.08);
  --border-light: rgba(0,0,0,0.10);
  --success:  #3ECF8E;
  --danger:   #E05252;
  --code-bg:  #161820;

  /* Layout */
  --container-max: 1200px;
  --container-pad: clamp(1rem, 4vw, 2.5rem);
  --section-pad-y: clamp(4rem, 8vw, 7rem);

  /* Typography */
  --font-heading: 'DM Mono', 'Courier New', monospace;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-code:    'JetBrains Mono', 'Courier New', monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  background-color: var(--bg-ink);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
}

h4, h5, h6 {
  font-family: var(--font-body);
  line-height: 1.3;
}

h1 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 500;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 400;
}

h3 {
  font-size: 1.2rem;
  font-weight: 500;
  font-family: var(--font-body);
}

p {
  line-height: 1.75;
  color: var(--text-secondary);
}

a {
  color: var(--amber-500);
  text-decoration: none;
}

a:hover {
  color: var(--amber-400);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

/* === Container === */
.rpx-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-pad);
}

/* === Section wrappers === */
.rpx-section {
  padding-block: var(--section-pad-y);
}

/* Dark sections */
.rpx-section--dark {
  background-color: var(--bg-ink);
  color: var(--text-primary);
}

.rpx-section--dark-alt {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

/* Light sections */
.rpx-section--light {
  background-color: var(--bg-light);
  color: var(--text-on-light);
}

.rpx-section--light-alt {
  background-color: var(--bg-cream);
  color: var(--text-on-light);
}

.rpx-section--white {
  background-color: var(--bg-white);
  color: var(--text-on-light);
}

/* Brand section */
.rpx-section--brand {
  background: linear-gradient(135deg, var(--amber-500) 0%, var(--amber-600) 100%);
  color: var(--bg-ink);
}

/* Light section text overrides */
.rpx-section--light h1,
.rpx-section--light h2,
.rpx-section--light h3,
.rpx-section--light h4 {
  color: var(--text-on-light);
}

.rpx-section--light p {
  color: var(--text-on-light-muted);
}

.rpx-section--light-alt h1,
.rpx-section--light-alt h2,
.rpx-section--light-alt h3,
.rpx-section--light-alt h4 {
  color: var(--text-on-light);
}

.rpx-section--light-alt p {
  color: var(--text-on-light-muted);
}

.rpx-section--white h1,
.rpx-section--white h2,
.rpx-section--white h3,
.rpx-section--white h4 {
  color: var(--text-on-light);
}

.rpx-section--white p {
  color: var(--text-on-light-muted);
}

/* Brand section text */
.rpx-section--brand h1,
.rpx-section--brand h2,
.rpx-section--brand h3,
.rpx-section--brand p {
  color: var(--bg-ink);
}

/* === Mono label === */
.rpx-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-500);
  display: block;
  margin-bottom: 0.75rem;
}

/* === Section eyebrow / heading group === */
.rpx-section-header {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.rpx-section-header--center {
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* === Utility: display heading === */
.rpx-display {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* === Fade-in animation === */
.rpx-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.rpx-fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Horizontal rule === */
hr {
  border: none;
  border-top: 1px solid var(--border-dark);
  margin-block: 2rem;
}

/* === Code & Pre === */
code {
  font-family: var(--font-code);
  font-size: 0.9rem;
  background-color: var(--code-bg);
  color: var(--amber-300);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  font-family: var(--font-code);
  font-size: 0.875rem;
  background-color: var(--code-bg);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  line-height: 1.6;
  color: var(--text-primary);
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* Syntax highlighting tokens */
.tok-keyword  { color: #E8872B; }
.tok-string   { color: #3ECF8E; }
.tok-comment  { color: var(--text-muted); font-style: italic; }
.tok-fn       { color: #A8B0C0; }
.tok-var      { color: var(--text-primary); }
.tok-num      { color: #F7BF7A; }
.tok-key      { color: #F0A04E; }

/* === Responsive breakpoints === */
@media (max-width: 768px) {
  :root {
    --section-pad-y: clamp(3rem, 6vw, 5rem);
  }
}
