/* ==========================================================================
   FireflyTechLabs — Global Styles
   Palette: Old TwinSun dark theme
   ========================================================================== */

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

:root {
  --navy: #1B2838;
  --navy-light: #243347;
  --orange: #E8652B;
  --orange-hover: #D4572A;
  --white: #FFFFFF;
  --off-white: #F8F9FA;
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  --text-on-dark: #E5E7EB;
  --text-muted-on-dark: #9CA3AF;
  --border-light: #E5E7EB;
  --border-dark: #374151;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
  -webkit-touch-callout: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: 1rem;
}

.accent {
  color: var(--orange);
}

.text-on-dark {
  color: var(--text-on-dark);
}

.text-muted {
  color: var(--text-muted);
}

.text-muted-on-dark {
  color: var(--text-muted-on-dark);
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section--dark {
  background: var(--navy);
  color: var(--text-on-dark);
}

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

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

/* --- Curved Divider --- */
.curve-divider {
  position: relative;
  overflow: hidden;
  line-height: 0;
  margin-top: -2px;
  margin-bottom: -2px;
}

.curve-divider svg {
  display: block;
  width: 100%;
  height: auto;
}

.curve-divider--dark-to-light svg {
  fill: var(--white);
}

.curve-divider--light-to-dark svg {
  fill: var(--navy);
}

.curve-divider--dark-to-off-white svg {
  fill: var(--off-white);
}

.curve-divider--off-white-to-dark svg {
  fill: var(--navy);
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--navy);
  border-bottom: 1px solid var(--border-dark);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__logo .logo-accent {
  color: var(--orange);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  color: var(--text-muted-on-dark);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--white);
}

.nav__cta {
  display: inline-block;
  padding: 8px 20px;
  border: 2px solid var(--orange);
  border-radius: 6px;
  color: var(--orange) !important;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.2s, color 0.2s;
}

.nav__cta:hover {
  background: var(--orange);
  color: var(--white) !important;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform 0.3s, opacity 0.3s;
}

.nav__hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  text-align: center;
}

.btn--outline {
  background: transparent;
  border-color: var(--orange);
  color: var(--orange);
}

.btn--outline:hover {
  background: var(--orange);
  color: var(--white);
}

.btn--solid {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.btn--solid:hover {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
}

.btn--ghost {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- Hero --- */
.hero {
  background: var(--navy);
  padding: 120px 0 80px;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 24px;
  font-size: 3.25rem;
}

.hero p {
  color: var(--text-muted-on-dark);
  font-size: 1.25rem;
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* --- Service Cards --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 32px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.card--dark {
  background: var(--navy-light);
  border-color: var(--border-dark);
}

.card--dark:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.card__icon {
  width: 48px;
  height: 48px;
  background: rgba(232, 101, 43, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--orange);
  font-size: 1.5rem;
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 16px;
}

.card--dark p {
  color: var(--text-muted-on-dark);
}

.card__link {
  color: var(--orange);
  font-weight: 600;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.card__link:hover {
  gap: 10px;
}

/* --- Page Header (for inner pages) --- */
.page-header {
  background: var(--navy);
  padding: 100px 0 60px;
  text-align: center;
}

.page-header h1 {
  color: var(--white);
  margin-bottom: 16px;
}

.page-header p {
  color: var(--text-muted-on-dark);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Content Sections (inner pages) --- */
.content-block {
  padding: 64px 0;
}

.content-block + .content-block {
  border-top: 1px solid var(--border-light);
}

.content-block h2 {
  margin-bottom: 16px;
}

.content-block h3 {
  margin-bottom: 12px;
  color: var(--orange);
}

.content-block p {
  color: var(--text-muted);
  max-width: 720px;
}

.content-block--dark p {
  color: var(--text-muted-on-dark);
}

/* Two-column layout for content */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

/* --- Values / Features Grid --- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  margin-top: 48px;
}

.value-item h3 {
  color: var(--orange);
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.value-item p {
  color: var(--text-muted-on-dark);
  font-size: 0.9375rem;
}

/* --- Case Studies Grid --- */
.case-studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.case-study-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.case-study-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.case-study-card__img {
  width: 100%;
  height: 200px;
  background: var(--off-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.case-study-card__body {
  padding: 24px;
}

.case-study-card__body h3 {
  margin-bottom: 8px;
}

.case-study-card__body p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state h2 {
  margin-bottom: 16px;
  color: var(--text-dark);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Contact Section --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-info h2 {
  margin-bottom: 16px;
}

.contact-info p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin-bottom: 32px;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 1rem;
}

.contact-detail svg {
  color: var(--orange);
  flex-shrink: 0;
}

/* --- Form --- */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form__label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form__input,
.form__textarea {
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--text-dark);
  transition: border-color 0.2s;
}

.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--orange);
}

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

.form__submit {
  align-self: flex-start;
}

/* --- Footer --- */
.footer {
  background: var(--navy);
  padding: 40px 0 24px;
  color: var(--text-muted-on-dark);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 48px;
  margin-bottom: 24px;
}

.footer__brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.footer__brand .logo-accent {
  color: var(--orange);
}

.footer__tagline {
  font-size: 0.875rem;
  color: var(--text-muted-on-dark);
  max-width: 300px;
}

.footer__nav h4 {
  color: var(--white);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer__nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__nav a {
  color: var(--text-muted-on-dark);
  font-size: 0.9375rem;
  transition: color 0.2s;
}

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

.footer__social {
  display: flex;
  gap: 16px;
}

.footer__social a {
  color: var(--text-muted-on-dark);
  transition: color 0.2s;
}

.footer__social a:hover {
  color: var(--orange);
}

.footer__bottom {
  border-top: 1px solid var(--border-dark);
  padding-top: 24px;
  text-align: center;
  font-size: 0.875rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }

  .hero { padding: 80px 0 60px; }
  .hero h1 { font-size: 2.5rem; }
  .hero p { font-size: 1.0625rem; }

  .section { padding: 64px 0; }

  .nav__links { display: none; }
  .nav__hamburger { display: flex; }

  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border-dark);
  }

  .two-col,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

  .footer__inner {
    flex-direction: column;
    gap: 32px;
  }

  .page-header {
    padding: 80px 0 48px;
  }
}
