/* ==========================================================================
   Risk Managed Solutions — Modern & Minimal
   Shared stylesheet for all pages
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-soft: #f4f7fa;
  --color-text: #1a2b3a;
  --color-text-muted: #5a6b7e;
  --color-border: #e2e7ed;
  --color-accent: #00816d;          /* RMS brand teal/green */
  --color-accent-hover: #00604f;
  --color-accent-soft: #e0f1ed;
  --color-brand-blue: #4e87a0;      /* RMS brand steel blue */
  --color-brand-blue-soft: #eaf1f5;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;

  --max-width: 1100px;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.04);
  --shadow-md: 0 4px 16px rgba(10, 22, 40, 0.06);

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: var(--space-sm); }
h3 { font-size: 1.25rem; margin-bottom: var(--space-xs); }

p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: var(--color-accent-hover); }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

section {
  padding: var(--space-xl) 0;
}

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  height: 44px;
  width: auto;
  display: block;
}

@media (max-width: 720px) {
  .brand img { height: 36px; }
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover { color: var(--color-accent); }

.nav-links a.active {
  color: var(--color-accent);
}

.nav-links .btn {
  margin-left: var(--space-xs);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-xl) 0 var(--space-lg);
  /* Layered: corner glow + dot grid + base gradient */
  background-image:
    radial-gradient(circle at 88% 12%, rgba(0, 129, 109, 0.10) 0%, transparent 38%),
    radial-gradient(circle, rgba(78, 135, 160, 0.13) 1px, transparent 1.4px),
    linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%);
  background-size: auto, 26px 26px, auto;
  background-position: center, 0 0, center;
}

/* Diagonal sheen line cutting across the hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(0, 129, 109, 0.045) 50%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero .container { position: relative; z-index: 2; }

.hero .eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
}

.hero h1 {
  max-width: 800px;
  margin-bottom: var(--space-sm);
}

.hero .lead {
  font-size: 1.15rem;
  max-width: 640px;
  margin-bottom: var(--space-md);
}

.hero-actions {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* Page header (for inner pages) */
.page-header {
  position: relative;
  overflow: hidden;
  padding: var(--space-lg) 0 var(--space-md);
  /* Mirrors hero but lighter: corner glow + softer dot grid */
  background-image:
    radial-gradient(circle at 92% 18%, rgba(0, 129, 109, 0.08) 0%, transparent 40%),
    radial-gradient(circle, rgba(78, 135, 160, 0.10) 1px, transparent 1.3px),
    linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg-soft) 100%);
  background-size: auto, 24px 24px, auto;
  border-bottom: 1px solid var(--color-border);
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(0, 129, 109, 0.035) 50%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.page-header .container { position: relative; z-index: 2; }
.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { font-size: 1.1rem; max-width: 640px; }

/* Section title block */
.section-title {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-title .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.section-title p {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Cards / grid */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 768px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  padding: var(--space-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
  font-size: 1.3rem;
}

.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; font-size: 0.95rem; }

/* CTA strip */
.cta {
  position: relative;
  overflow: hidden;
  color: white;
  padding: var(--space-lg) 0;
  text-align: center;
  background:
    radial-gradient(circle at 50% 60%, rgba(0, 129, 109, 0.45) 0%, transparent 55%),
    var(--color-text);
}

.cta .container { position: relative; z-index: 2; }

.cta h2, .cta p { color: white; }
.cta p { color: rgba(255, 255, 255, 0.75); margin-bottom: var(--space-md); }

.cta .btn-primary {
  background: white;
  color: var(--color-text);
}

.cta .btn-primary:hover {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) 0;
  background: var(--color-bg-soft);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.site-footer p {
  font-size: 0.875rem;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: var(--space-sm);
  list-style: none;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.footer-links a:hover { color: var(--color-accent); }

/* Forms */
.form {
  display: grid;
  gap: var(--space-sm);
  max-width: 560px;
}

.form-row {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-field input,
.form-field textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

/* Two-column splits (about / contact) */
.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; gap: var(--space-md); }
}

.info-list {
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.info-list li {
  padding-left: 1.6rem;
  position: relative;
  color: var(--color-text-muted);
}

.info-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
}

/* Service detail blocks */
.service-block {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.service-block:last-child { border-bottom: none; }

.service-block h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.service-block .meta {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

/* Contact info block */
.contact-card {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.contact-card h3 { margin-bottom: var(--space-sm); }

.contact-card .info-item {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-sm);
}

.contact-card .info-item:last-child { margin-bottom: 0; }

.contact-card .label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.contact-card .value { color: var(--color-text); font-size: 1rem; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: white;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links .btn { margin-left: 0; text-align: center; }
}

/* ==========================================================================
   Background vector-art utilities (decorative diamond/dot accents).
   Each art SVG is placed inside a section with .has-art and positioned
   via these helper classes.
   ========================================================================== */

.has-art {
  position: relative;
  overflow: hidden;
}

.has-art .container { position: relative; z-index: 2; }

.section-art {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

/* Hero art (large floating diamonds on the right) */
.hero-art {
  position: absolute;
  top: 50%;
  right: -120px;
  transform: translateY(-50%);
  width: 720px;
  height: 720px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}

@media (max-width: 900px) {
  .hero-art { right: -260px; width: 560px; height: 560px; opacity: 0.55; }
}
@media (max-width: 600px) {
  .hero-art { display: none; }
}

/* Page-header art (medium floating accent on the right) */
.page-header-art {
  position: absolute;
  top: 50%;
  right: -80px;
  transform: translateY(-50%);
  width: 380px;
  height: 380px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .page-header-art { right: -180px; width: 280px; height: 280px; opacity: 0.45; }
}
@media (max-width: 600px) {
  .page-header-art { display: none; }
}

/* Corner accents for any content section */
.section-art-tl { top: -60px; left: -60px;  width: 220px; height: 220px; opacity: 0.6; }
.section-art-tr { top: -60px; right: -60px; width: 220px; height: 220px; opacity: 0.6; }
.section-art-bl { bottom: -40px; left: -40px;  width: 280px; height: 280px; opacity: 0.6; }
.section-art-br { bottom: -40px; right: -40px; width: 280px; height: 280px; opacity: 0.6; }

@media (max-width: 768px) {
  .section-art-tl, .section-art-tr,
  .section-art-bl, .section-art-br { opacity: 0.35; }
}

/* Large "Why RMS"-style corner mesh */
.why-art {
  position: absolute;
  top: -100px;
  right: -60px;
  width: 460px;
  height: 460px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 768px) {
  .why-art { opacity: 0.3; right: -180px; }
}

/* CTA dark-section accent silhouette */
.cta-art {
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 260px;
  height: 260px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 1;
}
