/* ============================================
   AgentPrime Design System
   ============================================ */

:root {
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #dbeafe;
  --color-accent-subtle: #eff6ff;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-warm: #fafaf9;
  --color-border: #e2e8f0;
  --color-error: #dc2626;
  --color-success: #16a34a;
  --color-footer-bg: #0f172a;
  --color-footer-text: #94a3b8;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --container-max: 1200px;
  --container-narrow: 800px;
  --form-max: 700px;

  --section-padding: 120px;
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
  overflow: hidden;
}

/* Grain texture overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

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

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

h1, h2, h3, h4 {
  color: var(--color-text);
  line-height: 1.15;
}

ul {
  list-style: none;
}

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

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: -0.01em;
}

.btn--primary {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.btn--outline:hover {
  border-color: var(--color-text);
  transform: translateY(-1px);
}

.btn--full {
  width: 100%;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--color-border);
}

.nav__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--color-text);
}

.nav__cta {
  padding: 10px 24px;
  background: var(--color-text);
  color: #ffffff !important;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav__cta:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--color-text);
  transition: color 0.2s ease;
}

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

.mobile-menu__cta {
  margin-top: 16px;
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  font-weight: 600;
  padding: 16px 48px;
  background: var(--color-text);
  color: #ffffff !important;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.mobile-menu__cta:hover {
  background: #1e293b;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.hero .container {
  position: relative;
}

.hero__content {
  max-width: 740px;
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 28px;
  color: var(--color-text);
}

.hero__subheadline {
  font-size: 19px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 44px;
  max-width: 560px;
}

.hero__ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Decorative lines on right side of hero */
.hero__decoration {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  opacity: 0.07;
}

.hero__line {
  height: 1px;
  background: var(--color-text);
}

.hero__line:nth-child(1) {
  width: 320px;
}

.hero__line:nth-child(2) {
  width: 240px;
}

.hero__line:nth-child(3) {
  width: 160px;
}

/* ============================================
   Problem
   ============================================ */
.problem {
  padding: var(--section-padding) 0;
  background: var(--color-text);
  color: #ffffff;
  position: relative;
}

.problem__inner {
  max-width: 960px;
  margin: 0 auto;
}

.problem__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin-bottom: 24px;
}

.problem__headline {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 48px;
  letter-spacing: -0.02em;
}

.problem__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.problem__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.problem__text p {
  font-size: 17px;
  line-height: 1.7;
  color: #94a3b8;
}

.problem__callout {
  padding: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 8px 8px 0;
}

.problem__callout p {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.5;
  color: #e2e8f0;
}

.problem__callout em {
  color: #ffffff;
  font-style: italic;
}

/* ============================================
   Section Shared
   ============================================ */
.section-header {
  text-align: center;
  margin-bottom: 72px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================
   Services
   ============================================ */
.services {
  padding: var(--section-padding) 0;
  background: var(--color-bg-alt);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--color-bg);
  border-radius: 12px;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: transparent;
}

.service-card__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.service-card:hover .service-card__accent {
  transform: scaleX(1);
}

.service-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-radius: 12px;
  margin-bottom: 28px;
  transition: background 0.3s ease;
}

.service-card:hover .service-card__icon {
  background: var(--color-accent-light);
}

.service-card__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 20px;
}

.service-card__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-card__list li {
  font-size: 15px;
  color: var(--color-text-secondary);
  padding-left: 20px;
  position: relative;
}

.service-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.4;
}

/* ============================================
   Scenarios
   ============================================ */
.scenarios {
  padding: var(--section-padding) 0;
}

.scenarios__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.scenario {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  padding: 48px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: start;
}

.scenario:first-child {
  border-top: 1px solid var(--color-border);
}

.scenario__number {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--color-accent);
  line-height: 1;
  padding-top: 4px;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.scenario:hover .scenario__number {
  opacity: 1;
}

.scenario__body {
  max-width: 720px;
}

.scenario__situation {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 16px;
  color: var(--color-text);
}

.scenario__response {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ============================================
   Why AgentPrime
   ============================================ */
.why {
  padding: var(--section-padding) 0;
  background: var(--color-bg-alt);
}

.why .section-title {
  text-align: left;
}

.why__prose {
  margin-bottom: 56px;
}

.why__lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.why__pivot {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-accent);
}

