/* ==========================================================================
   Compee Sites - engine base stylesheet
   RTL-first (logical properties only), themeable via CSS variables injected
   by base.html (:root { --c-primary, --c-secondary, --font-stack }).
   No build step. Per-site custom_css is appended AFTER this file.
   ========================================================================== */

/* 1. Reset + tokens ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Always reserve the scrollbar gutter so the content width is identical
     whether or not a scrollbar is present. Without this the page shifts
     sideways when the scrollbar appears, and the position:fixed overlay
     header (media-hero pages) misaligns with the body content in browsers
     that include the scrollbar in the fixed containing block (notably RTL
     Firefox/Safari) - reads as "the page leans right". */
  scrollbar-gutter: stable;
  overflow-y: scroll; /* fallback for engines without scrollbar-gutter */
}
body {
  margin: 0;
  font-family: var(--font-stack, 'Heebo', sans-serif);
  direction: rtl;
  text-align: start;
  color: var(--c-text, #1e293b);
  background: var(--c-bg, #ffffff);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--c-primary); }

:root {
  --c-bg: #ffffff;
  --c-bg-alt: #f8fafc;
  --c-text: #1e293b;
  --c-text-muted: #64748b;
  --c-dark: #0b1120;       /* near-black navy: stats strip, footer */
  --radius: 12px;
  --max-w: 1100px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 14px 34px rgba(8, 12, 24, 0.22);
}

/* 2. Layout --------------------------------------------------------------- */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1rem;
}
.section { padding-block: 4.5rem; }
.section--alt { background: var(--c-bg-alt); }

/* centered section head: gold kicker + heavy title + muted sub */
.section-head { text-align: center; max-width: 680px; margin-inline: auto; margin-block-end: 2.5rem; }
.section-head__kicker {
  color: var(--c-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}
.section-head__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
  color: var(--c-text);
}
.section-head__sub { color: var(--c-text-muted); margin: 0.75rem 0 0; font-size: 1.05rem; }

/* 3. Header / nav ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-bg);
  border-block-end: 1px solid #e2e8f0;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.site-brand { text-decoration: none; display: flex; align-items: center; }
.site-brand__logo { max-height: 44px; width: auto; }
.site-brand__name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-primary);
}
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none;
  color: var(--c-text);
  font-weight: 500;
  padding-block: 0.25rem;
  border-block-end: 2px solid transparent;
}
.site-nav a:hover { color: var(--c-primary); border-block-end-color: var(--c-primary); }

/* transparent-over-hero header (engine.js arms it only when the page opens
   with a media hero; no-JS keeps the solid sticky header) */
.site-header--overlay {
  position: fixed;
  inset-inline: 0;
  top: 0;
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.site-header--overlay:not(.site-header--solid) {
  background: linear-gradient(to bottom, rgba(8, 12, 24, 0.45), transparent);
  border-block-end-color: transparent;
}
.site-header--overlay:not(.site-header--solid) .site-nav a,
.site-header--overlay:not(.site-header--solid) .site-brand__name,
.site-header--overlay:not(.site-header--solid) .site-nav__visitor { color: #ffffff; }
.site-header--overlay:not(.site-header--solid) .site-nav a:hover { border-block-end-color: var(--c-secondary); color: #ffffff; }
.site-header--overlay:not(.site-header--solid) .nav-toggle__button span { background: #ffffff; }
.site-header--overlay:not(.site-header--solid) .site-nav__login { background: var(--c-secondary); color: #0f172a !important; }
.site-header--overlay.site-header--solid {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 14px rgba(8, 12, 24, 0.1);
}

/* mobile nav: checkbox hack, no JS */
.nav-toggle { display: none; }
.nav-toggle__button { display: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle__button span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  margin-block: 5px;
  transition: transform 0.2s;
}
@media (max-width: 640px) {
  .nav-toggle__button { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 64px;
    flex-direction: column;
    gap: 0;
    background: var(--c-bg);
    border-block-end: 1px solid #e2e8f0;
    padding: 0.5rem 1rem 1rem;
  }
  .site-nav a { padding-block: 0.75rem; border-block-end: 1px solid #f1f5f9; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
}

/* 4. Hero ------------------------------------------------------------------ */
.hero {
  background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 55%, var(--c-dark)));
  color: #ffffff;
  padding-block: 4.5rem;
}
.hero--with-image {
  background-size: cover;
  background-position: center;
}
/* media hero (image or video): near-full-viewport, layered cinematic overlay */
.hero--media {
  position: relative;
  overflow: hidden;
  min-height: min(92svh, 860px);
  display: flex;
  align-items: center;
  padding-block: 6.5rem;
}
.hero--media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to left, rgba(8, 12, 24, 0.45), rgba(8, 12, 24, 0) 55%),
    linear-gradient(to bottom, rgba(8, 12, 24, 0.55), rgba(8, 12, 24, 0.25) 45%, rgba(8, 12, 24, 0.65));
}
.hero__inner { position: relative; z-index: 2; max-width: 760px; }
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  font-weight: 900;
  margin: 0 0 1rem;
  line-height: 1.12;
  text-wrap: balance;
}
.hero__sub {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 2rem;
  max-width: 560px;
}
.hero__badge {
  display: inline-block;
  margin-block-end: 1.5rem;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c-secondary) 40%, transparent);
  background: color-mix(in srgb, var(--c-secondary) 14%, transparent);
  color: var(--c-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hero__ctas { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.hero__scroll {
  position: absolute;
  /* physical left/translate/borders: a down-chevron is direction-agnostic
     decoration - logical properties flipped it sideways in RTL */
  left: 50%;
  bottom: 1.6rem;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
  transform: translateX(-50%) rotate(-45deg);
  animation: hero-scroll-bounce 1.6s ease-in-out infinite;
}
@keyframes hero-scroll-bounce {
  0%, 100% { translate: 0 0; opacity: 0.55; }
  50% { translate: 0 8px; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__scroll { animation: none; }
}

/* 5. Page header (content pages) ------------------------------------------ */
.page-header {
  background: var(--c-bg-alt);
  padding-block: 2.5rem;
  border-block-end: 1px solid #e2e8f0;
}
.page-header h1 { margin: 0; font-size: 1.9rem; color: var(--c-primary); }
.page-header__sub { margin: 0.5rem 0 0; color: var(--c-text-muted); }

/* 6. Prose (rendered markdown) --------------------------------------------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin-block: 2rem 0.75rem; color: var(--c-primary); clear: both; }
.prose h3 { font-size: 1.2rem; margin-block: 1.5rem 0.5rem; }
.prose p { margin-block: 0.75rem; }
.prose ul, .prose ol { padding-inline-start: 1.5rem; }
.prose li { margin-block: 0.3rem; }
.prose blockquote {
  margin-inline: 0;
  padding-inline-start: 1rem;
  border-inline-start: 4px solid var(--c-secondary);
  color: var(--c-text-muted);
}
.prose img { border-radius: var(--radius); }
.prose hr { border: none; border-block-start: 1px solid #e2e8f0; margin-block: 2rem; clear: both; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid #e2e8f0; padding: 0.5rem; text-align: start; }

/* 7. Cards ------------------------------------------------------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--c-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card__title { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--c-primary); }
.card__text { margin: 0; color: var(--c-text-muted); }
.card__image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  margin-block-end: 0.75rem;
}

/* 8. About ------------------------------------------------------------------ */
.about { display: grid; gap: 2rem; align-items: center; }
.about--with-image { grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .about--with-image { grid-template-columns: 2fr 3fr; }
}
.about__image { border-radius: var(--radius); width: 100%; object-fit: cover; }
.about__body h2 { color: var(--c-primary); margin-block-start: 0; }

/* 9. CTA strip --------------------------------------------------------------- */
.cta-strip {
  background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 55%, var(--c-dark)));
  color: #ffffff;
  padding-block: 3.25rem;
}
.cta-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cta-strip__text { font-size: clamp(1.2rem, 2.5vw, 1.55rem); font-weight: 800; max-width: 640px; }

/* 10. Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn--primary { background: var(--c-primary); color: #ffffff; }
.btn--primary:hover { filter: brightness(1.1); }
.btn--light { background: #ffffff; color: var(--c-primary); }
.btn--lg { padding: 0.9rem 2.1rem; font-size: 1.05rem; font-weight: 700; }
.btn--accent {
  background: var(--c-secondary);
  color: #0f172a;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--c-secondary) 30%, transparent);
}
.btn--accent:hover { filter: brightness(1.06); }
.btn--outline-light {
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.btn--outline-light:hover { background: #ffffff; color: var(--c-text); }

/* 10b. Banners ------------------------------------------------------------------ */
.banner {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius);
  margin-block-end: 1.5rem;
  font-weight: 500;
}
.banner--success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.banner--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.banner--owner { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.banner--owner a { color: #0369a1; font-weight: 700; text-decoration: underline; }

/* 10c. Services cards extras ------------------------------------------------------ */
.cards--two { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-block-start: 0.75rem;
}
.card__price { font-weight: 700; color: var(--c-primary); }
.btn--sm { padding: 0.4rem 1rem; font-size: 0.9rem; }

/* 10d. Gallery --------------------------------------------------------------------- */
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
.gallery--cols-2 { grid-template-columns: repeat(2, 1fr); }
.gallery--cols-4 { grid-template-columns: repeat(4, 1fr); }
.gallery__item { margin: 0; }
.gallery__item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}
.gallery__item figcaption {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-block-start: 0.35rem;
}
@media (max-width: 640px) {
  .gallery, .gallery--cols-2, .gallery--cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* 10e. Contact --------------------------------------------------------------------- */
.contact-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
.contact-form { display: grid; gap: 1rem; align-content: start; }
.form-field { display: grid; gap: 0.3rem; }
.form-field label { font-weight: 600; font-size: 0.9rem; }
.form-field input, .form-field textarea {
  padding: 0.6rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: calc(var(--radius) - 4px);
  font-family: inherit;
  font-size: 1rem;
  background: var(--c-bg);
  color: var(--c-text);
}
.form-field input:focus, .form-field textarea:focus {
  outline: 2px solid var(--c-primary);
  border-color: transparent;
}
.hp-field {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}
.contact-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.5rem; }
.contact-list a { text-decoration: none; }
.hours-table { border-collapse: collapse; margin-block: 1rem; }
.hours-table th { text-align: start; padding-inline-end: 1.5rem; padding-block: 0.25rem; }
.hours-table td { color: var(--c-text-muted); }
.contact-map {
  width: 100%;
  height: 280px;
  border: 0;
  border-radius: var(--radius);
  margin-block-start: 1rem;
}

/* 11. Error page ---------------------------------------------------------------- */
.error-page { text-align: center; padding-block: 3rem; }
.error-page h1 { font-size: 4rem; margin: 0; color: var(--c-primary); }

/* 12. Footer ---------------------------------------------------------------------- */
.site-footer {
  background: var(--c-dark);
  color: #94a3b8;
  padding-block-start: 4rem;
  /* No top margin: the footer sits flush against the preceding block. Light
     content sections already carry their own bottom padding for breathing
     room; dark strips (cta_strip / stats) butt right up to the footer - which
     is what we want. (The footer is a sibling of <main>, so an adjacent-
     sibling override against .cta-strip never matched - hence the old gap.) */
}
.site-footer__grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding-block-end: 3rem;
}
.site-footer__brand { font-weight: 800; font-size: 1.35rem; color: #ffffff; }
.site-footer__tagline { margin: 0.6rem 0 0; font-size: 0.95rem; color: #94a3b8; max-width: 280px; }
.site-footer__col { display: grid; gap: 0.55rem; align-content: start; justify-items: start; }
.site-footer__heading {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}
.site-footer__col a { color: #94a3b8; text-decoration: none; }
.site-footer__col a:hover { color: var(--c-secondary); }
.site-footer__address { font-size: 0.95rem; }
.site-footer__bottom { border-block-start: 1px solid rgba(255, 255, 255, 0.08); padding-block: 1.25rem; }
.site-footer__bottom-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #64748b;
}

/* 13. Responsive tweaks -------------------------------------------------------------- */
@media (max-width: 640px) {
  .hero { padding-block: 3rem; }
  .hero--media { min-height: min(86svh, 720px); padding-block: 5.5rem 4rem; }
  .section { padding-block: 2.75rem; }
  .section-head { margin-block-end: 1.75rem; }
  /* overlay header: the opened mobile dropdown is a white sheet */
  .site-header--overlay:not(.site-header--solid) .site-nav a { color: var(--c-text); }
  .site-header--overlay:not(.site-header--solid) .site-nav a:hover { color: var(--c-primary); }
}

/* 14. Courses --------------------------------------------------------------- */
.card--link { text-decoration: none; display: block; color: inherit; transition: box-shadow 0.15s; }
.card--link:hover { box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12); }
.course-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-block-start: 0.75rem;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}
.course-meta span { background: var(--c-bg-alt); padding: 0.15rem 0.6rem; border-radius: 999px; }
.course-meta--header { margin-block-start: 0.5rem; }
.back-link { color: var(--c-text-muted); text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: var(--c-primary); }
.course-toc__title { color: var(--c-primary); margin-block: 2rem 0.75rem; }
.course-toc { padding-inline-start: 1.25rem; max-width: 760px; }
.course-toc li { margin-block: 0.6rem; }
.course-toc__name { font-weight: 600; }
.course-toc__desc { display: block; color: var(--c-text-muted); font-size: 0.9rem; }
.course-cta { margin-block-start: 2.5rem; text-align: center; }
.course-cta__note { color: var(--c-text-muted); font-size: 0.85rem; margin-block-start: 0.5rem; }
.empty-state { color: var(--c-text-muted); text-align: center; padding-block: 2rem; }

/* 15. Blog (site-owned articles) --------------------------------------------- */
.article-byline {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-block-start: 0.75rem;
}
.article-byline--header { margin-block-start: 0.5rem; font-size: 0.9rem; }
.article-byline__cat {
  background: var(--c-bg-alt);
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  color: var(--c-primary);
  font-weight: 600;
}
.article-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-block-end: 1.5rem;
}

/* 13. Visitor auth (hosted-sites identity, phase B) -------------------------------- */
.container--narrow { max-width: 480px; }
.auth-alt { margin-block-start: 1.25rem; font-size: 0.95rem; color: var(--c-text-muted); }
.site-nav__visitor { color: var(--c-text-muted); font-size: 0.9rem; }
.site-nav__logout { display: inline; margin: 0; }
.site-nav__logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  color: var(--c-primary);
  padding: 0;
}
.site-nav__logout-btn:hover { text-decoration: underline; }
.course-lock { font-size: 0.85em; margin-inline-start: 0.3rem; }
.site-nav__login {
  background: var(--c-primary);
  color: #ffffff !important;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}
.site-nav__login:hover { filter: brightness(1.1); }
.site-nav__manage { font-weight: 600; }

/* 13b. Language switcher (multi-language sites) ------------------------------------ */
.site-nav__langs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: 0.5rem;
  padding-inline-start: 0.75rem;
  border-inline-start: 1px solid #cbd5e1;
  font-size: 0.85rem;
}
.site-nav__lang { color: var(--c-text-muted); border-block-end: none !important; }
.site-nav__lang:hover { color: var(--c-primary); }
.site-nav__lang--active { color: var(--c-primary); font-weight: 700; }
.site-header--overlay:not(.site-header--solid) .site-nav__lang { color: rgba(255, 255, 255, 0.85); }
.site-header--overlay:not(.site-header--solid) .site-nav__lang--active { color: #ffffff; }
.btn--google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  background: #ffffff;
  color: var(--c-text);
  border: 1px solid #cbd5e1;
  margin-block-end: 0.5rem;
}
.btn--google:hover { background: #f8fafc; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--c-text-muted);
  font-size: 0.85rem;
  margin-block: 1rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-block-start: 1px solid #e2e8f0;
}

