/* AMS Structural Analysis — Product Homepage
   Deep slate/navy + amber accent · engineering aesthetic */

:root {
  --slate-950: #0b1220;
  --slate-900: #111827;
  --slate-850: #151d2e;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --white: #ffffff;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --accent: var(--amber-500);
  --accent-hover: var(--amber-400);
  --accent-muted: rgba(245, 158, 11, 0.12);
  --accent-border: rgba(245, 158, 11, 0.35);
  --surface: var(--slate-850);
  --surface-elevated: var(--slate-800);
  --text: var(--slate-100);
  --text-muted: var(--slate-400);
  --border: rgba(148, 163, 184, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1120px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--slate-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-hover); }
ul { list-style: none; }
strong { font-weight: 600; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--slate-950);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; outline: 2px solid var(--white); outline-offset: 2px; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--white);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--white); }
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  display: grid;
  place-items: center;
  color: var(--slate-950);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4), 0 4px 12px rgba(245, 158, 11, 0.25);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.nav-links a {
  color: var(--slate-300);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
}
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,0.05); }

.nav-cta {
  display: none;
  padding: 0.5rem 1rem !important;
  background: var(--accent) !important;
  color: var(--slate-950) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
}
.nav-cta:hover { background: var(--accent-hover) !important; color: var(--slate-950) !important; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--slate-300);
  border-radius: 1px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--nav-h);
  background: var(--slate-900);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  color: var(--slate-200);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.nav-mobile a:hover { background: var(--surface); color: var(--white); }
.nav-mobile .nav-cta {
  display: block !important;
  text-align: center;
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-block; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none !important; }
}

/* —— Hero —— */
.hero {
  position: relative;
  padding: 3.5rem 0 4.5rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(245, 158, 11, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(20, 184, 166, 0.06), transparent 50%),
    linear-gradient(180deg, var(--slate-900) 0%, var(--slate-950) 100%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black 40%, transparent 95%);
  -webkit-mask-image: linear-gradient(180deg, black 40%, transparent 95%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 901px) {
  .hero-grid { grid-template-columns: 1fr 1.15fr; gap: 2.5rem; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--amber-400);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.hero-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-400);
  box-shadow: 0 0 8px var(--amber-400);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.15rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 0.75rem;
}
.hero h1 span { color: var(--amber-400); }

.hero-ru {
  font-size: 1rem;
  color: var(--slate-400);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--slate-300);
  max-width: 36em;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn:focus-visible {
  outline: 2px solid var(--amber-400);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--accent);
  color: var(--slate-950);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--slate-950);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--slate-200);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--slate-600);
  color: var(--white);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hero-meta strong {
  display: block;
  color: var(--slate-200);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

/* Hero visual — AMS app screenshot card */
.hero-visual {
  position: relative;
  max-width: none;
  min-width: 0;
  margin-inline: auto;
  width: 100%;
}
.frame-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 1.25rem;
}
.frame-card--shot {
  padding: 0;
}
.frame-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.frame-card--shot .frame-card-header {
  margin-bottom: 0;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
}
.frame-dots { display: flex; gap: 5px; }
.frame-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--slate-700);
}
.frame-dots i:nth-child(1) { background: #ef4444; }
.frame-dots i:nth-child(2) { background: var(--amber-500); }
.frame-dots i:nth-child(3) { background: #22c55e; }

.frame-card-shot-link {
  display: block;
  line-height: 0;
  cursor: zoom-in;
  outline: none;
}
.frame-card-shot-link:focus-visible {
  outline: 2px solid var(--amber-400);
  outline-offset: -2px;
}
.frame-card-shot-link:hover .frame-card-shot {
  opacity: 0.96;
}
.frame-card-shot {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1918 / 1030;
  object-fit: contain;
  image-rendering: auto;
  transform: none;
  vertical-align: middle;
  transition: opacity 0.2s var(--ease);
}

/* Legacy SVG diagram (kept for any leftover markup) */
.frame-svg {
  width: 100%;
  height: calc(100% - 2rem);
}
.frame-svg .member { stroke: var(--slate-400); stroke-width: 2.5; fill: none; }
.frame-svg .member-accent { stroke: var(--amber-500); stroke-width: 3; }
.frame-svg .node {
  fill: var(--slate-950);
  stroke: var(--teal-400);
  stroke-width: 2;
}
.frame-svg .load { stroke: var(--teal-400); stroke-width: 1.5; fill: var(--teal-400); }
.frame-svg .label {
  fill: var(--slate-400);
  font-family: var(--font-mono);
  font-size: 10px;
}
.frame-glow {
  position: absolute;
  width: 60%;
  height: 40%;
  bottom: 10%;
  left: 20%;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.15), transparent 70%);
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero-visual { max-width: 100%; }
}

