@charset "UTF-8";

:root {
  --bg: #f6f2ed;
  --bg-deep: #eee7e0;
  --surface: rgba(255, 253, 250, 0.78);
  --surface-solid: #fffdfa;
  --surface-muted: #f0ebe6;
  --ink: #27232b;
  --ink-soft: #6f666d;
  --ink-faint: #9b9298;
  --line: rgba(72, 58, 72, 0.12);
  --line-strong: rgba(72, 58, 72, 0.2);
  --brand: #8b6f8f;
  --brand-deep: #6e5276;
  --brand-soft: #ded1dc;
  --beige: #d8c0a4;
  --shadow: 0 22px 70px rgba(56, 41, 55, 0.1), 0 3px 14px rgba(56, 41, 55, 0.04);
  --card-shadow: 0 30px 80px rgba(27, 20, 29, 0.2), 0 5px 14px rgba(27, 20, 29, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ui-font: "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --display-font: "Noto Kufi Arabic", "Noto Sans Arabic", sans-serif;
  --transition: 220ms cubic-bezier(.2,.75,.25,1);
}

body[data-theme="dark"] {
  --bg: #18151a;
  --bg-deep: #211b22;
  --surface: rgba(38, 31, 40, 0.88);
  --surface-solid: #261f28;
  --surface-muted: #302731;
  --ink: #f3ede8;
  --ink-soft: #c4b9c0;
  --ink-faint: #8f858d;
  --line: rgba(245, 237, 232, 0.1);
  --line-strong: rgba(245, 237, 232, 0.18);
  --brand: #c09bc5;
  --brand-deep: #a981ae;
  --brand-soft: #473848;
  --beige: #b99879;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.24), 0 3px 14px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(139,111,143,.28); outline-offset: 2px; }

.ambient { position: fixed; z-index: -1; pointer-events: none; filter: blur(2px); opacity: .75; }
.ambient-one { width: 400px; height: 400px; top: -140px; right: -110px; background: radial-gradient(circle, rgba(191,156,190,.22), transparent 68%); }
.ambient-two { width: 520px; height: 520px; bottom: -260px; left: -180px; background: radial-gradient(circle, rgba(216,192,164,.16), transparent 70%); }
.page-shell { max-width: 1480px; margin: 0 auto; padding: 28px 44px 30px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(145deg, var(--surface-solid), var(--brand-soft)); box-shadow: 0 8px 20px rgba(100,73,103,.08); }
.brand-mark svg { width: 28px; height: 28px; fill: none; stroke: var(--brand-deep); stroke-linecap: round; stroke-width: 1.6; }
.brand-mark circle { fill: var(--beige); stroke: none; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-family: var(--display-font); font-size: 1rem; letter-spacing: -.04em; }
.brand-copy small { color: var(--ink-soft); font-size: .65rem; letter-spacing: .02em; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.status-pill, .edit-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: .68rem; background: rgba(255,255,255,.18); }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: #76a97d; box-shadow: 0 0 0 3px rgba(118,169,125,.14); }
.icon-button { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface); color: var(--ink); transition: transform var(--transition), background var(--transition), border-color var(--transition); }
.icon-button:hover { transform: translateY(-2px); border-color: var(--brand); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .moon-icon { display: none; }
body[data-theme="dark"] .sun-icon { display: none; }
body[data-theme="dark"] .moon-icon { display: block; fill: none; }

.hero { max-width: 780px; padding: 78px 0 50px; }
.hero-kicker, .eyebrow { color: var(--brand-deep); font-size: .67rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.hero-kicker { display: flex; align-items: center; gap: 11px; }
.kicker-line { width: 28px; height: 1px; background: var(--brand); display: inline-block; }
.hero h1 { margin: 16px 0 14px; font-family: var(--display-font); font-size: clamp(2.1rem, 4.4vw, 4rem); line-height: 1.38; letter-spacing: -.08em; font-weight: 800; }
.hero h1 em { color: var(--brand-deep); font-style: normal; }
.hero p { max-width: 520px; margin: 0; color: var(--ink-soft); font-size: .96rem; line-height: 2; }

.studio-grid { display: grid; grid-template-columns: minmax(310px, 380px) minmax(0, 1fr); gap: 22px; align-items: start; direction: ltr; }
.panel-surface { direction: rtl; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.control-panel, .preview-panel { border-radius: var(--radius-xl); }
.control-panel { padding: 25px 24px 22px; }
.panel-heading, .preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel-heading h2, .preview-heading h2 { margin: 6px 0 0; font-family: var(--display-font); font-size: 1rem; letter-spacing: -.05em; }
.edit-badge { color: var(--brand-deep); border-color: var(--brand-soft); background: var(--brand-soft); white-space: nowrap; font-size: .62rem; }
.form-stack { display: grid; gap: 16px; margin-top: 26px; }
.field-group { display: grid; gap: 8px; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); font-size: .76rem; font-weight: 700; }
.field-label small { color: var(--ink-faint); font-size: .61rem; font-weight: 500; }
input[type="text"], textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); color: var(--ink); padding: 11px 13px; font-size: .76rem; outline: none; transition: border-color var(--transition), box-shadow var(--transition), background var(--transition); }
input[type="text"]:hover, textarea:hover { border-color: var(--line-strong); }
input[type="text"]:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(139,111,143,.1); }
textarea { min-height: 99px; resize: vertical; line-height: 1.95; }
.section-divider { height: 1px; background: var(--line); margin: 22px 0; }
.option-block + .option-block { margin-top: 22px; }
.option-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.option-value, .text-button { color: var(--ink-faint); font-size: .62rem; }
.text-button { padding: 0; border: none; background: none; color: var(--brand-deep); }
.text-button:hover { text-decoration: underline; }
.size-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.size-option, .theme-option, .align-option { border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink-soft); transition: all var(--transition); }
.size-option { display: grid; justify-items: center; gap: 4px; padding: 9px 3px 8px; border-radius: 12px; }
.size-option:hover, .theme-option:hover, .align-option:hover { border-color: var(--brand); transform: translateY(-1px); }
.size-option.is-active, .theme-option.is-active, .align-option.is-active { color: var(--brand-deep); border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 5px 16px rgba(139,111,143,.1); }
.size-option strong, .theme-option span:not(.theme-dot) { font-size: .61rem; font-weight: 800; }
.size-option small, .theme-option small { font-size: .53rem; color: var(--ink-faint); direction: ltr; }
.size-shape { display: block; width: 22px; height: 22px; margin: 1px 0 2px; border: 1.5px solid currentColor; border-radius: 5px; opacity: .75; }
.landscape-shape { width: 28px; height: 17px; margin-top: 3px; }
.portrait-shape { width: 20px; height: 25px; }
.story-shape { width: 16px; height: 26px; border-radius: 4px; }
.theme-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.theme-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; padding: 10px; border-radius: 12px; text-align: right; }
.theme-dot { width: 22px; height: 22px; border-radius: 8px; border: 1px solid var(--line-strong); }
.light-dot { background: #fffdfa; }
.dark-dot { background: #1c181e; }
.color-options { display: grid; gap: 8px; }
.color-control { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); cursor: pointer; transition: border-color var(--transition); }
.color-control:hover { border-color: var(--brand); }
.color-control input { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; overflow: hidden; }
.color-control input::-webkit-color-swatch-wrapper { padding: 0; }
.color-control input::-webkit-color-swatch { border: 0; border-radius: 7px; }
.color-control span { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 6px; }
.color-control strong { font-size: .64rem; }
.color-control small { color: var(--ink-faint); font-family: ui-monospace, monospace; font-size: .57rem; direction: ltr; }
.range-wrap { padding: 2px 1px 0; }
input[type="range"] { width: 100%; height: 4px; appearance: none; background: linear-gradient(to left, var(--brand), var(--brand-soft)); border-radius: 4px; direction: rtl; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; border: 3px solid var(--surface-solid); border-radius: 50%; background: var(--brand); box-shadow: 0 2px 8px rgba(60,40,65,.24); }
.range-labels { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: .58rem; margin-top: 7px; }
.align-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 15px; }
.align-option { padding: 7px 4px; border-radius: 9px; font-size: .61rem; }
.export-button { width: 100%; display: flex; align-items: center; gap: 11px; margin-top: 24px; padding: 12px 13px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(105deg, var(--brand-deep), #9c769f); box-shadow: 0 11px 24px rgba(111,82,118,.24); text-align: right; transition: transform var(--transition), box-shadow var(--transition), filter var(--transition); }
.export-button:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(111,82,118,.3); filter: saturate(1.08); }
.export-button:active { transform: translateY(-1px); }
.export-button:disabled { cursor: wait; opacity: .7; transform: none; }
.export-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; background: rgba(255,255,255,.16); }
.export-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.export-button strong, .export-button small { display: block; }
.export-button strong { font-size: .74rem; }
.export-button small { margin-top: 2px; color: rgba(255,255,255,.72); font-size: .57rem; }
.button-arrow { margin-right: auto; font-size: 1.15rem; opacity: .75; direction: ltr; }

