@font-face {
  font-family: "Vazirmatn RD";
  src: url("/fonts/Vazirmatn-RD-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #142033;
  --muted: #69758a;
  --line: #dce2eb;
  --paper: #f5f7fa;
  --white: #ffffff;
  --orange: #ff7444;
  --orange-deep: #e95624;
  --navy: #1b2c45;
  --blue: #2b6ff7;
  font-family: "Vazirmatn RD", Tahoma, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #eef2f6;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 13%, rgba(43, 111, 247, .08), transparent 23rem),
    radial-gradient(circle at 8% 22%, rgba(255, 116, 68, .1), transparent 20rem),
    #eef2f6;
}

button, input { font: inherit; }
button { color: inherit; }

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

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(74, 89, 111, .18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  direction: ltr;
  letter-spacing: -.03em;
}

.brand-mark {
  width: 37px;
  height: 37px;
  position: relative;
  display: grid;
  place-items: center;
  transform: rotate(-8deg);
}

.brand-mark i {
  position: absolute;
  width: 26px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #eef2f6;
}
.brand-mark i:nth-child(1) { transform: translate(-5px, -6px); }
.brand-mark i:nth-child(2) { transform: translate(1px, 0); border-color: var(--orange); }
.brand-mark i:nth-child(3) { transform: translate(6px, 6px); }

.brand > span:last-child { display: flex; align-items: baseline; gap: 4px; }
.brand b { font-size: 18px; font-weight: 900; }
.brand em { font-size: 18px; font-style: normal; font-weight: 400; color: var(--orange-deep); }

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #d4dce7;
  border-radius: 99px;
  color: #647287;
  background: rgba(255, 255, 255, .54);
  font-size: 12px;
}
.privacy-badge span { width: 7px; height: 7px; border-radius: 50%; background: #37af74; box-shadow: 0 0 0 4px rgba(55, 175, 116, .12); }

.hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 64px;
  padding: 60px 54px 52px;
  direction: ltr;
}

