*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #0a0a0a;
  --white: #f5f3ef;
  --teal: #116979;
  --gold: #e6b31e;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-fa: 'doran', Tahoma, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-sans);
  overflow-x: hidden;
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

/* RTL */
html[lang="fa"] {
  direction: rtl;;
}
html[lang="fa"] .nav-logo {
  direction: ltr;
}

html[lang="en"] .lang-btn,
html[lang="fa"] .section-label{
  font-family: 'doran';
}

html[lang="fa"] body,
html[lang="fa"] input,
html[lang="fa"] .nav-links a,
html[lang="fa"] .lang-btn,
html[lang="fa"] .hero-title,
html[lang="fa"] .hero-sub,
html[lang="fa"] .back-link,
html[lang="fa"] .product-card-name,
html[lang="fa"] .product-card-desc,
html[lang="fa"] .footer-copy {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

html[lang="fa"] nav {
  flex-direction: row-reverse;
}

html[lang="fa"] .nav-right {
  flex-direction: row-reverse;
}

html[lang="fa"] .back-link {
  flex-direction: row-reverse;
}

::-webkit-scrollbar {
  width: 2px;
}

::-webkit-scrollbar-track {
  background: var(--white);
}

::-webkit-scrollbar-thumb {
  background: var(--teal);
}

.cursor-ring {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(17, 105, 121, 0.5);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  top: 0;
  left: 0;
  will-change: transform;
  transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1),
    height 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

body:has(a:hover) .cursor-ring,
body:has(button:hover) .cursor-ring {
  width: 52px;
  height: 52px;
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 4rem;
  transition: background 0.35s, box-shadow 0.35s;
}

nav.scrolled {
  background: rgba(245, 243, 239, 0.90);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(10, 10, 10, 0.07);
}

nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 4rem;
  right: 4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10, 10, 10, 0.07), transparent);
}

.nav-logo {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--black);
}

.nav-logo span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 3rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(10, 10, 10, 0.45);
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--black);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  background: none;
  border: 1px solid rgba(10, 10, 10, 0.12);
  color: rgba(10, 10, 10, 0.45);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: border-color 0.3s, color 0.3s;
}

.lang-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* HERO */
.hero {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8rem 4rem 4rem;
  text-align: center;
  /* border-bottom: 1px solid rgba(10, 10, 10, 0.07); */
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--black);
  margin-bottom: 1rem;
  visibility: hidden;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: rgba(10, 10, 10, 0.5);
  max-width: 50ch;
  line-height: 1.8;
  visibility: hidden;
}

/* CONTENT */
.content {
  padding: 4rem 4rem 6rem 4rem;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 3rem;
  transition: gap 0.3s;
  visibility: hidden;
}

.back-link:hover {
  gap: 1rem;
}

.back-link::before {
  content: '←';
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

#Agricultural,
#Industrial,
#Food {
    scroll-margin-top: 100px;
}

/* Products grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(10, 10, 10, 0.07);
  border: 1px solid rgba(10, 10, 10, 0.07);
  margin-bottom: 20px;
}

.product-card {
  background: var(--white);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* min-height: 200px; */
  justify-content: flex-start;
  transition: background 0.3s, transform 0.3s;
}

.product-card:hover {
  background: rgba(17, 105, 121, 0.04);
}

.product-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--teal);
  transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.product-card:hover::after {
  width: 100%;
}

.product-card-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--black);
  line-height: 1.1;
  text-align: center;
}

.product-card-desc {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(10, 10, 10, 0.4);
  letter-spacing: 0.05em;
  line-height: 1.7;
  margin-top: 0.2rem;
  text-align: center;
}

/* Error state */
.error-msg {
  text-align: center;
  padding: 4rem 2rem;
  font-family: var(--font-mono);
  color: rgba(10, 10, 10, 0.4);
}

/* Responsive */
@media (max-width: 900px) {
    nav {
    padding: 1rem 1.5rem 3rem 1.5rem;
    height: fit-content;
  }

  nav::after {
    left: 2rem;
    right: 2rem;
  }

  .nav-links {
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom:0;
    left: 0;
    right: 0;
  }


  .hero {
    padding: 6rem 2rem 3rem;
  }

  .content {
    padding: 4rem 2rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer {
    padding: 2rem;
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}