/* ================================
   AP Food Consulting – Dark Identity
   File: /assets/css/styles.css
================================ */

/* Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Playfair+Display:wght@400;500;600&display=swap");

:root {
  /* Color */
  --c-bg-main: #0f1113;
  --c-bg-alt: #16181b;

  --c-text-main: #f1f1f1;
  --c-text-soft: #b8b8b8;
  --c-muted: #8a8a8a;

  --c-accent: #9a7b4f;
  --c-accent-hover: #826743;

  --c-border: #26282c;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;

  --container: 1100px;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.25rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Type */
  --measure: 72ch;

  /* Effects */
  --shadow-1: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 18px 50px rgba(0, 0, 0, 0.45);

  --focus: 0 0 0 3px rgba(154, 123, 79, 0.35);

  /* Sticky header offset for anchor scrolling (set by JS when possible) */
  --header-offset: 92px;
}

@media (max-width: 980px) {
  :root {
    --header-offset: 112px;
  }
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--c-bg-main);
  color: var(--c-text-main);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

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

.section {
  padding: var(--space-8) 0;
}

/* Common lead text */
.section-lead,
.case-studies-lead {
  max-width: var(--measure);
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.6rem;
  color: var(--c-text-main);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.15rem);
}

h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem;
  color: var(--c-text-soft);
}

strong {
  color: var(--c-text-main);
  font-weight: 600;
}

.muted {
  color: var(--c-muted) !important;
}

/* Focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-sm);
}

/* Links */
a {
  color: var(--c-text-main);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(241, 241, 241, 0.35);
}

a:hover {
  color: var(--c-accent);
  text-decoration-color: rgba(154, 123, 79, 0.65);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1.1rem 0;
  background: rgba(15, 17, 19, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand__name {
  letter-spacing: 0.02em;
}

/* Header: transparent over hero, solid after scroll */
.site-header.is-overlay {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.site-header.is-solid {
  background: rgba(15, 17, 19, 0.78);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(10px);
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--c-accent);
  color: #0f1113;
  border-color: rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  background: var(--c-accent-hover);
}

.btn-outline {
  background: transparent;
  border-color: rgba(241, 241, 241, 0.65);
  color: var(--c-text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(241, 241, 241, 0.85);
}

.btn--sm {
  padding: 0.55rem 1rem;
}

.btn-block {
  width: 100%;
}

/* Surfaces / cards */
.surface {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.card {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 1.25rem;
}

.card--lg {
  border-radius: var(--radius-lg);
}

.card__kicker {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.hr {
  border-top: 1px solid var(--c-border);
}

/* Layout helpers */
.grid {
  display: grid;
  gap: var(--space-3);
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5); /* 1.5rem */
}
.services-cta {
  margin-top: var(--space-5);
}

.hero-grid {
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-6);
  align-items: center;
}

.about-grid {
  grid-template-columns: 420px 1fr;
  gap: var(--space-6);
  align-items: start;
}

.contact-grid {
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* Hero shared */
.hero {
  padding-top: var(--space-6);
}

.btn-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

/* Trust strip */
.trust {
  padding: var(--space-6) 0;
}

.trust__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding: var(--space-4) 0;
}

/* Process / FAQ section backgrounds */
.section-alt {
  background: var(--c-bg-alt);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

/* ================================
   Full-screen Hero (image background + slideshow)
================================ */
.hero-full {
  position: relative;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  padding: 0; /* override .section spacing */
}

.hero-full__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 35% 45%;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
}

.hero-img.active {
  opacity: 1;
}

.hero-full__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
      900px 520px at 40% 45%,
      rgba(15, 17, 19, 0.15),
      rgba(15, 17, 19, 0.78)
    ),
    linear-gradient(
      180deg,
      rgba(15, 17, 19, 0.5) 0%,
      rgba(15, 17, 19, 0.82) 62%,
      rgba(15, 17, 19, 0.96) 100%
    );
}

.hero-full__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-offset) + var(--space-6));
  padding-bottom: var(--space-7);
}

.hero-full__text {
  max-width: 760px;
}

/* Normalize hero copy spacing without inline styles */
.hero-lead {
  max-width: var(--measure);
}

.hero-sub {
  margin-top: var(--space-3);
}

/* Subtle hero entrance */
@keyframes heroEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-full__text {
  animation: heroEnter 700ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }

  .hero-img {
    transition: none;
  }

  .hero-full__text {
    animation: none;
  }
}

/* Mobile adjustments */
@media (max-width: 980px) {
  .hero-full {
    min-height: 720px;
    height: auto;
  }

  .hero-full__content {
    padding-top: calc(var(--header-offset) + var(--space-6));
    padding-bottom: var(--space-7);
  }

  .hero-full__text {
    max-width: 100%;
  }

  .hero-full__overlay {
    background: linear-gradient(
      180deg,
      rgba(15, 17, 19, 0.62) 0%,
      rgba(15, 17, 19, 0.9) 65%,
      rgba(15, 17, 19, 0.98) 100%
    );
  }
}

/* ================================
   A11y: skip link + honeypot wrapper
================================ */
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  transform: translateY(-150%);
  transition: transform 0.18s ease;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Honeypot wrapper is hidden; keep a label for semantics */
