/* ============================================
   DDG Surveying — 2026 Redesign
   ============================================ */

/* --- Custom Properties --- */
:root {
  --color-ink: #1a1a1a;
  --color-ink-light: #4a4a4a;
  --color-surface: #ffffff;
  --color-surface-alt: #f4f6f8;
  --color-accent: #017dc3;
  --color-accent-hover: #015f94;
  --color-border: #dde1e6;
  --color-error: #c0392b;
  --color-success: #27ae60;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 8rem;

  --content-width: 72rem;
  --nav-height: 5.5rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-surface-alt) url('../img/survey_bg.jpg') center center / cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* iOS Safari doesn't handle background-attachment: fixed reliably.
   On touch devices without hover, fall back to a fixed-position image layer. */
@media (hover: none) {
  body {
    background-attachment: scroll;
  }
}

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

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

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font: inherit;
}

address {
  font-style: normal;
}

/* --- Utilities --- */
.container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.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;
}

.sr-only--focusable:focus {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--color-accent);
  color: var(--color-ink);
  font-weight: 600;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 0.375rem;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

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

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--color-accent-hover);
}

.btn--outline {
  background: transparent;
  color: var(--color-ink);
  box-shadow: inset 0 0 0 2px var(--color-border);
}

.btn--outline:hover,
.btn--outline:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-ink);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.section-header p {
  color: var(--color-ink-light);
  font-size: 1.0625rem;
  max-width: 52rem;
  margin-inline: auto;
  text-wrap: balance;
}

/* ============================================
   Navigation
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow 0.3s var(--ease-out);
}

.site-header--scrolled {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav__logo img {
  height: 3rem;
  width: auto;
}

.nav__menu {
  display: flex;
  gap: var(--space-md);
}

.nav__menu a {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-light);
  transition: color 0.2s var(--ease-out);
  padding: 0.25rem 0;
}

.nav__menu a:hover,
.nav__menu a:focus-visible {
  color: var(--color-ink);
}

.nav__menu a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
}

.nav__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-ink);
  border-radius: 1px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
}

/* Hamburger open state */
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: var(--space-2xl) 0;
  scroll-margin-top: var(--nav-height);
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero__inner {
  display: flex;
  justify-content: center;
}

.hero__content {
  text-align: center;
  max-width: 40rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-lg);
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.hero__eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  color: var(--color-ink);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

.hero__actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.hero__wordmark {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-ink-light);
  margin-top: var(--space-sm);
}

/* ============================================
   Services
   ============================================ */
.services {
  padding: var(--space-xl) 0;
  scroll-margin-top: calc(var(--nav-height) + var(--space-md));
}

.services > .container {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-xl) var(--space-md);
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.service-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

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

.service-card__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  color: var(--color-accent);
}

.service-card__icon svg {
  width: 100%;
  height: 100%;
}

.service-card__title {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ============================================
   About
   ============================================ */
.about {
  padding: var(--space-xl) 0;
  scroll-margin-top: calc(var(--nav-height) + var(--space-md));
}

.about > .container {
  background: rgba(244, 246, 248, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-xl) var(--space-md);
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.about__content {
  display: grid;
  gap: var(--space-lg);
}

.about__text p {
  color: var(--color-ink-light);
  margin-bottom: var(--space-sm);
  font-size: 1.0625rem;
  line-height: 1.7;
}

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

.about__highlights {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.stat-card {
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 0.375rem 0.375rem 0;
}

.stat-card__number {
  display: block;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  color: var(--color-accent);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-card__label {
  font-size: 0.875rem;
  color: var(--color-ink-light);
  font-weight: 500;
}

.about__tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.tech-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-ink-light);
  border: 1px solid var(--color-border);
  border-radius: 2rem;
}

/* ============================================
   Contact
   ============================================ */
.contact {
  padding: var(--space-xl) 0;
  scroll-margin-top: calc(var(--nav-height) + var(--space-md));
}

.contact > .container {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-xl) var(--space-md);
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.contact__grid {
  display: grid;
  gap: var(--space-lg);
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact__detail h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-light);
  margin-bottom: 0.375rem;
}

.contact__detail a,
.contact__detail address {
  font-size: 1.0625rem;
  display: block;
  line-height: 1.6;
}

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

.contact__detail a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Form */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.form-group label span {
  color: var(--color-accent);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: var(--color-surface);
  color: var(--color-ink);
  transition: border-color 0.2s, outline 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
  border-color: var(--color-accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 8rem;
}

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

.form-group__error {
  font-size: 0.8125rem;
  color: var(--color-error);
  margin-top: 0.25rem;
}

.form-status {
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: padding 0.2s;
}

.form-status:not(:empty) {
  padding: 0.875rem 1rem;
}

.form-status--success {
  background: #eafaf1;
  color: var(--color-success);
}

.form-status--error {
  background: #fdedec;
  color: var(--color-error);
}

.contact__form .btn {
  align-self: flex-start;
}

.contact__form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-lg) 0 var(--space-md);
}

.footer__inner {
  display: grid;
  gap: var(--space-md);
}

.footer__brand p {
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 20rem;
}

.footer__logo {
  height: 3.5rem;
  width: auto;
  margin-bottom: var(--space-sm);
  filter: invert(1) brightness(2);
}

.footer__contact a {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.8;
  transition: color 0.2s;
}

.footer__contact a:hover {
  color: #fff;
}

.footer__contact a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.footer__legal {
  font-size: 0.8125rem;
  opacity: 0.6;
}

.footer__legal a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__legal a:hover {
  color: #fff;
}

/* ============================================
   Reveal Animations
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

/* Stagger service cards */
.services__grid .reveal:nth-child(3n+2) { transition-delay: 0.05s; }
.services__grid .reveal:nth-child(3n+3) { transition-delay: 0.1s; }

/* ============================================
   Responsive — Tablet (48em / 768px)
   ============================================ */
@media (min-width: 48em) {
  .nav__toggle { display: none; }

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

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

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

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

  .footer__legal {
    text-align: right;
  }
}

/* ============================================
   Responsive — Desktop (64em / 1024px)
   ============================================ */
@media (min-width: 64em) {
  .nav__logo img {
    height: 4rem;
  }

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

}

/* ============================================
   Responsive — Mobile Nav (below 48em)
   ============================================ */
@media (max-width: 47.999em) {
  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease-out);
  }

  .nav__menu--open {
    max-height: 20rem;
  }

  .nav__menu a {
    display: block;
    padding: 0.875rem var(--space-md);
    border-bottom: 1px solid var(--color-border);
  }
}