/* 16. Hero video ------------------------------------------------------------- */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (prefers-reduced-motion: reduce) {
  .hero__video { display: none; }
}

/* 17. Stats strip (home) ------------------------------------------------------ */
.stats {
  background: color-mix(in srgb, var(--c-primary) 18%, var(--c-dark));
  color: #ffffff;
  padding-block: 4rem;
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  text-align: center;
}
.stats__item { display: grid; gap: 0.35rem; }
.stats__value {
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}
.stats__label { font-size: 0.95rem; color: #94a3b8; }

/* 17b. Clients/partners strip --------------------------------------------------- */
.clients { background: var(--c-bg-alt); padding-block: 2.25rem; border-block: 1px solid #eef2f7; }
.clients__title { text-align: center; color: var(--c-text-muted); font-size: 0.9rem; margin: 0 0 1.1rem; }
.clients__row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.25rem 3rem;
  flex-wrap: wrap;
}
.clients__name { color: #94a3b8; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.clients__link { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: opacity .15s ease; }
.clients__link:hover { opacity: .9; }
.clients__link:hover .clients__name { color: var(--c-primary); }

/* 17c. Media cards (image-filled cards: features w/ image, services, projects) -- */
.media-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  text-decoration: none;
  box-shadow: var(--shadow);
  background: var(--c-dark);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.media-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.media-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 12, 24, 0.88), rgba(8, 12, 24, 0.30) 55%, rgba(8, 12, 24, 0.12));
}
.media-card--fallback {
  background: linear-gradient(160deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 40%, var(--c-dark)));
}
.media-card__body { position: absolute; inset-inline: 0; bottom: 0; padding: 1.4rem; z-index: 1; }
.media-card__title { margin: 0 0 0.4rem; font-size: 1.3rem; font-weight: 800; color: #ffffff; }
.media-card__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-card__meta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-block-start: 0.6rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}
.media-card .project-badge {
  position: absolute;
  top: 1rem;
  inset-inline-start: 1rem;
  z-index: 1;
}
.media-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.media-card:hover .media-card__img { transform: scale(1.06); }

