/* Fieldy — Shared Styles */

:root {
  --orange: #E8430A;
  --orange-light: #FF5B1F;
  --navy: #1B2B4B;
  --navy-light: #263d6b;
  --white: #FAFAF8;
  --gray-50: #F6F5F3;
  --gray-100: #ECEAE6;
  --gray-300: #C4BFB8;
  --gray-500: #888077;
  --gray-700: #4A4540;
  --font-heading: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --nav-h: 68px;
  /* Fluid horizontal page padding — shrinks from 48px desktop down to 16px on phones */
  --page-px: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Catch-all against horizontal overflow caused by oversized images or wide grids */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
}

/* No media element ever escapes its container */
img, video, svg { max-width: 100%; }
img { height: auto; }

/* NAV */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--page-px);
  background: rgba(250,250,248,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  gap: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.nav-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: -0.5px;
}

.nav-logo-text sup {
  font-size: 10px;
  font-weight: 600;
  vertical-align: super;
  color: var(--gray-500);
}

/* Image-based wordmark used in nav + footer (replaces the inline "fieldly" text) */
.nav-logo-wordmark {
  height: 26px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.footer-brand .nav-logo-wordmark {
  height: 28px;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--navy);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--orange);
  background: rgba(232,67,10,0.07);
}

.nav-links a.active {
  color: var(--orange);
  font-weight: 700;
}

.nav-cta {
  display: flex;
  gap: 10px;
  margin-left: 24px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-primary:hover {
  background: var(--orange-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,67,10,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--gray-300);
}

.btn-ghost:hover {
  border-color: var(--navy);
  background: var(--gray-50);
}

.btn-lg {
  font-size: clamp(14px, 1.4vw, 16px);
  padding: clamp(12px, 1.4vw, 14px) clamp(22px, 2.6vw, 32px);
  border-radius: 10px;
}

/* FOOTER */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.55);
  padding: clamp(40px, 6vw, 60px) var(--page-px) clamp(24px, 4vw, 40px);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
}

.footer-brand .nav-logo-text {
  color: #fff;
}

.footer-tagline {
  font-size: 13px;
  margin-top: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.45);
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--orange);
}

.footer-bottom {
  max-width: 1200px;
  margin: clamp(28px, 4vw, 40px) auto 0;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  gap: 8px;
  flex-wrap: wrap;
}

/* SECTION HELPERS */
.section {
  padding: clamp(48px, 9vw, 100px) var(--page-px);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(26px, 4.6vw, 52px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.section-title span {
  color: var(--orange);
}

.section-body {
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--gray-700);
  max-width: 560px;
  margin-top: 20px;
}

/* PRODUCT SCREENSHOT FRAME — fluid by width, the image keeps its natural
   aspect ratio. Variants pick the right max-width for landscape/portrait. */
.screenshot {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-100);
  background: #fff;
  box-shadow: 0 18px 48px rgba(27,43,75,0.14);
  overflow: hidden;
  display: block;
}

.screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

/* Wider variant — landscape map/dashboard screenshots */
.screenshot.wide { max-width: 680px; }

/* Narrower variant — naturally portrait screenshots (flowcharts, single phone) */
.screenshot.tall { max-width: 420px; }

/* Dark surround variant — for use on dark hero backgrounds */
.screenshot.on-dark {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}

/* Single-column override for two-col feature sections that have no screenshot. */
.features-two-col.features-single {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  gap: 0;
}

.features-two-col.features-single .section-body {
  margin-left: auto;
  margin-right: auto;
}

.features-two-col.features-single .features-bullets {
  text-align: left;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

/* FEATURE GRID */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

.feature-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  box-shadow: 0 12px 40px rgba(27,43,75,0.1);
  transform: translateY(-3px);
  border-color: var(--orange);
}

.feature-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(232,67,10,0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-card-icon svg {
  width: 24px;
  height: 24px;
  color: var(--orange);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.feature-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--gray-700);
}

/* NAV BACKGROUND on scroll */
.nav.scrolled {
  box-shadow: 0 2px 16px rgba(27,43,75,0.08);
}

/* HAMBURGER MENU — hidden on desktop, visible on mobile */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.nav-toggle:hover {
  border-color: var(--navy);
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.22s, opacity 0.18s;
}

/* Animate bars into an X when the menu is open */
.nav.open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Dark nav variant (routing page) — invert hamburger colors */
.nav[data-theme="dark"] .nav-toggle { border-color: rgba(255,255,255,0.25); }
.nav[data-theme="dark"] .nav-toggle:hover { border-color: rgba(255,255,255,0.5); }
.nav[data-theme="dark"] .nav-toggle-bar { background: white; }

/* Mobile-only menu items hidden by default */
.nav-links .mobile-only { display: none; }

/* ========================================================================
   RESPONSIVE BREAKPOINTS
   ======================================================================== */

/* Tablet / small laptop */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --nav-h: 60px; }

  .nav-logo-icon { width: 30px; height: 30px; }
  .nav-logo-wordmark { height: 22px; }

  /* Drop the inter-page nav on phones (footer carries those links) */
  .nav-links { display: none; }

  /* Sign In is a secondary action — hide on phones, keep the primary CTA */
  .nav-cta { margin-left: 8px; gap: 8px; }
  .nav-cta .btn-ghost { display: none; }

  /* Hamburger button appears on mobile */
  .nav-toggle { display: inline-flex; }

  /* When the hamburger is open: drop a panel below the nav with all links + Sign In */
  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(250,250,248,0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-100);
    padding: 8px 0;
    gap: 0;
    box-shadow: 0 12px 32px rgba(27,43,75,0.10);
    z-index: 99;
  }

  .nav.open .nav-links li { width: 100%; list-style: none; }

  .nav.open .nav-links a {
    display: block;
    padding: 14px var(--page-px);
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
  }

  .nav.open .nav-links .mobile-only {
    display: list-item;
    border-top: 1px solid var(--gray-100);
    margin-top: 4px;
  }

  .nav.open .nav-links .mobile-only a { color: var(--orange); }

  /* Dark nav drawer (routing page) */
  .nav[data-theme="dark"].open .nav-links {
    background: rgba(27,43,75,0.98);
    border-bottom-color: rgba(255,255,255,0.08);
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  }
  .nav[data-theme="dark"].open .nav-links a { color: rgba(255,255,255,0.85); }
  .nav[data-theme="dark"].open .nav-links a.active { color: var(--orange); }
  .nav[data-theme="dark"].open .nav-links .mobile-only { border-top-color: rgba(255,255,255,0.08); }

  .btn { font-size: 13px; padding: 9px 16px; }

  .feature-grid { grid-template-columns: 1fr; gap: 16px; }
  .feature-card { padding: 28px 22px; }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* Small phone */
@media (max-width: 420px) {
  .nav-logo-wordmark { height: 20px; }
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-col ul { align-items: center; }
}
