/* ==========================================================================
   Kitrovia — shared stylesheet for the first-edition static site.
   Plain CSS only: no build step, no framework, no external fonts or assets.
   Palette: restrained deep navy + white + generous whitespace.
   ========================================================================== */

:root {
  --navy: #0b2545;
  --navy-hover: #163c6d;
  --ink: #14263f;
  --muted: #465a72;
  --line: #dce4ed;
  --surface: #f4f7fb;
  --surface-2: #e8eff6;
  --accent: #1b4f9c;
  --white: #ffffff;
  --max-width: 1180px;
  --radius: 10px;
  --card-shadow: 0 1px 2px rgba(11, 37, 69, .05), 0 10px 26px rgba(11, 37, 69, .05);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--accent); }
a:hover { color: var(--navy-hover); }

:focus-visible { outline: 3px solid #8ab4e8; outline-offset: 3px; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(2.05rem, 4.8vw, 3.35rem); margin: 0 0 20px; }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); margin: 0 0 16px; }
h3 { font-size: 1.15rem; margin: 0 0 10px; }
h4 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

/* ---------- layout helpers ---------- */
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 76px 0; }
.section--tight { padding: 52px 0; }
.section--surface {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-head { max-width: 68ch; margin-bottom: 36px; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 64ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- header / navigation ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 16px 0;
}
.brand {
  color: var(--navy);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
.site-nav a {
  color: var(--muted);
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--accent); }
.header-cta { margin-left: 8px; }

/* ---------- buttons / links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 650;
  font-size: .95rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-hover); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: 9px 16px; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.text-link { color: var(--accent); font-weight: 650; text-decoration: none; }
.text-link:hover { color: var(--navy-hover); text-decoration: underline; }
.text-link::after { content: " \2192"; }

/* ---------- hero ---------- */
.hero { padding: 82px 0 76px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 { max-width: 18ch; }
.hero .lede { margin-bottom: 0; }

/* ---------- CSS-only image placeholders ---------- */
.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #33445c;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.5;
}
.media-placeholder span { display: block; max-width: 40ch; }
.media-placeholder--wide { aspect-ratio: 16 / 9; }
.media-placeholder--square { aspect-ratio: 1 / 1; }
.media-placeholder--short { aspect-ratio: 16 / 7; }
.media-placeholder--tall { aspect-ratio: 3 / 4; }

/* ---------- AI-generated concept illustrations ----------
   Image files are supplied separately. These rules keep the layout
   stable while the files are absent and once they are added. */
.media-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #33445c;
  font-size: .85rem;
  line-height: 1.5;
}
.media-image--wide { aspect-ratio: 16 / 9; }
.media-image--square { aspect-ratio: 1 / 1; }
.card .media-image { aspect-ratio: 16 / 10; }

.figure { margin: 0; }
.figure figcaption { margin-top: 12px; color: var(--muted); font-size: .9rem; }

