/**
 * Arzin — main stylesheet (tokens, reset, layout, header, footer, blog, forms).
 * Dark crypto-exchange design, RTL-first with logical properties.
 */

/* ============ 1. TOKENS ============ */
:root {
	--az-brand: #00D9C0;
	--az-brand-600: #00B39F;
	--az-up: #16C784;
	--az-down: #EA3943;

	--az-bg: #070D1A;
	--az-bg-2: #0B1220;
	--az-surface: #111A2B;
	--az-surface-2: #16223A;
	--az-line: #1E2C45;
	--az-line-2: #27374F;

	--az-text: #EAF0FA;
	--az-text-2: #A9B6CC;
	--az-muted: #6F7F99;

	--az-radius-sm: 8px;
	--az-radius: 12px;
	--az-radius-lg: 20px;

	--az-shadow: 0 4px 24px rgba(0, 0, 0, .35);
	--az-shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);

	--az-font: 'Vazirmatn', system-ui, sans-serif;

	--az-container: 1180px;
	--az-gutter: 16px;
	--az-header-h: 72px;

	--az-ease: cubic-bezier(.22, .61, .36, 1);
}

html[lang^="en"] { --az-font: 'Inter', system-ui, sans-serif; }

@media (min-width: 768px) { :root { --az-gutter: 24px; } }

/* ============ 2. RESET ============ */
*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--az-header-h) + 20px);
}

