:root {
  color-scheme: dark;
  --page: #080b12;
  --panel: rgba(9, 13, 24, 0.78);
  --panel-strong: rgba(12, 18, 31, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(102, 226, 255, 0.34);
  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.66);
  --soft: rgba(255, 255, 255, 0.08);
  --cyan: #66e2ff;
  --green: #7cf7bd;
  --pink: #ff5ca8;
  font-family: "Tajawal", "Cairo", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(3, 6, 12, 0.38), rgba(3, 6, 12, 0.84)),
    url("/assets/salfa-desktop.png") center bottom / cover fixed,
    var(--page);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 16%, rgba(102, 226, 255, 0.14), transparent 27%),
    radial-gradient(circle at 86% 18%, rgba(255, 92, 168, 0.14), transparent 25%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 48%, rgba(0, 0, 0, 0.32));
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: clamp(14px, 2.4vw, 30px);
}

.topbar,
.page-heading,
.projects-card,
.project-heading,
.browser-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.topbar {
  width: min(1120px, 100%);
  min-height: 58px;
  margin: 0 auto clamp(16px, 2.2vw, 26px);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 18px;
}

.brand,
.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  font-weight: 950;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #06111a;
  background: linear-gradient(135deg, var(--green), var(--cyan) 58%, var(--pink));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  font-weight: 950;
}

.top-actions a,
.ghost-button,
.primary-button,
.copy-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 850;
}

.top-actions a,
.ghost-button,
.copy-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.primary-button {
  color: #06111a;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.top-actions a:hover,
.ghost-button:hover,
.copy-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.12);
}

.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.view {
  display: none;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.view.is-active {
  display: block;
}

.page-heading,
.project-heading,
.projects-card,
.browser-card {
  border-radius: 22px;
}

.page-heading {
  padding: clamp(20px, 4vw, 34px);
  margin-bottom: 18px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.page-heading p,
.project-heading p,
.project-card span,
.project-card small,
.empty-state span,
.file-row small {
  color: var(--muted);
  line-height: 1.55;
}

.projects-card {
  padding: clamp(16px, 2.4vw, 24px);
}

.section-title {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-title span {
  color: var(--muted);
  font-weight: 850;
}

.search-field {
  display: grid;
  gap: 7px;
  max-width: 440px;
  margin-bottom: 16px;
}

.search-field span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 850;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  outline: none;
}

input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(102, 226, 255, 0.12);
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.project-card {
  min-height: 152px;
  display: grid;
  align-content: start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: rgba(102, 226, 255, 0.1);
  outline: none;
}

.project-card strong {
  font-size: 1.14rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 850;
}

.project-page {
  display: grid;
  gap: 16px;
}

.project-heading {
  padding: clamp(16px, 2.4vw, 24px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.project-heading h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.browser-card {
  padding: clamp(14px, 2.4vw, 22px);
}

.breadcrumbs {
  min-height: 46px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.crumb {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 850;
}

.crumb:hover {
  border-color: var(--line-strong);
}

.crumb-separator {
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}

.file-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 10px 12px;
  text-align: start;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.file-row:hover,
.file-row.is-active {
  border-color: var(--line-strong);
  background: rgba(102, 226, 255, 0.1);
}

.file-row strong {
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
}

.file-icon {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #06111a;
  background: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.file-row.file .file-icon {
  background: var(--cyan);
}

.console-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.console-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.console-head h2 {
  margin: 0;
}

pre {
  direction: ltr;
  text-align: left;
  margin: 0;
  max-height: min(48vh, 520px);
  overflow: auto;
  padding: 16px;
  color: #d7ffe9;
  background: rgba(2, 6, 12, 0.84);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
  white-space: pre-wrap;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
}

.empty-state strong {
  font-size: 1.1rem;
}

.toast {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  max-width: min(360px, calc(100vw - 36px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(8, 12, 22, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  transition: transform 160ms ease, opacity 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 820px) {
  body {
    background-attachment: scroll;
  }

  .project-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .project-heading .primary-button,
  .project-heading .ghost-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions a {
    flex: 1;
  }

  .section-title,
  .console-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .file-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
