/* Lightweight UX refinements shared by the production pages. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root{
  --font-ui:'Vazirmatn',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-latin:Inter,'Helvetica Neue',Arial,sans-serif;
  --navy:#1f2a44;
  --navy-dark:#101827;
  --navy-light:#3b5b7a;
  --gold:#b99035;
  --gold-light:#d7b65d;
  --gold-pale:#f7f1e2;
  --gold-text:#7b5a12;
  --bg:#f6f4ef;
  --text-dark:#202b38;
  --text-body:#4d5965;
  --text-muted:#73808c;
  --border:#dfe2e5;
  --border-light:#ece9e1;
  --shadow-sm:0 2px 8px rgba(31,42,68,.07);
  --shadow-md:0 8px 24px rgba(31,42,68,.1);
  --shadow-lg:0 16px 48px rgba(31,42,68,.13);
}
[dir="ltr"] body,[dir="ltr"] button,[dir="ltr"] input,[dir="ltr"] textarea,[dir="ltr"] select{font-family:var(--font-latin)}
body,button,input,textarea,select{font-feature-settings:"kern","liga","ss01";text-rendering:optimizeLegibility}
h1,h2,h3,h4,h5,h6{letter-spacing:-.025em;text-wrap:balance}
.hero-title,.section-title{letter-spacing:-.04em}
.section-title{max-width:18ch}
.section-header p{max-width:62ch;line-height:1.9}
.enc-card p,.article-card-image + .enc-body p{letter-spacing:-.005em}
.latin,.brand-name,.tool-name{font-family:var(--font-latin);font-feature-settings:"kern","liga"}
[data-theme="dark"]{
  --navy:#8ea8c1;
  --navy-dark:#0d1420;
  --navy-light:#b4c9dc;
  --gold:#cba84f;
  --gold-light:#e1c878;
  --gold-pale:rgba(203,168,79,.14);
  --gold-text:#e1c878;
  --bg:#101722;
  --bg-white:#182231;
  --text-dark:#edf2f7;
  --text-body:#c3ced8;
  --text-muted:#98a7b5;
  --border:#2a394a;
  --border-light:#223041;
}
.hero-section::after{background:linear-gradient(100deg,rgba(16,24,39,.94) 0%,rgba(31,42,68,.72) 48%,rgba(59,91,122,.34) 100%)}
[dir="ltr"] .hero-section::after{background:linear-gradient(260deg,rgba(16,24,39,.94) 0%,rgba(31,42,68,.72) 48%,rgba(59,91,122,.34) 100%)}
[data-theme="dark"] .hero-section::after{background:linear-gradient(100deg,rgba(8,13,22,.96) 0%,rgba(16,24,39,.82) 48%,rgba(31,42,68,.48) 100%)}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline-color:rgba(185,144,53,.9)}
.hero-actions{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center}
.hero-actions .btn{min-height:48px;display:inline-flex;align-items:center;justify-content:center}
.contact-action{display:inline-flex;align-items:center;gap:.5rem;min-height:44px}
.gallery-loading{min-height:180px;display:grid;place-items:center;color:var(--text-muted);border:1px dashed var(--border);border-radius:var(--radius)}
.gallery-item[role="button"]{cursor:zoom-in}
.gallery-item[role="button"]:focus-visible{outline:3px solid rgba(200,168,56,.8);outline-offset:4px}
#gallery-show-more{min-height:44px}
.article-card-image{position:relative;overflow:hidden}
.article-card-image img,.article-card-image .enc-cover{display:block;width:100%;height:220px;object-fit:cover}
.article-card-image img{transition:transform .45s ease}
.enc-card:hover .article-card-image img{transform:scale(1.04)}
.article-card-category{position:absolute;right:1rem;bottom:1rem;background:rgba(16,24,39,.82);color:#fff;padding:.3rem .7rem;border-radius:999px;font-size:.75rem;font-weight:700}
.detail-article-image{display:block;width:100%;height:360px;object-fit:cover;border-radius:var(--radius);margin:0 0 1.5rem;box-shadow:var(--shadow-md)}
[dir="ltr"] .article-card-category{right:auto;left:1rem}
.encyclopedia-card{border:0!important;background:transparent!important;box-shadow:none!important}
.encyclopedia-card .enc-body{padding:1.15rem .15rem .25rem}
.enc-media{height:250px;position:relative;overflow:hidden;background:var(--navy-dark);border-radius:18px;box-shadow:0 14px 32px rgba(16,24,39,.14)}
.enc-media .enc-photo,.enc-media picture{display:block;width:100%;height:100%}
.enc-media .enc-photo{object-fit:cover;transition:transform .7s cubic-bezier(.2,.7,.2,1),filter .7s ease}
.encyclopedia-card:hover .enc-photo,.encyclopedia-card:focus-within .enc-photo{transform:scale(1.07);filter:saturate(1.08)}
.enc-media-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(16,24,39,.04) 35%,rgba(16,24,39,.7) 100%);pointer-events:none}
.enc-media-open{position:absolute;top:1rem;left:1rem;width:38px;height:38px;display:grid;place-items:center;border-radius:50%;background:rgba(255,255,255,.92);color:var(--navy);font-size:.85rem;opacity:0;transform:scale(.85);transition:opacity .25s ease,transform .25s ease}
.encyclopedia-card:hover .enc-media-open,.encyclopedia-card:focus-within .enc-media-open{opacity:1;transform:scale(1)}
.enc-card-topline{display:flex;align-items:center;gap:.75rem}
.enc-card .card-cat{background:var(--gold-pale);border:1px solid rgba(185,144,53,.25);padding:.35rem .85rem}
.enc-card h3{font-size:1.12rem!important;line-height:1.55!important;margin-bottom:.55rem!important;transition:color .25s ease}
.encyclopedia-card,.encyclopedia-card h3,.encyclopedia-card p,.enc-detail-kicker,.enc-detail-figure figcaption{font-family:'Vazirmatn',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
.encyclopedia-card h3{font-weight:750!important;letter-spacing:-.015em}
.encyclopedia-card p{font-size:.9rem;line-height:1.85;max-width:42ch}
.enc-card .card-cat,.enc-read-more,.enc-detail-kicker{font-variant-numeric:tabular-nums}
.enc-detail-figure figcaption{letter-spacing:0;font-variant-numeric:tabular-nums}
.enc-cover-metric{font-variant-numeric:tabular-nums;direction:ltr}
.encyclopedia-card:hover h3,.encyclopedia-card:focus-within h3{color:var(--navy)}
.enc-read-more{display:inline-flex;align-items:center;gap:.4rem;margin-top:1.1rem;color:var(--navy);font-size:.8rem;font-weight:800}
.enc-read-more i{transition:transform .25s ease}
.encyclopedia-card:hover .enc-read-more i{transform:translateX(-4px)}
.enc-detail-kicker{display:inline-flex;align-items:center;gap:.5rem;color:var(--gold-text);font-size:.82rem;font-weight:800;letter-spacing:.03em;margin:.5rem 0 1rem}
.enc-detail-figure{margin:0 0 1.75rem;position:relative}
.enc-detail-figure .detail-hero-img{margin:0;display:block;width:100%;height:420px;object-fit:cover}
.enc-detail-figure figcaption{position:absolute;right:1rem;bottom:1rem;padding:.45rem .8rem;border-radius:999px;background:rgba(16,24,39,.78);color:#fff;font-size:.75rem;font-weight:700}
[dir="ltr"] .enc-detail-figure figcaption{right:auto;left:1rem}
@media (max-width:575px){.detail-article-image{height:220px}}
@media (max-width:575px){.enc-media{height:205px;border-radius:14px}.enc-detail-figure .detail-hero-img{height:240px}.enc-detail-figure figcaption{font-size:.68rem;bottom:.75rem}}
.hero-section::before,.about-section::before{background:none!important;opacity:0!important}
#recruitment,#faq{display:none!important}
.site-nav .navbar-nav{align-items:center}
.site-nav .navbar-nav .nav-link{font-size:.88rem}
.site-nav .navbar-toggler{touch-action:manipulation}
.section-header{max-width:760px}
.section-header.text-center{margin-inline:auto}
.contact-card a:hover{color:var(--gold-light)!important}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid rgba(200,168,56,.8);outline-offset:3px}
@media (max-width:991px){.site-nav .navbar-nav{gap:0}.site-nav .nav-link{padding:.7rem .85rem!important}.hero-actions .btn{flex:1 1 220px}}
@media (max-width:575px){.hero-actions{display:grid;grid-template-columns:1fr}.hero-actions .btn{width:100%}.btn-whatsapp{left:16px;bottom:16px;width:52px;height:52px}#scroll-to-top{left:20px;bottom:84px}}
@media (prefers-reduced-motion:reduce){.hero-actions .btn,.btn-whatsapp,#scroll-to-top{transition:none!important}.btn-whatsapp{animation:none!important}}

/* Final visual polish: consistent rhythm, stronger states and mobile stability. */
:root {
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --content-width: 1180px;
  --focus-ring: 0 0 0 4px rgba(185,144,53,.2);
  --turquoise: #0e7490;
  --slate-950: #0f172a;
  --slate-800: #1e293b;
}