.hero-copy { direction: rtl; text-align: right; }
.kicker { color: #536179; font-size: 13px; font-weight: 700; margin-bottom: 18px; }
.kicker span { display: inline-block; margin-left: 9px; padding: 5px 8px; border-radius: 5px; background: var(--ink); color: #fff; font-size: 10px; letter-spacing: .09em; }
.hero h1 { margin: 0; color: var(--ink); font-size: clamp(44px, 6vw, 77px); line-height: 1.12; letter-spacing: -.075em; font-weight: 900; }
.hero h1 mark { position: relative; color: var(--orange-deep); background: transparent; }
.hero h1 mark::after { content: ""; position: absolute; height: 7px; left: 2px; right: 2px; bottom: -5px; background: var(--orange); border-radius: 50%; transform: rotate(-1.5deg); opacity: .62; }
.hero-copy > p { max-width: 560px; margin: 28px 0 0 auto; color: var(--muted); font-size: 16px; line-height: 2; }

.archive-visual { position: relative; height: 300px; display: grid; place-items: center; perspective: 900px; }
.orbit { position: absolute; border: 1px dashed #aeb9c9; border-radius: 50%; opacity: .65; }
.orbit-one { width: 310px; height: 205px; transform: rotate(-14deg); }
.orbit-two { width: 250px; height: 295px; transform: rotate(58deg); }
.stack-card { position: absolute; width: 235px; height: 276px; border: 2px solid var(--navy); border-radius: 12px; background: #fff; box-shadow: 0 18px 45px rgba(37, 53, 77, .14); padding: 24px 22px; }
.card-back { transform: rotate(-15deg) translate(-42px, 6px); background: #cbdcff; }
.card-mid { transform: rotate(10deg) translate(39px, -4px); background: #ffe1d5; }
.card-front { transform: rotate(-2deg); }
.stack-card > span { display: block; height: 8px; margin-top: 18px; border-radius: 99px; background: #d8e0eb; }
.stack-card > span:nth-of-type(2) { width: 82%; }
.stack-card > span:nth-of-type(3) { width: 91%; }
.stack-card > span.short { width: 55%; }
.mini-head { display: flex; align-items: center; gap: 9px; padding-bottom: 14px; border-bottom: 1px solid #e1e6ee; font-size: 10px; letter-spacing: .07em; }
.mini-head i { width: 26px; height: 26px; border-radius: 8px; background: var(--orange); }
.card-front strong { position: absolute; left: 18px; bottom: 17px; padding: 7px 9px; color: #fff; background: var(--orange); border-radius: 5px; font: 800 11px/1 Arial; }

.workspace, .preview-section {
  position: relative;
  margin-bottom: 30px;
  padding: 34px;
  border: 1px solid #d5dce6;
  border-radius: 22px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 18px 60px rgba(40, 55, 78, .08);
}

.workspace-heading { display: flex; align-items: flex-start; gap: 14px; }
.step-number { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: var(--ink); font: 800 13px/1 Arial; }
.workspace-heading h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.04em; }
.workspace-heading p { margin: 0; color: var(--muted); font-size: 13px; }

#archive-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 26px; }
.url-field { height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 1.5px solid #cfd7e3; border-radius: 13px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.url-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(43, 111, 247, .1); }
.link-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--blue); background: #eaf1ff; font-weight: 800; }
.url-field input { min-width: 0; flex: 1; border: 0; outline: 0; color: #26344a; background: transparent; text-align: left; font: 14px/1.3 Consolas, "Courier New", monospace; }
.url-field input::placeholder { color: #9da8b8; }
.clear-button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f0f3f7; color: #748196; cursor: pointer; font-size: 21px; line-height: 1; }
.clear-button:hover { background: #e3e8ef; }
.primary-button { min-width: 185px; height: 58px; display: flex; align-items: center; justify-content: center; gap: 20px; border: 0; border-radius: 13px; color: #fff; background: var(--orange); box-shadow: 0 10px 22px rgba(233, 86, 36, .2); cursor: pointer; font-weight: 800; transition: transform .15s, background .15s; }
.primary-button:hover { transform: translateY(-1px); background: var(--orange-deep); }
.primary-button:disabled, .download-button:disabled { cursor: wait; opacity: .65; transform: none; }
.primary-button i { font-size: 21px; font-style: normal; }

.status, .error-box { margin-top: 22px; padding: 15px 18px; border-radius: 12px; display: flex; align-items: center; gap: 13px; }
.status { color: #264065; background: #eef4ff; border: 1px solid #d2e0ff; }
.status b, .status span, .error-box b, .error-box p { display: block; }
.status span { margin-top: 3px; color: #70809a; font-size: 12px; }
.spinner { width: 24px; height: 24px; flex: 0 0 auto; border: 3px solid #bcd0f6; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { color: #8a2f1f; background: #fff1ed; border: 1px solid #ffc9b8; }
.error-box > span { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--orange-deep); font-weight: 900; }
.error-box p { margin: 3px 0 0; font-size: 12px; }
[hidden] { display: none !important; }

.preview-section { padding: 34px; }
.preview-topline { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.ready-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #cfe5d8; border-radius: 99px; color: #2f7651; background: #f0faf4; font-size: 11px; }
.ready-pill i { width: 7px; height: 7px; border-radius: 50%; background: #39ad73; }
.preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.chat-preview { overflow: hidden; border: 1px solid #d9e0e9; border-radius: 16px; background: #f7f9fb; }
.chat-titlebar { min-height: 67px; display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid #dde3eb; background: #fff; }
.chat-titlebar > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.chat-titlebar b, .chat-titlebar small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-titlebar b { max-width: 520px; font-size: 14px; }
.chat-titlebar small { color: #7d899a; font-size: 10px; margin-top: 3px; }
.chat-logo { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--orange); font: 800 10px Arial; }
.window-dots { color: #9ba6b5; letter-spacing: 3px; }
.messages { padding: 18px; display: grid; gap: 13px; }
.preview-message { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; }
.preview-message.user { direction: rtl; }
.preview-message.assistant { direction: rtl; }
.message-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: #34435a; font-size: 9px; font-weight: 800; }
.assistant .message-avatar { background: var(--orange); }
.message-bubble { width: fit-content; max-width: 88%; padding: 10px 13px; border: 1px solid #dfe4eb; border-radius: 4px 13px 13px 13px; background: #fff; box-shadow: 0 3px 10px rgba(30, 47, 70, .04); }
.user .message-bubble { background: #edf2f7; }
.message-bubble b { display: block; margin-bottom: 3px; color: #4e5c70; font-size: 9px; }
.message-bubble p { margin: 0; max-height: 6em; overflow: hidden; color: #2b374a; font-size: 11px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.attachment-tag { display: inline-block; margin-top: 7px; padding: 4px 7px; border-radius: 6px; color: #5a6577; background: #e8edf3; font-size: 9px; }
.more-messages { padding: 11px; border-top: 1px solid #e0e5ec; color: #778396; background: #fff; text-align: center; font-size: 11px; }

.export-card { padding: 22px; border-radius: 16px; color: #fff; background: var(--navy); box-shadow: 0 15px 35px rgba(27, 44, 69, .18); }
.export-label { display: block; color: #aebbd0; font-size: 10px; }
.pdf-icon { position: relative; width: 64px; height: 76px; margin: 18px auto 16px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 6px; transform: rotate(-3deg); }
.pdf-icon b { color: #fff; font: 900 13px Arial; }
.pdf-icon i { position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; background: var(--orange); clip-path: polygon(0 0, 100% 100%, 0 100%); }
.export-card h3 { margin: 0 0 18px; min-height: 42px; font-size: 15px; line-height: 1.55; text-align: center; }
.export-card dl { margin: 0 0 18px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); }
.export-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 11px; }
.export-card dt { color: #aebbd0; }
.export-card dd { margin: 0; color: #fff; }
.download-button { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-radius: 11px; color: #fff; background: var(--orange); cursor: pointer; text-align: right; transition: background .15s, transform .15s; }
.download-button:hover { background: var(--orange-deep); transform: translateY(-1px); }
.download-icon { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 9px; font-size: 19px; }
.download-button b, .download-button small { display: block; }
.download-button b { font-size: 11px; }
.download-button small { margin-top: 2px; color: rgba(255,255,255,.78); font-size: 8px; }
.export-note { margin: 13px 0 0; color: #aebbd0; font-size: 9px; line-height: 1.7; text-align: center; }

.print-frame {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 794px;
  height: 1123px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

footer { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid rgba(74, 89, 111, .18); color: #7f8a9b; font-size: 10px; }
footer span { direction: ltr; letter-spacing: .12em; }
footer p { margin: 0; }
footer p a { display: inline-block; margin-right: 8px; color: var(--orange-deep); font-weight: 700; text-decoration: none; }
footer p a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; padding: 48px 12px 36px; text-align: center; }
  .hero-copy { text-align: center; }
  .hero-copy > p { margin-right: auto; }
  .archive-visual { display: none; }
  .preview-grid { grid-template-columns: 1fr; }
  .export-card { display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; align-items: center; }
  .export-card .export-label { grid-column: 1 / -1; }
  .pdf-icon { margin: 0; }
  .export-card h3 { margin: 0; text-align: right; }
  .export-card dl, .download-button, .export-note { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 20px, 1180px); }
  .topbar { height: 72px; }
  .privacy-badge { display: none; }
  .hero { min-height: 340px; gap: 0; }
  .hero h1 { font-size: 45px; }
  .hero-copy > p { font-size: 14px; }
  .workspace, .preview-section { padding: 22px 16px; border-radius: 17px; }
  .workspace-heading h2 { font-size: 18px; }
  #archive-form { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .preview-topline { align-items: flex-start; }
  .ready-pill { display: none; }
  .messages { padding: 12px; }
  .message-bubble { max-width: 100%; }
  footer { padding: 22px 0; flex-direction: column; justify-content: center; text-align: center; }
}
