/* Biopraxa: palette drawn from H&E histology stain (hematoxylin violet, eosin pink) */

@font-face {
  font-family: "Readex Pro";
  src: local("Readex Pro"), url("/fonts/ReadexPro.ttf") format("truetype");
  font-weight: 160 700;
  font-display: swap;
}

:root {
  --paper: #F6F6FB;
  --tint: #ECEAF6;
  --ink: #1E1A3A;
  --muted: #5D5873;
  --hema: #4B3F9E;
  --eosin: #C93A6D;
  --rule: #DAD7E8;
  --on-hema: #FFFFFF;
  --lens: #8E3C86;
  --contact-bg: var(--paper);
  --field-bg: #FFFFFF;
  --field-border: #7F7A9E;

  --font: "Readex Pro", "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15132A;
    --tint: #1D1A36;
    --ink: #EDEBF7;
    --muted: #A7A2C0;
    --hema: #A79CF2;
    --eosin: #F07CA3;
    --rule: #2F2B4D;
    --on-hema: #15132A;
    --lens: #C58BD6;
    --contact-bg: var(--paper);
    --field-bg: #221E3D;
    --field-border: #8C84C8;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 340;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body { font-size: 1.125rem; line-height: 1.85; }

h1, h2, h3 { font-weight: 560; line-height: 1.2; margin: 0; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; }
p { margin: 0; }

a { color: var(--hema); text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--eosin);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem;
  background: var(--hema); color: var(--on-hema); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 1rem; flex-wrap: wrap;
}
.logo {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--ink); text-decoration: none; font-weight: 560; font-size: 1.2rem;
}
.logo-mark { width: 2.4rem; height: auto; flex: none; }
.lm-a, .lm-b { fill: none; stroke-width: 3; }
.lm-a { stroke: var(--hema); }
.lm-b { stroke: var(--eosin); }
.lm-lens { fill: var(--lens); }
.wordmark { font-weight: 600; letter-spacing: -0.02em; font-size: 1.3rem; }
.wm-bio { color: var(--hema); }

.nav { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.75rem); flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.975rem; }
.nav a:hover { color: var(--hema); text-decoration: underline; }



/* Language switcher */
.langs { display: inline-flex; gap: 0.25rem; padding: 0.2rem; border: 1.5px solid var(--hema); border-radius: 999px; }
.langs a { font-size: 0.9rem; padding: 0.2rem 0.65rem; border-radius: 999px; color: var(--hema); text-decoration: none; line-height: 1.5; }
.langs a:hover { text-decoration: underline; }
.langs a[aria-current="page"] { background: var(--hema); color: var(--on-hema); }

/* Portrait and profile link */
.portrait { display: block; width: 9rem; height: 9rem; border-radius: 50%; object-fit: cover; margin-top: 1.5rem; }
.portrait-missing { display: grid; place-items: center; background: var(--tint); border: 2px dashed var(--rule); font-size: 0.85rem; text-align: center; }
.profile-link { margin-top: 1.25rem; }

/* Hero: the name as an annotated specimen */
.hero { padding-block: clamp(3rem, 8vw, 6.5rem) clamp(3rem, 7vw, 5.5rem); }
.lexicon {
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
  display: flex; flex-direction: column; align-items: flex-start;
}
.word {
  display: inline-flex; align-items: flex-end;
  font-size: clamp(3.75rem, 1.5rem + 11vw, 10rem);
  font-weight: 600; letter-spacing: -0.035em; line-height: 0.95;
}
.root { display: inline-flex; flex-direction: column; }
.root-text { display: block; }
.root-bio .root-text { color: var(--hema); }
.root-praxa .root-text { color: var(--ink); }
.root-label {
  display: flex; flex-direction: column;
  font-size: max(0.8rem, 0.11em); font-weight: 400; letter-spacing: 0; line-height: 1.35;
  color: var(--muted);
  padding-inline-start: 0.6rem; margin-inline-start: 0.08em;
  padding-bottom: 0.9rem; margin-bottom: 0.35rem;
  border-inline-start: 1.5px solid var(--eosin);
  position: relative;
}
.root-label::after {
  content: ""; position: absolute; bottom: -0.3rem; inset-inline-start: -0.3rem;
  width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--eosin);
}
.root-label em { font-style: italic; color: var(--ink); opacity: 0.8; }
.lexicon figcaption { margin-top: 1rem; color: var(--muted); max-width: 46ch; }

.hero-copy { max-width: 46rem; }
.hero h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.85rem); letter-spacing: -0.015em; }
.lead { margin-top: 1.25rem; font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); color: var(--muted); max-width: 60ch; }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.6rem 1.4rem; border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: 1rem;
}
.btn-primary { background: var(--hema); color: var(--on-hema); }
.btn-primary:hover { background: var(--ink); color: var(--paper); }
.btn-quiet { color: var(--ink); border: 1.5px solid var(--rule); }
.btn-quiet:hover { border-color: var(--hema); color: var(--hema); }

/* Sections */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--rule); }
.section-tint { background: var(--tint); }
.section-lead { margin-top: 0.75rem; color: var(--muted); max-width: 60ch; }

