/* =====================================================================
   RatechPlus Technologies — Theme Tokens
   Defaults only. Live values are injected as an inline <style> override
   from the `settings` table in includes/header.php, so the Admin
   Dashboard can change branding sitewide without touching this file.
   ===================================================================== */

:root {
  /* Brand */
  --color-primary: #0F2A4A;
  --color-primary-light: #2E8FE0;
  --color-secondary: #FF7A1A;
  --color-accent: #FF7A1A;
  --color-black: #0A0E14;
  --color-white: #FFFFFF;

  /* Surfaces */
  --color-bg: #FFFFFF;
  --color-bg-alt: #F5F8FB;
  --color-text: #101820;
  --color-text-muted: #5B6B7C;
  --color-header-bg: #0F2A4A;
  --color-footer-bg: #0A1B30;
  --color-link: #2E8FE0;
  --color-button-bg: #FF7A1A;
  --color-button-text: #FFFFFF;

  /* Type */
  --font-display: 'Ubuntu', 'Segoe UI', sans-serif;
  --font-body: 'Ubuntu', 'Segoe UI', sans-serif;
  --font-mono: 'Ubuntu Mono', 'Courier New', monospace;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 6px 24px rgba(15, 42, 74, 0.08);
  --shadow-lift: 0 16px 40px rgba(15, 42, 74, 0.14);
  --container-w: 1180px;
}

[data-theme="dark"] {
  --color-bg: #0A1220;
  --color-bg-alt: #0F1B2E;
  --color-text: #E9EEF5;
  --color-text-muted: #93A3B8;
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { opacity: .85; }

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

.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 20px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-primary-light);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-secondary); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-2px); opacity: 1; }

.btn-primary {
  background: var(--color-button-bg);
  color: var(--color-button-text);
  box-shadow: 0 10px 24px rgba(255, 122, 26, .28);
}
.btn-outline {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255,255,255,.35);
}
.btn-outline-dark {
  background: transparent;
  color: var(--color-primary);
  border-color: rgba(15,42,74,.25);
}

.section { padding: 88px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head p { color: var(--color-text-muted); font-size: 1.05rem; }

.card {
  background: var(--color-bg);
  border: 1px solid rgba(15,42,74,.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

[data-theme="dark"] .card { border-color: rgba(255,255,255,.08); }

.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 991px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 64px 0; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all .25s ease;
  z-index: 60;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

#page-loader {
  position: fixed; inset: 0; background: var(--color-primary);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  transition: opacity .4s ease, visibility .4s ease;
}
#page-loader.hide { opacity: 0; visibility: hidden; }
#page-loader .loader-mark {
  font-family: var(--font-mono); color: #fff; font-size: .9rem; letter-spacing: .1em;
  display: flex; align-items: center; gap: 10px;
}
#page-loader .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-secondary); animation: pulse 1.1s infinite ease-in-out; }
#page-loader .dot:nth-child(2) { animation-delay: .15s; }
#page-loader .dot:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%,80%,100% { opacity: .25; transform: scale(.8);} 40% { opacity: 1; transform: scale(1);} }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
