/* ===== FONTS ===== */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/montserrat-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/montserrat-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/roboto-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/roboto-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Kaushan Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/kaushan-script-400.woff2') format('woff2');
}

/* ===== CUSTOM PROPERTIES (Apple HIG 8pt grid) ===== */
:root {
  /* Spacing scale — 8pt baseline */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
  --space-3xl: 48px;
  --space-4xl: 56px;
  --space-5xl: 64px;

  /* Brand colors */
  --color-primary: #8CC63F;
  --color-primary-dark: #6EA22E;
  --color-primary-darker: #5E8E13;
  --color-accent: #fec503;

  /* Surface colors — dark scheme */
  --color-bg: #000000;
  --color-bg-alt: #111111;
  --color-bg-card: #1a1a1a;

  /* Text */
  --color-text: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-text-tertiary: #6e6e73;
  --color-text-heading: #f5f5f7;

  /* Borders & inputs */
  --color-border: rgba(255,255,255,0.1);
  --color-input-bg: #1a1a1a;
  --color-input-border: #3a3a3c;
  --color-input-text: #f5f5f7;

  /* Typography */
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-brand: 'Kaushan Script', cursive;

  /* Layout */
  --max-width: 980px;
  --nav-height: 64px;

  /* Corners — per HIG: 8px cards, 12px modals, 6px small */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Shadows — layered for depth per HIG */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);

  /* Motion — per HIG: 150ms micro, 300ms standard, 400ms complex */
  --duration-short: 150ms;
  --duration-base: 300ms;
  --duration-medium: 400ms;
  --ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text-heading);
  line-height: 1.1;
  letter-spacing: -0.003em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-short) var(--ease-out);
}
a:hover { color: var(--color-accent); }

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

::selection {
  background: var(--color-primary);
  color: #fff;
}

/* ===== UTILITY ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 735px) {
  .container {
    padding: 0 var(--space-md);
  }
}

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

/* ===== NAV — glassmorphism per HIG materials ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow var(--duration-short) var(--ease-out);
}
.nav.scrolled {
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.nav__links {
  display: flex;
  list-style: none;
  gap: var(--space-xs);
  align-items: center;
}
.nav__links a {
  color: rgba(255,255,255,0.8);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-sm) var(--space-md);
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color var(--duration-short) var(--ease-out);
}
.nav__links a:hover,
.nav__links a:focus-visible {
  color: var(--color-primary);
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-short) var(--ease-out);
}
.nav__toggle:hover {
  background: rgba(255,255,255,0.08);
}
.nav__toggle svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

@media (max-width: 768px) {
  .nav__toggle { display: flex; align-items: center; justify-content: center; }
  .nav__links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    padding: var(--space-sm) var(--space-md);
    gap: 0;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform var(--duration-base) var(--ease-out),
                opacity var(--duration-base) var(--ease-out);
    pointer-events: none;
  }
  .nav__links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .nav__links a {
    padding: var(--space-md);
    width: 100%;
  }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: var(--nav-height) var(--space-lg) 12vh;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: url('../img/bgnew.webp') center center / cover no-repeat;
  z-index: 0;
}
.hero__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  max-width: min(520px, 70vw);
  width: 100%;
  height: auto;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}
/* Fade to black at the bottom — seamless transition into page */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.1) 30%,
    rgba(0,0,0,0.4) 60%,
    rgba(0,0,0,0.85) 80%,
    #000000 100%
  );
}
.hero__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.hero__sub {
  font-size: 1.125rem;
  line-height: 1.56;
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-xl);
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

/* CTA button — black text on green */
.hero__cta {
  display: inline-block;
  background: var(--color-primary);
  color: #000;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px var(--space-xl);
  min-height: 44px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background var(--duration-short) var(--ease-out),
              transform var(--duration-short) var(--ease-out);
}
.hero__cta:hover {
  background: var(--color-primary-dark);
  color: #000;
  transform: scale(1.02);
}
.hero__cta:active {
  transform: scale(0.98);
}

/* ===== SECTIONS ===== */
.section {
  padding: var(--space-5xl) 0;
}
.section--alt {
  background: var(--color-bg-alt);
}
.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}
.section__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.005em;
}
.section__subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* ===== SERVICES ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}
.service-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.service-card__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-lg);
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-card__icon svg {
  width: 32px;
  height: 32px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.service-card__title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}
.service-card__text {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 50ch;
  margin: 0 auto;
}

/* ===== ABOUT ===== */
.about-content {
  max-width: 65ch;
  margin: 0 auto;
  text-align: center;
}
.about-content p {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}
.about-content p:last-child {
  margin-bottom: 0;
}

/* ===== CONTACT ===== */
.contact-form {
  max-width: 560px;
  margin: 0 auto;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-group {
  margin-bottom: var(--space-md);
}
.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px var(--space-md);
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-input-text);
  background: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius);
  transition: border-color var(--duration-short) var(--ease-out),
              box-shadow var(--duration-short) var(--ease-out);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(140,198,63,0.25);
}
.form-group textarea {
  min-height: 160px;
  resize: vertical;
}

/* Honeypot — hidden from humans, visible to bots */
.form-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Button — black text on green */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #000;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px var(--space-xl);
  min-height: 44px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background var(--duration-short) var(--ease-out),
              transform var(--duration-short) var(--ease-out);
}
.btn:hover {
  background: var(--color-primary-dark);
  transform: scale(1.02);
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.form-status {
  text-align: center;
  margin-top: var(--space-md);
  font-weight: 700;
  min-height: 1.5em;
}
.form-status.success { color: var(--color-primary); }
.form-status.error { color: #ff453a; }

/* ===== FOOTER ===== */
.footer {
  background: var(--color-bg);
  color: var(--color-text-tertiary);
  padding: var(--space-lg) 0;
  text-align: center;
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
}
.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}
.footer__links {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}
.footer__links a {
  color: var(--color-text-tertiary);
  font-size: 0.8125rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color var(--duration-short) var(--ease-out);
}
.footer__links a:hover { color: var(--color-primary); }

@media (max-width: 600px) {
  .footer .container {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== HTMX INDICATORS ===== */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}
.htmx-request .btn-text {
  display: none;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SCROLL ENTRANCE ANIMATIONS ===== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-medium) var(--ease-out),
              transform var(--duration-medium) var(--ease-out);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up {
    opacity: 1;
    transform: none;
  }
}

/* ===== SKIP LINK (a11y) ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-primary);
  color: #000;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 200;
  font-weight: 700;
}
.skip-link:focus {
  top: var(--space-sm);
  color: #000;
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}