/* —— Sections common —— */
section { padding: 4.5rem 0; }
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-500);
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(1.65rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--white);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 40em;
  margin-bottom: 2.5rem;
}

.section-alt {
  background: var(--slate-900);
  border-block: 1px solid var(--border);
}

/* —— Features —— */
.features-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.feature-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  color: var(--amber-400);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.feature-card p {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* —— Analysis —— */
.analysis-layout {
  display: grid;
  gap: 2rem;
}
@media (min-width: 800px) {
  .analysis-layout { grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
}

.analysis-list { display: flex; flex-direction: column; gap: 1rem; }
.analysis-item {
  display: flex;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.analysis-item .num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-muted);
  color: var(--amber-400);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.analysis-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}
.analysis-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.limits-card {
  background: linear-gradient(160deg, var(--surface-elevated), var(--slate-850));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}
.limits-card h3 {
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.limits-card h3 svg { color: var(--teal-400); flex-shrink: 0; }
.limits-card > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.limits-card ul { display: flex; flex-direction: column; gap: 0.65rem; }
.limits-card li {
  font-size: 0.9rem;
  color: var(--slate-300);
  padding-left: 1.35rem;
  position: relative;
}
.limits-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--teal-500);
  opacity: 0.85;
}
.limits-note {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--slate-400);
}

/* —— BIM —— */
.bim-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 700px) {
  .bim-grid { grid-template-columns: repeat(3, 1fr); }
}

.bim-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
}
.bim-format {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--amber-400);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
}
.bim-card h3 {
  font-size: 1.05rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.bim-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* —— Download CTA —— */
.download-band {
  position: relative;
  overflow: hidden;
}
.download-band .container {
  position: relative;
  background: linear-gradient(135deg, var(--slate-800) 0%, var(--slate-850) 50%, #1a2336 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.75rem 2rem;
  text-align: center;
}
.download-band .container::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 50%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.12), transparent 60%);
  pointer-events: none;
}
.download-band .section-title { margin-bottom: 0.5rem; }
.download-band .section-lead {
  margin-inline: auto;
  margin-bottom: 1.75rem;
}
.download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* —— Contact —— */
.contact-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 700px) {
  .contact-grid { grid-template-columns: 1.2fr 0.8fr; }
}

.contact-info h3 {
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.contact-info > p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.contact-list { display: flex; flex-direction: column; gap: 0.85rem; }
.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.contact-row svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--amber-400);
  margin-top: 2px;
}
.contact-row .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}
.contact-row a, .contact-row span {
  color: var(--slate-200);
  font-weight: 500;
  font-size: 0.95rem;
}
.contact-row a:hover { color: var(--amber-400); }

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.about-card h3 {
  font-size: 1.05rem;
  color: var(--white);
  margin-bottom: 0.75rem;
}
.about-card p {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.about-card p:last-child { margin-bottom: 0; }
.about-tag {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--teal-400);
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.25);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
}

/* —— Footer —— */
.site-footer {
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--slate-950);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand .logo { margin-bottom: 0.5rem; }
.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 28em;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.footer-links a {
  color: var(--slate-400);
  font-size: 0.875rem;
}
.footer-links a:hover { color: var(--amber-400); }
.footer-copy {
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--slate-600);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

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

/* —— Download page —— */
.nav-links a.is-active,
.nav-mobile a.is-active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.page-download .download-hero {
  padding-bottom: 3.5rem;
}

.download-hero-grid {
  align-items: stretch;
}

.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
  width: 100%;
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.download-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.download-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  color: var(--amber-400);
  flex-shrink: 0;
}

