:root {
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --soft: #f8fafc;
  --gold: #d4a017;
  --gold-soft: #f7efd6;
  --trust: #0f766e;
  --trust-soft: #ecfdf8;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --nav-h: 156px;
  --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.85;
}

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

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

button,
input,
textarea {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header--overlay {
  position: absolute;
  inset-inline: 0;
  top: 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
}

.site-header--overlay.is-scrolled {
  position: fixed;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand img {
  height: 144px;
  width: auto;
  background: transparent;
}

.site-header--overlay .brand img {
  height: 144px;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.4));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
  background: var(--soft);
}

.site-header--overlay .nav-links a {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  background: transparent;
}

.site-header--overlay .nav-links a:hover,
.site-header--overlay .nav-links a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-links a.nav-cta {
  background: var(--ink);
  color: #fff;
  margin-right: 0.35rem;
  text-shadow: none;
}

.site-header--overlay .nav-links a.nav-cta {
  background: var(--gold);
  color: var(--ink);
}

.nav-links a.nav-cta:hover {
  background: #1e293b;
  color: #fff;
}

.site-header--overlay .nav-links a.nav-cta:hover {
  background: #e0b12a;
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.site-header--overlay .nav-toggle {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.35);
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 3px auto;
  background: var(--ink);
}

.site-header--overlay .nav-toggle span {
  background: #fff;
}

/* Hero home */
.home-hero {
  position: relative;
  /* leave space so news ticker is visible in first viewport (portrait & landscape) */
  min-height: calc(100vh - 52px);
  min-height: calc(100dvh - 52px);
  max-height: calc(100dvh - 52px);
  display: grid;
  align-items: start;
  justify-items: center;
  overflow: hidden;
  background: var(--soft);
}

.home-hero-media {
  position: absolute;
  inset: 0;
}

.home-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) brightness(0.72);
  transform: scale(1);
  /* no delayed fade/zoom that looks like partial image load */
  opacity: 1;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.45) 0%,
    rgba(15, 23, 42, 0.55) 100%
  );
}

.home-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  /* keep brand block above the news ticker */
  padding: calc(var(--nav-h) + 0.75rem) 1rem 4.5rem;
  max-width: 760px;
  margin-top: clamp(0.5rem, 4vh, 2.5rem);
  transform: translateY(-6vh);
}

.hero-logo {
  width: 128px;
  height: 128px;
  margin: 0 auto 1.25rem;
  opacity: 0;
  transform: translateY(24px) scale(0.9);
  animation: enter 1s var(--ease) 0.1s forwards;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.35));
  background: transparent;
  object-fit: contain;
}

.home-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: enter 1s var(--ease) 0.25s forwards;
}

