/* style.css – monochromatic, high‑contrast, no colours except black & white */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #ffffff;
    color: #000000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-weight: 400;
}

.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
    flex: 1;
}

/* typography */
h1 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    border-bottom: 3px solid #000;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.subhead {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 2.5rem;
    max-width: 700px;
}

/* input section */
.input-panel {
    margin-bottom: 3rem;
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 2rem;
}

.input-panel label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.input-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

#baseColorPicker {
    width: 60px;
    height: 50px;
    border: 1px solid #000;
    background: #fff;
    cursor: pointer;
    padding: 0;
}

#baseColorHex {
    flex: 2 1 200px;
    padding: 0.8rem 1rem;
    border: 1px solid #000;
    background: #ffffff;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 500;
    transition: 0.1s;
}

#baseColorHex:focus {
    outline: none;
    background: #f2f2f2;
}

.btn {
    background: #ffffff;
    border: 2px solid #000;
    color: #000;
    padding: 0.8rem 1.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.btn:hover {
    background: #000;
    color: #ffffff;
}

.input-hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #444;
    border-left: 2px solid #aaa;
    padding-left: 1rem;
}

/* palette title */
.palette-title {
    font-weight: 400;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    border-bottom: 1px dashed #aaa;
    padding-bottom: 0.5rem;
}

.title-base {
    background: #f0f0f0;
    padding: 0.2rem 0.8rem;
    font-family: monospace;
    font-size: 1rem;
}

/* palette grid */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

/* colour card */
.color-card {
    border: 1px solid #000;
    background: #ffffff;
    transition: 0.2s ease;
}

.color-card:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 0 rgba(0,0,0,0.15);
}

.color-preview {
    height: 140px;
    width: 100%;
    border-bottom: 1px solid #000;
}

.card-body {
    padding: 1.2rem 1rem 1rem;
}

.color-hex {
    font-family: monospace;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.2rem;
    letter-spacing: 0.5px;
    word-break: break-all;
}

/* contrast rows */
.contrast-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    font-size: 0.95rem;
}

.contrast-bg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bg-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #000;
}

.bg-badge.white {
    background: #ffffff;
    color: #000;
    border: 1px solid #000;
}

.bg-badge.black {
    background: #000000;
    color: #ffffff;
}

.contrast-value {
    font-family: monospace;
    font-weight: 600;
    background: #f2f2f2;
    padding: 0.2rem 0.5rem;
    border: 1px solid #ccc;
}

/* badge styles – only black & white */
.badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    text-transform: uppercase;
    border: 1px solid #000;
    min-width: 42px;
    text-align: center;
}

.badge.aa {
    background: #ffffff;
    color: #000;
}

.badge.aaa {
    background: #000000;
    color: #ffffff;
}

.badge.fail {
    background: #ffffff;
    color: #666;
    border: 1px solid #aaa;
    text-decoration: line-through;
}

/* small text for large‑text info */
.card-body small {
    display: block;
    text-align: center;
    margin-top: 0.6rem;
    font-size: 0.7rem;
    color: #444;
    border-top: 1px dotted #ccc;
    padding-top: 0.5rem;
}

/* legend */
.legend {
    border: 1px solid #000;
    background: #f9f9f9;
    padding: 1.5rem 2rem;
}

.legend h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.legend ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-note {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: #333;
}

/* footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #000;
    background: #ffffff;
    color: #333;
    font-size: 0.9rem;
}

.footer-link {
    color: #000;
    text-decoration: none;
    border-bottom: 1px dotted #000;
}

.footer-link:hover {
    border-bottom: 2px solid #000;
}

/* responsive */
@media (max-width: 600px) {
    .container { padding: 0 1rem; }
    h1 { font-size: 1.8rem; }
    .input-row { flex-direction: column; align-items: stretch; }
    #baseColorPicker { width: 100%; height: 55px; }
    .btn { width: 100%; }
    .legend ul { flex-direction: column; gap: 0.8rem; }
}
