:root {
  color-scheme: light;
  --text: #24201e;
  --muted: #617085;
  --line: #dfe7f1;
  --orange: #ff6a3d;
  --orange-strong: #ff5a2b;
  --blue: #2563eb;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --shadow: 0 24px 80px rgba(24, 33, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 7%, rgba(255, 106, 61, 0.14), transparent 25%),
    radial-gradient(circle at 86% 3%, rgba(38, 135, 255, 0.1), transparent 24%),
    linear-gradient(180deg, #fffaf7 0%, #f7fafc 38%, #ffffff 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

html[lang="ar"] body {
  font-family:
    "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial,
    Inter, ui-sans-serif, system-ui, sans-serif;
}

html[lang="ar"] [data-i18n] {
  direction: ltr;
  unicode-bidi: normal;
}

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

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(255, 106, 61, 0.22);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 40px rgba(29, 39, 54, 0.08);
}

.site-header nav a {
  padding: 8px 13px;
  border-radius: 9px;
  color: #687385;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.site-header nav a:hover {
  background: #fff1ea;
  color: var(--orange-strong);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-switcher {
  position: relative;
  z-index: 40;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #ffd4c5;
  border-radius: 10px;
  background: #fff8f4;
  color: var(--orange-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(255, 106, 61, 0.08);
}

.language-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #fff0ea;
  color: var(--orange-strong);
  font-size: 12px;
  font-weight: 950;
}

.language-caret {
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  min-width: 178px;
  padding: 6px;
  border: 1px solid #eadfd8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(24, 33, 48, 0.16);
}

.language-switcher.open .language-menu {
  display: grid;
  gap: 2px;
}

.language-menu button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5f5b57;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.language-menu button:hover,
.language-menu button.active {
  border-color: #ffb29a;
  background: #fff4ef;
  color: var(--orange-strong);
  font-weight: 900;
}

html[lang="ar"] [data-language-current],
html[lang="ar"] [data-language-menu] button {
  direction: ltr;
  unicode-bidi: normal;
}

.header-action,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.header-action {
  padding: 0 16px;
  border: 1px solid #ffd4c5;
  background: #fff3ee;
  color: var(--orange-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.65fr);
  gap: 28px;
  width: min(1180px, calc(100% - 40px));
  margin: 40px auto 72px;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(255, 106, 61, 0.1), transparent 40%),
    linear-gradient(145deg, #fff, #f5f9ff);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange-strong);
  font-size: 13px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-copy > p,
.section-title p,
.hero-panel p,
.card-copy p,
.model-card p {
  color: var(--muted);
}

.hero-copy > p {
  max-width: 720px;
  font-size: 17px;
}

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

.primary-action {
  padding: 0 18px;
  background: var(--orange);
  color: #fff;
}

.secondary-action {
  padding: 0 18px;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
}

.hero-panel {
  display: grid;
  gap: 12px;
}

.hero-panel div,
.guide-card,
.model-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(29, 39, 54, 0.07);
}

.hero-panel div {
  padding: 18px;
}

.hero-panel span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #fff1ea;
  color: var(--orange);
  font-weight: 950;
}

.hero-panel strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.support-section {
  margin-top: -34px;
}

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

.support-grid article {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(29, 39, 54, 0.07);
}

.support-grid span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: #fff1ea;
  color: var(--orange);
  font-weight: 950;
}

.support-grid strong,
.support-grid p {
  display: block;
  margin: 0;
}

.support-grid strong {
  margin-bottom: 8px;
  color: #1d2430;
  font-size: 19px;
}

.support-grid p {
  color: var(--muted);
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 72px auto;
}

.band {
  width: 100%;
  padding: 66px max(20px, calc((100% - 1180px) / 2));
  background: #f5f8fb;
}

.band .section-title,
.band .image-grid,
.band .usage-layout {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  max-width: 820px;
  margin-bottom: 24px;
}

.image-grid {
  display: grid;
  gap: 18px;
}

.image-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-copy {
  padding: 22px 22px 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 12px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.tag.codex {
  background: #eaf2ff;
  color: #1d4ed8;
}

.tag.claude {
  background: #fff0e8;
  color: #e65322;
}

ol {
  margin: 0;
  padding-left: 20px;
  color: #263142;
}

li + li {
  margin-top: 6px;
}

.image-button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #eef3f8;
  cursor: zoom-in;
}

.image-button img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: left top;
  border-top: 1px solid var(--line);
}

.guide-card.compact .image-button img {
  aspect-ratio: 16 / 9;
}

.usage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.model-card {
  align-self: start;
  overflow: hidden;
  padding: 22px;
}

.model-card .image-button {
  margin-top: 16px;
  border-radius: 10px;
  overflow: hidden;
}

.model-card .image-button img {
  aspect-ratio: 16 / 11;
  object-fit: contain;
  object-position: center;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 40px));
  margin: 30px auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #526071;
}

footer a {
  color: var(--orange-strong);
  font-weight: 900;
}

.lightbox {
  width: min(1200px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.lightbox-head button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2937;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.lightbox img {
  width: 100%;
  max-height: calc(100vh - 100px);
  object-fit: contain;
  background: #f8fafc;
}

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

  .site-header nav {
    width: 100%;
    overflow-x: auto;
  }

  .header-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .hero,
  .image-grid.two,
  .support-grid,
  .usage-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header,
  .section,
  footer,
  .hero {
    width: calc(100% - 24px);
  }

  .hero {
    padding: 24px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-action,
  .secondary-action,
  .header-tools,
  .header-action,
  .language-switcher,
  .language-trigger {
    width: 100%;
  }

  .language-trigger {
    justify-content: center;
  }

  .language-menu {
    right: auto;
    left: 0;
    width: 100%;
  }
}
