/* ============================================================
   Repleo landing — light SaaS design layer.
   Tailwind handles layout; this file owns: tokens, the type
   system (Inter everywhere · Inter for small data labels (uppercase + tracking gives the label feel)
   labels only), the accent button system, check bullets,
   the chat UI (hero inbox + annotated conversation),
   annotation callouts, the math table, reveal system,
   FAQ accordion, RTL + a11y.

   Design system (mirrors tailwind.config in index.html):
     paper   #FAFAF8  warm canvas
     surface #FFFFFF  cards / panels
     line    #E6E4DE  hairlines — the structural material
     ink     #17181C  primary text
     muted   #5A6072  secondary text
     faint   #9A9FAE  captions, refs, source lines
     accent  #E14D0B  persimmon — primary buttons, ONE detail per section
     accent-deep #C74309 hover · accent-soft #FDEEE5 wash
   No gradients. No icons. No marketing filler. Minimal animation:
   subtle reveals. Structure = hairlines, whitespace, mono data.
   ============================================================ */

:root {
  --paper: #fafaf8;
  --surface: #ffffff;
  --line: #e6e4de;
  --line-deep: #c9c5ba; /* darkened hairline — secondary-button hover border */
  --ink: #17181c;
  --ink-soft: #3f4450;
  --muted: #5a6072;
  --faint: #9a9fae;
  --accent: #e14d0b;
  --accent-deep: #c74309;
  --accent-soft: #fdeee5;
  --shadow-btn: 0 4px 14px rgba(225, 77, 11, 0.25);
  --shadow-btn-hover: 0 6px 18px rgba(225, 77, 11, 0.32);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  text-rendering: optimizeLegibility;
  background: var(--paper);
  color: var(--ink);
}

/* ------------------------------------------------------------
   Type — Inter everywhere. Headlines 700, tight tracking.
   Small data labels: Inter, uppercase + tracking (no mono fonts anywhere).
   ------------------------------------------------------------ */
