/* Using CSS Logical Properties for better RTL/LTR support */
:root {
  color-scheme: light;
  --bg: #f7f3f1;
  --surface: #ffffff;
  --surface-strong: #f1e9e7;
  --text: #1a1a1a;
  --text-secondary: #5f5b57;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #e60023;
  --accent-strong: #a21725;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

:root.dark {
  color-scheme: dark;
  --bg: #111111;
  --surface: #181818;
  --surface-strong: #222222;
  --text: #f5f5f5;
  --text-secondary: #b8b8b8;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #ff4f6c;
  --accent-strong: #ff2a4a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(230, 0, 35, 0.08), transparent 25%),
    radial-gradient(circle at bottom right, rgba(230, 0, 35, 0.06), transparent 23%),
    var(--bg);
  color: var(--text);
  text-align: start; /* Standard for RTL/LTR */
}

button,
a {
  font: inherit;
}

.page-shell {
  max-width: 1180px;
  margin-inline: auto;
  padding: 76px 16px 8px;
  background: transparent;
}

main {
  min-height: calc(100vh - 104px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.brand {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.theme-switch {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-picker {
  position: relative;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 74px;
  min-height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 0;
}

.theme-switch:checked + .theme-toggle::after {
  transform: translateX(34px);
}

html[dir="rtl"] .theme-switch:checked + .theme-toggle::after {
  transform: translateX(-34px);
}

.theme-toggle:hover {
  background: var(--surface-strong);
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

.theme-sun {
  opacity: 0.8;
}

.theme-moon {
  opacity: 0.4;
}

.theme-switch:checked + .theme-toggle .theme-sun {
  opacity: 0.4;
}

.theme-switch:checked + .theme-toggle .theme-moon {
  opacity: 0.9;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 0 10px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 18px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  background: rgba(230, 0, 35, 0.08);
  transform: translateY(-1px);
}

.card-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-picker {
  position: relative;
}

.lang-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  min-width: 88px;
}

.lang-toggle:hover {
  background: var(--surface-strong);
}

.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  display: none;
  min-width: 160px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 10;
}

.lang-menu.open {
  display: block;
}

.lang-option {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: start;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lang-option:hover,
.lang-option.active {
  background: rgba(56, 189, 248, 0.14);
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
  padding: 16px 0 14px;
}

.hero-copy .eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
}

.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  line-height: 1.05;
}

.hero-copy p {
  max-width: 52ch;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.visual-card {
  width: 100%;
  padding: 32px;
  border-radius: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.visual-card h2 {
  margin: 0 0 14px;
  font-size: 1.75rem;
}

.visual-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.8;
}

.badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-strong);
  font-size: 0.8rem;
  margin-bottom: 18px;
  font-weight: 700;
}

.section {
  padding: 14px 0;
  position: relative;
}

.section-header {
  margin-bottom: 18px;
}

.section-label {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 700;
}

.section h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.grid-card {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.12);
}

.project-card h3 {
  margin: 0 0 16px;
}

.project-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.85;
}

.highlight-card {
  padding: 32px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.chip-row span {
  display: inline-flex;
  padding: 10px 14px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-strong);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.stats-card {
  display: grid;
  gap: 18px;
}

.stats-card > div {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.stats-card strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
}

.site-footer {
  padding: 16px 0 10px;
  text-align: center;
  color: var(--text-secondary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  border-radius: 28px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .hero, .split, .grid-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 18px;
  }
  .hero-copy h1 {
    font-size: 2.5rem;
  }
  .theme-toggle {
    width: 100%;
  }
}

/* Forms and details */
.form-row, .detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
  justify-content: space-between;
}

.form-row label {
  min-width: 120px;
  color: var(--text-secondary);
}

.form-row input, .form-row select {
  flex: 1 1 240px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 16px;
}

.status-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
.badge-processing { background: rgba(230, 100, 50, 0.12); color: var(--accent-strong); }
.badge-done { background: rgba(56,189,248,0.12); color: var(--accent); }
.badge-other { background: rgba(120,120,120,0.08); color: var(--text-secondary); }

.empty-state {
  text-align: center;
  padding: 36px 12px;
  background: var(--surface-strong);
  border: 1px dashed var(--border);
  border-radius: 12px;
}