/* 18. Testimonials (home) ------------------------------------------------------ */
.testimonials { position: relative; max-width: 720px; margin-inline: auto; text-align: center; }
.testimonials__quote {
  display: block;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--c-secondary);
  opacity: 0.5;
  height: 3rem;
  user-select: none;
}
.testimonial { margin: 0; }
.testimonial + .testimonial { margin-block-start: 2rem; }
/* JS upgrades the stack to a carousel (one slide + dots + arrows) */
.testimonials--js .testimonial { display: none; }
.testimonials--js .testimonial + .testimonial { margin-block-start: 0; }
.testimonials--js .testimonial--active { display: block; animation: testimonial-in 0.45s ease; }
@keyframes testimonial-in {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}
.testimonial blockquote {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 500;
  line-height: 1.75;
  color: var(--c-text);
}
.testimonial figcaption { margin-block-start: 1.25rem; color: var(--c-text); font-weight: 700; }
.testimonial figcaption span { font-weight: 400; color: var(--c-text-muted); }
.testimonial__stars { color: var(--c-secondary); letter-spacing: 0.18em; margin-block-end: 0.75rem; font-size: 1.05rem; }
.testimonials__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-block-start: 1.5rem;
}
.testimonials__arrow {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: var(--c-bg);
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.testimonials__arrow:hover { border-color: var(--c-secondary); color: var(--c-secondary); }
.testimonials__dots { display: flex; justify-content: center; gap: 0.5rem; }
.testimonials__dots button {
  width: 10px; height: 10px;
  border-radius: 999px;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: width 0.2s ease, background 0.2s ease;
}
.testimonials__dots button.is-active { background: var(--c-secondary); width: 22px; }

/* 19. Projects (portfolio page type) ------------------------------------------- */
.section__title { color: var(--c-primary); margin-block: 0 1.5rem; font-size: 1.6rem; }
.section__more { text-align: center; margin-block-start: 2rem; }
.project-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-block-start: 0.75rem;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}
.project-meta--header { margin-block-start: 0.6rem; }
.project-badge {
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
}
.project-badge--completed { background: #ecfdf5; color: #047857; }
.project-badge--in_progress { background: #eff6ff; color: #1d4ed8; }
.project-badge--planning { background: #fefce8; color: #a16207; }
.project-detail { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) {
  .project-detail { grid-template-columns: 2fr 1fr; }
}
.project-detail__cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-block-end: 1.5rem;
}
.project-detail__gallery { margin-block-start: 1.5rem; }
.project-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin-block: 1rem; }
.project-facts dt { font-weight: 600; }
.project-facts dd { margin: 0; color: var(--c-text-muted); }

/* 20. JS-driven animation (engine.js adds .anim; no JS = fully visible) -------- */
.anim { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.anim--visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .anim { opacity: 1; transform: none; transition: none; }
}
.site-header--scrolled { box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08); }

.auth-intro { color: var(--c-text-muted); margin-block-end: 1.25rem; }
