/* Lynox — professional dark theme (shared by all pages) */

@view-transition { navigation: auto; }

:root {
  --bg: #07090f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f4fb;
  --text-2: #c7cbe0;
  --text-3: #8b8fa8;
  --teal: #39e0c4;
  --violet: #8b7bff;
  --coral: #ff6f9c;
  --amber: #febc2e;
  --r: 18px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --display: "Space Grotesk", "Tajawal", sans-serif;
  --body: "Tajawal", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; position: relative; z-index: 2; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; inset-inline-start: 12px; top: -64px; z-index: 100;
  padding: 8px 16px; border-radius: 10px; background: var(--teal); color: #04120f;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(1100px, 100% - 40px); margin-inline: auto; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; will-change: transform; }
.bg::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #131a30 0%, var(--bg) 62%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.34; will-change: transform; transform: translateZ(0); }
.blob.b1 { width: 460px; height: 460px; background: var(--violet); top: -160px; right: -120px; animation: float1 30s ease-in-out infinite; }
.blob.b2 { width: 420px; height: 420px; background: var(--teal); bottom: -200px; left: -140px; animation: float2 36s ease-in-out infinite; opacity: 0.26; }
.blob.b3 { width: 300px; height: 300px; background: var(--coral); bottom: 14%; right: 6%; animation: float3 26s ease-in-out infinite; opacity: 0.16; }
.grid-lines {
  position: absolute; inset: 0; opacity: 0.55;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 0%, transparent 75%);
}
@keyframes float1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-40px, 70px) scale(1.1); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(80px, -40px) scale(0.96); } }
@keyframes float3 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-40px, -40px) scale(1.12); } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; padding: 12px 0; view-transition-name: site-header; }
.bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: 16px;
  background: rgba(10, 14, 26, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 18px; direction: ltr; }
.brand img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; object-position: 55% 30%; border: 1px solid var(--line-strong); }
.site-nav { margin-inline: auto; display: flex; gap: 2px; }
.site-nav a { padding: 6px 14px; border-radius: 10px; color: var(--text-2); font-size: 15px; font-weight: 500; text-decoration: none; transition: background 0.2s, color 0.2s; }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--teal); background: rgba(57, 224, 196, 0.1); }
.kbd-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-3); font-family: inherit; font-size: 14px; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.kbd-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.kbd-btn svg { width: 16px; height: 16px; }
kbd {
  padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06); font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  direction: ltr; display: inline-block; line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; border: 1px solid transparent;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.5; text-decoration: none; cursor: pointer;
  transition: transform 0.2s var(--bounce), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--teal); color: #04120f; box-shadow: 0 8px 28px rgba(57, 224, 196, 0.22); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(57, 224, 196, 0.34); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Cards ---------- */
.card {
  position: relative; padding: 26px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.spot:hover {
  background:
    radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 123, 255, 0.16), transparent 70%),
    var(--surface-2);
  border-color: var(--line-strong);
}
.card-title { margin: 0 0 16px; font-size: 1.05rem; font-weight: 700; color: var(--text-2); }

