:root {
    --ink: #17211d;
    --muted: #65716b;
    --paper: #f4f7f4;
    --surface: #ffffff;
    --line: #dce4df;
    --green: #147d52;
    --green-dark: #0c5f3d;
    --lime: #c8f36a;
    --night: #101d19;
    --danger: #bc3f45;
    --shadow: 0 22px 60px rgba(22, 42, 33, .10);
    --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Vazirmatn", Tahoma, sans-serif;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; top: -80px; right: 20px; z-index: 100; padding: 8px 14px; background: var(--lime); color: var(--night); border-radius: 6px; text-decoration: none; font-weight: 800; }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 9px; background: var(--green); color: white; font: 800 20px/1 Arial, sans-serif; box-shadow: 0 8px 22px rgba(20, 125, 82, .18); }
.brand-copy strong, .brand-copy small { display: block; line-height: 1.35; }
.brand-copy strong { font-size: 17px; }
.brand-copy small { color: var(--muted); font-size: 11px; font-weight: 500; }
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a { position: relative; color: #48554f; font-size: 14px; font-weight: 650; text-decoration: none; }
.main-nav a::after { content: ""; position: absolute; right: 0; bottom: -7px; width: 0; height: 2px; background: var(--green); transition: width .2s ease; }
.main-nav a:hover { color: var(--green); }
.main-nav a:hover::after { width: 100%; }

.hero { position: relative; overflow: hidden; background: var(--night); color: white; }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to left, black, transparent 85%); }
.hero::after { content: ""; position: absolute; width: 520px; height: 520px; left: -260px; bottom: -350px; border-radius: 50%; background: var(--lime); opacity: .08; filter: blur(12px); }
.hero-grid { position: relative; z-index: 1; min-height: 610px; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 82px; padding-block: 84px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--lime); font-size: 13px; font-weight: 800; }
.eyebrow i { width: 18px; height: 2px; display: inline-block; background: currentColor; }
.eyebrow.dark { color: var(--green); }
.hero h1 { max-width: 700px; margin: 13px 0 22px; font-size: clamp(40px, 5.1vw, 67px); line-height: 1.28; letter-spacing: -.035em; }
.hero-copy > p { max-width: 650px; margin: 0; color: #c2cdc7; font-size: 17px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin-top: 32px; }
.primary-action { min-height: 50px; display: inline-flex; align-items: center; gap: 18px; padding: 10px 20px; border-radius: 7px; background: var(--lime); color: var(--night); font-weight: 800; text-decoration: none; box-shadow: 0 12px 30px rgba(200, 243, 106, .13); transition: transform .2s ease, box-shadow .2s ease; }
.primary-action:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(200, 243, 106, .22); }
.primary-action span { font-size: 21px; }
.hero-note { display: inline-flex; align-items: center; gap: 8px; color: #aab8b1; font-size: 12px; }
.hero-note svg { width: 17px; color: var(--lime); }
.hero-visual { position: relative; direction: ltr; }
.code-window { overflow: hidden; border: 1px solid #3b4a43; border-radius: 12px; background: #09110e; box-shadow: 25px 25px 0 rgba(200, 243, 106, .12), 0 35px 80px rgba(0,0,0,.25); transform: rotate(-1deg); }
.window-bar { height: 44px; display: flex; align-items: center; gap: 7px; padding-inline: 15px; background: #202d27; color: #8d9c94; font: 12px Arial, sans-serif; }
.window-bar span { width: 9px; height: 9px; border-radius: 50%; background: #5c6862; }
.window-bar span:first-child { background: var(--lime); }
.window-bar b { margin-left: auto; font-weight: 400; }
.code-window pre { min-height: 275px; margin: 0; padding: 38px; color: #eff7f2; white-space: pre-wrap; font: 15px/2.15 Consolas, monospace; }
.code-window em { color: #65776d; font-style: normal; }
.code-window strong { color: #81cbaa; font-weight: 500; }
.code-window code > i { width: 8px; height: 19px; display: inline-block; margin-left: 5px; vertical-align: middle; background: var(--lime); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.floating-badge { position: absolute; right: -24px; bottom: -28px; min-width: 190px; display: flex; align-items: center; gap: 12px; direction: rtl; padding: 13px 15px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; background: rgba(31, 45, 38, .94); box-shadow: 0 15px 36px rgba(0,0,0,.24); }
.floating-badge > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--night); font-weight: 900; }
.floating-badge strong, .floating-badge small { display: block; line-height: 1.45; }
.floating-badge strong { font-size: 13px; }
.floating-badge small { color: #9eaca5; font-size: 10px; }

.catalog { padding-block: 92px 110px; scroll-margin-top: 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-heading h2 { margin: 4px 0 0; font-size: clamp(28px, 4vw, 37px); line-height: 1.4; letter-spacing: -.02em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.filter-panel { display: flex; align-items: center; gap: 13px; margin-bottom: 31px; }
.search-field { flex: 0 1 350px; height: 48px; display: flex; align-items: center; gap: 10px; padding-inline: 14px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(20, 125, 82, .09); }
.search-field svg { width: 20px; color: var(--muted); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-field input::placeholder { color: #8a958f; }
.search-field kbd { min-width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: #8b9690; background: #f8faf8; font: 11px Arial, sans-serif; }
.category-filter { min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
.category-btn { flex: none; min-height: 42px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: #59665f; cursor: pointer; font-size: 12px; font-weight: 700; transition: .2s ease; }
.category-btn:hover { border-color: #9aaba2; color: var(--green-dark); }
.category-btn.active { border-color: var(--night); background: var(--night); color: white; box-shadow: 0 7px 18px rgba(16, 29, 25, .12); }
.products-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.product-card { min-width: 0; min-height: 370px; display: flex; flex-direction: column; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 rgba(19, 44, 33, .02); transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.product-card:hover { transform: translateY(-5px); border-color: #b4c2ba; box-shadow: var(--shadow); }
.product-card[hidden] { display: none; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-index { color: #a0aba5; font: 600 12px Consolas, monospace; direction: ltr; }
.product-category { max-width: 72%; overflow: hidden; padding: 4px 10px; border-radius: 5px; background: #e7f5ed; color: var(--green-dark); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 800; }
.card-content { padding-block: 25px 20px; }
.card-content h3 { margin: 0 0 11px; font-size: 19px; line-height: 1.65; }
.card-content p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.card-footer { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.price strong, .price span { display: block; white-space: nowrap; }
.price strong { font-size: 19px; line-height: 1.25; letter-spacing: -.02em; }
.price span { color: var(--muted); font-size: 10px; }
.buy-btn { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 15px; border: 0; border-radius: 7px; background: var(--green); color: white; cursor: pointer; font-size: 11px; font-weight: 800; transition: background .2s, transform .2s; }
.buy-btn:hover { background: var(--green-dark); transform: translateY(-1px); }
.buy-btn:focus-visible, .category-btn:focus-visible, .primary-action:focus-visible, a:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.buy-btn:disabled { cursor: wait; opacity: .65; transform: none; }
.buy-btn span { font-size: 16px; }
.empty-state { min-height: 270px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px dashed #b9c6bf; border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state > span { font-size: 34px; color: var(--green); }
.empty-state h3 { margin: 4px 0 0; color: var(--ink); font-size: 19px; }
.empty-state p { margin: 0; font-size: 13px; }

.features { scroll-margin-top: 72px; padding-block: 68px; border-block: 1px solid #d5dfd9; background: #e6ece8; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.feature-grid article { display: flex; gap: 18px; padding: 6px 34px; border-left: 1px solid #c5d0ca; }
.feature-grid article:last-child { border-left: 0; }
.feature-grid article > span { padding-top: 4px; color: var(--green); font: 700 12px Consolas, monospace; }
.feature-grid h3 { margin: 0 0 6px; font-size: 19px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: 13px; }
.site-footer { padding-block: 42px; background: #0c1511; color: white; }
.footer-inner { display: flex; align-items: center; gap: 24px; }
.footer-brand .brand-mark { background: var(--lime); color: var(--night); box-shadow: none; }
.footer-brand .brand-copy small { color: #84928b; }
.footer-inner > p { margin: 0; color: #9aa8a1; font-size: 12px; }
.footer-inner > small { margin-right: auto; color: #77857e; font-size: 11px; }
.toast { position: fixed; bottom: 24px; left: 24px; z-index: 70; max-width: min(390px, calc(100% - 48px)); padding: 13px 17px; border-radius: 8px; background: var(--night); color: white; box-shadow: 0 16px 45px rgba(0,0,0,.22); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .22s ease; font-size: 13px; }
.toast.visible { opacity: 1; transform: none; }
.toast.error { border-right: 4px solid #e66c70; }

@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; gap: 55px; padding-block: 70px 88px; }
    .hero-copy { max-width: 760px; }
    .hero-visual { width: min(650px, 92%); }
    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-panel { align-items: stretch; flex-direction: column; }
    .search-field { flex-basis: 48px; max-width: none; }
    .category-filter { width: 100%; }
    .feature-grid article { padding-inline: 20px; }
}

@media (max-width: 650px) {
    .container { width: min(100% - 28px, 1160px); }
    .header-inner { min-height: 64px; }
    .brand-copy small { display: none; }
    .main-nav { gap: 17px; }
    .main-nav a { font-size: 12px; }
    .hero-grid { min-height: auto; padding-block: 55px 74px; }
    .hero h1 { font-size: 36px; }
    .hero-copy > p { font-size: 14px; }
    .hero-actions { align-items: flex-start; flex-direction: column; gap: 15px; }
    .code-window pre { min-height: 220px; padding: 24px; font-size: 12px; }
    .floating-badge { right: -10px; bottom: -35px; transform: scale(.9); }
    .catalog { padding-block: 68px 80px; }
    .section-heading { align-items: start; flex-direction: column; gap: 8px; }
    .search-field kbd { display: none; }
    .products-grid { grid-template-columns: 1fr; }
    .product-card { min-height: 340px; }
    .feature-grid { grid-template-columns: 1fr; }
    .feature-grid article { padding-block: 23px; border-left: 0; border-bottom: 1px solid #c5d0ca; }
    .feature-grid article:last-child { border-bottom: 0; }
    .footer-inner { align-items: flex-start; flex-direction: column; gap: 13px; }
    .footer-inner > small { margin-right: 0; }
}

@media (max-width: 390px) {
    .main-nav a:last-child { display: none; }
    .hero h1 { font-size: 31px; }
    .card-footer { align-items: stretch; flex-direction: column; }
    .buy-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
