/* ============================================================================
   LLJ Studios — shared stylesheet
   Tokens are lifted verbatim from Ironbox DESIGN.md §D1 so the site and the
   app read as one product. Do not repaint without updating DESIGN.md first.

   Deliberate constraints:
   - No external requests. No web fonts, no analytics, no CDN, no trackers.
     A privacy studio that phones home from its own privacy policy is absurd,
     and loading nothing third-party means no cookie banner is required.
   - Logical properties throughout (inline-start/end, never left/right) so the
     Arabic pages mirror correctly with a single dir="rtl" on <html>.
   ========================================================================= */

:root {
  /* Palette — DESIGN.md D1 */
  --primary:      #E3B778;  /* brass — the one accent */
  --on-primary:   #1A1206;
  --bg:           #0E1012;
  --surface:      #16191C;
  --surface-var:  #22272B;
  --on-surface:   #ECEFF1;
  --on-surface-mut:#99A2AA;
  --success:      #6FBF8B;
  --error:        #E5645B;

  /* Shape — DESIGN.md D1: one rounded family */
  --r-card:  16px;
  --r-pill:  24px;
  --r-sheet: 28px;
  --r-thumb: 12px;

  /* Spacing — 4dp grid, 16 gutters, 24 section gaps */
  --gutter: 16px;
  --gap:    24px;

  --measure: 68ch;      /* legal text line length */
  --page:    1080px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --font-ar: "Segoe UI", Tahoma, "Geeza Pro", "Noto Sans Arabic",
             "Noto Naskh Arabic", system-ui, sans-serif;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  background: var(--bg);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html[lang="ar"] { font-family: var(--font-ar); line-height: 1.9; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessibility floor from DESIGN.md D1: >=48px targets, visible focus. */
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); margin-top: 2.2em; }
h3 { font-size: 1.1rem; margin-top: 1.8em; color: var(--primary); }

/* Never letter-space or uppercase Arabic — DESIGN.md D1 */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 { letter-spacing: normal; }

p, li { color: var(--on-surface); }
p { margin: 0 0 1em; }

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--on-primary);
  padding: 12px 20px;
  border-radius: 0 0 var(--r-card) 0;
  z-index: 100;
}
.skip:focus { inset-inline-start: 0; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

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

main { flex: 1 0 auto; padding-block: clamp(2rem, 6vw, 4rem); }

.prose { max-width: var(--measure); }
.prose h2:first-of-type { margin-top: 1.5em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; }

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

.site-header {
  border-block-end: 1px solid var(--surface-var);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  color: var(--on-surface);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--primary); }
.brand-mark {
  width: 26px; height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.site-nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--on-surface-mut);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: var(--r-pill);
  font-size: .94rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav a:hover { color: var(--on-surface); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--primary); }

.site-footer {
  border-block-start: 1px solid var(--surface-var);
  padding-block: var(--gap);
  color: var(--on-surface-mut);
  font-size: .9rem;
  margin-block-start: clamp(3rem, 8vw, 5rem);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px var(--gap); align-items: center; }
.site-footer a { color: var(--on-surface-mut); }
.site-footer a:hover { color: var(--primary); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.footer-end { margin-inline-start: auto; }

/* Language switch */
.lang { display: flex; gap: 2px; align-items: center; }
.lang a {
  padding: 8px 11px;
  border-radius: var(--r-pill);
  text-decoration: none;
  color: var(--on-surface-mut);
  font-size: .86rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.lang a:hover { background: var(--surface); color: var(--on-surface); }
.lang a[aria-current="true"] { background: var(--surface-var); color: var(--primary); }

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */

.hero { padding-block: clamp(2rem, 7vw, 4.5rem); max-width: 46ch; }
.hero .lede {
  font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem);
  color: var(--on-surface-mut);
  margin-bottom: 1.8em;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 650;
  margin-bottom: .9em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  color: var(--on-surface);
  border-color: var(--surface-var);
}
.btn-ghost:hover { background: var(--surface); filter: none; }

.grid {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-block: var(--gap);
}

/* Portfolio grid. Cards keep a sane width and pack from the inline start, so a
   single app doesn't stretch across the full page — and adding the next title
   needs no change here. */
.grid-apps {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 380px));
  justify-content: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-var);
  border-radius: var(--r-card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card h3 { margin: 0; color: var(--on-surface); }
.card p { color: var(--on-surface-mut); margin: 0; font-size: .95rem; }

a.card { text-decoration: none; }
a.card:hover { border-color: var(--primary); background: var(--surface-var); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-block-start: 4px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-var);
  color: var(--on-surface-mut);
  font-size: .76rem;
  font-weight: 600;
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-live { color: var(--success); }
.status-soon { color: var(--primary); }

/* Key-fact list used on the trust/privacy summary */
.facts { list-style: none; padding: 0; margin: 0 0 1.5em; }
.facts li {
  padding-inline-start: 30px;
  position: relative;
  margin-bottom: .7em;
}
.facts li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .55em;
  width: 14px; height: 8px;
  border-inline-start: 2px solid var(--success);
  border-block-end: 2px solid var(--success);
  transform: rotate(-45deg);
}
html[dir="rtl"] .facts li::before { transform: rotate(-45deg) scaleX(-1); }

.callout {
  background: var(--surface);
  border: 1px solid var(--surface-var);
  border-inline-start: 3px solid var(--primary);
  border-radius: var(--r-card);
  padding: 18px 22px;
  margin-block: 1.5em;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--primary); }

/* Placeholder markers for details only the publisher can supply. */
.todo {
  background: color-mix(in srgb, var(--error) 16%, transparent);
  border: 1px dashed var(--error);
  border-radius: 6px;
  padding: 1px 7px;
  color: var(--on-surface);
  font-size: .93em;
  font-weight: 600;
  white-space: nowrap;
}

/* Used instead of an inline style attribute: the Content-Security-Policy sets
   style-src 'self', which blocks inline style="" outright. */
.mt-lg { margin-block-start: 2.5rem; }

.meta {
  color: var(--on-surface-mut);
  font-size: .88rem;
  border-block-start: 1px solid var(--surface-var);
  padding-block-start: var(--gutter);
  margin-block-start: var(--gap);
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1.4em;
  font-size: .94rem;
}
table.tbl th, table.tbl td {
  text-align: start;
  padding: 11px 14px;
  border-block-end: 1px solid var(--surface-var);
  vertical-align: top;
}
table.tbl th { color: var(--primary); font-weight: 650; }
.tbl-scroll { overflow-x: auto; }

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

@media print {
  .site-header, .site-footer, .skip { display: none; }
  html { background: #fff; color: #000; font-size: 11pt; }
  p, li, h1, h2, h3 { color: #000; }
  a { color: #000; }
  .callout, .card { border: 1px solid #999; }
}
