/* =========================================================
   Darmaltoon — Design System (main.css)
   ========================================================= */

:root {
  --color-primary: #0e7490;
  --color-primary-dark: #0b2545;
  --color-primary-light: #22d3ee;
  --color-secondary: #0ea5e9;
  --color-accent: #14b8a6;

  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;

  --color-success: #16a34a;
  --color-error: #dc2626;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --container: 1200px;
  --header-height: 72px;

  --font-latin: "Inter", "Manrope", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-rtl: "Vazirmatn", "Inter", system-ui, sans-serif;

  --transition: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

html[dir="rtl"] body {
  font-family: var(--font-rtl);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.2vw + 0.5rem, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 2.4vw + 0.4rem, 2.5rem); }
h3 { font-size: clamp(1.1rem, 0.6vw + 0.9rem, 1.35rem); }
p { margin: 0 0 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}
.container.narrow { max-width: 780px; }
.center { text-align: center; }

.skip-link {
  position: absolute; inset-inline-start: -9999px;
  background: var(--color-primary-dark); color: #fff; padding: 0.75rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { inset-inline-start: 1rem; top: 1rem; z-index: 9999; }

:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.55);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  border: 1px solid transparent; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff; box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: transparent; color: var(--color-primary-dark); border-color: var(--color-border);
}
.btn-ghost:hover { background: var(--color-surface); border-color: var(--color-primary); }
.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.9rem; }
.btn-block { width: 100%; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.site-header.is-scrolled { border-bottom-color: var(--color-border); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-height); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; color: var(--color-primary-dark); }
.brand-mark { display: inline-flex; }
.nav { margin-inline-start: auto; }
.nav-list { list-style: none; display: flex; gap: 0.35rem; margin: 0; padding: 0; }
.nav-list a {
  padding: 0.55rem 0.85rem; border-radius: 999px; font-size: 0.95rem; color: var(--color-text); font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-list a:hover, .nav-list a.is-active { background: var(--color-surface-alt); color: var(--color-primary-dark); }
.header-actions { display: flex; align-items: center; gap: 0.75rem; margin-inline-start: 0.5rem; }
.lang-switch { display: inline-flex; background: var(--color-surface-alt); border-radius: 999px; padding: 3px; }
.lang-btn {
  border: 0; background: transparent; padding: 0.4rem 0.7rem; border-radius: 999px; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; color: var(--color-text-muted);
}
.lang-btn.is-active { background: #fff; color: var(--color-primary-dark); box-shadow: var(--shadow-sm); }
.menu-toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: 0.5rem; flex-direction: column; gap: 4px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--color-primary-dark); border-radius: 2px; transition: transform var(--transition); }
.mobile-nav { display: none; border-top: 1px solid var(--color-border); background: #fff; padding: 1rem clamp(1rem, 3vw, 2rem) 1.5rem; }
.mobile-nav ul { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.15rem; }
.mobile-nav a { display: block; padding: 0.8rem 0.5rem; font-weight: 500; border-radius: var(--radius-sm); }
.mobile-nav a:hover { background: var(--color-surface-alt); }

.hero { position: relative; overflow: hidden; padding: clamp(3rem, 6vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 15% 10%, rgba(34, 211, 238, 0.18), transparent 70%),
    radial-gradient(55% 55% at 85% 20%, rgba(14, 116, 144, 0.14), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--color-background) 100%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.75rem; font-weight: 700; color: var(--color-primary);
  background: rgba(14, 116, 144, 0.08); padding: 0.35rem 0.75rem; border-radius: 999px;
  margin-bottom: 1rem;
}
.lead { color: var(--color-text-muted); font-size: clamp(1rem, 0.4vw + 0.95rem, 1.15rem); max-width: 60ch; }
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.75rem 0 1.25rem; }
.hero-points { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; color: var(--color-text-muted); font-size: 0.9rem; }
.hero-points span::before { content: "✓"; color: var(--color-accent); margin-inline-end: 0.4rem; font-weight: 700; }