/* ---------- grids / cards ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.card:hover { border-color: #b9cadc; }
.card p { color: var(--muted); }
.card .card-foot { margin-top: auto; padding-top: 4px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tag {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}
.question { color: var(--navy); font-size: 1.03rem; font-weight: 650; margin: 0; }

.question-callout {
  margin: 0 0 34px;
  padding: 22px 26px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.question-callout p { margin: 0; color: var(--navy); font-size: 1.1rem; font-weight: 650; }

.note {
  margin-top: 26px;
  padding: 18px 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
}
.note p { margin: 0; }

.badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 4px;
  background: var(--navy);
  color: var(--white);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.badge--demo { background: #8a5a12; }

/* ---------- steps / info blocks ---------- */
.step-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.step-list li { padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.step-label { display: block; margin-bottom: 10px; color: var(--accent); font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.step-list p { color: var(--muted); margin: 0; font-size: .94rem; }

.info-list { display: grid; gap: 26px; margin-top: 8px; }
.info-block { padding-top: 4px; border-top: 1px solid var(--line); }
.info-block h2, .info-block h3 { margin-top: 18px; }
.info-block p { color: var(--muted); max-width: 72ch; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; min-width: 460px; }
.table caption { text-align: left; padding: 14px 16px; color: var(--muted); font-size: .88rem; }
.table th, .table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { background: var(--surface); color: var(--navy); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td { color: var(--muted); font-size: .94rem; }

/* ---------- case study ---------- */
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.case-frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
.case-frames .figure { display: flex; flex-direction: column; }
.case-frames .media-placeholder { flex: 1; }

/* ---------- closing CTA ---------- */
.closing-cta { background: var(--navy); color: var(--white); padding: 66px 0; }
.closing-cta h2 { color: var(--white); margin-bottom: 12px; }
.closing-cta p { color: #d5e2f0; max-width: 60ch; }
.closing-cta .btn-primary { background: var(--white); color: var(--navy); }
.closing-cta .btn-primary:hover { background: var(--surface-2); color: var(--navy); }
.closing-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 26px; }

/* ---------- footer ---------- */
.site-footer { background: #081d37; color: #cfdcec; padding: 52px 0 28px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px; }
.site-footer h3 { color: var(--white); font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
.site-footer p, .site-footer li { color: #b8c9dd; font-size: .9rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #dce8f5; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid #244063; font-size: .85rem; color: #a9bdd3; }

/* ---------- form ---------- */
.form-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { color: var(--navy); font-size: .93rem; font-weight: 650; }
.field .optional { color: var(--muted); font-weight: 400; }
.field .hint { color: var(--muted); font-size: .85rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input[type="file"] { padding: 9px; font-size: .88rem; }
.field input::placeholder, .field textarea::placeholder { color: #6b7c91; }
.form-notice {
  margin: 0 0 24px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid #8a5a12;
  border-radius: 0 6px 6px 0;
  font-size: .93rem;
}
.form-status { margin-top: 18px; font-size: .93rem; font-weight: 600; color: var(--navy); }
.form-aside { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.form-aside h2 { font-size: 1.2rem; }
.form-aside p { color: var(--muted); font-size: .94rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .form-layout { grid-template-columns: 1fr; gap: 36px; }
  .hero .media-placeholder { aspect-ratio: 16 / 9; }
  .section { padding: 58px 0; }
  .header-cta { margin-left: 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .header-inner { gap: 12px; }
  .site-nav { width: 100%; order: 3; margin-left: 0; gap: 6px 18px; }
  .header-cta { margin-left: auto; }
  .section { padding: 46px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .closing-cta { padding: 50px 0; }
  .actions .btn, .closing-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- language switcher (present on all nine languages) ---------- */
.lang-switch { background: var(--white); border-top: 1px solid var(--line); }
.lang-switch ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px;
  list-style: none;
}
.lang-switch li { margin: 0; }
.lang-switch a {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 4px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}
.lang-switch a:hover { background: var(--surface); color: var(--navy); }
.lang-switch a[aria-current="page"] { background: var(--surface-2); color: var(--navy); }

/* ---------- RTL: Arabic only. Mirrored accents and logical alignment. ---------- */
[dir="rtl"] body {
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.85;
}
[dir="rtl"] .site-nav { margin-left: 0; margin-right: auto; }
[dir="rtl"] .header-cta { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .question-callout,
[dir="rtl"] .note,
[dir="rtl"] .form-notice {
  border-left: 1px solid var(--line);
  border-right: 4px solid var(--accent);
  border-radius: var(--radius) 0 0 var(--radius);
}
[dir="rtl"] .form-notice { border-right-color: #8a5a12; }
[dir="rtl"] .table caption,
[dir="rtl"] .table th,
[dir="rtl"] .table td { text-align: right; }
[dir="rtl"] .text-link::after { content: " \2190"; }
[dir="rtl"] .skip-link:focus { left: auto; right: 12px; }
[dir="rtl"] .field input,
[dir="rtl"] .field textarea { text-align: right; }
[dir="rtl"] .field input[type="email"],
[dir="rtl"] .field input[type="date"] { text-align: left; }