/* Reveal (only when JS is on) */
.reveal { transition: opacity 0.7s var(--ease) var(--d, 0s), translate 0.7s var(--ease) var(--d, 0s); }
.card.reveal, .link-row.reveal {
  transition: opacity 0.7s var(--ease) var(--d, 0s), translate 0.7s var(--ease) var(--d, 0s),
              transform 0.3s var(--bounce), background-color 0.25s, border-color 0.25s;
}
.js .reveal:not(.in) { opacity: 0; translate: 0 22px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 7vw, 88px) clamp(32px, 5vw, 56px); }
.chip {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  padding: 5px 14px 5px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  font-size: 14px; color: var(--text-2); text-decoration: none; transition: background 0.2s, border-color 0.2s;
}
.chip:hover { background: var(--surface-2); }
.chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 55% 30%; }
.chip .sep { width: 1px; height: 14px; background: var(--line-strong); }
.chip .name-en { font-family: var(--display); font-weight: 700; color: var(--text); direction: ltr; }
.hero-title { margin: 0 0 18px; font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.hero-title .muted { color: var(--text-3); }
.hero-lede { max-width: 34em; margin: 0 0 30px; font-size: 1.1rem; color: var(--text-2); }

/* ---------- Code window ---------- */
.editor {
  direction: ltr; text-align: left; overflow: hidden; border-radius: 16px;
  background: #0b0f1b; border: 1px solid var(--line-strong);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 123, 255, 0.08), 0 0 80px rgba(139, 123, 255, 0.12);
}
.editor-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--line); }
.editor-bar .dot { width: 11px; height: 11px; border-radius: 50%; opacity: 0.9; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.editor-tab {
  margin-inline-start: 14px; padding: 3px 12px; border-radius: 8px 8px 0 0;
  background: #0b0f1b; border: 1px solid var(--line); border-bottom: 0;
  font-family: var(--mono); font-size: 12px; color: var(--text-2); position: relative; top: 11px;
}
.editor pre { margin: 0; padding: 18px 0 20px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.85; counter-reset: ln; }
.ln { display: block; padding-right: 20px; white-space: pre; counter-increment: ln; }
.ln::before { content: counter(ln); display: inline-block; width: 44px; padding-right: 16px; text-align: right; color: #4a5068; user-select: none; }
.t-k { color: var(--violet); } .t-s { color: var(--teal); } .t-p { color: #9fb1ff; } .t-c { color: #5c6380; font-style: italic; } .t-f { color: var(--coral); }
.editor-status { display: flex; justify-content: space-between; padding: 6px 14px; background: rgba(139, 123, 255, 0.12); border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; padding-bottom: clamp(32px, 5vw, 56px); }
.bento > .card { grid-column: span 3; }
.bento > .card.wide { grid-column: 1 / -1; }

.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; }
.principles li { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); font-weight: 700; border-top: 2px solid var(--teal); }
.principles li:nth-child(2) { border-top-color: var(--violet); }
.principles li:nth-child(3) { border-top-color: var(--coral); }
.principles li:nth-child(4) { border-top-color: var(--amber); }

/* project preview */
.preview { direction: ltr; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #0b0f1b; }
.preview-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.preview-bar .dot { width: 9px; height: 9px; }
.preview-url { margin-inline-start: 10px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.preview-body {
  height: 124px;
  background:
    linear-gradient(115deg, rgba(139, 123, 255, 0.35), rgba(57, 224, 196, 0.18) 55%, transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 14px);
}
.project-title { margin: 14px 0 4px; font-family: var(--display); font-size: 1.5rem; font-weight: 700; line-height: 1.35; }
.project-desc { margin: 0 0 12px; color: var(--text-2); font-size: 15.5px; }
.more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; font-weight: 700; font-size: 14.5px; color: var(--teal); text-decoration: none; }
.more svg { width: 15px; height: 15px; transition: transform 0.25s; }
a.card:hover .more svg, .more:hover svg { transform: translate(-3px, -2px); }
a.card { text-decoration: none; display: flex; flex-direction: column; }

.cta-text { margin: 0 0 20px; max-width: 18em; font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 700; line-height: 1.4; }

/* ---------- Sub pages ---------- */
.page-head { padding-block: clamp(36px, 7vw, 80px) clamp(20px, 3vw, 32px); }
.page-title { margin: 0 0 10px; font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.page-lede { max-width: 34em; margin: 0; color: var(--text-2); font-size: 1.1rem; }
.section { padding-bottom: clamp(32px, 5vw, 56px); }
.section-title { margin: 0 0 18px; font-size: 1.35rem; font-weight: 700; }

.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.project-grid .featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: center; padding: 28px; }
.project-grid .featured .preview-body { height: 190px; }
.project-grid .featured .project-title { margin-top: 0; font-size: 2rem; }
.project-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.badge { display: inline-block; padding: 2px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; color: var(--text-2); }
.is-soon { border-style: dashed; opacity: 0.78; }
.is-soon .project-title { margin-top: 10px; }

.repo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; }
.repo { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; text-decoration: none; }
.repo-name { font-family: var(--mono); font-size: 14.5px; font-weight: 500; color: var(--teal); direction: ltr; text-align: right; }
.repo-desc { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.7; }
.repo-meta { display: flex; gap: 14px; margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--text-3); direction: ltr; justify-content: flex-end; }
.lang-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--text-3); }

