/* =========================================================
   TAMY v2 — light, minimal, "living" industrial line-art
   Palette: warm ivory + deep pine ink + logo sage + copper
   ========================================================= */
:root {
  --bg: #F7F5EF;        /* warm ivory (echoes logo beige) */
  --bg-2: #EFECE3;      /* tinted section */
  --surface: #FFFFFF;
  --ink: #18332F;       /* deep pine — primary dark */
  --ink-2: #47605A;     /* secondary text */
  --muted: #8A968F;
  --line: #D9D6CB;      /* hairlines */
  --sage: #85AB70;      /* logo green */
  --sage-d: #5E8A4C;
  --copper: #C4895A;    /* warm accent, pairs with logo beige */
  --radius: 18px;
  --header-h: 72px;
  --ease: cubic-bezier(.22,.8,.24,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--bg); color: var(--ink);
  line-height: 1.9; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.container { width: min(1160px, 90%); margin-inline: auto; }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-h);
  transition: background .3s, box-shadow .3s;
}
.header.scrolled { background: rgba(247,245,239,.88); box-shadow: 0 1px 0 var(--line); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand__logo { width: 42px; height: 42px; object-fit: contain; mix-blend-mode: multiply; border-radius: 8px; }
.brand__name { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav a { font-size: .93rem; color: var(--ink-2); position: relative; transition: color .2s; }
.nav a:not(.nav__cta)::after {
  content: ""; position: absolute; right: 0; bottom: -4px; height: 1.5px; width: 0;
  background: var(--sage); transition: width .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }
.nav__cta { padding: .45rem 1.15rem; border-radius: 999px; background: var(--ink); color: var(--bg) !important; transition: background .2s; }
.nav__cta:hover { background: var(--sage-d); }

.nav-toggle { display: none; background: none; border: 0; padding: .6rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--ink); margin: 6px 0; transition: transform .3s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font: inherit; font-weight: 600; font-size: .98rem;
  padding: .85rem 1.7rem; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .25s var(--ease), background .2s, box-shadow .25s;
}
.btn--primary { background: var(--ink); color: var(--bg); box-shadow: 0 8px 24px -10px rgba(24,51,47,.6); }
.btn--primary:hover { background: var(--sage-d); transform: translateY(-2px); }
.btn--primary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.btn--primary:hover svg { transform: translateX(-4px); }
.btn--link { color: var(--ink-2); padding-inline: .5rem; }
.btn--link:hover { color: var(--sage-d); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; padding-top: var(--header-h); position: relative; }
.hero::before { /* soft glow, contained */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 18% 45%, rgba(133,171,112,.16), transparent 70%),
    radial-gradient(500px 300px at 85% 85%, rgba(196,137,90,.10), transparent 70%);
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 3rem; padding-block: 3rem; }

.tag {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .85rem; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface);
  padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1.5rem;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--sage); animation: ping 2s var(--ease) infinite; }
@keyframes ping { to { transform: scale(3); opacity: 0; } }

.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.35; font-weight: 800; letter-spacing: -.02em; margin-bottom: 1.25rem; }
.hero h1 em { font-style: normal; color: var(--sage-d); position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ""; position: absolute; right: 0; bottom: .08em; height: .14em; width: 100%;
  background: var(--copper); opacity: .35; border-radius: 4px;
  transform-origin: right; animation: underline 1.2s .6s var(--ease) both;
}
@keyframes underline { from { transform: scaleX(0); } }
.hero p { color: var(--ink-2); font-size: 1.08rem; max-width: 500px; margin-bottom: 2.2rem; }
.hero__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hero__text > * { animation: rise .9s var(--ease) both; }
.hero__text > *:nth-child(2) { animation-delay: .08s; }
.hero__text > *:nth-child(3) { animation-delay: .16s; }
.hero__text > *:nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Scene (line-art) ---------- */
.hero__art { position: relative; }
.scene { width: 100%; height: auto; overflow: visible; }
.grid-dot { fill: var(--line); }
.ln { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ln--soft { stroke: var(--line); }
.ln--thin { stroke-width: 1.2; stroke: var(--ink-2); }
.ln--accent { stroke: var(--sage-d); stroke-width: 2.2; }
.ln--dash { stroke: var(--sage); stroke-width: 2; stroke-dasharray: 3 10; animation: dashflow 1.2s linear infinite; }
@keyframes dashflow { to { stroke-dashoffset: -13; } }
.fill-accent { fill: var(--sage-d); }
.fill-copper { fill: var(--copper); }
.fill-ink { fill: var(--ink); }
.node-bg { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; }
.card { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; filter: drop-shadow(0 18px 30px rgba(24,51,47,.08)); }
.area { fill: url(#area); animation: fadein 1.2s 1.4s both; }
.bar { fill: var(--bg-2); }
.bar.b2 { fill: rgba(196,137,90,.35); }

.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s var(--ease) forwards; }
.factory .draw:nth-child(2) { animation-delay: .3s; }
.factory .draw:nth-child(n+3) { animation-delay: .6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { from { opacity: 0; } }

.smoke { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: 0; animation: smoke 4.5s ease-out infinite; }
.smoke.s2 { animation-delay: 1.5s; }
.smoke.s3 { animation-delay: 3s; }
@keyframes smoke {
  0% { opacity: 0; transform: translate(0,0) scale(.6); }
  20% { opacity: .7; }
  100% { opacity: 0; transform: translate(-22px,-60px) scale(2.2); }
}
.smoke { transform-box: fill-box; transform-origin: center; }

.packet { fill: var(--sage-d); }
.packet--copper { fill: var(--copper); }
.ring { fill: none; stroke: var(--sage); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 2.6s ease-out infinite; }
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.8); opacity: 0; } }