.preview-panel { min-height: 730px; padding: 25px 27px 19px; overflow: hidden; }
.preview-meta { display: flex; align-items: center; gap: 7px; color: var(--ink-faint); font-family: ui-monospace, monospace; font-size: .58rem; direction: ltr; white-space: nowrap; }
.preview-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.preview-stage { position: relative; display: grid; place-items: center; min-height: 606px; margin-top: 22px; padding: 48px 36px; border: 1px solid var(--line); border-radius: 21px; overflow: hidden; background-color: var(--surface-muted); background-image: linear-gradient(45deg, rgba(139,111,143,.045) 25%, transparent 25%, transparent 75%, rgba(139,111,143,.045) 75%), linear-gradient(45deg, rgba(139,111,143,.045) 25%, transparent 25%, transparent 75%, rgba(139,111,143,.045) 75%); background-position: 0 0, 9px 9px; background-size: 18px 18px; }
.preview-stage::before, .preview-stage::after { content: ""; position: absolute; border: 1px solid rgba(139,111,143,.1); border-radius: 50%; pointer-events: none; }
.preview-stage::before { width: 520px; height: 520px; top: -220px; left: -160px; }
.preview-stage::after { width: 420px; height: 420px; right: -170px; bottom: -210px; }
.stage-label { position: absolute; display: flex; align-items: center; gap: 8px; color: var(--ink-faint); font-size: .56rem; letter-spacing: .03em; }
.stage-label i { display: block; width: 25px; height: 1px; background: var(--line-strong); }
.stage-label-top { top: 21px; right: 27px; }
.stage-label-bottom { bottom: 21px; left: 27px; }
.card-preview { --card-bg: #fffdfa; --card-ink: #27232b; --card-narrator: #8b6f8f; --card-source: #8c838b; --quote-scale: 1; position: relative; isolation: isolate; width: min(100%, 540px); aspect-ratio: 1 / 1; overflow: hidden; border-radius: 5px; color: var(--card-ink); background: var(--card-bg); box-shadow: var(--card-shadow); transition: aspect-ratio 420ms cubic-bezier(.2,.75,.25,1), background 320ms, color 320ms, transform 420ms; animation: card-in .7s cubic-bezier(.2,.75,.25,1) both; }
.card-preview.card-dark { --card-bg: #18151a; --card-ink: #f4eee9; --card-narrator: #c8a8c7; --card-source: #a79ba5; }
.card-preview[data-size="youtube"] { width: min(100%, 700px); }
.card-preview[data-size="cover"] { width: min(100%, 430px); }
.card-preview[data-size="story"] { width: min(100%, 340px); }
.card-wash { position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 22% 12%, rgba(216,192,164,.22), transparent 29%), radial-gradient(circle at 92% 92%, rgba(139,111,143,.15), transparent 32%); opacity: .82; }
.card-dark .card-wash { opacity: .27; }
.card-inner { position: absolute; inset: 8.5%; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid color-mix(in srgb, var(--card-ink) 12%, transparent); border-radius: 2px; padding: 7% 8%; }
.card-narrator { display: flex; align-items: flex-start; justify-content: center; gap: 8px; color: var(--card-narrator); text-align: center; }
.card-narrator p { max-width: 92%; margin: 0; font-size: clamp(.48rem, .85vw, .72rem); font-weight: 700; line-height: 1.8; }
.micro-ornament { margin-top: 3px; font-size: .62rem; color: var(--beige); }
.card-quote-wrap { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 8% 0; text-align: center; }
.card-quote-wrap p { width: 100%; margin: 0; font-family: var(--display-font); font-size: clamp(1.05rem, calc(2.05vw * var(--quote-scale)), 2rem); font-weight: 700; line-height: 1.9; letter-spacing: -.07em; text-wrap: balance; transition: font-size 240ms, color 240ms; }
.card-preview[data-align="right"] .card-quote-wrap { align-items: flex-start; text-align: right; }
.card-preview[data-align="right"] .card-quote-wrap p { text-align: right; }
.card-preview[data-align="justify"] .card-quote-wrap p { text-align: justify; text-align-last: center; }
.quote-symbol { position: absolute; top: 0; right: 0; color: var(--beige); font-family: Georgia, serif; font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: 1; opacity: .65; }
.quote-symbol-end { top: auto; right: auto; bottom: -2%; left: 0; }
.card-source { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--card-source); }
.card-source p { margin: 0; max-width: 76%; font-size: clamp(.48rem, .78vw, .66rem); line-height: 1.7; font-weight: 600; text-align: center; }
.source-rule { width: 14px; height: 1px; background: currentColor; opacity: .62; }
.card-orbit { position: absolute; border: 1px solid color-mix(in srgb, var(--card-ink) 11%, transparent); border-radius: 50%; pointer-events: none; }
.orbit-one { width: 75%; aspect-ratio: 1; right: -28%; top: -33%; }
.orbit-two { width: 60%; aspect-ratio: 1; left: -25%; bottom: -28%; }
.card-corner { position: absolute; width: 28px; height: 28px; border-color: var(--beige); opacity: .7; }
.corner-top { top: 5.3%; right: 5.3%; border-top: 1px solid; border-right: 1px solid; }
.corner-bottom { bottom: 5.3%; left: 5.3%; border-bottom: 1px solid; border-left: 1px solid; }
.preview-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--ink-faint); font-size: .6rem; }
.mini-tip, .preview-lock { display: flex; align-items: center; gap: 7px; }
.tip-icon { color: var(--beige); }
.preview-lock svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 35px; color: var(--ink-faint); font-size: .61rem; }

