:root {
        --bg: #f8fafc;
        --card: #fff;
        --bd: #e2e8f0;
        --tx: #1e293b;
        --hd: #0f172a;
        --mu: #64748b;
        --soft: #f1f5f9;
        --sky: #16a34a;
      }

      html.dark {
        --bg: #020617;
        --card: #0f172a;
        --bd: #1e293b;
        --tx: #f1f5f9;
        --hd: #fff;
        --mu: #94a3b8;
        --soft: #1e293b;
        --sky: #4ade80;
      }

      * {
        box-sizing: border-box;
        margin: 0;
      }

      html {
        scroll-behavior: smooth;
      }

      body {
        background: var(--bg);
        color: var(--tx);
        font-family: Inter, "Noto Sans Arabic", system-ui, sans-serif;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        -webkit-font-smoothing: antialiased;
        transition:
          background 0.3s,
          color 0.3s;
      }

      html[dir="rtl"] body {
        font-family: "Noto Sans Arabic", Inter, system-ui, sans-serif;
      }

      .ic {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        flex: none;
      }

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

      button {
        font: inherit;
        color: inherit;
        background: none;
        border: 0;
        cursor: pointer;
      }

      .wrap {
        max-width: 72rem;
        margin: 0 auto;
        padding: 0 1rem;
      }

      header {
        position: sticky;
        top: 0;
        z-index: 50;
        backdrop-filter: blur(12px);
        background: color-mix(in srgb, var(--card) 80%, transparent);
        border-bottom: 1px solid var(--bd);
      }

      header .wrap {
        height: 4rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        min-width: 0;
      }

      .logo {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.75rem;
        background: linear-gradient(to top right, #16a34a, #14532d);
        color: #fff;
        font-weight: 700;
        font-size: 1.25rem;
        display: grid;
        place-items: center;
        box-shadow: 0 4px 8px #0003;
        flex: none;
        overflow: hidden;
      }

      .logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

      .logo.has {
        background: transparent;
      }

      .logo.has span {
        display: none;
      }

      .brand h1 {
        font-size: 1rem;
        font-weight: 700;
        color: var(--hd);
        line-height: 1.2;
      }

      .brand p {
        font-size: 0.72rem;
        color: var(--mu);
      }

      .tools {
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }

      .ctl {
        height: 2.25rem;
        padding: 0 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid var(--bd);
        background: var(--soft);
        color: var(--mu);
        font-size: 0.75rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 0.375rem;
        transition: color 0.2s;
      }

      .ctl:hover {
        color: var(--sky);
      }

      .search {
        position: relative;
        width: 12rem;
      }

      .search .ic {
        position: absolute;
        inset-inline-start: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--mu);
        width: 14px;
      }

      .search input {
        width: 100%;
        height: 2.25rem;
        padding: 0 0.75rem 0 2.25rem;
        padding-inline: 2.25rem 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid var(--bd);
        background: var(--soft);
        color: var(--tx);
        font-size: 0.75rem;
        outline: 0;
      }

      .search input:focus {
        box-shadow: 0 0 0 2px #22c55e;
      }

      .sun {
        display: none;
      }

      html.dark .sun {
        display: block;
      }

      html.dark .moon {
        display: none;
      }

      main {
        flex: 1;
        width: 100%;
      }

      main.wrap {
        padding-top: 2rem;
        padding-bottom: 3rem;
      }

      @media (min-width: 640px) {
        main.wrap {
          padding-top: 3rem;
          padding-bottom: 3rem;
        }
      }

      .card {
        position: relative;
        overflow: hidden;
        background: var(--card);
        border: 1px solid var(--bd);
        border-radius: 1rem;
        padding: 1.5rem;
        box-shadow: 0 1px 2px #0000000d;
        margin-bottom: 1.5rem;
      }

      .bar {
        position: absolute;
        inset: 0 0 auto 0;
        height: 4px;
        background: linear-gradient(
          90deg,
          var(--a, #16a34a),
          var(--b, #84cc16)
        );
      }

      .hero {
        background: var(--card);
      }

      .hero .bar {
        background: linear-gradient(90deg, #14532d, #16e05a, #86efac);
      }

      .hero h2 {
        font-size: clamp(1.9rem, 4vw, 2.5rem);
        font-weight: 800;
        color: var(--hd);
        letter-spacing: -0.02em;
      }

      .hero .sub {
        color: var(--mu);
        margin-top: 0.5rem;
        font-size: 0.9rem;
        max-width: 42rem;
        line-height: 1.7;
      }

      .pills {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.9rem;
      }

      .pill {
        padding: 0.25rem 0.75rem;
        border-radius: 999px;
        font-size: 0.75rem;
        font-weight: 600;
        border: 1px solid;
      }

      .p1 {
        background: #d1fae5;
        color: #065f46;
        border-color: #a7f3d0;
      }

      .p2 {
        background: #dcfce7;
        color: #166534;
        border-color: #bbf7d0;
      }

      .p3 {
        background: #ecfccb;
        color: #3f6212;
        border-color: #d9f99d;
      }

      .p4 {
        background: #ccfbf1;
        color: #115e59;
        border-color: #99f6e4;
      }

      html.dark .p1 {
        background: #022c22cc;
        color: #6ee7b7;
        border-color: #065f46;
      }

      html.dark .p2 {
        background: #052e16cc;
        color: #86efac;
        border-color: #166534;
      }

      html.dark .p3 {
        background: #1a2e05cc;
        color: #bef264;
        border-color: #3f6212;
      }

      html.dark .p4 {
        background: #042f2ecc;
        color: #5eead4;
        border-color: #115e59;
      }

      .hero .frame {
        aspect-ratio: 3/1;
      }

      .grid.n5 {
        grid-template-columns: repeat(2, 1fr);
      }

      @media (min-width: 48rem) {
        .grid.n5 {
          grid-template-columns: repeat(5, 1fr);
        }
      }

      .sep {
        border: 0;
        margin: 1.8rem 0 0;
      }

      .sep.thin {
        height: 1px;
        background: var(--bd);
      }

      .sep.thick {
        height: 3px;
        border-radius: 99px;
        background: linear-gradient(90deg, var(--a), var(--b));
      }

      .proj .desc {
        max-width: none;
      }

      .pts {
        margin: 0.9rem 0 0;
        padding-inline-start: 1.2rem;
        font-size: 0.85rem;
        color: var(--mu);
        line-height: 1.8;
        max-width: none;
      }

      .min .pts {
        margin-top: 0.25rem;
      }

      .shot.wide {
        grid-column: 1 / -1;
      }

      @media (min-width: 640px) {
        .shot.wide {
          display: grid;
          grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
          grid-template-areas:
            "img text"
            "cap text";
          column-gap: 1.5rem;
          align-items: center;
        }

        .shot.wide .frame {
          grid-area: img;
        }

        .shot.wide figcaption {
          grid-area: cap;
        }

        .shot.wide .pts {
          grid-area: text;
          margin-top: 0;
        }
      }

      .pts li {
        margin: 0.25rem 0;
      }

      .expl {
        font-size: 0.85rem;
        color: var(--mu);
        line-height: 1.65;
        margin-top: 0.5rem;
      }

      .subh {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--hd);
        margin-top: 1.4rem;
      }

      /* neon green pulse on first card */
      .card.hero {
        margin-bottom: 2.75rem;
        --neon: #16e05a;
        --neon-hi: #4dff88;
        background: color-mix(in srgb, var(--neon) 16%, var(--card));
        border: 1.5px solid var(--neon);
        animation: neonPulse 2.6s ease-in-out infinite;
        will-change: box-shadow;
      }

      @keyframes neonPulse {
        0%,
        100% {
          border-color: color-mix(in srgb, var(--neon) 80%, transparent);
          box-shadow:
            0 0 3px var(--neon),
            0 0 10px color-mix(in srgb, var(--neon) 50%, transparent),
            0 0 22px color-mix(in srgb, var(--neon) 28%, transparent);
        }

        50% {
          border-color: var(--neon-hi);
          box-shadow:
            0 0 4px var(--neon-hi),
            0 0 15px color-mix(in srgb, var(--neon-hi) 85%, transparent),
            0 0 30px color-mix(in srgb, var(--neon) 55%, transparent);
        }
      }

      @media (prefers-reduced-motion: reduce) {
        .card.hero {
          animation: none;
          box-shadow:
            0 0 8px var(--neon),
            0 0 24px color-mix(in srgb, var(--neon) 45%, transparent);
        }
      }

      @media print {
        .card.hero {
          animation: none;
          box-shadow: none;
        }
      }

      .tabs {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.25rem;
        background: color-mix(in srgb, var(--bd) 60%, transparent);
        border-radius: 0.75rem;
        margin-bottom: 1.5rem;
      }

      .tab {
        padding: 0.375rem 0.875rem;
        border-radius: 0.5rem;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--mu);
      }

      .tab.on {
        background: var(--card);
        color: var(--sky);
        box-shadow: 0 1px 2px #0003;
      }

      .head {
        display: flex;
        align-items: flex-start;
        gap: 0.9rem;
        flex-wrap: wrap;
        margin-top: 0.25rem;
      }

      .ib {
        width: 3rem;
        height: 3rem;
        border-radius: 0.75rem;
        display: grid;
        place-items: center;
        flex: none;
        color: var(--a);
        background: color-mix(in srgb, var(--a) 14%, transparent);
      }

      .ib .ic {
        width: 22px;
        height: 22px;
      }

      .min {
        flex: 1;
        min-width: 15rem;
      }

      .head h3 {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--hd);
      }

      .desc {
        font-size: 0.85rem;
        color: var(--mu);
        line-height: 1.65;
        margin-top: 0.25rem;
        max-width: 46rem;
      }

      .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
      }

      .btn {
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0.4rem 0.875rem;
        border-radius: 0.5rem;
        font-size: 0.75rem;
        font-weight: 600;
        background: var(--soft);
        border: 1px solid var(--bd);
        color: var(--tx);
        transition:
          border-color 0.35s ease,
          box-shadow 0.35s ease,
          color 0.35s ease;
      }

      .btn.pri {
        border-color: var(--a);
      }

      .btn:hover,
      .btn:focus-visible {
        border-color: var(--a);
        color: var(--a);
        outline: 0;
        box-shadow:
          0 0 0 1px var(--a),
          0 0 8px 1px var(--a),
          0 0 18px 2px color-mix(in srgb, var(--a) 55%, transparent);
      }

      .grid {
        display: grid;
        gap: 1rem;
        margin-top: 1.4rem;
        grid-template-columns: 1fr;
      }

      @media (min-width: 640px) {
        .grid.n2,
        .grid.n3 {
          grid-template-columns: repeat(2, 1fr);
        }
      }

      @media (min-width: 1024px) {
        .grid.n3 {
          grid-template-columns: repeat(3, 1fr);
        }
      }

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

      .shot figcaption {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--mu);
        margin-top: 0.5rem;
        text-align: center;
      }

      .frame {
        position: relative;
        display: block;
        width: 100%;
        aspect-ratio: 16/9;
        border-radius: 0.75rem;
        overflow: hidden;
        border: 1.5px dashed
          color-mix(in srgb, var(--a, #16a34a) 55%, var(--bd));
        background: color-mix(in srgb, var(--a, #16a34a) 7%, var(--soft));
      }

      .frame.has {
        border-style: solid;
        border-width: 2px;
        border-color: color-mix(in srgb, var(--a, #16a34a) 75%, var(--bd));
        cursor: zoom-in;
      }

      .hero .frame,
      .hero .frame *,
      .hero .frame.has {
        cursor: default;
      }

      .frame img {
        position: absolute;
        inset: 0.5rem;
        width: calc(100% - 1rem);
        height: calc(100% - 1rem);
        object-fit: cover;
        border-radius: 0.4rem;
        opacity: 0.85; /* 1 = كاملة، 0 = شفافة تماماً */
      }

      .hero .frame img {
        opacity: 1;
      }

      .ph {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        color: var(--mu);
      }

      .ph .ic {
        width: 26px;
        height: 26px;
        opacity: 0.7;
      }

      .ph small {
        font-size: 0.72rem;
      }

      .frame.has .ph {
        display: none;
      }

      #none {
        display: none;
        text-align: center;
        padding: 3rem 1rem;
        color: var(--mu);
      }

      #none.show {
        display: block;
      }

      .hide {
        display: none !important;
      }

      footer {
        border-top: 1px solid var(--bd);
        padding: 1.25rem 1rem;
        text-align: center;
        font-size: 0.75rem;
        color: var(--mu);
      }

      #lb {
        position: fixed;
        inset: 0;
        z-index: 100;
        background: #000d;
        display: none;
        place-items: center;
        padding: 1rem;
        cursor: zoom-out;
      }

      #lb.on {
        display: grid;
      }

      #lb img {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0.5rem;
      }

      @media (max-width: 700px) {
        .search {
          width: 8rem;
        }

        .hide-sm {
          display: none;
        }
      }

      @media print {
        header,
        .tabs,
        .actions,
        #lb {
          display: none !important;
        }

        body {
          background: #fff;
        }

        .card {
          break-inside: avoid;
          box-shadow: none;
        }
      }
