:root {
  --bg: #f7f3ea;
  --card: #ffffff;
  --text: #151515;
  --muted: #6f6b63;
  --border: rgba(21,21,21,.12);
  --accent: #ffcf3f;
  --accent-dark: #151515;
  --shadow: 0 28px 90px rgba(30, 24, 10, .12);
  --radius: 32px;
}

* { 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;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 207, 63, .30), transparent 26rem),
    linear-gradient(120deg, #fbf7ed 0%, #f7f3ea 55%, #f4efe4 100%);
}

html[lang="ar"] body {
  font-family: "IBM Plex Sans Arabic", Inter, system-ui, sans-serif;
}

body.dark {
  --bg: #111111;
  --card: #1a1a1a;
  --text: #f7f3ea;
  --muted: #b5ad9e;
  --border: rgba(255,255,255,.13);
  --accent: #ffcf3f;
  --accent-dark: #111111;
  --shadow: 0 28px 90px rgba(0,0,0,.35);
  background:
    radial-gradient(circle at top left, rgba(255, 207, 63, .18), transparent 26rem),
    linear-gradient(120deg, #111111 0%, #171717 60%, #101010 100%);
}

.site-header {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.25rem;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #111;
  font-weight: 900;
  letter-spacing: -.04em;
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.icon-btn {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.38);
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

body.dark .icon-btn { background: rgba(255,255,255,.05); }

.text-icon {
  font-family: "IBM Plex Sans Arabic", Inter, sans-serif;
  font-weight: 900;
}

.page {
  width: min(1540px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: .55fr 1.45fr;
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 136px);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .95rem;
}

.hero-title {
  margin: 0;
  max-width: 760px;
  font-size: clamp(4.25rem, 9.5vw, 8.8rem);
  line-height: .9;
  letter-spacing: -.075em;
  font-weight: 900;
}

html[lang="ar"] .hero-title {
  font-size: clamp(3.1rem, 7.2vw, 6.4rem);
  line-height: 1.22;
  letter-spacing: 0;
  word-spacing: .08em;
  max-width: 720px;
  font-weight: 800;
}

.hero-desc {
  margin: 28px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.7;
  font-weight: 600;
}

.tool-card {
  width: 100%;
  max-width: 1050px;
  margin-inline-start: auto;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.mode-tabs {
  width: fit-content;
  margin-inline-start: auto;
  display: flex;
  gap: 6px;
  padding: 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.04);
}

body.dark .mode-tabs { background: rgba(255,255,255,.06); }

.mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--text);
  color: var(--bg);
}

.text-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr;
  gap: 22px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 12px;
}

.field > span {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 900;
}

textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 24px;
  font: 700 1.4rem/1.7 "IBM Plex Sans Arabic", Inter, sans-serif;
  color: var(--text);
  background: rgba(255,255,255,.68);
  outline: none;
}

body.dark textarea {
  background: rgba(255,255,255,.06);
}

#outputText {
  background: rgba(255, 207, 63, .10);
}

textarea:focus {
  border-color: rgba(255, 207, 63, .85);
  box-shadow: 0 0 0 4px rgba(255, 207, 63, .16);
}

.actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

button {
  font-family: inherit;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 56px;
  border-radius: 18px;
  padding: 0 22px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.primary-btn {
  border: 0;
  background: var(--accent);
  color: #111;
}

.secondary-btn,
.ghost-btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.45);
  color: var(--text);
}

body.dark .secondary-btn,
body.dark .ghost-btn {
  background: rgba(255,255,255,.05);
}

.status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.how-section {
  padding: 40px 0 0;
}

.how-section h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin: 0 0 24px;
  letter-spacing: -.04em;
}

html[lang="ar"] .how-section h2 {
  letter-spacing: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.steps article {
  background: color-mix(in srgb, var(--card) 86%, transparent);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
}

.steps span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #111;
  font-weight: 900;
}

.steps p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 700;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .text-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(4rem, 15vw, 7rem);
  }

  html[lang="ar"] .hero-title {
    font-size: clamp(2.8rem, 11vw, 5.4rem);
    line-height: 1.25;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: auto;
    padding: 14px 0;
    gap: 12px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .nav a {
    display: none;
  }

  .page {
    padding-top: 24px;
  }

  .tool-card {
    padding: 18px;
    border-radius: 24px;
  }

  .mode-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .mode-btn {
    flex: 1;
    padding: 12px;
  }

  .hero-title {
    letter-spacing: -.055em;
  }

  textarea {
    min-height: 220px;
    font-size: 1.15rem;
  }
}.footer {
  margin-top: 80px;
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.footer p {
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}