.hero-visual { position: relative; }
.window-frame {
  position: relative; background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--color-border);
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
  transition: transform var(--transition);
}
html[dir="rtl"] .window-frame { transform: perspective(1400px) rotateY(6deg) rotateX(2deg); }
.window-frame:hover { transform: perspective(1400px) rotateY(0) rotateX(0); }
.window-bar { display: flex; gap: 6px; padding: 0.75rem 1rem; background: var(--color-surface-alt); border-bottom: 1px solid var(--color-border); }
.window-bar span { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.window-bar span:nth-child(1) { background: #fda4af; }
.window-bar span:nth-child(2) { background: #fde68a; }
.window-bar span:nth-child(3) { background: #86efac; }
.big-frame { transform: none; }

.float-card {
  position: absolute; background: #fff; border-radius: var(--radius-md); padding: 0.75rem 0.9rem;
  box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
  display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; min-width: 140px;
  animation: float 6s ease-in-out infinite;
}
.float-card strong { font-size: 0.82rem; color: var(--color-text-muted); font-weight: 600; }
.fc-bar { display: block; height: 6px; background: var(--color-surface-alt); border-radius: 999px; overflow: hidden; }
.fc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary)); }
.fc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.15); }
.fc-1 { top: 12%; inset-inline-start: -8%; animation-delay: 0s; }
.fc-2 { bottom: 22%; inset-inline-end: -6%; animation-delay: 1.5s; }
.fc-3 { bottom: -4%; inset-inline-start: 22%; animation-delay: 3s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.trust-strip { background: #fff; border-block: 1px solid var(--color-border); }
.trust-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; padding: 1.75rem 0; text-align: center;
}
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--color-text-muted); }
.ti-icon { font-size: 1.5rem; }

.section { padding: clamp(3rem, 6vw, 6rem) 0; }
.section-alt { background: linear-gradient(180deg, #ffffff 0%, var(--color-surface-alt) 100%); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(2rem, 4vw, 3.5rem); }
.section-head .lead { margin-inline: auto; }

.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-bottom: 2rem; }
.tab {
  padding: 0.6rem 1rem; border-radius: 999px; border: 1px solid var(--color-border);
  background: #fff; cursor: pointer; font-weight: 500; font-size: 0.9rem; color: var(--color-text);
  transition: all var(--transition);
}
.tab:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }
.tab.is-active { background: var(--color-primary-dark); color: #fff; border-color: var(--color-primary-dark); }

.tab-panels { position: relative; }
.tab-panel { display: none; animation: fadeUp 320ms ease both; }
.tab-panel.is-active { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: center; }
.tab-shot { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--color-border); background: #fff; }
.tab-info h3 { color: var(--color-primary-dark); }
.tab-info p { color: var(--color-text-muted); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.feature-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 1.5rem; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(14, 116, 144, 0.35); }
.feature-card .fi {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(14, 116, 144, 0.15));
  font-size: 1.4rem; margin-bottom: 1rem;
}
.feature-card h3 { margin: 0 0 0.35rem; }
.feature-card p { margin: 0; color: var(--color-text-muted); font-size: 0.95rem; }

.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.why-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem;
}
.why-card h3 { margin: 0 0 0.35rem; color: var(--color-primary-dark); }
.why-card p { margin: 0; color: var(--color-text-muted); font-size: 0.95rem; }

.offline-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.offline-flow { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.flow-node {
  display: flex; align-items: center; gap: 0.6rem; background: #fff; border: 1px solid var(--color-border);
  padding: 0.85rem 1.2rem; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); width: 100%; justify-content: center;
  font-weight: 500;
}
.flow-arrow { color: var(--color-primary); font-size: 1.2rem; }

.workflow {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center;
  padding: 0; margin: 0;
}
.workflow li {
  background: #fff; border: 1px solid var(--color-border); padding: 0.75rem 1.1rem; border-radius: 999px;
  font-weight: 500; position: relative; box-shadow: var(--shadow-sm); font-size: 0.95rem;
}
.workflow li:not(:last-child)::after {
  content: "→"; margin-inline-start: 0.85rem; color: var(--color-primary); font-weight: 700;
}
html[dir="rtl"] .workflow li:not(:last-child)::after { content: "←"; }

.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.report-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.report-card span { font-weight: 600; color: var(--color-text-muted); font-size: 0.9rem; }
.report-bar { height: 8px; background: var(--color-surface-alt); border-radius: 999px; overflow: hidden; }
.report-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary)); }

