/* ============================================================
   سيركل Circl — automation & AI agency · brand: sand/ink/clay/saffron
   Mobile-first (375px), RTL, Alexandria headlines+body + Outfit latin
   ============================================================ */

:root {
  --sand: #F5EEE4;
  --ink: #1C1512;
  --clay: #B9472A;
  --clay-dark: #A33D23;
  --clay-text: #B9472A;
  --line: #E4D9CB;
  --saffron: #F2B23E;
  --muted: #6E5A50;
  --hairline: #E4D9CB;
  --paper: #FFFFFF;
  --ink-soft: #4A3A33;
  --accent-on-dark: #F2B23E;
  --error: #B3402B;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: 'Alexandria', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: 'Alexandria', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
}

p { margin: 0; }

ul, ol { margin: 0; padding: 0; }

/* author display rules (e.g. .quiz-success flex) must never beat the hidden attribute */
[hidden] { display: none !important; }

a { color: var(--clay); text-decoration: none; }
a:hover { color: var(--clay-dark); }

:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- brand signature: key word + closing dot ---------- */

.kw {
  color: var(--clay);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.35em;
}

.kw-ink {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.35em;
}

.node {
  display: inline-block;
  width: 0.14em;
  height: 0.14em;
  background: var(--clay);
  border-radius: 50%;
  margin-inline-start: 0.14em;
}

.eyebrow {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--clay-text);
  margin: 0 0 14px;
  /* page is RTL: the kicker sits on the same start edge (right) as the headline */
  text-align: right;
  text-wrap: balance;
}

/* Arabic half of a kicker: readable, no letterspacing (breaks letter joins) */
.eyebrow-ar {
  font-family: 'Alexandria', 'Segoe UI', Tahoma, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- ring decor (from the Circl mark) ----------
   Corner bleeds only where clear of text is guaranteed (>=880px);
   on phones they are dropped rather than risk sitting behind text.
   Every variant fades toward the content side with a mask so the
   ring never shows a hard-cropped edge (always both -webkit-
   mask-image and mask-image). */
.dots {
  display: none;
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  aspect-ratio: 1 / 1;
  height: auto;
}

/* the ghost rings inherit their color from context */
.hero .dots, .section .dots { color: var(--clay); }
.site-footer .dots { color: var(--sand); }

/* keep all real content above the decorative layer */
.hero .container, .section .container, .site-footer .container { position: relative; z-index: 1; }
.hero-inner { z-index: 1; }

section[id], footer[id] { scroll-margin-top: 80px; }

/* ---------- skip link ---------- */

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--sand);
  padding: 10px 18px;
  z-index: 60;
}
.skip-link:focus { inset-inline-start: 8px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--sand);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-block: 12px;
}

.brand img { height: 46px; width: auto; }

.nav { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; }
.nav a {
  display: block;
  padding: 7px 11px;
  font-size: 0.92rem;
  color: var(--ink);
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--clay-dark); border-bottom-color: var(--line); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}

