:root {
  color-scheme: dark;

  --background: #070b16;
  --background-soft: #0b1120;
  --surface: rgba(15, 23, 42, 0.88);
  --surface-strong: #111a2e;
  --surface-hover: #17213a;
  --border: #273550;
  --border-light: #354563;

  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;

  --primary: #60a5fa;
  --primary-strong: #3b82f6;
  --primary-dark: #1d4ed8;
  --danger: #fb7185;
  --danger-dark: #be123c;
  --success: #34d399;

  --shadow:
    0 24px 80px rgba(0, 0, 0, 0.3),
    0 4px 18px rgba(0, 0, 0, 0.18);

  --radius-small: 10px;
  --radius-medium: 16px;
  --radius-large: 24px;
  --container: 1240px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.14), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(96, 165, 250, 0.08), transparent 26%),
    var(--background);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
caret-color: var(--primary);
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

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

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

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

h1,
h2,
h3 {
  line-height: 1.2;
}

input,
textarea,
select,
button {
  min-width: 0;
  max-width: 100%;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  outline: none;
  background: rgba(7, 11, 22, 0.72);
  color: var(--text);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input,
select {
  min-height: 50px;
  padding: 0 14px;
}

textarea {
  min-height: 120px;
  padding: 13px 14px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
  opacity: 1;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-light);
  background: rgba(15, 23, 42, 0.92);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.13);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.markdown-preview:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.82);
  outline-offset: 3px;
}

.container {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--background);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  border-bottom: 1px solid rgba(39, 53, 80, 0.82);
  background: rgba(7, 11, 22, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
box-shadow: 0 8px 30px rgba(0,0,0,.15);
}

.navbar {
  position: relative;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.38);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
}

.brand-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.brand-text strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links > a {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  font-weight: 650;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.nav-links > a:hover {
  background: rgba(96, 165, 250, 0.1);
  color: var(--primary);
}

.language-control select {
  width: auto;
  min-width: 116px;
  min-height: 42px;
  padding-inline: 12px 34px;
  border-radius: 10px;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
}

.menu-button span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  border-radius: 999px;
  background: currentColor;
}

.hero {
  display: grid;
  min-height: 600px;
  place-items: center;
  align-content: center;
  padding-block: 90px;
  text-align: center;
}

.hero-badge,
.status-badge,
.autosave-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.hero-badge {
  margin-bottom: 24px;
  padding: 7px 12px;
}

.status-badge,
.autosave-badge {
  padding: 6px 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.hero h1 {
  max-width: 900px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, #ffffff 20%, #93c5fd 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: clamp(38px, 7vw, 76px);
  letter-spacing: -0.055em;
}

.hero > p {
  max-width: 720px;
  margin-bottom: 42px;
  color: var(--text-soft);
  font-size: clamp(17px, 2vw, 20px);
}

.hero-actions,
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.button {
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.button:hover{
    transform:translateY(-2px);
    box-shadow:0 14px 30px rgba(0,0,0,.22);
}

.button:active{
    transform:translateY(0);
}

.button-primary {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.18);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  border-color: var(--border-light);
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.button-danger {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(190, 18, 60, 0.12);
  color: #fda4af;
}

.button-danger:hover {
  border-color: var(--danger);
  background: rgba(190, 18, 60, 0.22);
}

.studio-section {
  padding-block: 76px;
  border-block: 1px solid rgba(39, 53, 80, 0.7);
  background: rgba(11, 17, 32, 0.5);
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.035em;
}

.section-heading > p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.section-heading.centered {
  text-align: center;
}

.section-heading.centered > p:last-child {
  margin-inline: auto;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
animation: fadeIn .25s ease;
}

.notice.success {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(6, 78, 59, 0.18);
  color: #a7f3d0;
}

.notice.error {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(136, 19, 55, 0.18);
  color: #fecdd3;
}

.import-card,
.panel,
.feature-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}

.panel,
.import-card,
.feature-card {
  transition:
    transform .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.panel:hover,
.import-card:hover,
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.import-card {
  margin-bottom: 22px;
  padding: 30px;
  border-radius: var(--radius-medium);
}

.card-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h3,
.panel-heading h3 {
  margin-bottom: 0;
  font-size: 21px;
}

.supporting-text {
  margin: 10px 0 16px;
  color: var(--muted);
}

.import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.panel {
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius-large);
}

.panel-heading {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

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

.field {
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 750;
}

.required-mark {
  color: var(--danger);
}

.field-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 7px;
}

.field small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.character-count {
  flex: 0 0 auto;
  white-space: nowrap;
  direction: ltr;
}

.preview-panel {
  position: sticky;
  top: 98px;
}

.markdown-preview {
  min-height: 560px;
  max-height: 70vh;
  padding: 30px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: #f8fafc;
  color: #0f172a;
  direction: ltr;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  text-align: left;
  overflow-wrap: anywhere;
  line-height: 1.75;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin-top: 1.3em;
  margin-bottom: 0.65em;
  color: #0f172a;
  line-height: 1.25;
}

.markdown-preview h1 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #cbd5e1;
  font-size: 32px;
}