.home-hero .hero-en {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.hero-slogan {
  margin: 0 auto 1.25rem;
  max-width: 28ch;
  font-size: clamp(1.05rem, 2.1vw, 1.3rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  animation: enter 1s var(--ease) 0.4s forwards;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: enter 1s var(--ease) 0.55s forwards;
}

@keyframes enter {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-zoom {
  to {
    transform: scale(1);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

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

.btn-primary {
  background: var(--gold);
  color: var(--ink);
}

.btn-primary:hover {
  background: #e0b12a;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-line {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

/* Ticker */
.news-ticker {
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 48px;
}

.ticker-label {
  flex: 0 0 auto;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
}

.ticker-track-wrap {
  overflow: hidden;
  flex: 1;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker-track {
  display: flex;
  flex-direction: row;
  direction: rtl;
  align-items: center;
  gap: 1.75rem;
  width: max-content;
  animation: ticker 57s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-track a {
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  transition: color 0.2s;
}

.ticker-track a:hover {
  color: var(--gold);
}

.ticker-dot {
  color: var(--gold);
  font-size: 0.55rem;
  opacity: 0.8;
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(50%);
  }
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-soft {
  background: var(--soft);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  color: var(--ink);
}

.section-head p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.section-head .link-more {
  color: var(--trust);
  font-weight: 700;
  white-space: nowrap;
}

/* News cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.news-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.news-card--compact {
  padding: 0.52rem;
  gap: 0.38rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  border-radius: 10px;
}

.news-card--compact .news-thumb {
  width: 100%;
  height: 62px;
  border-radius: 6px;
  overflow: hidden;
}

.news-card--compact .news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card--compact h3 {
  font-size: 0.57rem;
  line-height: 1.6;
}

.news-card--compact p {
  font-size: 0.52rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card--compact .news-meta {
  font-size: 0.5rem;
}

.news-card--compact .read {
  font-size: 0.55rem;
}

.news-card--row {
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  padding: 0.9rem;
}

.news-card--row .news-thumb {
  flex: 0 0 120px;
  width: 120px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
}

.news-card--row .news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card--row .news-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.news-card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
}

.news-meta {
  display: flex;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.news-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
}

.news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.news-card .read {
  color: var(--trust);
  font-weight: 700;
  font-size: 0.92rem;
}

.news-list {
  display: grid;
  gap: 0.85rem;
}

.news-list .news-card {
  box-shadow: none;
}

.news-highlight {
  scroll-margin-top: calc(var(--nav-h) + 16px);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Clients marquee */
.clients-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.clients-track {
  display: flex;
  width: max-content;
  gap: 0;
  align-items: start;
  animation: clients-move 40s linear infinite;
}

.clients-track:hover {
  animation-play-state: paused;
}

.client-item {
  flex: 0 0 calc(1120px / 7);
  width: calc(1120px / 7);
  max-width: calc((100vw - 2rem) / 7);
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  text-align: center;
  background: none;
  border: none;
  padding: 0.35rem 0.5rem;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s var(--ease);
}

.client-item:hover {
  transform: translateY(-3px);
}

.client-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

.client-logo img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  background: transparent;
}

.client-item span {
  color: var(--text);
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: 14ch;
}

@keyframes clients-move {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(50%);
  }
}

/* Page hero */
.page-hero {
  position: relative;
  min-height: 300px;
  display: grid;
  align-items: end;
  color: #fff;
  overflow: hidden;
  background: var(--ink);
}

.page-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08) translateY(12px);
  animation: page-hero-in 1.15s var(--ease) 0.05s forwards;
}

.page-hero .container {
  position: relative;
  z-index: 2;
  padding: 4.5rem 0 2.5rem;
  opacity: 0;
  transform: translateY(18px);
  animation: page-hero-copy 0.9s var(--ease) 0.25s forwards;
}

@keyframes page-hero-in {
  to {
    opacity: 0.45;
    transform: scale(1) translateY(0);
  }
}

@keyframes page-hero-copy {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.client-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.client-filter-bar span {
  color: var(--ink);
  font-weight: 700;
}

.client-filter-bar a {
  color: var(--trust);
  font-weight: 700;
}

.project-card[hidden] {
  display: none !important;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

.page-hero p {
  margin: 0;
  max-width: 40ch;
  color: rgba(255, 255, 255, 0.88);
}

.slogan-chip {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(212, 160, 23, 0.18);
  color: #f6d889;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Content blocks */
.content-block {
  padding: 4rem 0;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}

.split img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  border-radius: var(--radius);
}

.prose h2 {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1.7rem;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.feature {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  background: #fff;
}

.feature h3 {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.project-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.project-card .body {
  padding: 1.25rem 1.35rem 1.5rem;
}

.project-card .body span {
  display: inline-block;
  color: var(--trust);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.project-card .body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  color: var(--ink);
}

.project-card .body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Team table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 0.95rem 1rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--soft);
  color: var(--ink);
  font-size: 0.9rem;
}

td {
  color: var(--muted);
  font-size: 0.92rem;
}

td:first-child {
  color: var(--ink);
  font-weight: 700;
}

/* Contact form */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1.25rem;
}

.contact-side {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.contact-side h3 {
  margin: 0 0 1rem;
  color: var(--ink);
}

.contact-side li {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.contact-side ul {
  margin: 0;
  padding: 0;
}

.contact-side strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.contact-side a {
  color: var(--trust);
  font-weight: 600;
}

.form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  gap: 0.9rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.field input,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  background: var(--soft);
  outline: none;
}

.field input:focus,
.field textarea:focus {
  border-color: #94a3b8;
  background: #fff;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.78);
  padding: 2rem 0 1.1rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.req {
  color: #dc2626;
  font-weight: 800;
  margin-right: 0.15rem;
}

.field input:invalid:not(:placeholder-shown),
.field textarea:invalid:not(:placeholder-shown) {
  border-color: #fca5a5;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.footer-col h4 {
  margin: 0 0 0.85rem;
  color: #fff;
  font-size: 1rem;
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.footer-contact {
  font-size: 0.5em;
}

.footer-contact h4 {
  font-size: 1em;
  margin-bottom: 0.7em;
}

.footer-contact ul {
  gap: 0.45em;
  line-height: 1.45;
  font-size: 1em;
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  padding-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.5em;
}

@media (orientation: landscape) and (max-height: 520px) {
  .hero-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 0.45rem;
  }

  .home-hero-content {
    padding-top: calc(var(--nav-h) * 0.35);
    padding-bottom: 3rem;
    margin-top: 0;
    transform: translateY(-2vh);
  }

  .home-hero h1 {
    font-size: 1.35rem;
  }

  .hero-slogan {
    font-size: 0.9rem;
    margin-bottom: 0.7rem;
  }

  .btn {
    min-height: 38px;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 960px) {
  .news-grid,
  .feature-grid,
  .project-grid,
  .split,
  .contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .news-card--row {
    flex-direction: column;
  }

  .news-card--row .news-thumb {
    width: 100%;
    height: 140px;
    flex-basis: auto;
  }

  .nav-toggle {
    display: inline-block;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.6rem;
    box-shadow: var(--shadow);
  }

  .site-header:not(.site-header--overlay) .nav-links {
    background: #fff;
    border-color: var(--line);
  }

  .site-header:not(.site-header--overlay) .nav-links a {
    color: var(--muted);
    text-shadow: none;
  }

  .nav-links.is-open {
    display: flex;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .form-row,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .brand img,
  .site-header--overlay .brand img {
    height: 96px;
  }

  .hero-logo {
    width: 96px;
    height: 96px;
  }

  .home-hero {
    min-height: calc(100dvh - 52px);
    max-height: calc(100dvh - 52px);
  }

  .home-hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .hero-slogan {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }

  .client-item {
    flex-basis: calc((100vw - 2rem) / 7);
    width: calc((100vw - 2rem) / 7);
    max-width: none;
  }

  .project-card img {
    height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo,
  .home-hero h1,
  .hero-slogan,
  .hero-actions,
  .home-hero-media img,
  .ticker-track,
  .page-hero img,
  .page-hero .container {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .page-hero img {
    opacity: 0.45 !important;
  }
}