.dots--hero {
  left: -110px;
  bottom: -110px;
  width: 420px;
  opacity: 0.09;
  /* solid bottom-left, fading away from the corner */
  -webkit-mask-image: linear-gradient(to top left, #000 52%, transparent 82%);
          mask-image: linear-gradient(to top left, #000 52%, transparent 82%);
}

/* second hero bleed, top-right: a smaller ring, tightly masked so it is
   fully transparent well before the eyebrow row (~25px of gradient) */
.dots--hero-tr {
  inset-inline-start: -70px;
  top: -60px;
  width: 200px;
  opacity: 0.08;
  -webkit-mask-image: linear-gradient(to bottom left, #000 20%, transparent 48%);
          mask-image: linear-gradient(to bottom left, #000 20%, transparent 48%);
}

.hero-inner { position: relative; padding-block: 72px 84px; max-width: 780px; }

/* faint signature watermark in the hero's empty (inline-end) side */
.hero-mark {
  display: none;
  position: absolute;
  inset-inline-end: clamp(24px, 6vw, 88px);
  top: 96px;
  width: clamp(180px, 22vw, 320px);
  opacity: 0.06;
  color: var(--clay);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.hero-title {
  font-size: clamp(2.5rem, 7.5vw, 4.3rem);
  line-height: 1.35;
  margin: 0 0 18px;
}

.hero-sub {
  font-size: clamp(1.1rem, 2.8vw, 1.4rem);
  color: var(--ink-soft);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 14px 24px;
  flex-wrap: wrap;
  margin-top: 38px;
}

.link-quiet {
  font-size: 0.95rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.link-quiet:hover { color: var(--clay-dark); border-bottom-color: var(--clay); }

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  padding: 12px 30px;
  border: 1px solid var(--clay);
  background: var(--clay);
  color: #FFFFFF;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
/* hover = small underline flourish, no fill change */
.btn::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  background: var(--paper);
  transform: translateX(-50%);
  transition: width 0.2s;
}
.btn:hover, .btn:focus-visible { background: var(--clay); border-color: var(--clay); color: #FFFFFF; }
.btn:hover::after, .btn:focus-visible::after { width: 22px; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost::after { background: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--sand); }

.btn--start { padding: 9px 26px; font-size: 0.95rem; }

/* ---------- sections ---------- */

.section {
  position: relative;
  overflow: hidden;
  padding-block: 72px;
  border-bottom: 1px solid var(--hairline);
}

/* ring divider: thin warm trace leaving the section's start edge,
   ending in a small clay ring, floating just above the hairline */
.section::after,
.hero::after {
  content: '';
  position: absolute;
  bottom: 4px;
  inset-inline-start: 0;
  width: 188px;
  height: 12px;
  pointer-events: none;
  background:
    radial-gradient(circle at 16px 6px, transparent 0 2.6px, var(--clay) 2.6px 4px, transparent 4px) no-repeat,
    linear-gradient(var(--line), var(--line)) no-repeat 14px 5px / 174px 2px;
}

.section-head { max-width: 660px; margin-bottom: 48px; }

.section-title { font-size: clamp(1.85rem, 4.8vw, 2.6rem); margin-bottom: 12px; }

.section-sub { color: var(--muted); }

.badge {
  display: inline-block;
  background: var(--saffron);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 2px 12px;
  border-radius: 2px;
  margin-inline-start: 6px;
}

/* ---------- services cards ---------- */

.cards { display: grid; gap: 20px; }

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-index {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--clay-text);
}

.card-tag {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -10px;
}

.card-title { font-size: 1.45rem; }

.card-desc { font-size: 0.98rem; color: var(--ink-soft); }

.card-for {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}
.card-for-label { color: var(--clay-text); font-weight: 500; margin-inline-end: 6px; }

.card-link { font-weight: 500; font-size: 0.95rem; }
.card-link::after { content: '←'; margin-inline-start: 7px; font-family: 'Outfit', 'Segoe UI', sans-serif; }

/* ---------- pricing ---------- */

/* left-edge ring, sits clear of the plan grid; radial mask fades the
   top/bottom/right edges so no hard crop is visible */
.dots--pricing {
  left: -50px;
  top: 120px;
  width: 170px;
  opacity: 0.09;
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 30% 50%, #000 40%, transparent 90%);
          mask-image: radial-gradient(ellipse 85% 70% at 30% 50%, #000 40%, transparent 90%);
}

/* bottom-right bleed on the services section */
.dots--services {
  right: -100px;
  bottom: -100px;
  width: 380px;
  opacity: 0.09;
  -webkit-mask-image: linear-gradient(to top left, #000 52%, transparent 82%);
          mask-image: linear-gradient(to top left, #000 52%, transparent 82%);
}

/* top-left bleed on the how-we-work section */
.dots--how {
  left: -55px;
  top: -55px;
  width: 160px;
  opacity: 0.09;
  -webkit-mask-image: linear-gradient(to bottom right, #000 45%, transparent 80%);
          mask-image: linear-gradient(to bottom right, #000 45%, transparent 80%);
}

.price-group { margin-bottom: 60px; position: relative; }
.price-group:last-of-type { margin-bottom: 0; }

.price-group-head {
  display: flex;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
  margin-bottom: 24px;
}
.price-group-head h3 { font-size: 1.55rem; }

.price-group-tag {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.plans { display: grid; gap: 18px; }

.plan {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--line);
  border-radius: 2px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* closing dot on the card's top trace */
.plan::before {
  content: '';
  position: absolute;
  top: -5px;
  inset-inline-start: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay);
}

.plan--featured { border-top: 2px solid var(--clay); }

/* featured package: bigger ringed dot badge on the trace */
.plan--featured::before {
  top: -9px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--clay);
}

.plan-name {
  font-family: 'Alexandria', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 0;
}

.plan-num {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 2.45rem;
  line-height: 1.05;
}

.plan-unit { font-size: 0.85rem; color: var(--muted); }

.plan-sub-price { font-size: 0.85rem; color: var(--muted); margin-top: -6px; }

.plan-desc { font-size: 0.95rem; color: var(--ink-soft); }

.plan-note {
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--saffron);
  padding: 5px 10px;
  align-self: flex-start;
  border-radius: 2px;
}

.plan .btn--start { margin-top: auto; align-self: flex-start; }

.plan-subscribe { font-size: 0.85rem; }

.pricing-note {
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--muted);
  border-inline-start: 2px solid var(--line);
  padding-inline-start: 14px;
}

/* ---------- how we work ---------- */

.steps { list-style: none; position: relative; display: grid; gap: 36px; }

.step-index {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--clay-text);
  margin-bottom: 8px;
}

.step-title { font-size: 1.25rem; margin-bottom: 6px; }

.step-desc { font-size: 0.95rem; color: var(--muted); }

/* vertical trace on mobile */
.steps::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  inset-inline-start: 5px;
  width: 2px;
  background: var(--line);
}
.step { position: relative; padding-inline-start: 32px; }
/* dot with a sand ring so it reads as a junction on the trace */
.step::before {
  content: '';
  position: absolute;
  top: 7px;
  inset-inline-start: 0;
  width: 8px;
  height: 8px;
  border: 2px solid var(--sand);
  border-radius: 50%;
  background: var(--clay);
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--sand);
  padding-block: 64px 40px;
}

.dots--footer {
  left: -100px;
  bottom: -100px;
  width: 380px;
  opacity: 0.08;
  /* solid bottom-left, fading away from the corner */
  -webkit-mask-image: linear-gradient(to top left, #000 52%, transparent 82%);
          mask-image: linear-gradient(to top left, #000 52%, transparent 82%);
}

.footer-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-logo { width: clamp(170px, 18vw, 220px); height: auto; }

.footer-name { font-size: 1.05rem; font-weight: 500; }

.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 8px; }
.footer-links a { color: var(--accent-on-dark); }
.footer-links a:hover { color: var(--line); }
.footer-links span { font-family: 'Outfit', 'Segoe UI', sans-serif; font-weight: 400; font-size: 0.9em; }

.footer-meta {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 238, 228, 0.62);
  margin-top: 10px;
  text-align: right;
}

.footer-copy { font-size: 0.8rem; color: rgba(245, 238, 228, 0.62); margin-top: 4px; }

/* ---------- questionnaire dialog ---------- */

.quiz {
  width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 960px);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--sand);
  color: var(--ink);
  padding: 0;
  margin: auto;
  overflow: auto;
}

.quiz::backdrop { background: rgba(28, 21, 18, 0.55); }

.quiz-sheet { padding: 26px 24px 26px; }

.quiz-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.quiz-bar .eyebrow { margin: 0; }

.quiz-close {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 2px;
}
.quiz-close:hover { color: var(--clay-dark); }

.quiz-head { margin: 18px 0 22px; }

.quiz-title { font-size: 1.65rem; }

.quiz-package {
  font-size: 0.95rem;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
  margin-top: 8px;
}
.quiz-package strong { color: var(--ink); font-weight: 600; }

.qfield { margin-bottom: 20px; }

.qlabel { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 8px; }
.qreq { color: var(--clay-text); margin-inline-start: 3px; }

.qcontrol {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 10px 14px;
}
textarea.qcontrol { min-height: 96px; resize: vertical; line-height: 1.8; }
.qcontrol:focus { outline: 2px solid var(--clay); outline-offset: 0; border-color: var(--clay); }
.qcontrol--ltr { direction: ltr; text-align: left; }

fieldset.qgroup {
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--paper);
  padding: 14px 16px;
}
fieldset.qgroup legend { font-weight: 500; font-size: 0.95rem; padding-inline-end: 10px; }

.qopts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.qopt { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.qopt input { accent-color: var(--clay); width: 17px; height: 17px; margin: 0; }

.qoptional-title {
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
  padding-top: 18px;
  margin-bottom: 18px;
}

.qerror { color: var(--error); font-size: 0.82rem; margin: 6px 0 0; }
.qfield.is-invalid .qcontrol,
.qfield.is-invalid fieldset.qgroup { border-color: var(--error); }

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
}
.quiz-hint { font-size: 0.84rem; color: var(--muted); }

.quiz-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding-block: 26px;
}
.quiz-success-msg { font-family: 'Alexandria', 'Segoe UI', Tahoma, sans-serif; font-weight: 700; font-size: 1.5rem; }