.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; padding-bottom: clamp(24px, 4vw, 40px); }
.profile { position: sticky; top: 92px; text-align: center; }
.profile .avatar { width: 128px; height: 128px; margin: 0 auto 16px; padding: 3px; border-radius: 32px; background: linear-gradient(135deg, var(--teal), var(--violet)); box-shadow: 0 14px 40px rgba(139, 123, 255, 0.3); }
.profile .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 55% 30%; border-radius: 29px; }
.profile h2 { margin: 0; font-family: var(--display); font-size: 1.8rem; line-height: 1.3; direction: ltr; }
.profile .role { margin: 0 0 18px; color: var(--text-3); font-size: 15px; }
.profile .actions { justify-content: center; }
.prose p { max-width: 36em; margin: 0 0 1.1em; color: var(--text-2); font-size: 1.05rem; line-height: 2; }
.prose p:last-child { margin-bottom: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-tag { padding: 6px 15px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; color: var(--text-2); }
.chip-tag:nth-child(3n + 1) { border-color: rgba(139, 123, 255, 0.45); }
.chip-tag:nth-child(3n + 2) { border-color: rgba(57, 224, 196, 0.4); }
.chip-tag:nth-child(3n + 3) { border-color: rgba(255, 111, 156, 0.4); }
.stack-group { margin-bottom: 18px; }
.stack-group:last-child { margin-bottom: 0; }
.stack-group h3 { margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--text-3); }
.timeline { margin: 0; padding: 0; list-style: none; border-inline-start: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 22px 22px 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--bg); }
.timeline strong { display: block; font-size: 1.05rem; }
.timeline .when { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); direction: ltr; text-align: right; }
.timeline p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }

/* ---------- Contact ---------- */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; padding-bottom: clamp(32px, 6vw, 72px); }
.link-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 500; font-size: 15.5px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.link-row:hover, .link-row:focus-visible { transform: translateY(-3px); }
.link-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; color: var(--teal); background: rgba(57, 224, 196, 0.1); }
.link-row:nth-child(3n + 2) .link-icon { color: var(--violet); background: rgba(139, 123, 255, 0.12); }
.link-row:nth-child(3n) .link-icon { color: var(--coral); background: rgba(255, 111, 156, 0.12); }
.link-icon svg { width: 20px; height: 20px; }
.link-note { margin-inline-start: auto; font-size: 12.5px; color: var(--text-3); }
.link-row.is-pending { opacity: 0.55; cursor: default; }
.link-row.is-pending:hover { transform: none; background: var(--surface); border-color: var(--line); }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 2; margin-top: 8px; padding: 22px 0; border-top: 1px solid var(--line); color: var(--text-3); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; align-items: center; }

/* ---------- Command palette ---------- */
.palette { width: min(580px, 92vw); margin: 12vh auto auto; padding: 0; border: 0; background: transparent; color: var(--text); }
.palette::backdrop { background: rgba(4, 6, 12, 0.65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pal-box { overflow: hidden; border-radius: 18px; background: #0d1220; border: 1px solid var(--line-strong); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6); }
.pal-input { width: 100%; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font-family: inherit; font-size: 17px; outline: none; }
.pal-input::placeholder { color: var(--text-3); }
.pal-list { max-height: 330px; margin: 0; padding: 8px; overflow-y: auto; list-style: none; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--text-2); }
.pal-item[aria-selected="true"] { background: rgba(57, 224, 196, 0.12); color: var(--text); }
.pal-item .pal-kind { margin-inline-start: auto; font-size: 12px; color: var(--text-3); }
.pal-empty { padding: 20px; text-align: center; color: var(--text-3); }
.pal-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 20px; border-radius: 12px; background: #131a2e; border: 1px solid var(--line-strong); font-size: 14.5px;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Hero entrance for the code lines ---------- */
@keyframes lineIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .editor .ln { animation: lineIn 0.45s var(--ease) both; animation-delay: calc(var(--i) * 55ms + 350ms); }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero, .about-grid, .project-grid .featured { grid-template-columns: 1fr; }
  .profile { position: static; }
}
@media (max-width: 760px) {
  .bento > .card { grid-column: 1 / -1; }
  .project-grid, .repo-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .site-nav { order: 3; width: 100%; justify-content: center; margin-inline: 0; }
  .site-nav a { padding: 6px 12px; }
  .kbd-btn { margin-inline-start: auto; }
  .kbd-btn .kbd-label, .kbd-btn kbd { display: none; }
  .principles { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none !important; }
  .reveal, .card.reveal, .link-row.reveal { transition: none !important; }
  .js .reveal:not(.in) { opacity: 1; translate: none; }
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
}
