/* Yazmo "coming soon" homepage (core/resources/views/site/home.blade.php). Self-contained: no external requests. */
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro/ReadexPro-Variable.woff2") format("woff2");
  font-weight: 160 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #171b1a;
  --ink-2: #1f2422;
  --graphite: #292c29;
  --line: rgba(248, 247, 241, 0.09);
  --paper: #f7f6f0;
  --cream: #f8f7f1;
  --sub: #b4b7b2;
  --faint: #8e928d;
  --lime: #c9f26a;
  --lime-deep: #9fc24a;
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, sans-serif;
  --key: clamp(46px, 14.5vw, 92px);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--ink);
  /* Subtle grid, fading towards the edges. */
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(201, 242, 106, 0.08), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-position: center top, -1px -1px, -1px -1px;
  color: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

:lang(ar) body, body:lang(ar) { line-height: 1.8; }

a { color: var(--lime); text-underline-offset: 3px; }
a:hover { color: var(--cream); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Top bar ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px;
}
.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
}
.top-brand img { display: block; border-radius: 8px; }
.lang-switch { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 15px; }
.lang-switch a { color: var(--sub); text-decoration: none; padding: 6px 4px; }
.lang-switch a:hover { color: var(--cream); }
.lang-switch a[aria-current] { color: var(--lime); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Wordmark built from key caps. Always left-to-right ("yazmo" is a Latin word). */
.wordmark {
  display: flex;
  gap: clamp(6px, 1.6vw, 14px);
  margin: 16px 0 28px;
  direction: ltr;
}
.key {
  display: grid;
  place-items: center;
  width: var(--key);
  height: calc(var(--key) * 1.08);
  border-radius: calc(var(--key) * 0.22);
  background: linear-gradient(180deg, #fffefa 0%, var(--cream) 70%, #e9e7dd 100%);
  color: var(--ink);
  font-size: calc(var(--key) * 0.52);
  font-weight: 700;
  line-height: 1;
  box-shadow:
    0 calc(var(--key) * 0.07) 0 #c9c7bc,
    0 calc(var(--key) * 0.12) calc(var(--key) * 0.2) rgba(0, 0, 0, 0.45);
  padding-bottom: calc(var(--key) * 0.06);
}
.key-lime {
  background: linear-gradient(180deg, #dbff8a 0%, var(--lime) 70%, #b6dc5b 100%);
  box-shadow:
    0 calc(var(--key) * 0.07) 0 var(--lime-deep),
    0 calc(var(--key) * 0.12) calc(var(--key) * 0.2) rgba(0, 0, 0, 0.45);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
:lang(ar) .eyebrow { letter-spacing: 0; font-size: 15px; }

.headline {
  margin: 0;
  font-size: clamp(30px, 7vw, 60px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
:lang(ar) .headline { letter-spacing: 0; line-height: 1.35; }
.headline-main, .headline-soon { display: block; }
.headline-soon { color: var(--lime); }
.headline-soon .dash { color: var(--faint); }

.lead {
  max-width: 34em;
  margin: 18px auto 0;
  color: var(--sub);
  font-size: clamp(16px, 2.3vw, 19px);
  text-wrap: pretty;
}

/* ---------- AI demo card ---------- */
.demo { width: 100%; max-width: 560px; margin: 36px auto 0; }
.demo-card {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(248, 247, 241, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(41, 44, 41, 0.95), rgba(31, 36, 34, 0.95));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: start;
}
.demo-row { display: grid; gap: 4px; }
.demo-label { color: var(--faint); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
:lang(ar) .demo-label { letter-spacing: 0; font-size: 13px; }
.demo-text {
  margin: 0;
  min-height: 1.7em;
  font-size: clamp(17px, 3.2vw, 21px);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.demo-text[dir="rtl"] { text-align: right; }
.demo-text[dir="ltr"] { text-align: left; }
.demo-before { color: var(--sub); }
.demo-after { color: var(--cream); font-weight: 600; }
.demo-after::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-inline-end: 0.45em;
  border-radius: 50%;
  background: var(--lime);
  vertical-align: 0.15em;
}
.demo-spark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.spark-icon { fill: currentColor; }

/* States set by home.js (only when motion is allowed). */
.demo.is-typing .demo-before::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-inline-start: 2px;
  background: var(--lime);
  vertical-align: -0.15em;
  animation: caret 0.9s steps(1) infinite;
}
.demo.is-working .demo-spark { animation: spark 0.7s ease-in-out infinite alternate; }
.demo.is-working .spark-icon { animation: spin 1.2s linear infinite; }
.demo.is-done:is([data-key="fix"], [data-key="rewrite"]) .demo-before { text-decoration: line-through; text-decoration-color: rgba(246, 123, 101, 0.8); text-decoration-thickness: 2px; }
.demo-after { transition: opacity 0.35s ease, transform 0.35s ease; }
.demo.is-hidden-after .demo-after { opacity: 0; transform: translateY(6px); }


/* ---------- Platforms + promise ---------- */
.platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  border: 1px solid rgba(248, 247, 241, 0.16);
  border-radius: 999px;
  background: rgba(23, 27, 26, 0.7);
  font-size: 15px;
}
.chip svg, .promise svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.chip-name { font-weight: 600; }
.chip-soon {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(201, 242, 106, 0.14);
  color: var(--lime);
  font-size: 12px;
  font-weight: 500;
}

.promise {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  align-items: center;
  max-width: 34em;
  margin: 28px auto 0;
  color: var(--sub);
  font-size: 15px;
  text-align: start;
}
.promise svg { color: var(--lime); }
.promise strong { color: var(--cream); font-weight: 600; }

/* ---------- Footer ---------- */
.home-footer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
  text-align: center;
}
.home-footer p { margin: 6px 0; }
.home-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0 0 8px; padding: 0; list-style: none; }
.home-footer-links a { color: var(--sub); text-decoration: none; display: inline-block; padding: 4px 0; }
.home-footer-links a:hover { color: var(--cream); text-decoration: underline; }
.home-footer-legal { font-size: 13px; }

/* ---------- Key-cap "typing in" (home.js adds .js-motion to <html> only when motion is allowed) ---------- */
.js-motion .key { opacity: 0; transform: translateY(-14px) scale(0.96); }
.js-motion .key.is-in { animation: key-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1.2) forwards; }

@keyframes key-in {
  0% { opacity: 0; transform: translateY(-14px) scale(0.96); }
  55% { opacity: 1; transform: translateY(4px) scale(1); box-shadow: 0 1px 0 #c9c7bc, 0 2px 6px rgba(0, 0, 0, 0.4); }
  100% { opacity: 1; transform: none; }
}
@keyframes caret { 50% { opacity: 0; } }
@keyframes spark { from { box-shadow: 0 0 0 0 rgba(201, 242, 106, 0.55); } to { box-shadow: 0 0 0 10px rgba(201, 242, 106, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tool strip (the active one follows the demo) ---------- */
.tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
  margin: 26px auto 0;
  padding: 0;
  list-style: none;
}
.tool {
  padding: 6px 12px;
  border: 1px solid rgba(248, 247, 241, 0.14);
  border-radius: 999px;
  background: rgba(23, 27, 26, 0.6);
  color: var(--sub);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.tool.is-active {
  border-color: var(--lime);
  background: rgba(201, 242, 106, 0.14);
  color: var(--lime);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 242, 106, 0.18);
}

/* ---------- Background: drifting key caps + pointer glow (decorative) ---------- */
.bg-keys { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.float-key {
  position: absolute;
  display: grid;
  place-items: center;
  width: 54px;
  height: 58px;
  border: 1px solid rgba(248, 247, 241, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 247, 241, 0.06), rgba(248, 247, 241, 0.015));
  color: rgba(248, 247, 241, 0.16);
  font-size: 22px;
  font-weight: 600;
  animation: drift 18s ease-in-out infinite alternate;
}
.float-key:nth-child(1)  { top: 12%; left: 5%;   animation-duration: 17s; }
.float-key:nth-child(2)  { top: 24%; right: 6%;  animation-duration: 21s; animation-delay: -4s; }
.float-key:nth-child(3)  { top: 58%; left: 3%;   animation-duration: 19s; animation-delay: -8s; width: 64px; }
.float-key:nth-child(4)  { top: 70%; right: 4%;  animation-duration: 23s; animation-delay: -2s; }
.float-key:nth-child(5)  { top: 40%; left: 12%;  animation-duration: 16s; animation-delay: -6s; color: rgba(201, 242, 106, 0.28); border-color: rgba(201, 242, 106, 0.18); }
.float-key:nth-child(6)  { top: 8%;  right: 18%; animation-duration: 20s; animation-delay: -10s; }
.float-key:nth-child(7)  { top: 86%; left: 16%;  animation-duration: 22s; animation-delay: -3s; }
.float-key:nth-child(8)  { top: 48%; right: 13%; animation-duration: 18s; animation-delay: -12s; }
.float-key:nth-child(9)  { top: 84%; right: 22%; animation-duration: 24s; animation-delay: -7s; }
.float-key:nth-child(10) { top: 30%; left: 22%;  animation-duration: 25s; animation-delay: -14s; }
/* Small screens: fewer, fainter keys, kept to the edges. */
@media (max-width: 719px) {
  .float-key { width: 40px; height: 44px; font-size: 16px; border-radius: 11px; opacity: 0.7; }
  .float-key:nth-child(n+7) { display: none; }
  .float-key:nth-child(5), .float-key:nth-child(10) { left: -8px; }
}

.has-glow body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(201, 242, 106, 0.07), transparent 70%);
}
.top, .hero, .home-footer { position: relative; z-index: 1; }

/* "coming soon" shimmer */
.js-motion .headline-soon .soon-text {
  background: linear-gradient(90deg, var(--lime) 0%, #f3ffd0 45%, var(--lime) 60%, var(--lime) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4.5s ease-in-out infinite;
}

/* Demo card glows while the AI works. */
.demo-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(201, 242, 106, 0), 0 0 40px rgba(201, 242, 106, 0);
  transition: box-shadow 0.4s ease;
}
.demo.is-working .demo-card::after { box-shadow: 0 0 0 1px rgba(201, 242, 106, 0.55), 0 0 44px rgba(201, 242, 106, 0.22); }
.demo.is-done .demo-after { animation: pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.3); }

/* A wordmark key pressed now and then. */
.js-motion .key.is-in.is-press { animation: key-press 0.32s ease forwards; }

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) rotate(-6deg); }
  100% { transform: translate3d(14px, -26px, 0) rotate(7deg); }
}
@keyframes shimmer { 0% { background-position: 100% 0; } 60%, 100% { background-position: -50% 0; } }
@keyframes pop { 0% { transform: translateY(6px) scale(0.98); } 100% { transform: none; } }
@keyframes key-press {
  0%, 100% { transform: none; opacity: 1; }
  45% { transform: translateY(5px); opacity: 1; box-shadow: 0 1px 0 #c9c7bc, 0 2px 6px rgba(0, 0, 0, 0.4); }
}

@media (min-width: 720px) {
  .top { padding: 24px 32px; }
  .hero { padding-top: 40px; }
  .demo-card { padding: 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js-motion .key { opacity: 1; transform: none; }
}

@media (forced-colors: active) {
  .key, .demo-spark, .chip-soon { border: 1px solid CanvasText; }
}