html { scroll-padding-top: 92px; }
body { min-width: 320px; }
#main-content > .view-section > .container { max-width: var(--content-width); }
.view-section { min-height: 60vh; }
.view-section > .container { padding-top: clamp(4.5rem, 8vw, 7rem) !important; padding-bottom: clamp(4.5rem, 8vw, 7rem) !important; }
.section-header { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-title { line-height: 1.22; }
.section-tag {
  color: #8a7440;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.4;
  opacity: .92;
}
.section-tag::before {
  width: 22px;
  height: 1px;
  margin-inline: 0 9px;
  background: #a58a4a;
}
[dir="rtl"] .section-tag::before { margin-inline: 9px 0; }
.section-header.text-center .section-tag::before { margin-inline: 0 9px; }
[dir="rtl"] .section-header.text-center .section-tag::before { margin-inline: 9px 0; }
.section-header.text-center .section-tag { display: inline-flex; align-items: center; }
.section-header.text-center .section-title { margin-top: .65rem; }

.site-nav {
  padding: .65rem 0;
  background: rgba(255,255,255,.94);
}
.site-nav .container { min-height: 54px; }
.site-nav .navbar-brand { min-width: 0; }
.site-nav .navbar-brand > div { min-width: 0; }
.site-nav .nav-brand-text { white-space: nowrap; }
.site-nav .navbar-toggler {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--gold-pale);
}
.site-nav .navbar-toggler:focus-visible { box-shadow: var(--focus-ring); }
.site-nav .navbar-collapse { align-items: center; }
#theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dark);
  touch-action: manipulation;
}
#theme-toggle:hover { background: var(--gold-pale); color: var(--navy); }

