/* lumy: الأنماط المشتركة لكل الصفحات. الألوان كلها في :root، والحركة تحترم تقليل الحركة. */

:root {
  color-scheme: dark light;
  --bg: #08080a;
  --fg: #f4f4f0;
  --muted: #a3a3ad;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.2);
  --grid: rgba(255, 255, 255, 0.055);
  --grid-lit: rgba(255, 214, 153, 0.55);
  --glow: 255, 214, 153;
  --ring: #ffd699;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f4ef;
    --fg: #111114;
    --muted: #55555f;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-hover: rgba(255, 255, 255, 0.95);
    --line: rgba(17, 17, 20, 0.11);
    --line-strong: rgba(17, 17, 20, 0.22);
    --grid: rgba(17, 17, 20, 0.06);
    --grid-lit: rgba(201, 110, 20, 0.6);
    --glow: 226, 146, 46;
    --ring: #9a5200;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: -100px;
  inset-inline-start: 16px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* الشبكة الخافتة، وفوقها طبقة مضيئة يحرّكها المؤشر: هوية الموقع */
.grid-light {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  --lx: 50%;
  --ly: 20%;
}

.grid-light::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-lit) 1px, transparent 1px), linear-gradient(90deg, var(--grid-lit) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(320px circle at var(--lx) var(--ly), #000 0%, transparent 100%);
  mask-image: radial-gradient(320px circle at var(--lx) var(--ly), #000 0%, transparent 100%);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
}

.wordmark {
  display: inline-flex;
  align-items: flex-start;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 4px 0 0 3px;
  border-radius: 50%;
  background: rgb(var(--glow));
  box-shadow: 0 0 12px rgba(var(--glow), 0.9);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(380px, 100%);
  min-height: 44px;
  padding: 0 12px 0 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.search:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(var(--glow), 0.14);
}

.search-icon {
  position: absolute;
  inset-inline-start: 14px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

.search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search kbd {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font: 500 0.78rem var(--mono);
}

.tools,
.tool,
.center,
.foot,
.hero {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 11vh, 128px) 24px 48px;
}

.headline {
  margin: 0;
  font-size: clamp(2.4rem, 9.6vw, 7.5rem);
  font-weight: 650;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

/* كل سطر في قناع يخفيه، ثم ينزلق السطر من أسفل القناع (المعرّف M-2740) */
.headline .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.headline .line > span {
  display: block;
}

.headline .line:nth-child(1) {
  --i: 0;
}

.headline .line:nth-child(2) {
  --i: 1;
}

.lede {
  max-width: 34ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  text-wrap: balance;
}

@media (prefers-reduced-motion: no-preference) {
  .headline .line > span {
    animation: rise 0.9s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 120ms + 100ms);
  }

  .lede,
  .path {
    animation: fade-up 0.9s var(--ease) both 0.45s;
  }
}

@keyframes rise {
  from {
    transform: translate3d(0, 110%, 0);
  }

  to {
    transform: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.tools {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 24px 96px;
}

.tools-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tools-head h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.count {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid [hidden] {
  display: none;
}

/* بطاقة الأداة: بقعة ضوء تتبع المؤشر داخلها، وتظهر بالتركيز بلوحة المفاتيح (المعرّف M-2151) */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 188px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), background-color 0.45s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--glow), 0.22), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.card:hover,
.card:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translate3d(0, -3px, 0);
}

.card:hover::before,
.card:focus-visible::before {
  opacity: 1;
}

.card:active {
  transform: scale(0.985);
  transition-duration: 0.12s;
}

.card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 4px;
}

.card-index {
  color: var(--muted);
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.04em;
}

.card-name {
  margin: 8px 0 0;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
}

.card-path {
  color: var(--muted);
  font: 500 0.85rem var(--mono);
}

/* السهم ينزلق عند المرور أو التركيز (المعرّف M-1139) */
.card-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.45s var(--spring);
}

.card:hover .card-arrow,
.card:focus-visible .card-arrow {
  transform: translate3d(4px, 0, 0);
}

/* كل بطاقة تصعد وتتضح عند دخولها، بتأخير يتتابع (المعرّف M-6707) */
.motion .reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.6s var(--ease) var(--d, 0ms), transform 0.6s var(--ease) var(--d, 0ms);
}

.motion .reveal.in {
  opacity: 1;
  transform: none;
}

.empty {
  margin: 8px 0 0;
  padding: 40px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.empty[hidden] {
  display: none;
}

.foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.foot a {
  text-decoration: none;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.crumbs a,
.crumbs [aria-current] {
  white-space: nowrap;
}

.crumbs [aria-current] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--fg);
}

.tool {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(32px, 8vh, 80px) 24px 48px;
}

.path {
  margin: 0 0 14px;
  color: var(--muted);
  font: 500 0.85rem var(--mono);
}

.tool .headline {
  font-size: clamp(2.2rem, 7.5vw, 5rem);
}

.tool .lede {
  margin-top: 20px;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  margin-top: 48px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.empty-workspace {
  margin: auto;
  color: var(--muted);
  text-align: center;
}

.pulse {
  display: block;
  width: 12px;
  height: 12px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgb(var(--glow));
}

@media (prefers-reduced-motion: no-preference) {
  .pulse {
    animation: pulse 2.4s var(--ease) infinite;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--glow), 0.55);
  }

  70% {
    box-shadow: 0 0 0 16px rgba(var(--glow), 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(var(--glow), 0);
  }
}

/* عناصر الواجهة الافتراضية داخل الأدوات، حتى تبقى متسقة مع الموقع قبل أن تأتي كل أداة بتصميمها */
.workspace button {
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: 600 0.95rem var(--font);
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}

.workspace button:hover {
  transform: translate3d(0, -1px, 0);
}

.workspace button:active {
  transform: scale(0.98);
}

.workspace input,
.workspace select,
.workspace textarea {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
}

.center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 70vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 28px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.3s var(--ease);
}

.button:hover {
  transform: translate3d(0, -2px, 0);
}

@media (max-width: 640px) {
  .topbar,
  .hero,
  .tools,
  .tool,
  .foot {
    padding-inline: 16px;
  }

  .search {
    width: 100%;
  }

  .search kbd {
    display: none;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

/* تقليل الحركة: تختفي الحركات والانتقالات، ويبقى كل محتوى ظاهرًا */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card:hover,
  .card:focus-visible,
  .button:hover,
  .workspace button:hover,
  .workspace button:active {
    transform: none;
  }

  .card:hover .card-arrow,
  .card:focus-visible .card-arrow {
    transform: none;
  }
}
