/* The subject directory uses paper, ink, and a different accent for each discipline. */
.subject-home { background: #faf9f5; }
.subject-portal { width: min(calc(100% - 3rem), 78rem); padding-block: clamp(1.4rem, 3.6vw, 3.3rem) .5rem; }
.portal-cover {
    display: grid; grid-template-columns: 1.05fr 1fr; align-items: stretch;
    border: 1px solid #d6dbd5; border-radius: 1.15rem; overflow: hidden;
    background: #f0f2e9;
}
.portal-intro {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
    padding: clamp(1.75rem, 3.7vw, 3.4rem);
}
.portal-intro h1 {
    max-width: 15ch; margin: 0; color: #142d38;
    font-size: clamp(2.1rem, 4vw, 3.6rem); line-height: 1.08;
    letter-spacing: var(--display-tracking); font-weight: var(--display-weight); text-wrap: balance;
}
.portal-intro p { max-width: 39ch; margin: 1rem 0 1.5rem; color: #41535a; font-size: clamp(1rem, 1.3vw, 1.085rem); line-height: 1.6; }
.portal-action {
    display: inline-flex; align-items: center; gap: 1.3rem; min-height: 44px;
    padding: .65rem 1.05rem; border-radius: .5rem; background: #1c494a; color: white;
    text-decoration: none; font-weight: 620;
}
.portal-action:hover { background: #103d3f; color: white; }
.portal-illustration { display: block; align-self: stretch; width: 100%; height: 100%; object-fit: contain; background-color: #1d3642;
    background-image: linear-gradient(90deg, #9bc9c012 1px, transparent 1px), linear-gradient(#9bc9c012 1px, transparent 1px), linear-gradient(120deg, #243d49, #142f3d);
    background-size: 20px 20px, 20px 20px, 100% 100%; }
.subject-directory { padding-top: clamp(1.5rem, 3vw, 2.55rem); }
.subject-directory h2, .portal-resources h2 {
    margin: 0 0 1rem; color: #1d3038; font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    font-weight: var(--display-weight); line-height: 1.22; letter-spacing: -.025em;
}
.subject-grid {
    list-style: none; margin: 0; padding: 0; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem;
}
.subject-tile { min-width: 0; --tone: #395f79; --wash: #e5edf4; }
.subject-tile[data-subject=programming] { --tone: #22615b; --wash: #e1f0e8; }
.subject-tile[data-subject=maths] { --tone: #896239; --wash: #f8edd8; }
.subject-tile[data-subject=chemistry] { --tone: #635383; --wash: #efebf6; }
.subject-card {
    display: flex; flex-direction: column; align-items: flex-start; height: 100%; margin: 0;
    padding: clamp(1.15rem, 2vw, 1.6rem); border: 1px solid #d7ddd9;
    border-radius: .85rem; background: #fff; color: #1b303a; text-decoration: none;
}
a.subject-card { border-color: #b3cdc3; box-shadow: 0 5px 16px -13px #264b43; }
a.subject-card:hover, a.subject-card:focus-visible { background: #f4faf6; border-color: var(--tone); color: #133833; }
.subject-symbol { display: grid; place-items: center; width: 2.85rem; height: 2.85rem; border-radius: .72rem; color: var(--tone); background: var(--wash); }
.subject-card h3 { margin: 1.05rem 0 .4rem; color: inherit; font-size: clamp(1.16rem, 1.7vw, 1.43rem); font-weight: var(--display-weight); letter-spacing: -.022em; }
.subject-card p { max-width: 43ch; flex: 1; margin: 0 0 1.15rem; color: #516067; line-height: 1.57; }
.subject-foot {
    display: flex; width: 100%; align-items: center; justify-content: space-between;
    padding-top: .85rem; border-top: 1px solid #e2e8e2; color: var(--tone); font-size: .88rem; font-weight: 630;
}
.subject-foot > span { font-size: 1.08rem; line-height: 1; }
.subject-planned { justify-content: flex-start; gap: .4rem; color: #60696c; font-weight: 500; }
.subject-planned::before { content: ''; width: .45rem; height: .45rem; border: 1.4px solid currentColor; border-radius: 50%; }
.portal-resources { padding: 1.6rem 0 0; margin: 1.8rem 0 0; border-top: 1px solid #d7ddd9; }
.portal-resources h2 { font-size: 1.17rem; letter-spacing: -.012em; margin-bottom: .45rem; }
.portal-resources nav { display: flex; gap: .25rem 1.7rem; flex-wrap: wrap; }
.portal-resources a { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; color: #25534f; font-weight: 550; }
.portal-resources a span { text-decoration: none; }
@media (max-width: 770px) {
    .subject-portal { width: min(calc(100% - 2rem), 42rem); }
    .portal-cover { grid-template-columns: 1fr; }
    .portal-intro { padding: 1.6rem; }
    .portal-intro h1 { max-width: none; }
    .portal-illustration { height: clamp(8rem, 31vw, 13.75rem); }
    .subject-grid { grid-template-columns: 1fr; }
    .subject-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .25rem .9rem; }
    .subject-symbol { grid-row: 1 / 3; width: 2.5rem; height: 2.5rem; }
    .subject-card h3 { margin: .1rem 0; }
    .subject-card p { grid-column: 2; margin: 0; }
    .subject-foot { grid-column: 1 / -1; margin-top: .6rem; }
}
@media print {
    .portal-cover { display: block; border: 0; }
    .portal-intro { padding: 0; }
    .portal-illustration, .portal-action { display: none; }
    .subject-card { break-inside: avoid; }
}
