/* --------------------------------------------------
   1. Design settings
   Change these colors and sizes to personalize the site.
-------------------------------------------------- */
:root {
    color-scheme: dark;
    --page-background: #100f14;
    --card-background: #1a1821;
    --card-hover-background: #211d2c;
    --main-text: #f3eff9;
    --muted-text: #b0a9bd;
    --accent-color: #b9a2ef;
    --accent-light: #e0d1ff;
    --border-color: #332d40;
    --soft-border: rgba(195, 175, 239, 0.12);
    --page-width: 1120px;
    --page-padding: 32px;
    --card-radius: 22px;
    --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* --------------------------------------------------
   2. Page foundations
-------------------------------------------------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 104px;
}

body {
    background-color: var(--page-background);
    color: var(--main-text);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    line-height: 1.65;
    margin: 0;
    min-height: 100vh;
    overflow-wrap: break-word;
}

/* Soft, fixed lighting adds depth without covering the content. */
body::before {
    background:
        radial-gradient(ellipse at 82% 5%, rgba(135, 90, 215, 0.14), transparent 43%),
        radial-gradient(ellipse at 6% 60%, rgba(118, 88, 164, 0.06), transparent 34%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: fixed;
    z-index: -1;
}

a {
    color: inherit;
}

img,
video {
    max-width: 100%;
}

::selection {
    background-color: #55406f;
    color: #ffffff;
}

/* --------------------------------------------------
   3. Top navigation
   These are the existing navigation links.
-------------------------------------------------- */
.site-header {
    align-items: center;
    background-color: rgba(16, 15, 20, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--soft-border);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: var(--page-width);
    padding: 23px var(--page-padding);
    position: sticky;
    top: 0;
    transition: padding 220ms ease, border-color 220ms ease;
    z-index: 10;
}

/* JavaScript adds this class after the visitor starts scrolling. */
.site-header.is-scrolled {
    border-color: var(--border-color);
    padding-top: 14px;
    padding-bottom: 14px;
}

/* The existing KS logo receives a soft lavender finish. */
.site-logo {
    align-items: center;
    background: linear-gradient(135deg, #e1d1fb, #ad92dc);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(161, 128, 219, 0.14);
    color: #21192e;
    display: flex;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 750;
    height: 43px;
    justify-content: center;
    letter-spacing: -0.4px;
    text-decoration: none;
    transition: box-shadow 220ms ease, transform 220ms ease;
    width: 43px;
}

.site-logo:hover {
    box-shadow: 0 4px 28px rgba(161, 128, 219, 0.26);
    transform: translateY(-2px);
}

/* Simple link underlines keep the header visually quiet. */
.main-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: flex-end;
}

.main-navigation a {
    color: var(--muted-text);
    font-size: 14px;
    padding: 7px 0;
    position: relative;
    text-decoration: none;
    transition: color 180ms ease;
}

.main-navigation a::after {
    background-color: var(--accent-color);
    border-radius: 2px;
    bottom: 0;
    content: "";
    height: 2px;
    left: 0;
    position: absolute;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 220ms var(--ease-out);
    width: 100%;
}

.main-navigation a:hover,
.main-navigation a.is-current {
    color: var(--main-text);
}

.main-navigation a:hover::after,
.main-navigation a.is-current::after {
    transform: scaleX(1);
}

/* --------------------------------------------------
   4. Shared page container and section labels
-------------------------------------------------- */
.page-container {
    margin: 0 auto;
    max-width: var(--page-width);
    padding: 0 var(--page-padding);
}

.small-heading {
    color: var(--accent-color);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 1.7px;
    margin: 0 0 22px;
    text-transform: uppercase;
}

/* The introduction label keeps its exact text. */
.hero-section > .small-heading {
    align-items: center;
    background-color: rgba(185, 162, 239, 0.05);
    border: 1px solid var(--soft-border);
    border-radius: 999px;
    display: inline-flex;
    gap: 10px;
    line-height: 1.8;
    padding: 7px 13px;
}

.hero-section > .small-heading::before {
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(185, 162, 239, 0.4);
    content: "";
    flex-shrink: 0;
    height: 6px;
    width: 6px;
}

/* --------------------------------------------------
   5. Home page introduction
   The single-column layout preserves the simple introduction.
-------------------------------------------------- */
.hero-section {
    max-width: 870px;
    padding: clamp(68px, 8vw, 104px) 0 100px;
}

.hero-section h1 {
    background: linear-gradient(110deg, #f5f0fc 12%, #c5acee 85%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-size: clamp(52px, 8.3vw, 96px);
    font-weight: 700;
    letter-spacing: -4.8px;
    line-height: 1.02;
    margin: 0;
    max-width: 850px;
    text-wrap: balance;
}

.hero-description {
    color: var(--muted-text);
    font-size: 19px;
    line-height: 1.8;
    margin: 28px 0 30px;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* The original action buttons retain their text and destinations. */
.primary-button,
.secondary-button {
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    min-height: 48px;
    padding: 11px 21px;
    text-decoration: none;
    transition:
        background-color 200ms ease,
        border-color 200ms ease,
        box-shadow 200ms ease,
        transform 200ms ease;
}

.primary-button {
    background-color: var(--accent-light);
    color: #221a30;
}

.secondary-button {
    background-color: rgba(185, 162, 239, 0.045);
    color: var(--main-text);
}

.primary-button:hover,
.secondary-button:hover {
    background-color: rgba(185, 162, 239, 0.12);
    border-color: #9277bd;
    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.16);
    color: var(--main-text);
    transform: translateY(-2px);
}

/* --------------------------------------------------
   6. My Work heading and existing navigation boxes
-------------------------------------------------- */
.work-section {
    padding-bottom: 96px;
}

.section-heading {
    align-items: center;
    border-bottom: 1px solid var(--soft-border);
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 20px;
}

.section-heading h2 {
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -1px;
    margin: 0;
    order: -1;
}

.section-heading .small-heading {
    margin: 0;
}

.work-card-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Shared card surface: subtle borders, soft light, consistent corners. */
.work-card,
.detail-card,
.semester-card,
.showcase-video-section,
.showcase-description {
    background:
        linear-gradient(145deg, rgba(196, 171, 240, 0.035), transparent 55%),
        var(--card-background);
    border: 1px solid var(--soft-border);
    border-radius: var(--card-radius);
    min-width: 0;
    position: relative;
}

.work-card {
    display: block;
    min-height: 277px;
    padding: 26px;
    text-decoration: none;
}

/* The home page keeps all three original clickable boxes. */
.card-number,
.detail-number {
    color: var(--accent-color);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
}

.work-card h3 {
    font-size: 27px;
    font-weight: 650;
    letter-spacing: -0.7px;
    line-height: 1.2;
    margin: 66px 0 11px;
}

.work-card p {
    color: var(--muted-text);
    font-size: 14px;
    line-height: 1.75;
    margin: 0;
    max-width: 320px;
}

.card-arrow {
    align-items: center;
    background-color: rgba(185, 162, 239, 0.06);
    border: 1px solid var(--soft-border);
    border-radius: 50%;
    color: var(--accent-light);
    display: flex;
    font-size: 19px;
    height: 37px;
    justify-content: center;
    position: absolute;
    right: 25px;
    top: 22px;
    transition:
        background-color 220ms ease,
        border-color 220ms ease,
        transform 220ms ease;
    width: 37px;
}

/* --------------------------------------------------
   7. Card hover lighting
   JavaScript updates the light position only while hovering.
-------------------------------------------------- */
.work-card,
.project-link-card,
.award-link-card,
.certificate-card {
    isolation: isolate;
    transition:
        border-color 250ms ease,
        box-shadow 250ms ease,
        transform 250ms var(--ease-out);
}

.work-card::before,
.project-link-card::before,
.award-link-card::before {
    background: radial-gradient(
        260px circle at var(--light-x, 50%) var(--light-y, 0%),
        rgba(178, 139, 240, 0.11),
        transparent 75%
    );
    border-radius: inherit;
    content: "";
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transition: opacity 250ms ease;
    z-index: -1;
}

/* Keyboard users receive the same highlight as mouse users. */
.work-card:hover,
.work-card:focus-visible,
.project-link-card:hover,
.project-link-card:focus-visible,
.award-link-card:hover,
.award-link-card:focus-visible,
.certificate-card:hover,
.certificate-card:focus-visible {
    border-color: rgba(185, 162, 239, 0.48);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px);
}

.work-card:hover::before,
.work-card:focus-visible::before,
.project-link-card:hover::before,
.project-link-card:focus-visible::before,
.award-link-card:hover::before,
.award-link-card:focus-visible::before {
    opacity: 1;
}

.work-card:hover .card-arrow,
.work-card:focus-visible .card-arrow {
    background-color: rgba(185, 162, 239, 0.14);
    border-color: rgba(185, 162, 239, 0.35);
    transform: translate(2px, -2px);
}

/* --------------------------------------------------
   8. Inner page introductions
-------------------------------------------------- */
.subpage-introduction {
    border-bottom: 1px solid var(--soft-border);
    padding: 76px 0 52px;
}

.subpage-introduction h1 {
    font-size: clamp(44px, 6.6vw, 76px);
    font-weight: 650;
    letter-spacing: -3px;
    line-height: 1.08;
    margin: 0;
    max-width: 920px;
    text-wrap: balance;
}

.subpage-introduction > p:last-child {
    color: var(--muted-text);
    font-size: 18px;
    line-height: 1.8;
    margin: 22px 0 0;
    max-width: 690px;
}

/* --------------------------------------------------
   9. Existing project and award boxes
-------------------------------------------------- */
.detail-card-list {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 36px 0 44px;
}

.detail-card {
    display: flex;
    flex-direction: column;
    min-height: 315px;
    padding: 29px;
}

.detail-card-top-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.detail-date {
    color: var(--muted-text);
    font-size: 12px;
}

.detail-card h2 {
    font-size: 29px;
    font-weight: 650;
    letter-spacing: -0.8px;
    line-height: 1.2;
    margin: 48px 0 14px;
    max-width: 410px;
}

.detail-card p {
    color: var(--muted-text);
    font-size: 15px;
    line-height: 1.75;
    margin: 0 0 23px;
}

.project-link-card,
.award-link-card {
    color: var(--main-text);
    text-decoration: none;
}

.project-card-call-to-action {
    border-top: 1px solid var(--soft-border);
    color: var(--accent-light);
    font-size: 12px;
    font-weight: 600;
    margin-top: auto;
    padding-top: 17px;
}

.award-card {
    min-height: 300px;
}

/* --------------------------------------------------
   10. Project showcase layout and local video player
-------------------------------------------------- */
.project-showcase {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    padding: 36px 0 44px;
}

.showcase-video-section,
.showcase-description {
    padding: 25px;
}

.showcase-video-section {
    background-color: #141219;
}

.showcase-video-section h2 {
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.4px;
    margin: 0 0 18px;
    text-transform: uppercase;
}

.showcase-description {
    display: flex;
    flex-direction: column;
}

.showcase-description .small-heading {
    margin-bottom: 15px;
}

.showcase-description h2 {
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -0.7px;
    line-height: 1.2;
    margin: 0 0 16px;
}

.showcase-description > p:not(.small-heading) {
    color: var(--muted-text);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

/* Video paths, native controls, and playback remain unchanged. */
.project-video,
.project-video-placeholder {
    aspect-ratio: 16 / 9;
    background-color: #08070b;
    border: 1px solid var(--soft-border);
    border-radius: 12px;
    display: block;
    margin-top: 26px;
    object-fit: contain;
    width: 100%;
}

.showcase-video-section .project-video,
.showcase-video-section .project-video-placeholder {
    margin-top: 0;
}

.project-video-placeholder {
    align-items: center;
    border-style: dashed;
    color: var(--muted-text);
    display: flex;
    font-size: 13px;
    justify-content: center;
}

/* Technology labels use the same restrained accent color. */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
    padding-top: 24px;
}

.tag-list span {
    background-color: rgba(185, 162, 239, 0.055);
    border: 1px solid var(--soft-border);
    border-radius: 999px;
    color: var(--accent-light);
    font-size: 11px;
    padding: 5px 10px;
}

/* --------------------------------------------------
   11. Award certificate gallery
-------------------------------------------------- */
.award-gallery {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 36px 0 44px;
}

.certificate-card {
    background-color: var(--card-background);
    border: 1px solid var(--soft-border);
    border-radius: var(--card-radius);
    color: var(--main-text);
    display: block;
    overflow: hidden;
    text-decoration: none;
}

.certificate-card img {
    display: block;
    height: auto;
    width: 100%;
}

.certificate-caption {
    align-items: center;
    border-top: 1px solid var(--soft-border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 18px 22px;
}

.certificate-caption h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.certificate-caption span {
    color: var(--accent-color);
    font-size: 11px;
}

/* --------------------------------------------------
   12. Coursework timeline
   Semester information sits beside its course list.
-------------------------------------------------- */
.semester-list {
    display: grid;
    gap: 18px;
    padding: 36px 0 44px;
}

.semester-card {
    column-gap: 36px;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    padding: 28px;
}

/* A slightly brighter border identifies the latest semester. */
.semester-card:first-child {
    background:
        linear-gradient(110deg, rgba(170, 130, 229, 0.085), transparent 58%),
        var(--card-background);
    border-color: rgba(185, 162, 239, 0.32);
}

.semester-heading {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

.semester-heading h2 {
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -0.6px;
    line-height: 1.2;
    margin: 0;
}

.semester-heading > span {
    color: var(--muted-text);
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.course-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.course-list li {
    align-items: center;
    border-top: 1px solid var(--soft-border);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 13px 0;
}

.course-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.course-list li:last-child {
    padding-bottom: 0;
}

.course-list li > span:first-child {
    color: #d9d2e4;
    font-size: 14px;
}

.course-grade,
.course-status {
    align-items: center;
    background-color: rgba(185, 162, 239, 0.12);
    border: 1px solid rgba(185, 162, 239, 0.16);
    border-radius: 9px;
    color: var(--accent-light);
    display: flex;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    justify-content: center;
    min-height: 29px;
    min-width: 29px;
}

.course-status {
    border-radius: 999px;
    font-size: 10px;
    padding: 3px 10px;
}

/* Keeps the existing coursework profile link below the courses. */
.text-link {
    color: var(--accent-color);
    font-size: 12px;
    grid-column: 2;
    margin-top: 20px;
    text-decoration: none;
}

.text-link:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* --------------------------------------------------
   13. Existing supplementary links and page navigation
-------------------------------------------------- */
.external-note {
    align-items: center;
    background-color: rgba(185, 162, 239, 0.04);
    border: 1px solid var(--soft-border);
    border-radius: 16px;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin: 16px 0 44px;
    padding: 22px;
}

.external-note p {
    color: var(--muted-text);
    margin: 0;
}

.external-note a {
    color: var(--accent-color);
    flex-shrink: 0;
    font-size: 13px;
    text-decoration: none;
}

.external-note a:hover {
    text-decoration: underline;
}

.page-navigation {
    border-top: 1px solid var(--soft-border);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 24px 0 76px;
}

.page-navigation a {
    color: var(--muted-text);
    font-size: 13px;
    padding: 5px 0;
    text-decoration: none;
    transition: color 180ms ease;
}

.page-navigation a:hover {
    color: var(--accent-light);
}

/* --------------------------------------------------
   14. Footer
-------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--soft-border);
    color: var(--muted-text);
    display: flex;
    font-size: 12px;
    gap: 16px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: var(--page-width);
    padding: 26px var(--page-padding) 34px;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent-light);
}

/* --------------------------------------------------
   15. Keyboard accessibility
-------------------------------------------------- */
a:focus-visible,
video:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 5px;
}

/* --------------------------------------------------
   16. Entrance animations
   Every element remains visible when JavaScript is unavailable.
-------------------------------------------------- */
@keyframes gentle-entrance {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

.hero-section > *,
.subpage-introduction > * {
    animation: gentle-entrance 650ms var(--ease-out) both;
}

.hero-section > :nth-child(2),
.subpage-introduction > :nth-child(2) {
    animation-delay: 80ms;
}

.hero-section > :nth-child(3),
.subpage-introduction > :nth-child(3) {
    animation-delay: 140ms;
}

.hero-section > :nth-child(4) {
    animation-delay: 200ms;
}

/* Reveal hidden items when they enter the screen or receive focus. */
.reveal-pending {
    opacity: 0;
    translate: 0 14px;
}

.reveal-pending.is-visible,
.reveal-pending:focus-within {
    opacity: 1;
    translate: 0 0;
}

.reveal-pending {
    transition:
        opacity 500ms var(--ease-out),
        translate 500ms var(--ease-out),
        border-color 250ms ease,
        box-shadow 250ms ease,
        transform 250ms var(--ease-out);
}

/* --------------------------------------------------
   17. Tablet layout
-------------------------------------------------- */
@media (max-width: 900px) {
    :root {
        --page-padding: 26px;
    }

    .hero-section {
        padding-top: 72px;
        padding-bottom: 82px;
    }

    .hero-section > .small-heading {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .work-card {
        padding: 22px;
    }

    .work-card h3 {
        font-size: 25px;
    }

    .project-showcase {
        grid-template-columns: 1fr;
    }

    .semester-card {
        column-gap: 24px;
        grid-template-columns: 155px minmax(0, 1fr);
    }
}

/* --------------------------------------------------
   18. Phone layout
-------------------------------------------------- */
@media (max-width: 680px) {
    :root {
        --page-padding: 20px;
        --card-radius: 18px;
    }

    .site-header {
        gap: 15px;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .main-navigation {
        column-gap: 16px;
        row-gap: 0;
    }

    .main-navigation a {
        font-size: 12px;
        min-height: 34px;
    }

    .site-logo {
        height: 40px;
        width: 40px;
    }

    .hero-section {
        padding-top: 52px;
        padding-bottom: 65px;
    }

    .hero-section > .small-heading {
        border-radius: 13px;
        font-size: 9px;
        letter-spacing: 0.7px;
        padding: 8px 11px;
    }

    .hero-section h1 {
        font-size: clamp(44px, 11.5vw, 70px);
        letter-spacing: -2.4px;
    }

    .hero-description {
        font-size: 17px;
        margin-top: 23px;
    }

    .section-heading h2 {
        font-size: 26px;
    }

    .section-heading .small-heading {
        font-size: 9px;
        letter-spacing: 1.1px;
    }

    .work-card-grid,
    .detail-card-list,
    .award-gallery {
        grid-template-columns: 1fr;
    }

    .work-section {
        padding-bottom: 62px;
    }

    .work-card {
        min-height: 223px;
        padding: 24px;
    }

    .work-card h3 {
        font-size: 27px;
        margin-top: 42px;
    }

    .subpage-introduction {
        padding-top: 50px;
        padding-bottom: 36px;
    }

    .subpage-introduction h1 {
        font-size: clamp(38px, 10vw, 58px);
        letter-spacing: -1.9px;
    }

    .subpage-introduction > p:last-child {
        font-size: 16px;
    }

    .detail-card {
        min-height: 288px;
        padding: 24px;
    }

    .detail-card h2 {
        font-size: 27px;
        margin-top: 38px;
    }

    .showcase-video-section,
    .showcase-description {
        padding: 20px;
    }

    .semester-card {
        display: block;
        padding: 22px;
    }

    .semester-heading {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 24px;
    }

    .semester-heading h2 {
        font-size: 23px;
    }

    .course-list li > span:first-child {
        font-size: 13px;
    }

    .text-link {
        display: inline-block;
    }

    .certificate-caption {
        flex-wrap: wrap;
    }

    .external-note,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-navigation {
        padding-bottom: 54px;
    }
}

/* --------------------------------------------------
   19. Reduced motion
   Respect visitors who prefer a still interface.
-------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .reveal-pending {
        opacity: 1;
        translate: none;
    }

    .work-card:hover,
    .project-link-card:hover,
    .award-link-card:hover,
    .certificate-card:hover,
    .site-logo:hover,
    .primary-button:hover,
    .secondary-button:hover,
    .work-card:hover .card-arrow {
        transform: none;
    }
}