.hp-wrap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hp-label,
.hp-field {
  display: block;
}

/* ================================
   Forms
================================ */
.form {
  padding: 1.25rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

label {
  display: inline-block;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--c-text-main);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(184, 184, 184, 0.55);
}

/* Fix select dropdown options on dark theme */
select option {
  background: var(--c-bg-alt);
  color: var(--c-text-main);
}

.form-status {
  margin: 0;
  min-height: 1.25rem;
}

.form-fine {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--c-muted);
}

/* Form status (success/error) */
#formStatus.is-success {
  color: rgba(170, 255, 190, 0.9) !important;
}

#formStatus.is-error {
  color: rgba(255, 130, 130, 0.9) !important;
}

.turnstile-wrap {
  margin-top: 0.25rem;
}

.cf-turnstile {
  margin-top: 0.25rem;
}

/* ================================
   FAQ
================================ */
details {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  margin-top: 0.75rem;
}

details:first-of-type {
  margin-top: 1rem;
}

details > summary {
  cursor: pointer;
  color: var(--c-text-main);
}

details[open] {
  box-shadow: var(--shadow-1);
}

details > p {
  margin-top: 0.75rem;
}

/* ================================
   Process
================================ */
.process-grid {
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-6);
}

.process-list {
  margin-top: var(--space-4);
  padding-left: 0;
  list-style: none;
  max-width: var(--measure);
  display: grid;
  gap: var(--space-2);
}

.process-list li {
  color: var(--c-text-soft);
}

.process-list strong {
  color: var(--c-text-main);
}

.process-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  opacity: 0.92;
  filter: saturate(0.95) contrast(0.95);
  box-shadow: none;
  mask-image: radial-gradient(
    85% 85% at 50% 50%,
    rgba(0, 0, 0, 1) 70%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* ================================
   Case Studies
================================ */
.case-studies-grid {
  margin-top: var(--space-4);
}

.case__title {
  margin: 0.6rem 0 0.5rem;
}

.case__block {
  margin-top: 0.9rem;
}

.case__label {
  margin: 0 0 0.35rem;
}

.case__text {
  margin: 0;
}

.case__list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--c-text-soft);
}

.case__list li {
  margin: 0.25rem 0;
}

/* ================================
   About
================================ */
.about-portrait {
  border-radius: var(--radius-lg);
}

.about-disclaimer {
  margin-top: var(--space-3);
  max-width: 65ch;
}

/* ================================
   Contact
================================ */
.contact-lead {
  max-width: 60ch;
}

.contact-meta {
  margin-top: var(--space-4);
}

.contact-email {
  margin: 0;
}

.contact-alt {
  margin: 0.25rem 0 0;
}

/* Contact logo */
.contact-logo {
  width: 100%;
  margin-top: var(--space-7);
  display: flex;
  justify-content: flex-start; /* desktop */
  opacity: 0.35;
}

.contact-logo img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  filter: grayscale(100%);
}

@media (max-width: 980px) {
  .contact-logo {
    justify-content: center;
    margin-top: var(--space-6);
    opacity: 0.25;
  }

  .contact-logo img {
    max-width: 200px;
  }

  .contact-copy {
    width: 100%;
  }
}

/* ================================
   Footer
================================ */
.footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-bg-main);
  padding: var(--space-7) 0 var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: var(--space-6);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-brand {
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.footer-title {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: var(--c-text-main);
}

.footer-title--spaced {
  margin-top: var(--space-5);
}

.footer-text {
  max-width: 40ch;
  margin: 0.5rem 0 0;
}

.footer-small {
  font-size: 0.9rem;
  margin-top: var(--space-4);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin: 0.35rem 0;
}

.footer-links a {
  text-decoration: none;
  color: var(--c-text-soft);
}

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

.footer-lang {
  margin-top: var(--space-3);
  align-self: flex-start;
}

.footer-legal {
  font-size: 0.75rem;
  max-width: 70ch;
  margin-top: var(--space-6);
  line-height: 1.5;
}

/* ================================
   Anchor offset for sticky header
================================ */
section[id] {
  scroll-margin-top: var(--header-offset);
}

/* ================================
   Mobile layout
================================ */
@media (max-width: 980px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  @media (max-width: 980px) {
    .grid-3 {
      grid-template-columns: 1fr;
    }
  }

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

  .nav {
    gap: 0.5rem;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* ================================
   Mobile nav
================================ */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(241, 241, 241, 0.28);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(241, 241, 241, 0.9);
  border-radius: 999px;
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-header__row {
    position: relative;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    left: 0;
    padding: 0.9rem;
    background: rgba(15, 17, 19, 0.95);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(10px);
    gap: 0.65rem;
  }

  .site-header.nav-open .nav {
    display: grid;
  }

  .site-header.nav-open .nav a {
    padding: 0.55rem 0.35rem;
    text-decoration: none;
  }

  .site-header.nav-open .nav .btn {
    width: 100%;
    justify-content: center;
  }
}

.policy-container {
  max-width: 80ch;
}

.policy-note {
  margin-top: 1.25rem;
}

.footer__inline {
  margin: 0;
}