body {
	margin: 0;
	background: var(--az-bg);
	color: var(--az-text);
	font-family: var(--az-font);
	font-size: 16px;
	line-height: 1.85;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .5em;
	color: #fff;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 3.4vw + 1rem, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.2vw + 1rem, 2.25rem); }
h3 { font-size: clamp(1.1rem, .8vw + 1rem, 1.35rem); }

p { margin: 0 0 1rem; }
a { color: var(--az-brand); text-decoration: none; transition: color .18s var(--az-ease); }
a:hover { color: #fff; }
img, svg, video { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0 0 1rem; padding-inline-start: 1.4rem; }
strong { color: #fff; font-weight: 700; }
small { font-size: .8125rem; }
hr { border: 0; border-top: 1px solid var(--az-line); margin: 2rem 0; }

::selection { background: var(--az-brand); color: #04121a; }

:focus-visible {
	outline: 2px solid var(--az-brand);
	outline-offset: 3px;
	border-radius: 6px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.az-skip-link {
	position: absolute;
	inset-inline-start: 16px;
	top: -80px;
	z-index: 200;
	padding: 12px 20px;
	background: var(--az-brand);
	color: #04121a;
	font-weight: 700;
	border-radius: 8px;
	transition: top .2s var(--az-ease);
}
.az-skip-link:focus { top: 16px; color: #04121a; }

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

/* ============ 3. LAYOUT ============ */
.az-container {
	width: 100%;
	max-width: var(--az-container);
	margin-inline: auto;
	padding-inline: var(--az-gutter);
}

.az-section { padding-block: 64px; }
@media (min-width: 768px) { .az-section { padding-block: 88px; } }
@media (min-width: 1200px) { .az-section { padding-block: 96px; } }

.az-page { padding-block: 36px 72px; }

.az-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}
@media (min-width: 1024px) {
	.az-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

.az-sidebar { position: static; }
@media (min-width: 1024px) {
	.az-sidebar { position: sticky; top: calc(var(--az-header-h) + 24px); }
}

.az-section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.az-section-title { margin-bottom: .35em; }
.az-section-sub { color: var(--az-text-2); margin: 0; }

.az-empty {
	text-align: center;
	color: var(--az-muted);
	padding: 40px 20px;
	border: 1px dashed var(--az-line-2);
	border-radius: var(--az-radius);
	background: var(--az-surface);
}

.az-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .az-grid--2, .az-grid--3, .az-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
	.az-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.az-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============ 4. BUTTONS ============ */
.az-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 11px 24px;
	border: 1px solid transparent;
	border-radius: var(--az-radius-sm);
	font-family: inherit;
	font-size: .9375rem;
	font-weight: 700;
	line-height: 1.4;
	cursor: pointer;
	text-align: center;
	transition: transform .18s var(--az-ease), background .18s, box-shadow .18s, color .18s;
}
.az-btn:active { transform: translateY(1px); }

.az-btn--primary {
	background: var(--az-brand);
	color: #04121a;
	box-shadow: 0 6px 20px rgba(0, 217, 192, .22);
}
.az-btn--primary:hover {
	background: var(--az-brand-600);
	color: #04121a;
	box-shadow: 0 10px 28px rgba(0, 217, 192, .32);
	transform: translateY(-2px);
}

.az-btn--ghost { background: rgba(255, 255, 255, .04); border-color: var(--az-line-2); color: var(--az-text); }
.az-btn--ghost:hover { border-color: var(--az-brand); color: var(--az-brand); background: rgba(0, 217, 192, .06); }

.az-btn--outline { background: transparent; border-color: var(--az-line-2); color: var(--az-text); }
.az-btn--outline:hover { border-color: var(--az-brand); color: var(--az-brand); }

.az-btn--dark { background: #04121a; color: #fff; }
.az-btn--dark:hover { background: #072029; color: var(--az-brand); }

.az-btn--sm { min-height: 38px; padding: 7px 16px; font-size: .8125rem; }
.az-btn--block { width: 100%; }

/* ============ 5. HEADER ============ */
.az-topbar {
	background: #050B14;
	border-bottom: 1px solid var(--az-line);
	font-size: .8125rem;
	color: var(--az-text-2);
}
.az-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 38px;
}
.az-topbar__left, .az-topbar__right { display: flex; align-items: center; gap: 18px; }
.az-topbar a { color: var(--az-text-2); }
.az-topbar a:hover { color: var(--az-brand); }
.az-topbar__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--az-up);
	display: inline-block;
	margin-inline-end: 6px;
	box-shadow: 0 0 8px var(--az-up);
}
.az-topbar { display: none; }
@media (min-width: 768px) { .az-topbar { display: block; } }

.az-header {
	position: relative;
	background: rgba(7, 13, 26, .92);
	border-bottom: 1px solid var(--az-line);
	z-index: 60;
}
.az-header--sticky { position: sticky; top: 0; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.az-header.is-scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, .45); background: rgba(7, 13, 26, .98); }

.az-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: var(--az-header-h);
}

.az-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; color: #fff; }
.az-logo:hover { color: #fff; }
.az-logo__mark {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--az-brand), #5C6CFF);
	color: #04121a;
	font-weight: 700;
	font-size: 1.05rem;
}
.az-logo img { height: 38px; width: auto; }

.az-nav ul { list-style: none; margin: 0; padding: 0; }
.az-nav__top { display: flex; align-items: center; gap: 4px; }
.az-nav__top > li { position: relative; }
.az-nav__top > li > a {
	display: block;
	padding: 10px 14px;
	border-radius: 8px;
	color: var(--az-text-2);
	font-size: .9375rem;
	font-weight: 600;
	transition: color .18s, background .18s;
}
.az-nav__top > li > a:hover,
.az-nav__top > li.current-menu-item > a {
	color: var(--az-brand);
	background: rgba(0, 217, 192, .08);
}

.az-nav__sub {
	position: absolute;
	top: calc(100% + 8px);
	inset-inline-start: 0;
	min-width: 210px;
	padding: 8px;
	background: var(--az-surface);
	border: 1px solid var(--az-line-2);
	border-radius: var(--az-radius);
	box-shadow: var(--az-shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: .2s var(--az-ease);
	z-index: 70;
}
.az-nav__top li:hover > .az-nav__sub,
.az-nav__top li:focus-within > .az-nav__sub { opacity: 1; visibility: visible; transform: none; }
.az-nav__sub a { display: block; padding: 8px 14px; border-radius: 6px; color: var(--az-text-2); font-size: .875rem; }
.az-nav__sub a:hover { background: var(--az-surface-2); color: var(--az-brand); }

.az-header__actions { display: flex; align-items: center; gap: 10px; }
.az-header__login { font-weight: 600; font-size: .9375rem; color: var(--az-text-2); }
.az-header__login:hover { color: var(--az-brand); }

.az-burger {
	display: none;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--az-line-2);
	border-radius: 10px;
	color: var(--az-text);
	cursor: pointer;
}

.az-nav { display: none; }
.az-header__actions .az-btn--ghost { display: none; }
.az-burger { display: inline-flex; }
@media (min-width: 1024px) {
	.az-nav { display: block; }
	.az-header__actions .az-btn--ghost { display: inline-flex; }
	.az-burger { display: none; }
}

/* Mobile drawer */
.az-drawer {
	position: fixed;
	inset-block: 0;
	inset-inline-end: 0;
	width: min(340px, 86vw);
	background: var(--az-bg-2);
	border-inline-start: 1px solid var(--az-line);
	box-shadow: var(--az-shadow-lg);
	z-index: 120;
	padding: 20px;
	overflow-y: auto;
	transform: translateX(105%);
	transition: transform .28s var(--az-ease);
}
html[dir="rtl"] .az-drawer { transform: translateX(-105%); }
.az-drawer.is-open,
html[dir="rtl"] .az-drawer.is-open { transform: none; }

.az-drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.az-drawer ul { list-style: none; margin: 0 0 20px; padding: 0; }
.az-drawer a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--az-line); color: var(--az-text); font-weight: 600; }
.az-drawer .sub-menu a { padding-inline-start: 18px; font-weight: 400; color: var(--az-text-2); }

