/* CV Peony: soft outside, sharp inside. Paper, ink and one terracotta accent. */
@font-face { font-family: "Cairo"; font-weight: 400; src: url(/vendor/fonts/cairo-400.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Cairo"; font-weight: 700; src: url(/vendor/fonts/cairo-700.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Fraunces"; font-weight: 400; src: url(/vendor/fonts/fraunces-400.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Fraunces"; font-weight: 600; src: url(/vendor/fonts/fraunces-600.ttf) format("truetype"); font-display: swap; }

:root {
  color-scheme: light;
  --paper: #F7F2EA;
  --ink: #1E1B18;
  --accent: #B4532A;
  /* derived from the three colours above */
  --accent-deep: #8F3F1D;
  --accent-soft: #F0DCCD;
  --card: #FCF9F3;
  --line: #E3D8C6;
  --soft: #EFE6D6;
  --muted: #5C544B;
  --radius: 18px;
  --serif: "Fraunces", "Cairo", Georgia, serif;
  --sans: "Cairo", system-ui, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
  position: relative;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-deep); }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.error { color: var(--accent-deep); font-weight: 700; }

/* the one organic shape in the background */
.blob-wrap { position: absolute; top: 0; left: 0; right: 0; height: 640px; overflow: hidden; z-index: -1; pointer-events: none; }
.blob {
  position: absolute;
  top: -140px;
  inset-inline-end: -160px;
  width: 620px;
  height: 560px;
  background: var(--accent-soft);
  border-radius: 58% 42% 63% 37% / 41% 55% 45% 59%;
  opacity: 0.75;
}

/* header */
.site-header { padding: 14px 0; }
.bar { max-width: 1060px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand img { display: block; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; }
.nav a:hover { color: var(--accent-deep); }

/* pill buttons */
.pill {
  font: inherit;
  font-weight: 700;
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.pill-solid { background: var(--accent); color: #fff; }
.pill-solid:hover:not(:disabled) { background: var(--accent-deep); border-color: var(--accent-deep); }
.pill-ghost { background: transparent; color: var(--accent-deep); }
.pill-ghost:hover { background: var(--accent-soft); }
.pill:disabled { opacity: 0.55; cursor: not-allowed; }
.pill:focus-visible, .drop:focus-within, summary:focus-visible, .raw:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }

/* hero */
.hero { padding-top: 36px; padding-bottom: 30px; }
.eyebrow { font-family: var(--serif); text-transform: uppercase; letter-spacing: 0.32em; font-size: 0.8rem; color: var(--accent-deep); margin: 0 0 10px; }
h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.25;
  margin: 0 0 14px;
  max-width: 18ch;
}
:lang(ar) h1 { line-height: 1.5; max-width: 20ch; }
.lead { font-size: 1.15rem; max-width: 60ch; color: var(--muted); margin: 0 0 26px; }

.upload { max-width: 640px; padding: 20px; }
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-line { font-weight: 700; }
.sample-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }

/* sections */
.section-title { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; margin: 0 0 14px; }
section.wrap { padding-top: 34px; padding-bottom: 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.steps p { margin: 0; color: var(--muted); }
.num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--serif); font-weight: 600; margin-bottom: 8px; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }

/* the text boxes: every line carries its own direction */
.raw {
  margin: 10px 0 0;
  padding: 12px 14px;
  max-height: 340px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0; /* inside content is sharp */
  font-size: 0.95rem;
  line-height: 1.7;
}
.ln { display: block; unicode-bidi: plaintext; text-align: start; overflow-wrap: anywhere; }
.ba-card { margin: 0; }
.ba-card figcaption { font-weight: 700; margin-bottom: 4px; }
.ba-after .raw { border-color: var(--accent); }

/* result */
.result { padding-bottom: 10px; }
.summary { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.score { font-family: var(--serif); font-weight: 600; font-size: 3.4rem; line-height: 1; color: var(--accent-deep); }
.score small { font-size: 1.1rem; color: var(--muted); margin-inline-start: 4px; }
.score-label { margin: 6px 0 0; font-weight: 700; }
.score-block p { margin: 0; }
.meters { flex: 1; min-width: 240px; display: grid; gap: 10px; }
.meter { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; align-items: center; font-size: 0.95rem; }
.meter i { display: block; height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.meter b { display: block; height: 100%; background: var(--accent); border-radius: 999px; width: 0; }
.meter em { font-style: normal; font-weight: 700; text-align: end; }
.facts { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 18px; margin: 4px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.disclaimer { margin: 10px 4px 0; }
.notice h3 { font-size: 1.3rem; }
.issues { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.issues li { padding: 10px 12px; background: var(--paper); border-inline-start: 4px solid var(--line); }
.issues li.bad { border-inline-start-color: var(--accent); }
.issues li.warn { border-inline-start-color: var(--accent); border-inline-start-style: dotted; }
.issues li.ok { border-inline-start-color: var(--ink); }

/* the resume preview: a real sheet of paper */
.paper-wrap { margin-top: 14px; display: flex; justify-content: center; background: var(--soft); border-radius: 12px; padding: 22px 12px; }
.paper {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 480px;
  overflow: hidden;
  padding: 30px 32px;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 1px 2px rgba(30, 27, 24, 0.1), 0 14px 30px -14px rgba(30, 27, 24, 0.35);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.5;
  color: #111;
}
.paper::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(rgba(255,255,255,0), #fff 78%); }
.paper::before {
  content: attr(data-watermark);
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 54px; letter-spacing: 0.12em;
  color: var(--accent); opacity: 0.12; transform: rotate(-24deg); pointer-events: none; z-index: 2;
}
.p-name { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.p-contact { color: #444; font-size: 10px; }
.p-h { font-size: 13px; font-weight: 700; margin: 10px 0 2px; }
.paper .ln { margin-bottom: 1px; }

.cta { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; }
.price { font-family: var(--serif); font-weight: 600; font-size: 1.8rem; margin: 0; }

/* privacy band with the wave edge */
.band { background: var(--soft); margin-top: 36px; }
.wave { display: block; width: 100%; height: 40px; fill: var(--paper); transform: translateY(-1px); }
.privacy { padding-top: 10px; padding-bottom: 30px; }
.privacy p { max-width: 62ch; margin: 0 0 8px; }

.faq { padding-bottom: 40px; }
.faq details { margin-bottom: 10px; padding: 14px 20px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 24px 0 36px; }
.foot-in { max-width: 1060px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.foot-logo { display: block; }
.foot-links { display: flex; gap: 20px; flex: 1; }
.foot-links a { color: var(--muted); }
.foot-copy { margin: 0; color: var(--muted); font-family: var(--serif); }

/* legal pages */
.legal { max-width: 760px; padding-bottom: 40px; }
.legal h1 { font-size: 2.2rem; }
.legal h2 { font-size: 1.15rem; margin: 26px 0 4px; }
.legal p { margin: 0 0 8px; }
.todo-field { color: var(--accent-deep); background: var(--accent-soft); border: 1px dashed var(--accent); padding: 8px 12px; border-radius: 10px; font-weight: 700; }
.back { display: inline-block; margin: 8px 0 10px; }

@media (max-width: 640px) {
  .nav { gap: 12px; font-size: 0.9rem; }
  .meter { grid-template-columns: 88px 1fr 40px; }
  .paper { height: 420px; padding: 22px; }
  .blob { width: 420px; height: 380px; inset-inline-end: -140px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* score explanation and designer-mode download */
.how-score { margin-top: 12px; }
.how-score summary { cursor: pointer; font-weight: 700; }
.how-score h4 { margin: 14px 0 4px; font-size: 1rem; }
.how-score ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; }
.how-score li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; background: var(--paper); border-inline-start: 3px solid var(--line); }
.how-score li b { white-space: nowrap; }
.how-score li.lost { border-inline-start-color: var(--accent); }
.how-score .calc { margin-top: 12px; padding: 10px 12px; background: var(--soft); font-weight: 700; }
.dev-dl { border-top: 1px dashed var(--line); padding-top: 10px; width: 100%; }
.dl-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- blocks: the lines we read, editable ---- */
.blocks { margin-top: 16px; }
.blk-page { margin-top: 12px; }
.blk-page h4 { margin: 0 0 8px; font-family: var(--serif); }
.blk { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.blk input[type="text"] { flex: 1; min-width: 0; font: inherit; font-size: 0.92rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.blk input[type="text"]:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.blk.off input[type="text"] { text-decoration: line-through; opacity: 0.5; background: var(--soft); }
.kind { font-size: 0.72rem; background: var(--accent-soft); color: var(--accent-deep); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pill.small { padding: 5px 14px; font-size: 0.82rem; }

/* ---- design and method options ---- */
.opts { width: 100%; display: grid; gap: 10px; }
.opt-group { border: 0; padding: 0; margin: 0; }
.opt-group legend { font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 8px; background: #fff; cursor: pointer; font-size: 0.86rem; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chip:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.sw { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); background: #fff; display: inline-block; position: relative; flex: none; }
.sw-rule::after { content: ""; position: absolute; inset: 11px 2px auto 2px; height: 2px; background: var(--accent); }
.sw-band { background: linear-gradient(var(--accent) 0 38%, #fff 38%); }
.sw-side { background: linear-gradient(90deg, var(--accent) 0 26%, #fff 26%); }
.mode { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; font-size: 0.88rem; cursor: pointer; }
.mode input { margin-top: 5px; accent-color: var(--accent); }
.opt-note { margin: 0; max-width: 46ch; }
.photo-row { display: grid; gap: 6px; justify-items: start; }
.photo-title { font-weight: 700; font-size: 0.9rem; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* template looks in the HTML preview (the PDF draws the same ideas) */
.paper.tpl-rule .p-h, .paper.tpl-band .p-h { border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.paper.tpl-rule .p-h, .paper.tpl-side .p-h { color: var(--accent-deep); }
.paper.tpl-band { padding-top: 0; }
.paper.tpl-band .p-head { background: var(--accent); margin: 0 -32px 8px; padding: 22px 32px 10px; }
.paper.tpl-band .p-name, .paper.tpl-band .p-contact { color: #fff; }
.paper.tpl-side { border-inline-start: 9px solid var(--accent); }
.p-head { display: flex; gap: 12px; align-items: flex-start; }
.p-id { flex: 1; min-width: 0; }
.p-photo { width: 56px; height: 56px; object-fit: cover; flex: none; position: relative; z-index: 1; }

/* ---- create from scratch ---- */
.builder { padding-bottom: 24px; }
.builder-grid { align-items: start; }
.b-form { display: grid; gap: 18px; }
.fgroup { display: grid; gap: 10px; }
.fgroup h4 { margin: 0; font-family: var(--serif); }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fld { display: grid; gap: 4px; font-size: 0.88rem; }
.fld span { font-weight: 700; }
.fld input, .fld textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.fld input:focus-visible, .fld textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.entries { display: grid; gap: 12px; }
.entry { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; justify-items: start; }
.entry .row2, .entry .fld { width: 100%; }
#b-buy, #b-close { margin-top: 8px; }

[hidden] { display: none !important; }

/* ---- pictures read by OCR ---- */
.imgs { margin-top: 16px; }
.img-result { margin-top: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; display: grid; gap: 8px; }
.img-result label { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; }
.img-result input[type="text"] { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.img-result input[type="checkbox"] { accent-color: var(--accent); }

/* ---- pages ---- */
.status { min-height: 0; }
.back { background: none; border: 0; color: var(--accent-deep); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; margin: 10px 0 0; }
.back:hover { text-decoration: underline; }
.page { padding-top: 6px; padding-bottom: 30px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 26px; }
.choice { display: grid; gap: 10px; justify-items: start; text-align: start; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); padding: 22px; }
.choice strong { font-family: var(--serif); font-size: 1.25rem; }
.choice span { color: var(--muted); }
.choice em { font-style: normal; margin-top: 4px; }
.choice:hover { border-color: var(--accent); }
.choice:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---- text boxes: big enough to read on a phone, growing with the text, direction from the text ---- */
.fld textarea, .blk textarea, .img-result textarea {
  font: inherit; font-size: 1rem; line-height: 1.5; width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  resize: none; overflow: hidden; text-align: start; unicode-bidi: plaintext;
}
.fld textarea:focus-visible, .blk textarea:focus-visible, .img-result textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.blk { align-items: flex-start; }
.blk textarea { flex: 1; min-width: 0; }
.blk.off textarea { text-decoration: line-through; opacity: 0.5; background: var(--soft); }
.fld { font-size: 0.95rem; }
@media (max-width: 640px) {
  .blk { flex-wrap: wrap; }
  .blk textarea { flex-basis: 100%; }
  .row2 { grid-template-columns: 1fr; }
  .fld textarea, .blk textarea { font-size: 1.05rem; padding: 12px 14px; }
}

/* ---- design swatches, colour dots, and the template looks in the preview (colour comes from --tc) ---- */
.chips { gap: 8px; }
.sw-long { background: linear-gradient(#fff 0 55%, var(--accent) 55% 70%, #fff 70%); }
.sw-center { background: linear-gradient(#fff 0 60%, var(--accent) 60% 70%, #fff 70%); border-style: double; }
.sw-block { background: linear-gradient(90deg, #fff 0 20%, var(--accent) 20% 40%, #fff 40%); }
.sw-tint { background: linear-gradient(#fff 0 45%, var(--accent-soft) 45% 75%, #fff 75%); }
.sw-frame { background: #fff; border: 2px solid var(--accent); }
.sw-topbar { background: linear-gradient(var(--accent) 0 18%, #fff 18%); }
.sw-dots { background: radial-gradient(circle at 25% 35%, var(--accent) 0 2px, transparent 3px), radial-gradient(circle at 25% 75%, var(--accent) 0 2px, transparent 3px), #fff; }
.sw-corner { background: linear-gradient(135deg, var(--accent) 0 35%, #fff 35%); }
.dot { position: relative; display: inline-flex; cursor: pointer; }
.dot input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.dot-sw { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); display: inline-block; }
.dot:has(input:checked) .dot-sw { box-shadow: 0 0 0 2px var(--ink); }
.dot:has(input:focus-visible) .dot-sw { box-shadow: 0 0 0 3px var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.paper { --tc: var(--accent); }
.paper.tpl-rule .p-h, .paper.tpl-band .p-h, .paper.tpl-frame .p-h, .paper.tpl-topbar .p-h { border-bottom: 1px solid var(--tc); padding-bottom: 1px; }
.paper.tpl-rule .p-h, .paper.tpl-side .p-h, .paper.tpl-long .p-h, .paper.tpl-center .p-h, .paper.tpl-frame .p-h, .paper.tpl-dots .p-h, .paper.tpl-corner .p-h { color: var(--tc); }
.paper.tpl-band .p-head { background: var(--tc); }
.paper.tpl-side { border-inline-start: 9px solid var(--tc); }
.paper.tpl-long .p-head { border-bottom: 2.5px solid var(--tc); padding-bottom: 5px; margin-bottom: 4px; }
.paper.tpl-center .p-head { border-bottom: 1.5px solid var(--tc); padding-bottom: 6px; justify-content: center; text-align: center; flex-direction: column; align-items: center; }
.paper.tpl-center .p-id .ln { text-align: center; }
.paper.tpl-center .p-head .p-photo { order: -1; }
.paper.tpl-block .p-name, .paper.tpl-topbar .p-name, .paper.tpl-corner .p-name { color: var(--tc); }
.paper.tpl-block .p-h { border-inline-start: 5px solid var(--tc); padding-inline-start: 6px; }
.paper.tpl-tint .p-h { background: color-mix(in srgb, var(--tc) 14%, #fff); padding: 1px 6px; }
.paper.tpl-frame { outline: 1.5px solid var(--tc); outline-offset: -12px; }
.paper.tpl-topbar { border-top: 9px solid var(--tc); }
.paper.tpl-dots { border-inline-start: 1.5px solid color-mix(in srgb, var(--tc) 22%, #fff); margin-inline-start: 0; }
.paper.tpl-dots .p-h::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--tc); margin-inline-end: 6px; }
.paper.tpl-corner { border-image: none; background: linear-gradient(135deg, var(--tc) 0 28px, #fff 28px); background-repeat: no-repeat; }
[dir="rtl"] .paper.tpl-corner { background: linear-gradient(225deg, var(--tc) 0 28px, #fff 28px); }