.why__differentiators {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.why__item {
  padding-left: 28px;
  border-left: 3px solid var(--color-accent);
  transition: border-color 0.3s ease;
}

.why__item:hover {
  border-left-color: var(--color-accent-hover);
}

.why__item h3 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.why__item p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ============================================
   About
   ============================================ */
.about {
  padding: var(--section-padding) 0;
}

.about .section-title {
  text-align: left;
}

.about__prose {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about__prose p {
  font-size: 17px;
  line-height: 1.75;
}

.about__lead {
  font-size: 18px !important;
}

.about__lead strong {
  color: var(--color-text);
}

.about__location {
  font-weight: 600;
  color: var(--color-text);
  margin-top: 8px;
  letter-spacing: -0.01em;
}

/* ============================================
   Contact / Get Started
   ============================================ */
.contact {
  padding: var(--section-padding) 0;
  background: var(--color-bg-alt);
}

.contact__inner {
  max-width: var(--form-max);
  margin: 0 auto;
}

.contact .section-header {
  text-align: left;
}

.contact .section-subtitle {
  margin: 0;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input.error,
.form-group select.error {
  border-color: var(--color-error);
}

.form-group input.error:focus,
.form-group select.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

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

.form-error {
  font-size: 13px;
  color: var(--color-error);
  min-height: 0;
}

.contact__form .btn {
  margin-top: 8px;
}

/* Success State */
.contact__success {
  display: none;
  text-align: center;
  padding: 64px 0;
}

.contact__success.active {
  display: block;
}

.contact__success-icon {
  color: var(--color-success);
  margin-bottom: 24px;
}

.contact__success h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--color-text);
}

.contact__success p {
  font-size: 16px;
  color: var(--color-text-secondary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--color-footer-bg);
  padding: 72px 0 36px;
  color: var(--color-footer-text);
}

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

.footer__logo {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.footer__tagline {
  font-size: 14px;
  color: var(--color-footer-text);
  margin-top: 10px;
}

.footer__nav {
  display: flex;
  gap: 32px;
}

.footer__nav a {
  font-size: 14px;
  color: var(--color-footer-text);
  transition: color 0.2s ease;
}

.footer__nav a:hover {
  color: #ffffff;
}

.footer__bottom {
  padding-top: 24px;
}

.footer__bottom p {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.5);
}

/* ============================================
   Scroll Animations
   ============================================ */
.animate-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  :root {
    --section-padding: 96px;
  }

  .hero__headline {
    font-size: 56px;
  }

  .section-title {
    font-size: 40px;
  }

  .problem__headline {
    font-size: 40px;
  }

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

  .problem__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero__decoration {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 72px;
  }

  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 56px);
    padding-bottom: 56px;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__headline {
    font-size: 42px;
    text-align: center;
  }

  .hero__headline br {
    display: none;
  }

  .hero__eyebrow {
    text-align: center;
  }

  .hero__subheadline {
    font-size: 17px;
    text-align: center;
    max-width: 100%;
  }

  .hero__ctas {
    justify-content: center;
  }

  .section-title {
    font-size: 36px;
  }

  .problem__headline {
    font-size: 32px;
  }

  .problem__headline br {
    display: none;
  }

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

  .scenario {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 36px 0;
  }

  .scenario__number {
    font-size: 28px;
  }

  .scenario__situation {
    font-size: 20px;
  }

  .why .section-title,
  .about .section-title,
  .contact .section-header {
    text-align: center;
  }

  .contact .section-subtitle {
    margin: 0 auto;
  }

  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 32px;
  }

  .footer__nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }

  .footer__bottom {
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 56px;
  }

  .container,
  .container-narrow {
    padding: 0 16px;
  }

  .hero__headline {
    font-size: 34px;
  }

  .hero__ctas {
    flex-direction: column;
    width: 100%;
  }

  .hero__ctas .btn {
    width: 100%;
  }

  .problem__headline {
    font-size: 28px;
  }

  .problem__callout {
    padding: 28px;
  }

  .problem__callout p {
    font-size: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .service-card {
    padding: 32px 24px;
  }
}