.display-hero {
  font-weight: 700;
  font-size: clamp(42px, 6.2vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.display-2 {
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.pull-line {
  font-weight: 700;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.mono-label {
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
}
.mono {
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

/* Tier prices — Inter 700; the /mo unit rides as a small data label. */
.price {
  font-weight: 700;
  font-size: clamp(28px, 2.8vw, 34px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: lining-nums;
}
.stat-unit {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.42em;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* How-it-works step numbers — small mono data labels, persimmon. */
.step-num {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}

/* ------------------------------------------------------------
   Arabic mode — Plex Sans Arabic carries body + headlines;
   Latin tracking does not apply.
   ------------------------------------------------------------ */
html.lang-ar body {
  font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
  letter-spacing: 0;
}
html.lang-ar .display-hero,
html.lang-ar .display-2,
html.lang-ar .pull-line {
  font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}
html.lang-ar .display-hero {
  font-size: clamp(36px, 5.8vw, 60px);
  line-height: 1.14;
}
html.lang-ar .mono-label,
html.lang-ar .mono,
html.lang-ar .msg-meta,
html.lang-ar .chat-status-label,
html.lang-ar .chip-ok,
html.lang-ar .callout-kicker,
html.lang-ar .math-table th,
html.lang-ar .math-before,
html.lang-ar .math-after {
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  letter-spacing: 0;
}
html.lang-ar [class*='tracking-'] {
  letter-spacing: 0 !important;
}

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

/* ------------------------------------------------------------
   Button system — one language on landing and dashboard.
   Primary = accent fill; secondary = white surface, hairline.
   ----------------------------------------------------------- */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  border-radius: 10px;
  padding: 12px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    box-shadow 0.18s ease, transform 0.18s ease;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background: var(--accent-deep);
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--accent-deep);
  box-shadow: var(--shadow-btn);
  transform: translateY(0);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-secondary:hover {
  border-color: var(--line-deep);
  background: var(--paper);
}
.btn-secondary:active {
  transform: translateY(0);
  background: var(--paper);
}
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 13.5px;
  border-radius: 9px;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 11px;
}

/* Ink underline link — the quiet CTA. */
.link-underline {
  display: inline-block;
  color: var(--ink);
  font-weight: 600;
  padding-bottom: 2px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: var(--ink);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.link-underline:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent-deep);
}

/* ------------------------------------------------------------
   Eyebrow + accent underline (the one accent detail per section)
   ------------------------------------------------------------ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--accent);
}
.eyebrow-dash {
  display: inline-block;
  width: 1.25rem;
  height: 2px;
  background: var(--accent);
}
.u-accent {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.18em;
}

/* ------------------------------------------------------------
   Check bullets — typographic, no icons.
   ------------------------------------------------------------ */
.check {
  position: relative;
  padding-inline-start: 1.6rem;
  color: var(--ink-soft);
}
.check::before {
  content: '\2713'; /* typographic check — a glyph, not an icon */
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--accent);
}

/* Step Output lines — mono data labels. */
.output-line {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Chat UI — a real conversation, not a transcript dump.
   The panel is a white surface card; lead messages are white
   bordered cards (start-aligned), AI replies are the accent
   wash (end-aligned). Body text: Inter 14px/1.5 (Arabic mode:
   Plex Sans Arabic). Mono ONLY for the tiny tags/timestamps.
   ------------------------------------------------------------ */
.chat-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(23, 24, 28, 0.06);
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}
.chat-who {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
}
.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.chat-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.chat-sub {
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 20px;
}
.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 86%;
}
.msg-lead { align-self: flex-start; }
.msg-ai   { align-self: flex-end; }
.bubble {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--ink);
  overflow-wrap: break-word;
}
.bubble-lead {
  background: var(--surface);
  border: 1px solid var(--line);
  border-end-start-radius: 4px; /* the tail corner */
}
.bubble-ai {
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-end-end-radius: 4px;
}
/* Meta rows — mono data only (AI chip, reply time, timestamp). */
.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.msg-lead .msg-meta { justify-content: flex-start; }
.msg-ai   .msg-meta { justify-content: flex-end; }
.chat-time { color: var(--muted); }
.chip-ai {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
    color: #ffffff;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}
.chip-fast {
  font-weight: 600;
  color: var(--accent-deep);
}
/* Handoff / outcome bar under a thread. */
.chat-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 20px;
}
.chat-status-label {
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
    color: var(--ink);
}
.chip-ok {
  flex: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
    color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 2px 8px;
}

/* ------------------------------------------------------------
   Annotation callouts (See-it-work) — white cards on the right,
   a hairline + accent dot reaching toward the transcript.
   ------------------------------------------------------------ */
.callout {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(23, 24, 28, 0.06);
  padding: 14px 16px;
}
.callout-kicker {
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
    color: var(--accent-deep);
}
.callout-text {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
}
@media (min-width: 1024px) {
  .callout::before {
    content: '';
    position: absolute;
    top: 26px;
    inset-inline-end: 100%;
    width: 44px;
    height: 1px;
    background: var(--line-deep);
  }
  .callout::after {
    content: '';
    position: absolute;
    top: 23px;
    inset-inline-end: calc(100% + 44px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
  }
}

/* ------------------------------------------------------------
   The math — before/after table. Ink hairlines, mono numbers.
   ------------------------------------------------------------ */
.math-table {
  width: 100%;
  border-collapse: collapse;
}
.math-table th {
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
    color: var(--faint);
  text-align: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink);
}
.math-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}
.math-table tr:last-child td { border-bottom: 0; }
.math-metric {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.math-before,
.math-after {
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 13px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.math-before { color: var(--muted); }
.math-after {
  font-weight: 600;
  color: var(--accent-deep);
}
.math-line {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
}
@media (max-width: 480px) {
  .math-table th, .math-table td { padding-inline: 12px; }
}

/* ------------------------------------------------------------
   Pricing — the Office (founding) tier carries a persimmon
   top-rule only. Everything else is ink hairlines.
   ------------------------------------------------------------ */
.col-yours {
  border-top: 2px solid var(--accent);
}

/* ------------------------------------------------------------
   Scroll reveal (IntersectionObserver adds .is-visible)
   Hidden state only applies when JS is available (html.js).
   ----------------------------------------------------------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   FAQ accordion — typographic plus, rotated when open.
   ------------------------------------------------------------ */
summary::-webkit-details-marker {
  display: none;
}
summary {
  list-style: none;
}
.faq-x {
  flex: none;
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  color: var(--faint);
  transition: transform 0.25s ease, color 0.25s ease;
}
.faq[open] .faq-x {
  transform: rotate(45deg);
  color: var(--accent);
}
.faq summary:hover .faq-x {
  color: var(--accent-deep);
}
.faq[open] .faq-a {
  animation: faq-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes faq-in {
  from { opacity: 0; transform: translateY(-6px); }
}

/* ------------------------------------------------------------
   RTL page tweaks
   ------------------------------------------------------------ */
html.lang-ar [dir='ltr'] {
  unicode-bidi: isolate;
}

/* ------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------ */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ------------------------------------------------------------
   Reduced motion: show everything, animate nothing
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .faq[open] .faq-a { animation: none !important; }
  .faq-x { transition: none !important; }
  .btn-primary,
  .btn-secondary { transition: none !important; }
}
