/* ============================================
   SPO.expert Landing Page - Styles
   Mobile-first responsive design
   ============================================ */

/* --- Custom Properties --- */
:root {
  --color-primary: #0f2b46;
  --color-primary-light: #163a5c;
  --color-accent: #00b4d8;
  --color-accent-hover: #0096b7;
  --color-success: #06d6a0;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-bg-light: #f8fafc;
  --color-white: #ffffff;
  --color-border: #e2e8f0;
  --color-danger: #ef4444;
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --max-width: 1140px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --transition: 0.2s ease;
}

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

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

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

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

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

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

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 2.5rem 0;
}

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

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 1.75rem;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  min-height: 44px;
  min-width: 44px;
  text-align: center;
  line-height: 1.2;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-white);
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.35);
}

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

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

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

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

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1.1rem;
}

/* --- Header / Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 43, 70, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

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

.logo img {
  width: 32px;
  height: 32px;
}

.logo .logo-text {
  color: var(--color-white);
}

.logo .logo-text span {
  color: var(--color-accent);
}

.nav-links {
  display: none;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.nav-cta {
  display: none;
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

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

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

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

/* Mobile menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.25rem;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

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

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  padding: 6rem 0 3rem;
  color: var(--color-white);
  text-align: center;
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: 1.25rem;
}

.hero h1 span {
  color: var(--color-accent);
}

.hero-sub {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: rgba(255, 255, 255, 0.8);
  max-width: 640px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

.hero-taglines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.hero-taglines span {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600;
  color: var(--color-success);
  letter-spacing: 0.02em;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-accent);
}

.stat-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

/* --- Definition Section --- */
.definition {
  background: var(--color-bg-light);
}

.definition-box {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.definition-box p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-text);
}

.definition-box p:last-child {
  margin-bottom: 0;
}

/* --- Problem Section --- */
.problems-grid {
  display: grid;
  gap: 1.25rem;
}

.problem-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow var(--transition);
}

.problem-card:hover {
  box-shadow: var(--shadow-md);
}

.problem-icon {
  width: 48px;
  height: 48px;
  background: #fef2f2;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.problem-card h3 {
  color: var(--color-text);
  font-size: 1.1rem;
}

.problem-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Solution Section --- */
.solution {
  background: var(--color-bg-light);
}

.solution-grid {
  display: grid;
  gap: 1.25rem;
}

.solution-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow var(--transition);
}

.solution-card:hover {
  box-shadow: var(--shadow-md);
}

.solution-icon {
  width: 48px;
  height: 48px;
  background: #ecfdf5;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.solution-card h3 {
  font-size: 1.1rem;
}

.solution-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Features Section --- */
.features-grid {
  display: grid;
  gap: 1.5rem;
}

.feature-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.1), rgba(6, 214, 160, 0.1));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- How It Works --- */
.how-it-works {
  background: var(--color-bg-light);
}

.steps {
  display: grid;
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.step-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.step-content p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Use Cases --- */
.use-cases-grid {
  display: grid;
  gap: 1.25rem;
}

.use-case-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.use-case-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.use-case-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.use-case-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Case Study --- */
.case-study {
  background: var(--color-primary);
  color: var(--color-white);
}

.case-study .section-label {
  color: var(--color-success);
}

.case-study .section-header h2 {
  color: var(--color-white);
}

.case-study .section-header p {
  color: rgba(255, 255, 255, 0.7);
}

.case-study-content {
  display: grid;
  gap: 1.25rem;
  max-width: 800px;
  margin: 0 auto;
}

.case-phase {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.case-phase h3 {
  color: var(--color-accent);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.case-phase p,
.case-phase li {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.case-phase ul {
  list-style: none;
  padding: 0;
}

.case-phase ul li {
  padding: 0.35rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.case-phase ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
}

.case-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.metric {
  text-align: center;
  padding: 1rem;
  background: rgba(6, 214, 160, 0.1);
  border: 1px solid rgba(6, 214, 160, 0.2);
  border-radius: var(--radius);
}

.metric-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-success);
}

.metric-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

/* --- Comparison Table --- */
.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.comparison-table thead {
  background: var(--color-primary);
  color: var(--color-white);
}

.comparison-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.comparison-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background: var(--color-bg-light);
}

.check {
  color: var(--color-success);
  font-weight: 700;
}

.cross {
  color: var(--color-danger);
}

/* --- FAQ --- */
.faq {
  background: var(--color-bg-light);
}

.faq-list {
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-stack);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  gap: 1rem;
  min-height: 44px;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--color-bg-light);
}

.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 1.25rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Contact / CTA Section --- */
.contact {
  background: var(--color-white);
}

.contact-wrapper {
  display: grid;
  gap: 1.75rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact-info h2 {
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.contact-benefits {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}

.contact-benefits li {
  padding: 0.3rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--color-text);
  font-size: 0.95rem;
}

.contact-benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 10px;
  height: 10px;
  background: var(--color-success);
  border-radius: 50%;
}

.contact-form {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-stack);
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: var(--color-danger);
}

.required {
  color: var(--color-danger);
  font-weight: 700;
}

/* Honeypot - visually hidden */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
  tab-index: -1;
}

.form-submit {
  width: 100%;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 2rem 0 1.25rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.footer-brand .logo {
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: none;
}

.footer-col h4 {
  color: var(--color-white);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.4rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* --- Legal Pages --- */
.legal-page {
  padding: 7rem 0 4rem;
}

.legal-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}

.legal-page .legal-updated {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.legal-content {
  max-width: 780px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.legal-content h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-content p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.legal-content ul,
.legal-content ol {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-content li {
  margin-bottom: 0.35rem;
}

.legal-content a {
  color: var(--color-accent);
}

.legal-content a:hover {
  text-decoration: underline;
}

/* --- Utilities --- */
.text-center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Tablet: 768px */
@media (min-width: 768px) {
  section {
    padding: 3rem 0;
  }

  .hero {
    padding: 7rem 0 3.5rem;
  }

  .hero-taglines {
    flex-direction: row;
    gap: 1.5rem;
  }

  .hero-ctas {
    flex-direction: row;
    justify-content: center;
  }

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

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

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

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

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

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

  .contact-wrapper {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .footer-grid {
    grid-template-columns: 1fr 2fr;
  }
}

/* Tablet only: center the lone 3rd AI Layer card on row 2 */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .case-study .solution-card:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: calc(50% - 0.625rem);
  }
}

/* Desktop: 1024px */
@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }

  .nav-cta {
    display: inline-flex;
  }

  .hamburger {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }

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

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

  .case-study .solution-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
  }

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

  .steps {
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 2fr;
  }
}