.chart { stroke-dasharray: 1; stroke-dashoffset: 1; animation: chart 6s var(--ease) 1s infinite; }
@keyframes chart {
  0% { stroke-dashoffset: 1; }
  35%, 85% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.peak { transform-box: fill-box; transform-origin: center; animation: peak 6s 1s infinite; }
@keyframes peak { 0%, 30% { transform: scale(0); } 38% { transform: scale(1.4); } 45%, 88% { transform: scale(1); } 100% { transform: scale(0); } }
.live { animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.gauge-arc { stroke-dasharray: 1; stroke-dashoffset: 1; animation: gauge 7s var(--ease) infinite; }
@keyframes gauge { 0% { stroke-dashoffset: 1; } 35% { stroke-dashoffset: .25; } 50% { stroke-dashoffset: .32; } 70% { stroke-dashoffset: .12; } 90% { stroke-dashoffset: .2; } 100% { stroke-dashoffset: 1; } }
.needle { stroke: var(--copper); stroke-width: 2.4; }

/* ---------- Sections ---------- */
.section { padding: clamp(4.5rem, 10vw, 7.5rem) 0; position: relative; }
.section--tint { background: var(--bg-2); }
.head { text-align: center; margin-bottom: 3.5rem; }
.kicker { display: inline-block; font-size: .82rem; font-weight: 600; color: var(--copper); letter-spacing: .04em; margin-bottom: .6rem; }
.head h2, .contact h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.45; }

/* Process steps with connecting line */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 52px; right: 12%; left: 12%; height: 1px;
  background: repeating-linear-gradient(to left, var(--line) 0 6px, transparent 6px 12px);
}
.step {
  position: relative; text-align: center; padding: 0 1rem 1.5rem;
}
.icon {
  width: 104px; height: 104px; padding: 22px; margin: 0 auto 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 50%;
  fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  position: relative; transition: border-color .3s, transform .4s var(--ease), box-shadow .4s;
}
.icon path, .icon rect { stroke-dasharray: 1; stroke-dashoffset: 1; }
.step.visible .icon path, .step.visible .icon rect { animation: draw 1.4s var(--ease) forwards; }
.step.visible .icon :nth-child(2) { animation-delay: .2s; }
.step.visible .icon :nth-child(3) { animation-delay: .4s; }
.step.visible .icon :nth-child(4) { animation-delay: .6s; }
.dot-run { fill: var(--copper); stroke: none; }
.icon__needle { stroke: var(--copper); transform-origin: 32px 44px; }
.step.visible .icon__needle { animation: draw 1s var(--ease) .4s forwards, sweep 3s ease-in-out 1.6s infinite; }
@keyframes sweep { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-70deg); } }
.step:hover .icon { border-color: var(--sage); transform: translateY(-4px); box-shadow: 0 16px 30px -18px rgba(24,51,47,.45); }
.step__no { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.step h3 { font-size: 1.08rem; margin-bottom: .35rem; }
.step p { font-size: .92rem; color: var(--ink-2); }

/* Services: editorial list */
.services { display: grid; grid-template-columns: 1fr 1.6fr; gap: 4rem; align-items: start; }
.head--side { text-align: right; margin: 0; position: sticky; top: calc(var(--header-h) + 2rem); }
.head--side p { color: var(--ink-2); margin-top: .75rem; }
.svc { list-style: none; border-top: 1px solid var(--line); }
.svc li {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.5rem; align-items: baseline;
  padding: 1.6rem .5rem; border-bottom: 1px solid var(--line);
  position: relative; transition: padding .35s var(--ease);
}
.svc li::before {
  content: ""; position: absolute; right: 0; top: 50%; width: 0; height: 2px; background: var(--sage);
  transition: width .35s var(--ease);
}
.svc li:hover { padding-right: 2rem; }
.svc li:hover::before { width: 1.2rem; }
.svc b { font-size: 1.12rem; font-weight: 700; }
.svc span { color: var(--ink-2); font-size: .95rem; }

/* Clients */
.clients { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 880px; margin-inline: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.client { height: 150px; display: grid; place-items: center; padding: 1.75rem 2rem; }
.client + .client { border-right: 1px solid var(--line); }
.client img { max-height: 84px; max-width: 100%; width: auto; height: auto; object-fit: contain; opacity: .55; filter: grayscale(1); transition: opacity .3s, filter .3s, transform .4s var(--ease); }
.client img[src$=".svg"] { width: 100%; height: 84px; }
.client:hover img { opacity: 1; filter: none; transform: scale(1.04); }
.client__fallback { font-weight: 800; letter-spacing: .15em; color: var(--ink-2); direction: ltr; }

/* Contact */
.contact { background: var(--ink); color: var(--bg); overflow: hidden; }
.contact::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(247,245,239,.08) 1px, transparent 1px);
  background-size: 22px 22px;
}
.contact .kicker { color: var(--sage); }
.contact__inner { position: relative; display: grid; grid-template-columns: 1fr 1.15fr; gap: 4rem; align-items: start; }
.contact__lead { color: rgba(247,245,239,.7); margin: .75rem 0 2rem; max-width: 400px; }
.contact__list { list-style: none; display: grid; gap: 1.1rem; }
.contact__list li { display: flex; align-items: center; gap: .9rem; color: rgba(247,245,239,.88); }
.contact__list svg { width: 40px; height: 40px; padding: 9px; flex-shrink: 0; border: 1px solid rgba(247,245,239,.18); border-radius: 12px; fill: none; stroke: var(--sage); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.contact__list a:hover { color: var(--sage); }

/* Floating-label form */
.form { display: grid; gap: 1.1rem; background: rgba(247,245,239,.04); border: 1px solid rgba(247,245,239,.12); border-radius: var(--radius); padding: 2rem; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--bg);
  background: transparent; border: 0; border-bottom: 1px solid rgba(247,245,239,.25);
  padding: 1.35rem 0 .55rem; transition: border-color .25s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage); }