.download-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.download-card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.download-meta-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 0;
  border-block: 1px solid var(--border);
}

.download-meta-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--slate-300);
}

.download-meta-list li span {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.download-meta-list code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber-400);
  background: var(--accent-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--accent-border);
}

.btn-block {
  width: 100%;
}

.download-counter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--teal-400);
  text-align: center;
  padding: 0.55rem 0.75rem;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: var(--radius-sm);
}

.download-card-note {
  font-size: 0.8rem;
  color: var(--slate-500);
  text-align: center;
  line-height: 1.45;
}

/* Notes */
.notes-alert {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius);
  color: #fca5a5;
  font-size: 0.95rem;
  line-height: 1.5;
}

.notes-alert strong {
  color: #fecaca;
}

.notes-list {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 700px) {
  .notes-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.notes-list > li {
  display: flex;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.notes-mark {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 0.45rem;
  border-radius: 2px;
  background: var(--amber-500);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.notes-list h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.notes-list p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.activation-card {
  background: linear-gradient(160deg, var(--surface-elevated), var(--slate-850));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.activation-card h3 {
  font-size: 1.05rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.activation-card p {
  font-size: 0.925rem;
  color: var(--slate-300);
  margin-bottom: 0.65rem;
}

.activation-cta {
  margin-bottom: 0 !important;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted) !important;
  font-size: 0.875rem !important;
}

.examples-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}

.examples-band h3 {
  font-size: 1.05rem;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.examples-band p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-top: 1.25rem;
}

.social-row a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--slate-300);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.social-row a:hover {
  color: var(--amber-400);
  border-color: var(--accent-border);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.footer-social a {
  color: var(--slate-400);
  font-size: 0.875rem;
}

.footer-social a:hover {
  color: var(--amber-400);
}

/* —— Language dropdown (v2) —— */
.lang-dd { position: relative; display: inline-block; margin-inline: 0.35rem; }
.lang-dd > summary { list-style: none; }
.lang-dd > summary::-webkit-details-marker { display: none; }
.lang-dd-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  padding: 0.4rem 0.65rem; border-radius: 6px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.03); color: var(--slate-300, #cbd5e1);
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap; user-select: none;
}
.lang-dd-btn:hover, .lang-dd[open] .lang-dd-btn { color: var(--white, #fff); border-color: var(--accent); }
.lang-dd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-dd-short { display: none; }
.lang-dd-caret { transition: transform .15s; opacity: .8; }
.lang-dd[open] .lang-dd-caret { transform: rotate(180deg); }
.lang-dd-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 200;
  min-width: 10rem; margin: 0; padding: 0.3rem; list-style: none;
  background: var(--slate-900, #0f172a); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
.lang-dd-menu li { margin: 0; }
.lang-dd .lang-dd-opt {
  display: block; padding: 0.5rem 0.75rem !important; border-radius: 5px !important;
  color: var(--slate-300, #cbd5e1) !important; background: transparent !important;
  font-size: 0.875rem !important; text-decoration: none; text-align: start;
}
.lang-dd .lang-dd-opt:hover, .lang-dd .lang-dd-opt:focus-visible { color: #fff !important; background: rgba(255,255,255,.07) !important; }
.lang-dd .lang-dd-opt.is-active { color: var(--slate-950, #020617) !important; background: var(--accent) !important; font-weight: 700; }
.nav-mobile-lang .lang-dd { display: block; margin-inline: 0; }
.nav-mobile-lang .lang-dd-btn { width: 100%; justify-content: center; }
.nav-mobile-lang .lang-dd-menu { position: static; margin-top: 6px; box-shadow: none; }
@media (max-width: 767px) {
  .nav-trailing .lang-dd-cur { display: none; }
  .nav-trailing .lang-dd-short { display: inline; }
}

.nav-trailing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Desktop: switcher lives in .nav-links; hide trailing duplicate */
.nav-trailing .lang-dd { display: inline-flex; }
.nav-links .lang-dd { display: none; }

@media (min-width: 768px) {
  .nav-trailing .lang-dd { display: none; }
  .nav-links .lang-dd { display: inline-flex; }
  .nav-trailing { display: none; }
}

.nav-mobile-lang {
  padding: 0.5rem 1rem;
}



/* —— RTL layout —— */
[dir="rtl"] body {
  font-family: "Noto Sans Arabic", "DM Sans", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

[dir="rtl"] .nav-inner {
  flex-direction: row; /* logo stays start (right in RTL), trailing at end (left) */
}

[dir="rtl"] .nav-links {
  flex-direction: row;
}

/* RTL: document dir mirrors the hero grid naturally (text at inline-start). */
[dir="rtl"] .hero-grid {
  /* inherit dir from html; keep same column template as LTR */
}

[dir="rtl"] .hero-lead,
[dir="rtl"] .section-lead,
[dir="rtl"] .feature-card p,
[dir="rtl"] .analysis-item p,
[dir="rtl"] .bim-card p,
[dir="rtl"] .contact-info > p,
[dir="rtl"] .about-card p,
[dir="rtl"] .footer-brand p,
[dir="rtl"] .notes-list p,
[dir="rtl"] .activation-card p,
[dir="rtl"] .examples-band p,
[dir="rtl"] .download-card-note,
[dir="rtl"] .limits-card > p,
[dir="rtl"] .limits-note {
  text-align: start;
}

[dir="rtl"] .analysis-item {
  flex-direction: row;
}

[dir="rtl"] .limits-card li {
  padding-left: 0;
  padding-right: 1.35rem;
}

[dir="rtl"] .limits-card li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .contact-row {
  flex-direction: row;
}

[dir="rtl"] .notes-list > li {
  flex-direction: row;
}

[dir="rtl"] .download-card-header {
  flex-direction: row;
}

[dir="rtl"] .download-meta-list li {
  flex-direction: row;
}

[dir="rtl"] .examples-band {
  flex-direction: row;
}

[dir="rtl"] .footer-inner {
  text-align: start;
}

[dir="rtl"] .footer-copy {
  flex-direction: row;
}

[dir="rtl"] .bim-card {
  text-align: center; /* keep centered branding cards */
}

[dir="rtl"] .download-band .container {
  text-align: center;
}

[dir="rtl"] .btn svg {
  transform: scaleX(-1);
}

[dir="rtl"] .hero-actions .btn-primary svg {
  /* download arrow stays downward — do not flip */
  transform: none;
}

[dir="rtl"] .examples-band .btn svg {
  /* external-link icon: mirror for RTL reading direction */
  transform: scaleX(-1);
}

[dir="rtl"] .frame-svg .label {
  /* keep diagram labels LTR (engineering symbols) */
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] .logo-mark,
[dir="rtl"] .bim-format,
[dir="rtl"] .download-meta-list code,
[dir="rtl"] .about-tag,
[dir="rtl"] .analysis-item .num {
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] .skip-link {
  left: auto;
  right: 1rem;
}

[dir="rtl"] .hero-badge {
  flex-direction: row;
}

/* Nudge Arabic line-height slightly for Noto Sans Arabic */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
  line-height: 1.35;
}

/* —— Profile page (.ams-profile) —— */
.page-profile {
  /* Bootstrap 3 loads before this file; keep AMS chrome dominant */
}

.page-profile .site-nav,
.page-profile .site-footer {
  font-family: var(--font);
}

.page-profile .ams-profile-wrap.container {
  width: min(100% - 2rem, var(--max)) !important;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.ams-profile {
  padding: calc(var(--nav-h) + 1.75rem) 0 4rem;
  min-height: 60vh;
}

.ams-profile-alert {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  color: var(--text);
  margin-top: 1rem;
}

.ams-profile-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .ams-profile-layout {
    grid-template-columns: 1fr;
  }
  .ams-profile-sidebar {
    order: -1;
  }
}

.ams-profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.ams-profile-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.ams-profile-privacy {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85em;
}

.ams-profile-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--white);
}

.ams-profile-avatar {
  background: var(--slate-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  margin-bottom: 0.75rem;
}

.ams-profile-avatar img {
  display: block;
  margin: 0 auto;
  max-height: 100%;
  object-fit: contain;
}

.ams-profile-avatar-link {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.65rem;
}

.ams-profile-stack-form {
  margin-bottom: 0.65rem;
}

.ams-profile-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ams-profile-btn-row .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.45rem 0.75rem;
}

.ams-profile-presence {
  text-align: center;
  margin: 0 0 0.65rem;
  font-family: var(--font);
}

.ams-profile-views {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  justify-content: flex-end;
}

.ams-profile-views .fa {
  color: var(--accent);
}

.ams-profile-link-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text) !important;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.ams-profile-link-card:hover {
  border-color: var(--accent-border);
  background: var(--surface-elevated);
  color: var(--white) !important;
}

.ams-profile-link-card .fa {
  color: var(--accent);
}

.ams-profile-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ams-profile-info-list li span {
  color: var(--slate-300);
  font-weight: 500;
  margin-inline-end: 0.35rem;
}

.ams-profile-info-list li span::after {
  content: ":";
}

.ams-profile-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.ams-profile-admin-actions form {
  margin: 0;
}

.ams-profile-warn { color: #f87171; margin: 0.25rem 0; }
.ams-profile-ok { color: #34d399; margin: 0.25rem 0; }

.ams-profile-feed {
  min-width: 0;
}

.ams-profile-compose {
  margin-bottom: 1rem !important;
}

.ams-profile-compose-btn {
  background: var(--slate-800) !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  height: 48px !important;
  color: var(--text-muted) !important;
  font-weight: 500;
  text-align: start;
  padding-inline: 1.25rem !important;
}

.ams-profile-compose-btn:hover {
  color: var(--white) !important;
  border-color: var(--accent-border) !important;
}

/* Restyle Bootstrap panels / pagination emitted by posts.php */
.ams-profile .panel,
.ams-profile-posts .panel {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  color: var(--text);
  margin-bottom: 1rem !important;
}

.ams-profile .panel-default > .panel-heading,
.ams-profile-posts .panel-heading {
  background: var(--surface-elevated) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

.ams-profile .panel-body,
.ams-profile-posts .panel-body {
  background: transparent !important;
  color: var(--text);
}

.ams-profile .panel a,
.ams-profile-posts .panel a {
  color: var(--accent);
}

.ams-profile .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 1rem !important;
  list-style: none;
}

.ams-profile .pagination > li > a,
.ams-profile .pagination > li > span {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.45rem 0.85rem !important;
  float: none !important;
  margin: 0 !important;
}

.ams-profile .pagination > li.active > a,
.ams-profile .pagination > .active > span {
  background: var(--accent-muted) !important;
  border-color: var(--accent-border) !important;
  color: var(--accent) !important;
  font-weight: 600;
}

.ams-profile .pagination > li > a:hover {
  background: var(--surface-elevated) !important;
  color: var(--white) !important;
}

.ams-profile .btn-default,
.ams-profile .btn-primary,
.ams-profile .btn-success,
.ams-profile .btn-danger,
.ams-profile .btn-warning {
  border-radius: var(--radius-sm) !important;
  font-family: var(--font);
}

.ams-profile .btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--slate-950) !important;
  font-weight: 600;
}

.ams-profile .btn-primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}

.ams-profile .btn-default,
.ams-profile .btn-ghost {
  background: transparent !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

.ams-profile .modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
}

.ams-profile .modal-header,
.ams-profile .modal-footer {
  border-color: var(--border) !important;
}

.ams-profile .form-control {
  background: var(--slate-900) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
}

.ams-profile .thumbnail {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.ams-profile-posts {
  color: var(--text);
}

.ams-profile-posts img {
  border-radius: var(--radius-sm);
}

/* Soften Bootstrap body bleed on profile */
.page-profile body,
body.page-profile {
  background: var(--slate-950) !important;
  color: var(--text) !important;
}

[dir="rtl"] .ams-profile-views {
  justify-content: flex-start;
}

[dir="rtl"] .ams-profile-info-list li span {
  margin-inline-end: 0;
  margin-inline-start: 0.35rem;
}

/* phone menu open: page behind is locked, the menu itself scrolls */
html.nav-locked, html.nav-locked body { overflow: hidden; overscroll-behavior: none; }
html.nav-locked .site-nav { position: fixed; top: 0; left: 0; right: 0; }
.nav-mobile.is-open {
  max-height: calc(100vh - var(--nav-h));
  max-height: calc(100dvh - var(--nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
