/* ------------------------------------------------------------------
   Saqf — visual identity stylesheet
   Editorial typography, architectural restraint, warm earth palette.
   No gradients, no glass, no bento. Hairlines and ink.
   ------------------------------------------------------------------ */

/* ============ Theme tokens =========================================== */

:root {
  /* Light theme (default) */
  --bg:        #f4ede0;   /* warm bone */
  --bg-2:      #ebe2cf;   /* paper */
  --bg-card:  #ffffffd9;
  --ink:       #1c1917;   /* warm stone-900 */
  --ink-2:     #44403c;   /* stone-700 */
  --muted:     #847b6c;   /* taupe */
  --line:      #cebfa6;   /* drawn line */
  --line-soft: #ddd0b5;
  --accent:        #b35a2a;  /* terracotta */
  --accent-deep:   #8a4220;
  --accent-soft:   #e9cbb8;
  --counter:       #2f3e46;  /* deep slate, editorial counterpoint */
  --ok:        #4a7c59;
  --warn:      #b78a3f;

  --radius:   2px;
  --radius-2: 6px;

  /* Type */
  --font-serif:  "Fraunces", "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-sans:   "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono:   "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, "Liberation Mono", monospace;
  --font-arab:   "Reem Kufi", "Amiri", "Noto Naskh Arabic", serif;

  /* Spacing scale (8px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:        #15171c;   /* deep ink-blue (not black) */
  --bg-2:      #1c1f25;
  --bg-card:   #1f2329cc;
  --ink:       #ece5d4;
  --ink-2:     #c7bfa8;
  --muted:     #8b8470;
  --line:      #2f333c;
  --line-soft: #232730;
  --accent:        #d97742;  /* brighter terracotta on dark */
  --accent-deep:   #a85a2c;
  --accent-soft:   #3a2820;
  --counter:       #9bb0a6;  /* oxidized copper / sage */
  --ok:        #7fb38e;
  --warn:      #d4b06c;

  color-scheme: dark;
}

/* ============ Base =================================================== */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  /* very faint blueprint dot grid */
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 0);
  background-size: 24px 24px;
  background-position: 0 0;
}

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

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-deep); }

[data-theme="dark"] a:hover { color: var(--accent); }

/* Tabular numerals — architectural drawing discipline */
.num, .mono, time, .stat, .step-num, .scale {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}

/* ============ Typography ============================================== */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 450;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-feature-settings: "ss01" 1;
  color: var(--counter);
  margin: 0 0 var(--s-4) 0;
}

h1 { font-size: clamp(40px, 5.5vw, 76px); font-weight: 400; }
h2 { font-size: clamp(28px, 3.5vw, 42px); }
h3 { font-size: 20px; letter-spacing: -0.01em; }

p { margin: 0 0 var(--s-4) 0; color: var(--ink-2); }

.lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 var(--s-5) 0;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--accent);
}

.pullquote {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.35;
  color: var(--ink);
  border-left: 1px solid var(--accent);
  padding-left: var(--s-5);
  margin: var(--s-7) 0;
  max-width: 60ch;
}

.arab {
  font-family: var(--font-arab);
  font-weight: 500;
  color: var(--accent);
}

/* ============ Layout ================================================= */

.shell {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--s-6);
}

main { flex: 1; }

/* hairline rule between sections */
.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--s-8) 0;
}
.rule.with-mark {
  position: relative;
  border-top: 1px solid var(--line);
}
.rule.with-mark::after {
  content: "·";
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--accent);
  padding: 0 var(--s-3);
  font-size: 22px;
  line-height: 1;
}

/* ============ Header / Footer ========================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 26px; height: 26px;
  color: var(--accent);
  display: inline-flex;
}
.brand-word {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 450;
  letter-spacing: -0.01em;
}
.brand-sep {
  width: 1px; height: 18px;
  background: var(--line);
  margin: 0 4px;
}
.brand-sub {
  font-family: var(--font-arab);
  font-size: 19px;
  color: var(--accent);
  line-height: 1;
  transform: translateY(1px);
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--s-5);
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-nav a:hover { color: var(--ink); }

/* theme toggle */
.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 4px 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }
.theme-toggle .dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--line);
  transition: background 0.2s ease, transform 0.3s ease;
  position: relative;
}
[data-theme="dark"] .theme-toggle .dot {
  background: var(--accent);
  box-shadow: inset -3px -3px 0 0 var(--ink);
}

/* ============ Hero =================================================== */

.hero {
  padding: clamp(64px, 10vw, 128px) 0 clamp(48px, 8vw, 96px) 0;
  position: relative;
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .arab {
  font-size: 0.65em;
  margin-left: 8px;
  vertical-align: 0.2em;
}

.hero .lead { margin-bottom: var(--s-6); }

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
  margin-bottom: var(--s-7);
}

/* architectural scale ruler — decorative but on-brand */
.scale {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.scale-line {
  position: relative;
  height: 18px;
  width: 240px;
  margin-right: 10px;
}
.scale-line::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  height: 1px;
  background: var(--line);
}
.scale-line .tick {
  position: absolute;
  bottom: 4px;
  width: 1px;
  height: 8px;
  background: var(--muted);
}
.scale-line .tick.major { height: 12px; background: var(--ink-2); bottom: 4px; }
.scale-line .tick-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
}

/* ============ Buttons ================================================ */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-2);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover:not(:disabled) {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent-deep);
}
[data-theme="dark"] .btn-ghost:hover:not(:disabled) { color: var(--accent); }

.btn .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

.note {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ============ Process steps ========================================== */

.process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: var(--s-7) 0 var(--s-8) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.step {
  padding: var(--s-6) var(--s-5);
  border-left: 1px solid var(--line);
  position: relative;
}
.step:first-child { border-left: none; }
.step-num {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: var(--s-3);
}
.step h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 450;
  color: var(--counter);
  margin: 0 0 var(--s-2) 0;
}
.step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 32ch;
}

@media (max-width: 760px) {
  .process { grid-template-columns: 1fr; }
  .step { border-left: none; border-top: 1px solid var(--line); }
  .step:first-child { border-top: none; }
}

/* ============ Manifesto section ====================================== */

.manifesto {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--s-7);
  margin: var(--s-7) 0;
  align-items: start;
}
.manifesto .left .eyebrow { margin-bottom: var(--s-3); }
.manifesto .left h2 {
  font-size: clamp(28px, 3vw, 38px);
  margin: 0;
}
.manifesto .right p {
  font-size: 16.5px;
  color: var(--ink-2);
  max-width: 58ch;
}
.manifesto .right p strong { color: var(--ink); font-weight: 500; }

@media (max-width: 860px) {
  .manifesto { grid-template-columns: 1fr; gap: var(--s-5); }
}

/* ============ Footer ================================================ */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  margin-top: var(--s-8);
}
.site-footer .shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s-5);
  padding-bottom: var(--s-5);
  flex-wrap: wrap;
  gap: var(--s-4);
}
.site-footer .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.site-footer .meta strong {
  color: var(--ink-2);
  font-weight: 500;
}

/* live system status line — useful while in dev */
.sys-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sys-status .ping-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.sys-status .ping-btn:hover { border-color: var(--accent); color: var(--ink); }
.pulse-ok { color: var(--ok); }
.pulse-ok::before {
  content: "● ";
  color: var(--ok);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ============ Accessibility ========================================== */

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