.az-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(3, 8, 16, .7);
	opacity: 0;
	visibility: hidden;
	transition: .25s;
	z-index: 110;
}
.az-backdrop.is-open { opacity: 1; visibility: visible; }

/* ============ 6. FOOTER ============ */
.az-footer { background: #050B14; border-top: 1px solid var(--az-line); padding-block: 56px 0; margin-top: 80px; }
.az-footer__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 768px) { .az-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .az-footer__grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }

.az-footer__about { color: var(--az-text-2); font-size: .9375rem; max-width: 40ch; margin-top: 14px; }
.az-footer h3 { font-size: .9375rem; margin-bottom: 16px; color: #fff; }
.az-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.az-footer ul a { color: var(--az-text-2); font-size: .9375rem; }
.az-footer ul a:hover { color: var(--az-brand); }

.az-social { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.az-social a {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--az-line-2);
	border-radius: 10px;
	color: var(--az-text-2);
	transition: .18s var(--az-ease);
}
.az-social a:hover { color: var(--az-brand); border-color: var(--az-brand); transform: translateY(-2px); }

.az-footer__bottom {
	margin-top: 40px;
	padding-block: 20px;
	border-top: 1px solid var(--az-line);
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	color: var(--az-muted);
	font-size: .8125rem;
}

/* ============ 7. PAGE / BLOG ============ */
.az-page-head {
	padding-block: 30px 26px;
	border-bottom: 1px solid var(--az-line);
	background: var(--az-bg-2);
}
.az-page-head h1 { margin-bottom: .25em; }
.az-page-head .az-lead { color: var(--az-text-2); margin: 0; max-width: 62ch; }

.az-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
	font-size: .8125rem;
	color: var(--az-muted);
}
.az-breadcrumb a { color: var(--az-text-2); }
.az-breadcrumb a:hover { color: var(--az-brand); }
.az-breadcrumb [aria-current] { color: var(--az-text); }
.az-breadcrumb__sep { opacity: .4; }

