:root {
  color-scheme: light;
  --ink: #18202f;
  --muted: #667085;
  --line: #d8dee9;
  --paper: #ffffff;
  --soft: #f5f7fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #d97706;
  --blue: #2563eb;
  --shadow: 0 18px 45px rgba(24, 32, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Cairo", system-ui, sans-serif;
  background: var(--soft);
  color: var(--ink);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand,
.nav-links,
.hero-actions,
.tool-tabs,
.tool-title,
.settings-row,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.86rem;
}

.nav-links {
  gap: clamp(12px, 3vw, 30px);
  color: var(--muted);
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--brand);
}

.language-toggle {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  background: white;
  color: var(--brand-dark);
  font-weight: 800;
  cursor: pointer;
}

.language-toggle:hover {
  border-color: var(--brand);
}

body.lang-en,
body.lang-en button,
body.lang-en input,
body.lang-en select,
body.lang-en textarea {
  font-family: Arial, system-ui, sans-serif;
}

body.lang-en .hero h1 {
  max-width: 900px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: 52px 0 28px;
}

.hero h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.9rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.12rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 800;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.primary-link,
.secondary-link,
.run-button,
.tab-button {
  min-height: 46px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
}

.primary-link {
  background: var(--brand);
  color: white;
}

.secondary-link {
  border: 1px solid var(--line);
  background: white;
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.metric {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metric.wide {
  grid-column: 1 / -1;
  background: #101828;
  color: white;
}

.metric span {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.metric small {
  color: inherit;
  opacity: 0.72;
  font-weight: 700;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px dashed #aab4c3;
  border-radius: 8px;
  background: repeating-linear-gradient(
    135deg,
    #ffffff,
    #ffffff 10px,
    #eef2f7 10px,
    #eef2f7 20px
  );
  color: #64748b;
  font-weight: 800;
}

.ad-slot-live {
  display: block;
  overflow: hidden;
  padding: 0;
  border-style: solid;
  background: transparent;
}

.ad-wide {
  margin: 0 auto 36px;
}

.tools-shell,
.faq {
  padding: 28px 0 54px;
}

.section-heading h2,
.info-band h2,
.faq h2,
.content-section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.tool-tabs {
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: var(--paper);
  color: var(--muted);
}

.tab-button.active {
  border-color: var(--brand);
  background: #e6fffb;
  color: var(--brand-dark);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ad-side {
  min-height: 250px;
}

.tool-card {
  display: none;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tool-card.active {
  display: block;
}

.tool-title {
  gap: 14px;
  margin-bottom: 20px;
}

.tool-title > svg {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: 8px;
  background: #e6fffb;
  color: var(--brand);
}

.tool-title h3 {
  margin: 0;
  font-size: 1.35rem;
}

.tool-title p {
  margin: 2px 0 0;
  color: var(--muted);
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 180px;
  border: 2px dashed #b7c1d1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-zone svg {
  width: 38px;
  height: 38px;
  color: var(--brand);
}

.settings-row {
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0;
}

.settings-row label {
  display: grid;
  gap: 6px;
  min-width: min(220px, 100%);
  color: var(--muted);
  font-weight: 700;
}

select,
input[type="range"],
input[type="text"],
input[type="email"],
textarea {
  min-height: 42px;
}

select,
input[type="text"],
input[type="email"],
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: white;
  color: var(--ink);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

textarea {
  resize: vertical;
}

.file-list {
  display: grid;
  gap: 8px;
  min-height: 20px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.page-sorter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.page-thumb {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 172px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcff;
  color: var(--ink);
  cursor: grab;
}

.page-thumb:active {
  cursor: grabbing;
}

.page-thumb.dragging {
  opacity: 0.52;
  border-color: var(--brand);
}

.page-thumb canvas {
  width: 100%;
  max-width: 110px;
  height: 136px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.page-thumb span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.run-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  padding: 12px 16px;
  background: var(--brand);
  color: white;
}

.run-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.status-line {
  min-height: 28px;
  color: var(--blue);
  font-weight: 800;
}

.feature-grid,
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-grid {
  padding: 26px 0 54px;
}

.feature-grid article,
.article-grid article {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.feature-grid svg {
  width: 34px;
  height: 34px;
  color: var(--brand);
}

.feature-grid h3,
.article-grid h3 {
  margin: 12px 0 8px;
}

.feature-grid p,
.article-grid p {
  margin: 0;
  color: var(--muted);
}

.content-section {
  padding: 26px 0 54px;
}

.editorial-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.editorial-layout article {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.editorial-layout h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.editorial-layout p {
  margin: 0 0 14px;
  color: var(--muted);
}

.editorial-layout p:last-child {
  margin-bottom: 0;
}

.info-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 336px);
  gap: 26px;
  align-items: center;
  padding: 46px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-band p {
  color: var(--muted);
}

.ad-square {
  min-height: 280px;
}

.faq details {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.faq summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
}

.faq details p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
}

.site-footer {
  justify-content: space-between;
  gap: 14px;
  padding: 22px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a:hover {
  color: var(--brand);
}

.page-shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}

.text-page {
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.text-page h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
}

.text-page h2 {
  margin: 30px 0 8px;
  font-size: 1.35rem;
}

.text-page p {
  color: var(--muted);
}

.contact-link {
  margin-top: 14px;
}

.contact-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 820px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .workspace,
  .info-band,
  .feature-grid,
  .article-grid,
  .editorial-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .metric.wide {
    grid-column: auto;
  }

  .ad-side {
    min-height: 120px;
  }

  .tab-button {
    flex: 1 1 145px;
  }
}

@media (max-width: 480px) {
  main {
    width: min(100% - 22px, 1180px);
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .language-toggle {
    width: 100%;
  }

  .tool-title {
    align-items: flex-start;
  }
}
