/* Clickd public site. Colors mirror src/theme/colors.ts. Dark only.
   Logical properties only, so the same rules serve English and Arabic. */

@font-face {
  font-family: Poppins;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/poppins-400.woff') format('woff');
}
@font-face {
  font-family: Poppins;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/poppins-600.woff') format('woff');
}
@font-face {
  font-family: Poppins;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/poppins-700.woff') format('woff');
}
@font-face {
  font-family: Poppins;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/poppins-800.woff') format('woff');
}
@font-face {
  font-family: Cairo;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/cairo-400.woff') format('woff');
}
@font-face {
  font-family: Cairo;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/cairo-600.woff') format('woff');
}
@font-face {
  font-family: Cairo;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/cairo-700.woff') format('woff');
}
@font-face {
  font-family: Cairo;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/cairo-800.woff') format('woff');
}

:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --line: #2a2a2c;
  --dashed: #3a3a3d;
  --ink: #f5f3ef;
  --muted: #b3afa8;
  --accent: #ff5a36;
  --on-accent: #141414;
  --danger: #ff6b6b;
  --gutter: clamp(16px, 4vw, 40px);
  --font: Poppins, system-ui, sans-serif;
  --tracking-display: -0.03em;
  --body-size: 1rem;
  --body-leading: 1.7;
  --display-leading: 1.06;
  --heading-leading: 1.25;
}

html:lang(ar) {
  --font: Cairo, system-ui, sans-serif;
  --tracking-display: 0; /* Tracking breaks joined Arabic letters. */
  --body-size: 1.125rem;
  --body-leading: 1.85;
  --display-leading: 1.3;
  --heading-leading: 1.45;
}

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

html {
  background: var(--bg);
  scrollbar-color: var(--dashed) var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--body-size);
  line-height: var(--body-leading);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: calc(38rem + 2 * var(--gutter));
}

html:lang(ar) .narrow {
  max-width: calc(34rem + 2 * var(--gutter));
}

/* A word in the other language keeps its own face (language switch, not-found page). */
[lang='ar'] {
  font-family: Cairo, system-ui, sans-serif;
}

[lang='en'] {
  font-family: Poppins, system-ui, sans-serif;
}

/* Header ------------------------------------------------------------------ */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.wordmark {
  direction: ltr;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-family: Poppins, system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.wordmark span,
.closing-mark span {
  color: var(--accent);
}

.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 160ms ease-out;
}

.lang:hover {
  border-color: var(--muted);
  color: var(--ink);
}

/* Home: hero --------------------------------------------------------------- */

.hero-chip {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-block-start: clamp(24px, 4vw, 48px);
  padding-inline: clamp(20px, 4vw, 48px);
  border-radius: 22px;
  background: var(--accent);
  color: var(--on-accent);
}

.hero-chip h1 {
  font-size: clamp(1.875rem, 9.4vw, 6rem);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  line-height: var(--display-leading);
}

.hero-chip h1 span {
  display: block;
}

.hero-chip ::selection {
  background: var(--on-accent);
  color: var(--accent);
}

.lens {
  --lens: clamp(168px, 27vw, 320px);
  align-self: flex-end;
  flex: none;
  width: var(--lens);
  height: auto;
  /* The chip's edge cuts the mark through its lower tip, clear of the dot, at every width. */
  margin-block: clamp(8px, 1.5vw, 16px) calc(var(--lens) * -0.263);
  fill: none;
  stroke: var(--on-accent);
}

.lens path {
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: lens-draw 1200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lens circle {
  fill: var(--on-accent);
  stroke: none;
}

@keyframes lens-draw {
  from {
    stroke-dashoffset: 0.72;
  }
}

.soon {
  padding-block-start: 16px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Home: sections ----------------------------------------------------------- */

.section {
  padding-block-start: clamp(72px, 11vw, 136px);
}

.section h2 {
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  line-height: var(--heading-leading);
  text-wrap: balance;
}

.split {
  display: grid;
  gap: 32px;
}

.lede {
  max-width: 34rem;
  padding-block-start: 16px;
  color: var(--muted);
  font-size: 1.0625rem;
}

html:lang(ar) .lede {
  font-size: 1.1875rem;
}

.rows {
  padding: 0;
  list-style: none;
}

.rows li {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  border-block-end: 1px solid var(--line);
  font-weight: 700;
}

.rows i {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.c-blue {
  background: #1570ef;
}
.c-green {
  background: #12805c;
}
.c-yellow {
  background: #ffc400;
}
.c-violet {
  background: #7a3fd1;
}

.caption {
  padding-block-start: 12px;
  color: var(--muted);
  font-size: 0.75rem;
}

.how {
  display: grid;
  gap: 28px;
  margin-block-start: 32px;
  padding: 0;
  list-style: none;
}

.how li {
  padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
}

.how b {
  display: block;
  padding-block-end: 4px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: var(--heading-leading);
}

.closing-mark {
  direction: ltr;
  display: block;
  padding-block-start: clamp(72px, 11vw, 136px);
  color: var(--ink);
  font-family: Poppins, system-ui, sans-serif;
  font-size: min(26vw, 21rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-align: center;
  white-space: nowrap;
}

/* Documents ---------------------------------------------------------------- */

.doc {
  padding-block: 24px 16px;
}

.doc h1 {
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  line-height: var(--heading-leading);
}

.meta {
  padding-block-start: 6px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.draft {
  margin-block-start: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.draft strong {
  font-weight: 800;
}

.draft ::selection,
.draft::selection {
  background: var(--on-accent);
  color: var(--accent);
}

.intro {
  padding-block-start: 24px;
}

.toc {
  margin-block-start: 24px;
  border-block: 1px solid var(--line);
}

.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toc[open] svg {
  transform: rotate(180deg);
}

.toc ol {
  padding: 0 0 12px;
  list-style: none;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
}

.doc section {
  padding-block-start: 40px;
  scroll-margin-block-start: 8px;
}

.doc h2 {
  padding-block-end: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: var(--heading-leading);
}

.doc section p + p,
.doc section ul + p,
.doc section ol + p,
.doc section dl + p,
.doc section p + ul,
.doc section p + ol,
.doc section p + dl {
  margin-block-start: 12px;
}

.doc section > ul {
  padding-inline-start: 1.25em;
}

.doc section > ul li + li {
  margin-block-start: 6px;
}

.doc section > ul li::marker {
  color: var(--accent);
}

.facts > div {
  padding-block: 12px;
  border-block-end: 1px solid var(--line);
}

.facts > div:first-child {
  border-block-start: 1px solid var(--line);
}

.facts dt {
  font-weight: 700;
}

.facts dd {
  color: var(--muted);
}

.gap {
  padding: 1px 7px;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.steps {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding-block: 8px;
  border-block-end: 1px solid var(--line);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}

.steps strong {
  font-weight: 700;
}

.steps .danger {
  color: var(--danger);
}

/* Footer ------------------------------------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin-block-start: clamp(48px, 7vw, 88px);
  padding-block: 12px 20px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}

.foot a:hover,
.foot a[aria-current='page'] {
  color: var(--ink);
}

/* Not found ---------------------------------------------------------------- */

.missing {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 60dvh;
}

.missing h1 {
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 800;
  line-height: var(--heading-leading);
}

/* Wider screens ------------------------------------------------------------ */

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }

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

  .facts > div {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .lens path {
    animation: none;
  }

  .lang,
  .toc svg {
    transition: none;
  }
}