/* Services as a definition list, not cards */
.services { margin: 2.5rem 0 0; }
.service {
  display: grid; grid-template-columns: minmax(12rem, 1fr) 2fr; gap: 0.5rem 2.5rem;
  padding-block: 1.4rem; border-bottom: 1px solid var(--rule);
}
.service:first-child { border-top: 1px solid var(--rule); }
.service dt { font-weight: 560; font-size: 1.15rem; }
.service dd { margin: 0; color: var(--muted); max-width: 62ch; }

.boundary {
  margin-top: 2.5rem; max-width: 46rem;
  padding: 1.25rem 1.5rem; border-inline-start: 4px solid var(--eosin);
  background: var(--tint); border-radius: 0 0.5rem 0.5rem 0;
}
[dir="rtl"] .boundary { border-radius: 0.5rem 0 0 0.5rem; }
.boundary h3 { margin-bottom: 0.4rem; }
.boundary p { color: var(--muted); }

/* Steps: a real sequence, so numbered */
.steps {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
  counter-reset: step;
}
.steps li { counter-increment: step; padding-top: 1rem; border-top: 2px solid var(--hema); }
.steps li::before {
  content: counter(step);
  display: block; font-size: 2.25rem; font-weight: 300; color: var(--hema); line-height: 1; margin-bottom: 0.75rem;
}
.steps h3 { margin-bottom: 0.4rem; }
.steps p { color: var(--muted); }

/* About */
.about { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem 2.5rem; }
.about-head .portrait { margin-top: 1.75rem; }
.about-body p { max-width: 58ch; }
.facts { margin: 1.25rem 0 0; padding: 0; list-style: none; }
.facts li {
  padding-block: 0.6rem; border-bottom: 1px solid var(--rule);
  padding-inline-start: 1.25rem; position: relative;
}
.facts li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 1.25em;
  width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--eosin);
}

/* Contact */
.contact { background: var(--contact-bg); color: var(--ink); border-top: 1px solid var(--rule); }
.contact-inner { max-width: 46rem; margin-inline: auto; padding-inline: var(--gutter); }
.contact h2 { color: var(--ink); }
.contact p { margin-block: 1rem 2rem; color: var(--muted); max-width: 58ch; }

/* Contact form (on a soft lavender background) */
.contact-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem;
  margin-top: 0.5rem;
}
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 500; font-size: 0.975rem; }
.optional { font-weight: 300; opacity: 0.8; }
.contact-form input, .contact-form textarea, .contact-form select {
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--field-bg); border: 1.5px solid var(--field-border); border-radius: 0.6rem;
  padding: 0.7rem 0.85rem; width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 7rem; }
.contact-form select { appearance: none; cursor: pointer; padding-inline-end: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.2rem) 55%, calc(100% - 0.85rem) 55%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
[dir="rtl"] .contact-form select { background-position: 0.85rem 55%, 1.2rem 55%; }
.contact .field-hint { margin: 0.15rem 0 0; font-size: 0.875rem; color: var(--muted); }
.contact-form input:hover, .contact-form textarea:hover, .contact-form select:hover { border-color: var(--hema); }
.contact-form input:focus-visible, .contact-form textarea:focus-visible {
  outline: 3px solid var(--eosin); outline-offset: 2px;
}
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
.nd { display: none; }
.contact .form-note { margin: 0; font-size: 0.925rem; color: var(--muted); }
.contact .form-note a, .contact-alt a { color: var(--hema); }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.contact .form-actions .btn-primary { border: 0; cursor: pointer; font-family: inherit; }
.contact .form-actions .btn-primary:disabled { opacity: 0.6; cursor: progress; }
.form-status { margin: 0; font-weight: 500; }
.form-status:empty { display: none; }
.form-status[data-kind="success"] { background: var(--field-bg); color: var(--ink); padding: 0.5rem 0.9rem; border-radius: 0.5rem; border-inline-start: 4px solid var(--hema); }
.form-status[data-kind="error"] { background: #FFE3EC; color: #7A1238; padding: 0.5rem 0.9rem; border-radius: 0.5rem; }
.contact .contact-alt { margin: 2rem 0 0; font-size: 0.975rem; color: var(--muted); }
.contact-inner { max-width: 50rem; }
@media (max-width: 40rem) { .contact-form { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { padding-block: 2rem; color: var(--muted); font-size: 0.925rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer a { color: var(--muted); }

/* Legal pages */
.legal { padding-block: clamp(2.5rem, 6vw, 4.5rem); max-width: 46rem; }
.legal h1 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.legal p, .legal li { color: var(--ink); }
.legal p + p, .legal p + ul, .legal ul + p { margin-top: 0.75rem; }
.legal ul { padding-inline-start: 1.25rem; margin: 0.5rem 0 0; }
.legal li + li { margin-top: 0.4rem; }
.legal .note {
  margin-top: 2rem; padding: 1rem 1.25rem; background: var(--tint);
  border-inline-start: 4px solid var(--eosin); color: var(--muted); font-size: 0.95rem;
}
.placeholder { background: #FFF2A8; color: #1E1A3A; padding: 0 0.25em; border-radius: 3px; }

/* Responsive */
@media (max-width: 56rem) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .service { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .nav > a { display: none; }
  .root-label { padding-bottom: 0.6rem; }
}

/* Network paragraph in the about sections */
.network { margin-top: 0.9rem; max-width: 58ch; }

/* Thin ring so a white photo background keeps its round shape */
img.portrait { box-shadow: 0 0 0 1px var(--rule), 0 0 0 5px var(--tint); }