.accordion details {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 1rem 1.25rem; margin-bottom: 0.6rem;
}
.accordion summary {
  cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; color: var(--color-primary); font-size: 1.4rem; line-height: 1; }
.accordion details[open] summary::after { content: "−"; }
.accordion p { margin: 0.75rem 0 0; color: var(--color-text-muted); }

.cta-section { padding-bottom: clamp(4rem, 8vw, 7rem); }
.cta-card {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff; border-radius: var(--radius-xl); padding: clamp(2rem, 4vw, 3.5rem); text-align: center;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.cta-card::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 60%; height: 180%;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.35), transparent);
  pointer-events: none;
}
.cta-card h2 { color: #fff; }
.cta-card p { color: rgba(255, 255, 255, 0.85); max-width: 55ch; margin-inline: auto; }
.cta-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.cta-card .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.cta-card .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.cta-card .btn-primary { background: #fff; color: var(--color-primary-dark); }
.cta-card .btn-primary:hover { background: #f1f5f9; }

.page-hero { padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem); background:
  radial-gradient(60% 60% at 50% 0%, rgba(34, 211, 238, 0.15), transparent 70%),
  linear-gradient(180deg, #fff 0%, var(--color-background) 100%); }
.center-cta { justify-content: center; }

.pd-section { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: center; }
.pd-section.reverse { direction: rtl; }
.pd-section.reverse > * { direction: ltr; }
html[dir="rtl"] .pd-section.reverse { direction: ltr; }
html[dir="rtl"] .pd-section.reverse > * { direction: rtl; }
.pd-shot { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--color-border); background: #fff; }
.pd-copy h2 { color: var(--color-primary-dark); }
.pd-copy p { color: var(--color-text-muted); }

.form-wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: start; }
.form-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-md); display: grid; gap: 1.1rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--color-text); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  font: inherit; color: var(--color-text); background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.12);
}
.field.has-error input, .field.has-error select, .field.has-error textarea {
  border-color: var(--color-error); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}
.field-error { color: var(--color-error); font-size: 0.82rem; min-height: 1em; }
.field.checkbox label { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 500; font-size: 0.92rem; }
.field.checkbox input { width: auto; margin-top: 0.2rem; }
.form-success {
  margin-top: 0.5rem; background: rgba(22, 163, 74, 0.08); border: 1px solid rgba(22, 163, 74, 0.35);
  padding: 1rem 1.2rem; border-radius: var(--radius-md); color: #14532d;
}
.form-success p { margin: 0.2rem 0 0; font-size: 0.9rem; }

.contact-aside .aside-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.contact-aside h3 { margin-top: 0; color: var(--color-primary-dark); }
.contact-aside p { font-size: 0.92rem; }
.placeholder { color: var(--color-text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--color-surface-alt); padding: 0.1rem 0.35rem; border-radius: 6px; }

.prose h2 { color: var(--color-primary-dark); margin-top: 2rem; }
.theme-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.theme-list li { background: #fff; border: 1px solid var(--color-border); padding: 1rem 1.2rem; border-radius: var(--radius-md); }

.error-page { min-height: 80vh; display: grid; place-items: center; padding: 4rem 1rem; }

.site-footer { background: var(--color-primary-dark); color: #cbd5e1; padding: 3.5rem 0 1.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer .brand { color: #fff; }
.site-footer h4 { color: #fff; font-size: 0.95rem; margin: 0 0 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer-col a { color: #cbd5e1; font-size: 0.92rem; }
.footer-col a:hover { color: #fff; }
.footer-col button {
  background: transparent; border: 0; color: #cbd5e1; font: inherit; padding: 0; cursor: pointer; text-align: start;
}
.footer-col button:hover { color: #fff; }
.footer-brand p { color: #94a3b8; font-size: 0.92rem; max-width: 34ch; }
.footer-eco { color: #7dd3fc !important; font-size: 0.85rem; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.12); margin-top: 2.5rem; padding-top: 1.25rem;
  font-size: 0.85rem; color: #94a3b8;
}
.footer-placeholder { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }

.back-top {
  position: fixed; inset-inline-end: 1.25rem; bottom: 1.25rem; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--color-primary-dark); color: #fff; font-size: 1.1rem; box-shadow: var(--shadow-lg);
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }

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