.field label {
  position: absolute; right: 0; top: 1.25rem; color: rgba(247,245,239,.55); font-size: .95rem;
  pointer-events: none; transform-origin: right top; transition: transform .25s var(--ease), color .25s;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-1.15rem) scale(.8); color: var(--sage);
}
.field .invalid, .field input.invalid, .field textarea.invalid { border-color: #E39B82; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.form__foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.form .btn--primary { background: var(--sage); color: var(--ink); box-shadow: none; }
.form .btn--primary:hover { background: #9BC286; }
.form .btn:disabled { opacity: .6; cursor: wait; transform: none; }
.form__status { font-size: .93rem; }
.form__status.ok { color: var(--sage); }
.form__status.err { color: #E39B82; }

/* Footer */
.footer { background: var(--ink); color: rgba(247,245,239,.5); font-size: .88rem; border-top: 1px solid rgba(247,245,239,.08); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.4rem; flex-wrap: wrap; }
.footer a:hover { color: var(--sage); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.steps .reveal:nth-child(2) { transition-delay: .1s; }
.steps .reveal:nth-child(3) { transition-delay: .2s; }
.steps .reveal:nth-child(4) { transition-delay: .3s; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 1rem; }
  .hero p { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__art { max-width: 520px; margin-inline: auto; width: 100%; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
  .steps::before { display: none; }
  .services, .contact__inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .head--side { position: static; text-align: center; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .35s var(--ease);
  }
  .nav.open { max-height: 320px; }
  .nav a { width: 100%; text-align: center; padding: .95rem; }
  .nav a::after { display: none; }
  .nav__cta { border-radius: 0; }
  .header:has(.nav.open) { background: var(--bg); }
  .nav-toggle.open span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav-toggle.open span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .brand__name { font-size: .9rem; }
  .svc li { grid-template-columns: 1fr; gap: .25rem; }
  .clients { grid-template-columns: 1fr; }
  .client + .client { border-right: 0; border-top: 1px solid var(--line); }
  .form { padding: 1.4rem; }
}
@media (max-width: 460px) {
  .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .draw, .chart, .gauge-arc, .icon path, .icon rect { stroke-dashoffset: 0 !important; }
  .reveal { opacity: 1; transform: none; }
}
