/* ============================================
   RMK Professional Services — Stylesheet
   Minimal & Elegant Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colour palette — sophisticated neutrals with a refined accent */
  --color-primary: #1a1a2e;       /* Deep navy */
  --color-secondary: #16213e;     /* Dark blue */
  --color-accent: #0f3460;        /* Rich blue */
  --color-highlight: #e2e2e2;     /* Soft silver */
  --color-text: #2d2d2d;          /* Dark grey for body text */
  --color-text-light: #6b6b6b;    /* Muted text */
  --color-bg: #ffffff;            /* White background */
  --color-bg-alt: #f8f8f8;        /* Off-white sections */
  --color-border: #e8e8e8;        /* Subtle borders */
  --color-white: #ffffff;

  /* Typography */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 300;
  line-height: 1.2;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--color-text-light);
  font-size: 1.05rem;
}

.lead {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--color-text);
  font-weight: 300;
}

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

.container--narrow {
  max-width: var(--max-width-narrow);
}

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

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--dark {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.section--dark h2,
.section--dark h3 {
  color: var(--color-white);
}

.section--dark p {
  color: rgba(255, 255, 255, 0.75);
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
  display: block;
}

.section--dark .section-label {
  color: rgba(255, 255, 255, 0.5);
}

/* --- Grid System --- */
.grid {
  display: grid;
  gap: var(--space-lg);
}

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

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

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav--scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.04);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.nav__logo span {
  font-weight: 300;
  color: var(--color-text-light);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-light);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s ease;
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-primary);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

.nav__cta {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-white) !important;
  background-color: var(--color-primary);
  padding: 10px 24px;
  border-radius: 4px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.nav__cta:hover {
  background-color: var(--color-secondary);
  transform: translateY(-1px);
}

.nav__cta::after {
  display: none;
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background-color: var(--color-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Hero --- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: 72px;
  position: relative;
}

.hero--compact {
  min-height: auto;
  padding-top: calc(72px + var(--space-xl));
  padding-bottom: var(--space-xl);
}

.hero__content {
  max-width: 720px;
}

.hero__title {
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  max-width: 600px;
}

.hero__actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 14px 32px;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}

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

.btn--primary:hover {
  background-color: var(--color-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(26, 26, 46, 0.2);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  background-color: var(--color-bg-alt);
}

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

.btn--white:hover {
  background-color: var(--color-highlight);
  transform: translateY(-1px);
}

.btn--arrow::after {
  content: '→';
  transition: transform 0.3s ease;
}

.btn--arrow:hover::after {
  transform: translateX(4px);
}

/* --- Cards --- */
.card {
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: var(--color-bg);
}

.card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  transform: translateY(-4px);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-alt);
  border-radius: 8px;
}

.card__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-accent);
}

.card__title {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.card__text {
  font-size: 0.95rem;
  color: var(--color-text-light);
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-top: var(--space-sm);
  transition: gap 0.3s ease;
}

.card__link:hover {
  gap: 10px;
}

/* --- Stats / Metrics --- */
.stats {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
}

.stat__number {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat__label {
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Case Study Cards --- */
.case-study {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  background-color: var(--color-bg);
}

.case-study:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  transform: translateY(-4px);
}

.case-study__header {
  padding: var(--space-lg);
  background-color: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.case-study__tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  background-color: rgba(15, 52, 96, 0.08);
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: var(--space-sm);
}

.case-study__body {
  padding: var(--space-lg);
}

.case-study__meta {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.case-study__meta-item {
  font-size: 0.85rem;
}

.case-study__meta-label {
  color: var(--color-text-light);
  display: block;
  margin-bottom: 2px;
}

.case-study__meta-value {
  color: var(--color-primary);
  font-weight: 500;
}

/* --- Testimonial --- */
.testimonial {
  padding: var(--space-lg);
  border-left: 2px solid var(--color-primary);
  margin: var(--space-lg) 0;
}

.testimonial__quote {
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 300;
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.testimonial__author {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary);
}

.testimonial__role {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* --- Process / Timeline --- */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  counter-reset: process-counter;
}

.process__step {
  counter-increment: process-counter;
  position: relative;
}

.process__step::before {
  content: counter(process-counter, decimal-leading-zero);
  font-size: 3rem;
  font-weight: 200;
  color: var(--color-highlight);
  line-height: 1;
  display: block;
  margin-bottom: var(--space-sm);
}

.process__step h3 {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.process__step p {
  font-size: 0.9rem;
}

/* --- Contact Form --- */
.form__group {
  margin-bottom: var(--space-md);
}

.form__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form__input,
.form__textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

.form__input:focus,
.form__textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.06);
}

.form__textarea {
  min-height: 160px;
  resize: vertical;
}

.form__select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color 0.3s ease;
}

.form__select:focus {
  border-color: var(--color-primary);
}

/* --- Footer --- */
.footer {
  background-color: var(--color-primary);
  color: rgba(255, 255, 255, 0.6);
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__brand {
  max-width: 320px;
}

.footer__logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.footer__logo span {
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
}

.footer__desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.5);
}

.footer__nav {
  display: flex;
  gap: var(--space-xl);
}

.footer__nav-group h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.footer__nav-group a {
  display: block;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 0;
  transition: color 0.3s ease;
}

.footer__nav-group a:hover {
  color: var(--color-white);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.footer__social {
  display: flex;
  gap: var(--space-sm);
}

.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.footer__social a:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--color-white);
}

.footer__social svg {
  width: 16px;
  height: 16px;
}

/* --- Divider --- */
.divider {
  width: 40px;
  height: 1px;
  background-color: var(--color-primary);
  margin: var(--space-md) 0;
}

.section--dark .divider {
  background-color: rgba(255, 255, 255, 0.3);
}

/* --- Two-column content --- */
.content-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.content-split--reverse {
  direction: rtl;
}

.content-split--reverse > * {
  direction: ltr;
}

/* --- Values list (About page) --- */
.values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.value-item {
  padding: var(--space-md) 0;
}

.value-item h3 {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

/* --- CTA Banner --- */
.cta-banner {
  text-align: center;
  padding: var(--space-xl) 0;
}

.cta-banner h2 {
  margin-bottom: var(--space-sm);
}

.cta-banner p {
  max-width: 500px;
  margin: 0 auto var(--space-lg);
}

/* --- Page Header (inner pages) --- */
.page-header {
  padding-top: calc(72px + var(--space-xl));
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.page-header__subtitle {
  font-size: 1.15rem;
  color: var(--color-text-light);
  max-width: 600px;
  font-weight: 300;
}

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

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

.service-detail__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.service-detail__icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-alt);
  border-radius: 8px;
}

.service-detail__icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--color-accent);
}

.service-detail__capabilities {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.capability {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--color-text);
}

.capability::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--color-accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Responsive --- */
@media (max-width: 968px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .content-split {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .content-split--reverse {
    direction: ltr;
  }

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

  .stats {
    flex-wrap: wrap;
    gap: var(--space-lg);
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .footer__nav {
    gap: var(--space-lg);
  }

  .service-detail__capabilities {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav__links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav__links--open {
    opacity: 1;
    visibility: visible;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__toggle--active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .nav__toggle--active span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle--active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .process {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 80vh;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats {
    flex-direction: column;
    gap: var(--space-md);
  }

  .footer__nav {
    flex-direction: column;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .values {
    grid-template-columns: 1fr;
  }
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in--visible {
  opacity: 1;
  transform: translateY(0);
}
