/* ==========================================================
   REPOSITORY PAGE ONLY
   Visual redesign for the public repository.
   All selectors are scoped to .repository-page or .repository-body.
   No global components are restyled here.
========================================================== */

.repository-body {
    background: #f7faff;
    color: #173b72;
}

.repository-body .ai-life-canvas,
.repository-body .background-blur,
.repository-body .background-grid {
    display: none !important;
}

.repository-page {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(700px 420px at -5% 3%, rgba(89, 151, 255, .13), transparent 68%),
        radial-gradient(640px 430px at 105% 24%, rgba(139, 92, 246, .09), transparent 67%),
        linear-gradient(180deg, #f8fbff 0%, #f6faff 48%, #fbfcff 100%);
    min-height: 100vh;
}

.repository-page::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .34;
    background-image:
        linear-gradient(135deg, transparent 49.5%, rgba(67, 133, 237, .08) 50%, transparent 50.5%);
    background-size: 180px 180px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 42%);
}

.repository-hero {
    position: relative;
    padding: 104px 0 30px;
    min-height: 330px;
}

.repository-hero-shell {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
    align-items: center;
    gap: 30px;
}

.repository-hero-copy {
    max-width: 700px;
}

.repository-tag {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 17px;
    border: 1px solid rgba(70, 144, 255, .30);
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 8px 28px rgba(51, 112, 207, .08);
    color: #1479e8;
    font-size: 13px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.repository-hero-copy h1 {
    margin: 17px 0 14px;
    max-width: 690px;
    color: #123b77;
    font-size: clamp(44px, 5vw, 68px);
    line-height: .99;
    letter-spacing: -.045em;
    font-weight: 850;
}

.repository-hero-copy h1 span {
    display: inline-block;
    background: linear-gradient(100deg, #168cf3 4%, #4e75f5 46%, #8958ed 88%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.repository-hero-copy p {
    max-width: 610px;
    color: #6682ad;
    font-size: 16px;
    line-height: 1.75;
    font-weight: 500;
}

.repository-hero-visual {
    position: relative;
    min-height: 270px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.repository-hero-visual img {
    position: relative;
    z-index: 2;
    width: min(100%, 470px);
    max-height: 290px;
    object-fit: contain;
    filter: drop-shadow(0 25px 34px rgba(51, 115, 222, .14));
}

.repository-visual-glow {
    position: absolute;
    width: 410px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(86, 158, 255, .20), rgba(136, 105, 246, .08) 45%, transparent 72%);
    filter: blur(8px);
}

.repository-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.repository-orb-left {
    width: 330px;
    height: 330px;
    left: -195px;
    top: -110px;
    background: radial-gradient(circle at 60% 55%, rgba(89, 157, 255, .16), rgba(89, 157, 255, .05) 60%, transparent 70%);
}

.repository-orb-right {
    width: 430px;
    height: 430px;
    right: -245px;
    bottom: -235px;
    background: radial-gradient(circle at 35% 35%, rgba(132, 103, 241, .13), rgba(132, 103, 241, .04) 57%, transparent 72%);
}

.repository-dots {
    position: absolute;
    width: 76px;
    height: 64px;
    opacity: .52;
    background-image: radial-gradient(circle, rgba(62, 123, 250, .48) 1.3px, transparent 1.4px);
    background-size: 12px 12px;
    pointer-events: none;
}

.repository-dots-top { right: 4.5%; top: 42px; }
.repository-dots-bottom { left: 0; bottom: 26px; opacity: .36; }

.repository-line {
    position: absolute;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(69, 139, 246, .22), transparent);
    pointer-events: none;
}

.repository-line-one { width: 140px; left: 3.5%; top: 285px; }
.repository-line-two { width: 88px; left: 8%; top: 301px; }

.repository-search-panel {
    position: relative;
    z-index: 3;
    padding: 0 0 24px;
}

.repository-search-card {
    position: relative;
    max-width: 1110px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid rgba(104, 158, 238, .24);
    border-radius: 27px;
    background: rgba(255, 255, 255, .90);
    box-shadow: 0 20px 52px rgba(65, 117, 194, .13), 0 2px 8px rgba(45, 94, 162, .05);
    backdrop-filter: blur(18px);
}

.repository-search-accent {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    border-radius: 27px 27px 0 0;
    background: linear-gradient(90deg, #218df6, #6678f3 55%, #8e5be8);
    opacity: .78;
}

.repository-search-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.repository-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 12px;
    align-items: end;
}

.repository-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.repository-field label {
    padding-left: 3px;
    color: #6d86ac;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .02em;
}

.repository-input-wrap,
.repository-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid #d7e6f7;
    border-radius: 14px;
    background: #ffffff;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.repository-input-wrap:focus-within,
.repository-select-wrap:focus-within {
    border-color: #72b4ff;
    box-shadow: 0 0 0 4px rgba(57, 143, 242, .08);
    background: #fff;
}

.repository-field-icon,
.repository-filter-icon {
    flex: 0 0 20px;
    margin-left: 14px;
    color: #3289eb;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

.repository-input-wrap input,
.repository-select-wrap select {
    width: 100%;
    min-width: 0;
    height: 48px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #254c80;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
}

.repository-input-wrap input {
    padding: 0 14px 0 10px;
}

.repository-input-wrap input::placeholder {
    color: #9aacc3;
    font-weight: 500;
}

.repository-select-wrap {
    background: linear-gradient(180deg, #fbfdff 0%, #f6faff 100%);
}

.repository-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding: 0 40px 0 10px;
}

.repository-chevron {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f85b2;
    font-size: 16px;
    pointer-events: none;
}

.repository-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.repository-search-button {
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    background: linear-gradient(105deg, #168cf4 0%, #4979f2 55%, #7b58e8 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(69, 119, 230, .18);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.repository-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(69, 119, 230, .24);
    filter: saturate(1.05);
}

.repository-search-button span {
    font-size: 17px;
    line-height: 1;
}

.repository-results {
    position: relative;
    z-index: 2;
    padding: 28px 0 88px;
}

.repository-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 22px;
}

.repository-heading-line {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 3px;
}

.repository-heading-line span {
    width: 5px;
    height: 23px;
    border-radius: 999px;
    background: linear-gradient(180deg, #228cf5, #765ff0);
}

.repository-heading-line p {
    color: #6b87ad;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.repository-section-heading h2 {
    color: #153d76;
    font-size: 29px;
    line-height: 1.15;
    letter-spacing: -.025em;
    font-weight: 850;
}

.repository-result-count {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: #8298b8;
    font-size: 12px;
}

.repository-result-count strong {
    color: #2769bd;
    font-size: 17px;
}

.repository-project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.repository-project-card {
    position: relative;
    min-width: 0;
    min-height: 315px;
    display: flex;
    flex-direction: column;
    padding: 18px;
    overflow: hidden;
    border: 1px solid #dce9f8;
    border-radius: 21px;
    background: linear-gradient(145deg, #fff 0%, #fbfdff 68%, #faf9ff 100%);
    box-shadow: 0 10px 30px rgba(49, 105, 176, .08);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.repository-project-card::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 130px;
    right: -85px;
    top: -75px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(115, 103, 243, .11), transparent 70%);
    pointer-events: none;
}

.repository-project-card:hover {
    transform: translateY(-5px);
    border-color: #bcdcff;
    box-shadow: 0 20px 42px rgba(45, 103, 180, .13);
}

.repository-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.repository-project-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(74, 142, 238, .18);
    border-radius: 13px;
    background: linear-gradient(135deg, #eaf5ff, #eef0ff);
    color: #388cf1;
    font-size: 21px;
    font-weight: 800;
}

.repository-card-body {
    flex: 1;
    padding-top: 17px;
}

.repository-card-body h3 {
    margin-bottom: 16px;
    color: #173f7b;
    font-size: 17px;
    line-height: 1.38;
    letter-spacing: -.015em;
    font-weight: 800;
}

.repository-meta-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.repository-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    color: #6682a9;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 550;
}

.repository-meta-item span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.repository-meta-icon {
    flex: 0 0 18px;
    width: 18px;
    color: #418ee9;
    font-size: 15px;
    text-align: center;
    line-height: 1.3;
}

.repository-researchers { color: #54759f; }
.repository-adviser { color: #8095b3; }

.repository-view-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 43px;
    margin-top: 17px;
    padding: 0 13px 0 16px;
    border: 1px solid #b8d9ff;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fbff);
    color: #197be1;
    font-size: 12px;
    font-weight: 800;
    transition: background .22s ease, border-color .22s ease, color .22s ease;
}

.repository-view-button span:last-child {
    font-size: 18px;
    transition: transform .22s ease;
}

.repository-project-card:hover .repository-view-button {
    border-color: #6faaf1;
    background: linear-gradient(105deg, #edf7ff, #f4f1ff);
}

.repository-project-card:hover .repository-view-button span:last-child {
    transform: translateX(3px);
}

.repository-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 30px;
}

.repository-page-number {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid #d5e4f6;
    border-radius: 11px;
    background: #fff;
    color: #6683aa;
    font-size: 12px;
    font-weight: 750;
    transition: all .2s ease;
}

.repository-page-number:hover,
.repository-page-number.active {
    border-color: #5e91f2;
    color: #fff;
    background: linear-gradient(105deg, #268cf4, #765ce9);
    box-shadow: 0 8px 18px rgba(76, 103, 226, .16);
}

.repository-empty-state {
    max-width: 620px;
    margin: 25px auto 0;
    padding: 54px 30px;
    text-align: center;
    border: 1px solid #dce8f6;
    border-radius: 24px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 15px 38px rgba(48, 101, 172, .08);
}

.repository-empty-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 15px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #edf6ff;
    color: #338bed;
    font-size: 26px;
}

.repository-empty-state h2 {
    margin-bottom: 7px;
    color: #173e77;
    font-size: 23px;
}

.repository-empty-state p {
    margin-bottom: 20px;
    color: #7a91b0;
    font-size: 13px;
}

.repository-reset-button {
    min-height: 43px;
    padding: 0 18px;
    border-radius: 12px;
}

@media (max-width: 1050px) {
    .repository-hero-shell { grid-template-columns: 1fr .78fr; gap: 20px; }
    .repository-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .repository-hero { padding: 88px 0 26px; }
    .repository-hero-shell { grid-template-columns: 1fr; }
    .repository-hero-copy { text-align: center; margin: 0 auto; }
    .repository-hero-copy p { margin: 0 auto; }
    .repository-hero-visual { min-height: 205px; margin-top: -10px; }
    .repository-hero-visual img { width: min(100%, 390px); max-height: 225px; }
    .repository-search-row { grid-template-columns: 1fr; }
    .repository-search-button { width: 100%; }
    .repository-filters { grid-template-columns: 1fr; }
    .repository-section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 560px) {
    .repository-hero { padding: 76px 0 18px; }
    .repository-hero-copy h1 { font-size: 43px; }
    .repository-hero-copy p { font-size: 14px; }
    .repository-hero-visual { min-height: 175px; }
    .repository-hero-visual img { max-height: 185px; }
    .repository-search-card { padding: 15px; border-radius: 21px; }
    .repository-project-grid { grid-template-columns: 1fr; gap: 14px; }
    .repository-project-card { min-height: 0; }
    .repository-results { padding-bottom: 62px; }
    .repository-section-heading h2 { font-size: 25px; }
    .repository-dots-top { right: -15px; top: 24px; }
    .repository-line-one { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .repository-project-card,
    .repository-search-button,
    .repository-reset-button,
    .repository-view-button,
    .repository-view-button span:last-child,
    .repository-page-number { transition: none; }
}

/* Contextual search result emphasis. The inherited text color keeps this
   readable in both light and dark repository themes. */
.repository-project-card .similarity-highlight,
.repository-project-card mark.similarity-highlight {
    background: rgba(250, 204, 21, 0.28);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
}

.repository-search-match {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted, #8b93a7);
}

.repository-search-abstract {
    margin: 5px 0 10px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary, #aeb6c7);
}

/* Matched-context line under a search result card */
.repository-search-context {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted, #6b7280);
    margin: 2px 0 6px;
    word-break: break-word;
}