.toast { position: fixed; right: 28px; bottom: 28px; z-index: 10; display: flex; align-items: center; gap: 9px; padding: 12px 15px 12px 16px; border: 1px solid rgba(118,169,125,.25); border-radius: 13px; color: #385d3d; background: #edf7ee; box-shadow: 0 16px 35px rgba(43,70,46,.15); font-size: .72rem; opacity: 0; transform: translateY(15px); pointer-events: none; transition: opacity 250ms, transform 250ms; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: white; background: #76a97d; font-size: .7rem; }
body[data-theme="dark"] .toast { color: #d7f1da; background: #243828; border-color: #46694c; }

.reveal-on-load { animation: reveal-up .75s cubic-bezier(.2,.75,.25,1) both; }
.hero.reveal-on-load { animation-delay: .08s; }
.studio-grid.reveal-on-load { animation-delay: .16s; }
@keyframes reveal-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-in { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

@media (max-width: 980px) {
  .page-shell { padding-inline: 25px; }
  .studio-grid { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 15px; }
  .preview-stage { min-height: 560px; padding-inline: 22px; }
  .control-panel { padding-inline: 18px; }
}
@media (max-width: 760px) {
  .page-shell { padding: 18px 16px 24px; }
  .status-pill { display: none; }
  .hero { padding: 55px 0 34px; }
  .hero h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .hero p { font-size: .84rem; }
  .studio-grid { display: flex; flex-direction: column; }
  .control-panel, .preview-panel { width: 100%; }
  .control-panel { order: 2; }
  .preview-panel { order: 1; min-height: 0; padding: 20px 15px 16px; }
  .preview-heading { padding-inline: 5px; }
  .preview-heading h2 { font-size: .9rem; }
  .preview-meta { font-size: .5rem; }
  .preview-stage { min-height: 430px; margin-top: 16px; padding: 38px 16px; }
  .stage-label { font-size: .5rem; }
  .stage-label-top { top: 15px; right: 17px; }
  .stage-label-bottom { bottom: 15px; left: 17px; }
  .preview-footer { padding-inline: 4px; font-size: .54rem; }
  .card-preview { width: min(100%, 360px); }
  .card-preview[data-size="youtube"] { width: min(100%, 500px); }
  .card-preview[data-size="cover"] { width: min(100%, 330px); }
  .card-preview[data-size="story"] { width: min(100%, 240px); }
  .site-footer { padding-top: 25px; }
}
@media (max-width: 420px) {
  .brand-copy small { font-size: .57rem; }
  .brand-mark { width: 42px; height: 42px; }
  .preview-lock { display: none; }
  .card-inner { inset: 7.5%; padding-inline: 7%; }
}