.az-posts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 640px) { .az-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .az-posts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.az-card {
	display: flex;
	flex-direction: column;
	background: var(--az-surface);
	border: 1px solid var(--az-line);
	border-radius: var(--az-radius);
	overflow: hidden;
	transition: transform .22s var(--az-ease), border-color .22s, box-shadow .22s;
}
.az-card:hover { transform: translateY(-6px); border-color: var(--az-line-2); box-shadow: var(--az-shadow-lg); }
.az-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--az-surface-2); }
.az-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--az-ease); }
.az-card:hover .az-card__media img { transform: scale(1.04); }
.az-card__body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.az-card__title { font-size: 1.0625rem; margin: 0; }
.az-card__title a { color: #fff; }
.az-card__title a:hover { color: var(--az-brand); }
.az-card__excerpt { color: var(--az-text-2); font-size: .875rem; margin: 0; }
.az-meta { color: var(--az-muted); font-size: .8125rem; display: flex; gap: 8px; align-items: center; }
.az-meta__sep { opacity: .5; }

.az-pagination { margin-top: 40px; }
.az-pagination ul { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.az-pagination a, .az-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--az-line-2);
	border-radius: 10px;
	font-size: .875rem;
	font-weight: 600;
	color: var(--az-text-2);
}
.az-pagination .current { background: var(--az-brand); border-color: var(--az-brand); color: #04121a; }
.az-pagination a:hover { border-color: var(--az-brand); color: var(--az-brand); }

/* Single post */
.az-single__title { margin-bottom: .35em; }
.az-single__thumb { margin: 0 0 28px; border-radius: var(--az-radius); overflow: hidden; border: 1px solid var(--az-line); }
.az-entry { color: var(--az-text-2); font-size: 1.0625rem; line-height: 1.95; }
.az-entry > * { max-width: 72ch; }
.az-entry h2, .az-entry h3 { color: #fff; margin-top: 1.8em; }
.az-entry a { text-decoration: underline; text-underline-offset: 3px; }
.az-entry blockquote {
	margin: 1.5em 0;
	padding: 18px 22px;
	border-inline-start: 3px solid var(--az-brand);
	background: var(--az-surface);
	border-radius: var(--az-radius);
	color: var(--az-text);
}
.az-entry table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .9375rem; }
.az-entry th, .az-entry td { padding: 12px 14px; border-bottom: 1px solid var(--az-line); text-align: start; }
.az-entry th { color: #fff; background: var(--az-surface); }
.az-entry img { border-radius: var(--az-radius); }
.az-entry code { background: var(--az-surface-2); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.az-entry pre { background: #050B14; border: 1px solid var(--az-line); padding: 16px; border-radius: var(--az-radius); overflow-x: auto; }

/* ============ 8. FORMS ============ */
input[type="text"], input[type="email"], input[type="url"], input[type="tel"],
input[type="search"], input[type="password"], input[type="number"], textarea, select {
	width: 100%;
	padding: 12px 14px;
	background: var(--az-surface);
	border: 1px solid var(--az-line-2);
	border-radius: var(--az-radius-sm);
	color: var(--az-text);
	font-family: inherit;
	font-size: .9375rem;
	transition: border-color .18s, box-shadow .18s;
}
input::placeholder, textarea::placeholder { color: var(--az-muted); }
input:focus, textarea:focus, select:focus {
	border-color: var(--az-brand);
	box-shadow: 0 0 0 3px rgba(0, 217, 192, .14);
	outline: none;
}
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; color: var(--az-text); }

/* ============ 9. WIDGETS / COMMENTS ============ */
.widget { margin-bottom: 28px; padding: 20px; background: var(--az-surface); border: 1px solid var(--az-line); border-radius: var(--az-radius); }
.widget-title { font-size: 1rem; margin-bottom: 14px; }
.widget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.widget ul a { color: var(--az-text-2); font-size: .9375rem; }
.widget ul a:hover { color: var(--az-brand); }

.az-comments { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--az-line); }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.comment-body { padding: 18px; background: var(--az-surface); border: 1px solid var(--az-line); border-radius: var(--az-radius); }
.comment .avatar { float: inline-start; margin-inline-end: 12px; border-radius: 50%; }
.comment-form textarea { min-height: 140px; }

/* ============ 10. 404 / SEARCH ============ */
.az-404 { text-align: center; padding-block: 72px; max-width: 620px; margin-inline: auto; }
.az-404__code {
	font-size: clamp(5rem, 16vw, 9rem);
	font-weight: 700;
	line-height: 1;
	color: transparent;
	-webkit-text-stroke: 2px var(--az-brand);
	margin: 0 0 8px;
}

/* ============ 11. ANIMATIONS ============ */
@media (prefers-reduced-motion: no-preference) {
	.az-reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--az-ease), transform .7s var(--az-ease); }
	.az-reveal.is-in { opacity: 1; transform: none; }
}