/* ---------- responsive ---------- */

@media (min-width: 680px) {
  .plans { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards .card:last-child { grid-column: 1 / -1; }
}

@media (min-width: 880px) {
  .dots { display: block; }

  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards .card:last-child { grid-column: auto; }

  .steps { grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .steps::before {
    top: 5px;
    bottom: auto;
    inset-inline: 6px;
    width: auto;
    height: 2px;
  }
  .step { padding-inline-start: 0; padding-top: 34px; }
  .step::before { top: 0; inset-inline-start: 0; }
}

@media (min-width: 980px) {
  .plans { grid-template-columns: repeat(3, 1fr); }
  .plans--two { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: 88px; }
  .hero-inner { padding-block: 96px 110px; }
}

/* the top-right hero bleed only earns its place once a real side gutter exists */
@media (min-width: 880px) and (max-width: 1079px) {
  .dots--hero-tr { display: none; }
}
@media (min-width: 1080px) {
  .dots--hero-tr { display: block; }
}

/* watermark appears only when the hero's empty side is wide enough to keep it clear of text */
@media (min-width: 1160px) {
  .hero-mark { display: block; }
}

/* keep the tracked-caps kickers inside 320px viewports */
@media (max-width: 480px) {
  .eyebrow { font-size: 0.7rem; letter-spacing: 0.18em; }
  .eyebrow-ar { font-size: 0.9rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