.hero-section { min-height: min(760px, 92vh); padding: 8rem 0 5rem; }
.hero-title { max-width: 12ch; }
.hero-desc { max-width: 40rem; }
.hero-actions .btn { border-radius: 12px; }
.stats-section { background: var(--bg-white, #fff); border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.stat-item { padding: 1rem; }

.service-card, .project-card, .contact-card, .enc-card {
  border-radius: var(--radius-md);
}
.service-card, .project-card, .contact-card {
  box-shadow: var(--shadow-sm);
}
.service-card:hover, .project-card:hover, .contact-card:hover {
  transform: translateY(-4px);
}
.service-card-detail { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--border-light); font-size: .84rem !important; line-height: 1.8; color: var(--text-body) !important; }
.service-card-link { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; color: var(--navy); font-size: .8rem; font-weight: 800; }
.service-card-link i { transition: transform .2s ease; }
.service-card:hover .service-card-link i { transform: translateX(-3px); }
.filter-btn {
  min-height: 42px;
  padding: .55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-white, #fff);
  color: var(--text-body);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.filter-btn:hover { color: var(--navy); border-color: var(--navy-light); transform: translateY(-1px); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.gallery-item, .article-card-image, .enc-media { border-radius: var(--radius-md); }
.gallery-item { background: var(--navy-dark); }
.gallery-item img { aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-overlay { padding: 1rem; }
.article-card-image img, .article-card-image .enc-cover { height: clamp(190px, 24vw, 240px); }
.enc-card h3 { line-height: 1.5 !important; }
.enc-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.form-control, .form-select {
  min-height: 48px;
  border-radius: 12px;
  border-color: var(--border);
  background: var(--bg-white, #fff);
  color: var(--text-dark);
}
textarea.form-control { min-height: 132px; resize: vertical; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: var(--focus-ring); }
.form-label { color: var(--text-dark); font-weight: 700; margin-bottom: .45rem; }

#detail-content {
  max-width: 860px;
  margin-inline: auto;
  background: var(--bg-white, #fff);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding-inline: clamp(1.25rem, 4vw, 3.5rem) !important;
  box-shadow: var(--shadow-sm);
}
.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 42px;
  margin-bottom: 1.5rem;
  color: var(--navy);
  font-weight: 800;
}
.detail-back-btn:hover { color: var(--gold-text); transform: translateX(3px); }
.detail-article-image, .enc-detail-figure .detail-hero-img { border-radius: var(--radius-md); }
.art-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; color: var(--text-muted); }
.art-meta span { white-space: nowrap; }
.technical-note { line-height: 1.8; border-inline-start: 3px solid var(--gold); padding-inline-start: .85rem; }
.projects-section { background: var(--slate-950); color: #dbeafe; }
.projects-section .section-title { color: #f8fafc; }
.projects-section .section-tag { color: #7dd3fc; }
.projects-section .section-tag::before { background: #38bdf8; }
.projects-section .section-header p { color: #94a3b8 !important; }
.projects-showcase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.project-showcase-card { min-width: 0; overflow: hidden; border: 1px solid rgba(148,163,184,.2); border-radius: 20px; background: var(--slate-800); box-shadow: 0 18px 50px rgba(2,8,23,.2); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.project-showcase-card:hover { transform: translateY(-4px); border-color: rgba(56,189,248,.65); box-shadow: 0 24px 60px rgba(2,8,23,.34); }
.project-showcase-media { position: relative; overflow: hidden; aspect-ratio: 8 / 5; background: #020617; }
.project-showcase-image, .project-showcase-media picture { display: block; width: 100%; height: 100%; }
.project-showcase-image { object-fit: cover; transition: transform .2s ease; }
.project-showcase-card:hover .project-showcase-image { transform: scale(1.03); }
.project-showcase-badge { position: absolute; inset-block-start: 1rem; inset-inline-start: 1rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(14,116,144,.92); color: #ecfeff; font-size: .72rem; font-weight: 800; }
.project-showcase-body { padding: 1.35rem; }
.project-showcase-location { color: #7dd3fc; font-size: .78rem; font-weight: 700; }
.project-showcase-location i { margin-inline-end: .35rem; }
.project-showcase-body h3 { margin: .65rem 0 .55rem; color: #f8fafc; font-size: 1.12rem; }
.project-showcase-body p { min-height: 5.2em; margin: 0; color: #cbd5e1; font-size: .88rem; line-height: 1.85; }
.project-showcase-meta { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid rgba(148,163,184,.18); color: #94a3b8; font-size: .74rem; }
.project-showcase-meta a { color: #7dd3fc; font-weight: 800; white-space: nowrap; }
.project-showcase-meta a:hover { color: #e0f2fe; }

.lightbox { overscroll-behavior: contain; }
.lightbox-close { width: 44px; height: 44px; border-radius: 50%; }
.lightbox-close:focus-visible { box-shadow: var(--focus-ring); }

[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] .site-nav { background: rgba(16,23,34,.94); }
[data-theme="dark"] .filter-btn,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] #detail-content { background: var(--bg-white); color: var(--text-body); }
[data-theme="dark"] .stats-section { background: var(--bg-white); }
[data-theme="dark"] .section-tag { color: #c7aa63; opacity: .86; }
[data-theme="dark"] .section-tag::before { background: #b69650; }

@media (max-width: 991px) {
  .site-nav .navbar-collapse {
    margin-top: .75rem;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white, #fff);
    box-shadow: var(--shadow-md);
  }
  .site-nav .navbar-nav { align-items: stretch; }
  .site-nav .nav-link { border-radius: 8px; }
  .site-nav .nav-link:hover, .site-nav .nav-link.active-link { background: var(--gold-pale); }
}
@media (max-width: 575px) {
  .view-section > .container { padding-inline: 1rem !important; }
  .hero-section { min-height: 680px; padding-top: 7rem; }
  .hero-title { font-size: clamp(2rem, 10vw, 2.8rem); }
  .hero-desc { font-size: 1rem; }
  .section-title { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .contact-card { padding: 1.25rem !important; }
  #detail-content { border-radius: var(--radius-md); }
  .projects-showcase-grid { grid-template-columns: 1fr; gap: 1rem; }
}
@media (min-width:576px) and (max-width:991px) { .projects-showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