.markdown-preview h2 {
  padding-bottom: 7px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 24px;
}

.markdown-preview h3 {
  font-size: 19px;
}

.markdown-preview p,
.markdown-preview li {
  color: #334155;
}

.markdown-preview a {
  color: #2563eb;
  text-decoration: underline;
}

.markdown-preview ul {
  padding-left: 24px;
}

.markdown-preview pre {
  padding: 14px;
  overflow-x: auto;
  border-radius: 14px;
border:1px solid #1e293b;
  background: #0f172a;
  color: #e2e8f0;
  direction: ltr;
  text-align: left;
}

.markdown-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-preview .empty-preview {
  display: grid;
  min-height: 500px;
  place-content: center;
  color: #64748b;
  text-align: center;
}

.preview-actions {
  justify-content: stretch;
  margin-top: 16px;
}

.preview-actions .button {
  flex: 1 1 180px;
}

.features-section {
  padding-block: 82px;
}

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

.feature-card {
  padding: 24px;
  border-radius: var(--radius-medium);
}

.feature-card h3 {
  margin-bottom: 10px;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(7, 11, 22, 0.92);
}

.footer-content {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
}

.footer-content p {
  margin: 0;
}

.footer-content a {
  color: var(--primary);
  font-weight: 700;
}

html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .hero,
html[dir="rtl"] .section-heading.centered {
  text-align: center;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
  text-align: right;
}

html[dir="rtl"] input[type="url"] {
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] .character-count,
html[dir="rtl"] pre,
html[dir="rtl"] code,
html[dir="rtl"] .markdown-preview {
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] .eyebrow {
  letter-spacing: 0;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .markdown-preview {
    min-height: 440px;
    max-height: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 82px;
  }

  .container {
    width: min(calc(100% - 24px), var(--container));
  }

  .navbar {
    min-height: 68px;
  }

  .brand-text small {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .nav-links {
    position: absolute;
    inset-block-start: calc(100% + 1px);
    inset-inline: 0;
    display: none;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 0 0 14px 14px;
    background: rgba(7, 11, 22, 0.98);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: grid;
    gap: 6px;
  }

  .nav-links > a {
    width: 100%;
    padding: 11px 12px;
  }

  .language-control,
  .language-control select {
    width: 100%;
  }

  .hero {
    min-height: 520px;
    padding-block: 64px;
  }

  .hero h1 {
    font-size: clamp(36px, 12vw, 54px);
  }

  .hero-actions,
  .preview-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    width: 100%;
  }

  .studio-section,
  .features-section {
    padding-block: 58px;
  }

  .import-card,
  .panel {
    padding: 17px;
    border-radius: 17px;
  }

  .card-heading,
  .panel-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .import-row {
    grid-template-columns: 1fr;
  }

  .import-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .import-actions .button {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-full {
    grid-column: auto;
  }

  .field-meta {
    flex-wrap: wrap;
  }

  .markdown-preview {
    min-height: 380px;
    padding: 17px;
  }

  .footer-content {
    flex-direction: column;
    justify-content: center;
    padding-block: 24px;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-text strong {
    max-width: 180px;
    font-size: 15px;
  }

  .hero {
    min-height: auto;
  }

  .import-actions {
    grid-template-columns: 1fr;
  }

  .status-badge,
  .autosave-badge {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #32445f;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a6ea5;

}
@keyframes fadeIn {

from{
opacity:0;
transform:translateY(-8px);
}

to{
opacity:1;
transform:none;
}

}