@import url("colours.css");

body {
    font-family: monospace;
    background: var(--background);
    color: var(--text);
    line-height: 1.4;
    margin: 0;
    padding: 2rem;
    font-size: 0.9rem;
}

main {
    max-width: 80ch;
    margin: 0 auto;
    padding: 0;
}

h1 {
    font-family: monospace;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 900;
    color: var(--primary);
    margin: 0 0 2rem 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    padding-bottom: 0.5em;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background-color: var(--accent);
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        width: 0;
    }

    to {
        width: 80px;
    }
}

h2 {
    font-family: monospace;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 800;
    color: var(--primary);
    margin: 2.5rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

h2:hover {
    color: var(--accent);
}

h3 {
    font-family: monospace;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 700;
    color: var(--text);
    margin: 1.5rem 0 0.8rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

p {
    font-family: monospace;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    line-height: 1.7;
    margin: 0 0 1rem 0;
    padding: 0;
    max-width: 70ch;
    color: var(--text);
}

/* Project entry styling */
.project-entry {
    margin: 0 0 4rem 0;
    padding: 2rem;
    border: 2px solid var(--secondary);
    background-color: var(--background);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-entry:nth-child(2) {
    animation-delay: 0.1s;
}

.project-entry:nth-child(3) {
    animation-delay: 0.2s;
}

.project-entry:nth-child(4) {
    animation-delay: 0.3s;
}

.project-entry:hover {
    transform: translateX(8px);
    border-color: var(--accent);
}

.project-entry h2 {
    margin-top: 0;
    position: relative;
    display: inline-block;
}

.project-entry h2::before {
    content: "";
    color: var(--accent);
    margin-right: 0.5em;
    font-weight: 900;
}

.project-description {
    margin: 1rem 0 1.5rem 2ch;
    font-family: monospace;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    line-height: 1.7;
    padding-left: 1em;
    border-left: 3px solid var(--secondary);
}

.project-features {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background-color: var(--secondary);
    border-left: 4px solid var(--accent);
}

.project-features h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.project-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-features li {
    font-family: monospace;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    line-height: 1.6;
    margin-bottom: 0.8em;
    padding-left: 2ch;
    position: relative;
}

.project-features li::before {
    content: "";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.project-features li strong {
    color: var(--primary);
    font-weight: 800;
}

/* Tech tags styling */
.project-tech {
    margin: 1.5rem 0;
}

.project-tech h3 {
    margin-bottom: 0.8rem;
}

.tech-tag {
    display: inline-block;
    font-family: monospace;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 700;
    padding: 0.4em 0.8em;
    margin: 0.3em 0.3em 0.3em 0;
    background-color: var(--primary);
    color: var(--background);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--primary);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background-color: var(--background);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Project links styling */
.project-links {
    margin: 1.5rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-link {
    font-family: monospace;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    font-weight: 700;
    text-decoration: none;
    color: var(--background);
    background-color: var(--primary);
    padding: 0.6em 1.2em;
    border: 2px solid var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--accent);
    transition: left 0.4s ease;
    z-index: -1;
}

.project-link:hover::before {
    left: 0;
}

.project-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Regular paragraph links */
.project-entry p a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid var(--secondary);
    transition: all 0.3s ease;
}

.project-entry p a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Build Status Styling */
.build-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.project-status {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.8em;
    background-color: var(--secondary);
    border-left: 3px solid var(--accent);
}

.build-status-text {
    font-weight: 700;
    color: var(--text);
    font-family: monospace;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4em 0.8em;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--background);
    font-family: monospace;
    border: 2px solid transparent;
}

.status-badge:hover {
    transform: translateY(-2px);
}

.status-badge.success {
    background-color: #22c55e;
    border-color: #22c55e;
}

.status-badge.success:hover {
    background-color: var(--background);
    color: #22c55e;
}

.status-badge.failure {
    background-color: #dc2626;
    border-color: #dc2626;
}

.status-badge.failure:hover {
    background-color: var(--background);
    color: #dc2626;
}

.status-badge.in_progress {
    background-color: #2563eb;
    border-color: #2563eb;
    animation: pulse 2s infinite;
}

.status-badge.in_progress:hover {
    background-color: var(--background);
    color: #2563eb;
    animation: none;
}

.status-badge.unknown {
    background-color: #4b5563;
    border-color: #4b5563;
}

.status-badge.unknown:hover {
    background-color: var(--background);
    color: #4b5563;
}

.status-badge.error {
    background-color: #d97706;
    border-color: #d97706;
}

.status-badge.error:hover {
    background-color: var(--background);
    color: #d97706;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.status-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

.loading-skeleton {
    background: var(--secondary);
    animation: loading 1.5s infinite;
    width: 100px;
    height: 28px;
    border: 2px solid var(--secondary);
}

@keyframes loading {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .project-entry {
        padding: 1.5rem;
        margin-bottom: 2.5rem;
    }

    .project-entry:hover {
        transform: none;
    }

    .project-description {
        margin-left: 0;
        padding-left: 0.8em;
    }

    .project-features {
        padding: 1rem;
    }

    .project-links {
        flex-direction: column;
    }

    .project-link {
        text-align: center;
    }

    h1::after {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .project-entry {
        padding: 1rem;
    }

    .project-features li {
        font-size: 0.85rem;
    }

    .tech-tag {
        font-size: 0.75rem;
        padding: 0.3em 0.6em;
    }

    .project-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .build-status {
        margin-left: 0;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    main {
        max-width: 90ch;
    }

    .project-entry {
        padding: 2.5rem;
    }

    .project-features {
        padding: 2rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .project-entry {
        border-width: 3px;
    }

    .tech-tag,
    .project-link,
    .status-badge {
        border-width: 3px;
    }
}