/* =========================================================
   DHA LAB
   Digital Health Analytics Lab
========================================================= */


/* =========================================================
   DESIGN TOKENS
========================================================= */

:root {

    --paper: #f4f2ec;
    --white: #ffffff;

    --ink: #171918;

    --gray: #696d69;
    --light-gray: #9da19d;

    --line: #d6d5cf;

    --teal: #183d38;
    --teal-dark: #102d29;

    --footer: #111513;

    --max-width: 1380px;

}


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {

    background: var(--paper);

    color: var(--ink);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Helvetica Neue",
        Helvetica,
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

}


a {
    color: inherit;
}


img {
    display: block;
    max-width: 100%;
}


/* =========================================================
   GLOBAL CONTAINER
========================================================= */

.header-inner,
.hero-inner,
.section-inner,
.footer-inner {

    width: min(
        calc(100% - 80px),
        var(--max-width)
    );

    margin: 0 auto;

}


/* =========================================================
   HEADER
========================================================= */

.site-header {

    background: var(--paper);

    border-bottom: 1px solid var(--line);

}


.header-inner {

    min-height: 94px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 60px;

}


/* =========================================================
   BRAND
========================================================= */

.brand {

    display: flex;

    align-items: center;

    color: var(--ink);

    text-decoration: none;

}


.brand-mark {

    padding-right: 21px;

    font-size: 30px;

    line-height: 1;

    font-weight: 700;

    letter-spacing: -0.06em;

}


.brand-name {

    padding-left: 21px;

    border-left: 1px solid var(--line);

    color: var(--gray);

    font-size: 11px;

    line-height: 1.3;

}


/* =========================================================
   NAVIGATION
========================================================= */

.main-nav {

    display: flex;

    align-items: center;

    gap: 34px;

}


.main-nav a {

    position: relative;

    padding: 10px 0;

    color: var(--ink);

    text-decoration: none;

    font-size: 13px;

    font-weight: 500;

}


.main-nav a::after {

    content: "";

    position: absolute;

    left: 0;
    bottom: 5px;

    width: 100%;
    height: 1px;

    background: var(--ink);

    transform: scaleX(0);

    transform-origin: right;

    transition: transform 0.25s ease;

}


.main-nav a:hover::after {

    transform: scaleX(1);

    transform-origin: left;

}


/* =========================================================
   HERO
========================================================= */

.hero {

    /*
       Keep the main visual close to the navigation.
    */

    padding: 26px 0 0;

}


/* =========================================================
   HERO VISUAL
========================================================= */

.hero-visual {

    position: relative;

    width: 100%;

    height: min(
        690px,
        calc(100vh - 145px)
    );

    min-height: 540px;

    overflow: hidden;

    background: var(--teal-dark);

}


/* =========================================================
   HERO IMAGE
========================================================= */

.hero-image {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    object-position: center;

}


/* =========================================================
   HERO OVERLAY
========================================================= */

.hero-overlay {

    position: absolute;

    inset: 0;

    z-index: 1;

    background:

        linear-gradient(
            90deg,
            rgba(7, 16, 14, 0.82) 0%,
            rgba(7, 16, 14, 0.65) 30%,
            rgba(7, 16, 14, 0.25) 58%,
            rgba(7, 16, 14, 0.04) 82%
        ),

        linear-gradient(
            0deg,
            rgba(5, 10, 9, 0.28) 0%,
            rgba(5, 10, 9, 0) 45%
        );

}


/* =========================================================
   HERO CONTENT
========================================================= */

.hero-content {

    position: absolute;

    z-index: 3;

    left: 58px;
    bottom: 62px;

    max-width: 690px;

    color: white;

}


/* =========================================================
   HERO EYEBROW
========================================================= */

.hero-eyebrow {

    margin-bottom: 20px;

    color: rgba(
        255,
        255,
        255,
        0.72
    );

    font-size: 10px;

    line-height: 1;

    font-weight: 600;

    letter-spacing: 0.16em;

}


/* =========================================================
   HERO TITLE
========================================================= */

.hero-content h1 {

    margin-bottom: 25px;

    font-size: clamp(
        56px,
        6vw,
        88px
    );

    line-height: 0.92;

    font-weight: 400;

    letter-spacing: -0.06em;

}


/* =========================================================
   HERO DESCRIPTION
========================================================= */

.hero-description {

    max-width: 500px;

    color: rgba(
        255,
        255,
        255,
        0.84
    );

    font-size: 16px;

    line-height: 1.65;

}


/* =========================================================
   HERO AFFILIATION
========================================================= */

.hero-affiliation {

    position: absolute;

    z-index: 3;

    right: 40px;
    bottom: 38px;

    color: rgba(
        255,
        255,
        255,
        0.68
    );

    text-align: right;

    font-size: 11px;

    line-height: 1.6;

}


.hero-affiliation p + p {

    margin-top: 2px;

}


/* =========================================================
   NEWS
========================================================= */

.news {

    padding: 125px 0 135px;

    background: var(--paper);

}


/* =========================================================
   NEWS HEADER
========================================================= */

.news-header {

    margin-bottom: 70px;

    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 60px;

}


/* =========================================================
   SECTION LABEL
========================================================= */

.section-label {

    margin-bottom: 22px;

    color: var(--gray);

    font-size: 10px;

    line-height: 1;

    font-weight: 600;

    letter-spacing: 0.15em;

}


/* =========================================================
   NEWS TITLE
========================================================= */

.news-header h2 {

    max-width: 800px;

    font-size: clamp(
        43px,
        5vw,
        70px
    );

    line-height: 1;

    font-weight: 400;

    letter-spacing: -0.052em;

}


/* =========================================================
   ALL NEWS LINK
========================================================= */

.section-link {

    position: relative;

    padding-bottom: 6px;

    color: var(--ink);

    text-decoration: none;

    font-size: 13px;

}


.section-link::after {

    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;
    height: 1px;

    background: var(--ink);

    transform-origin: left;

    transition: transform 0.25s ease;

}


.section-link:hover::after {

    transform: scaleX(0.45);

}


/* =========================================================
   NEWS LIST
========================================================= */

.news-list {

    border-top: 1px solid var(--line);

}


/* =========================================================
   NEWS ITEM
========================================================= */

.news-item {

    padding: 37px 0;

    display: grid;

    grid-template-columns:
        170px
        minmax(0, 1fr)
        40px;

    gap: 30px;

    align-items: start;

    border-bottom: 1px solid var(--line);

}


/* =========================================================
   NEWS DATE
========================================================= */

.news-item time {

    padding-top: 5px;

    color: var(--gray);

    font-size: 10px;

    line-height: 1;

    font-weight: 600;

    letter-spacing: 0.12em;

}


/* =========================================================
   NEWS CONTENT
========================================================= */

.news-content h3 {

    margin-bottom: 10px;

    font-size: 23px;

    line-height: 1.25;

    font-weight: 500;

    letter-spacing: -0.025em;

}


.news-content p {

    max-width: 700px;

    color: var(--gray);

    font-size: 14px;

    line-height: 1.65;

}


/* =========================================================
   NEWS ARROW
========================================================= */

.news-arrow {

    padding-top: 2px;

    text-align: right;

    font-size: 18px;

    transition: transform 0.2s ease;

}


.news-item:hover .news-arrow {

    transform:
        translate(3px, -3px);

}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {

    padding: 67px 0;

    background: var(--footer);

    color: #aeb6b2;

}


/* =========================================================
   FOOTER GRID
========================================================= */

.footer-inner {

    display: grid;

    grid-template-columns:
        1.2fr
        1.6fr
        0.8fr;

    gap: 70px;

}


/* =========================================================
   FOOTER DHA
========================================================= */

.footer-dha {

    margin-bottom: 14px;

    color: white;

    font-size: 31px;

    line-height: 1;

    font-weight: 700;

    letter-spacing: -0.06em;

}


.footer-brand,
.footer-affiliation,
.footer-meta {

    font-size: 12px;

    line-height: 1.7;

}


.footer-affiliation p + p {

    margin-top: 8px;

}


.footer-meta {

    text-align: right;

}


.footer-meta a {

    display: inline-block;

    margin-top: 23px;

    color: white;

    text-decoration: none;

}


.footer-meta a:hover {

    opacity: 0.65;

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {


    .header-inner,
    .hero-inner,
    .section-inner,
    .footer-inner {

        width:
            min(
                calc(100% - 48px),
                var(--max-width)
            );

    }


    /* HEADER */

    .header-inner {

        min-height: 90px;

    }


    .main-nav {

        gap: 21px;

    }


    /* HERO */

    .hero {

        padding-top: 22px;

    }


    .hero-visual {

        height: 620px;

        min-height: 0;

    }


    .hero-content {

        left: 45px;
        bottom: 50px;

    }


    .hero-affiliation {

        right: 35px;
        bottom: 30px;

    }


    /* NEWS */

    .news {

        padding: 100px 0 110px;

    }

}


/* =========================================================
   SMALL TABLET
========================================================= */

@media (max-width: 800px) {


    /* NAV */

    .main-nav {

        gap: 16px;

    }


    .main-nav a {

        font-size: 12px;

    }


    /* HERO */

    .hero-visual {

        height: 580px;

    }


    .hero-content h1 {

        font-size: 62px;

    }


    /*
       Hide affiliation because it competes
       with the main text at smaller widths.
    */

    .hero-affiliation {

        display: none;

    }


    /* NEWS */

    .news-item {

        grid-template-columns:
            125px
            minmax(0, 1fr)
            30px;

    }


    /* FOOTER */

    .footer-inner {

        grid-template-columns:
            1fr
            1fr;

    }


    .footer-meta {

        grid-column: 1 / -1;

        text-align: left;

    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 650px) {


    /* GLOBAL */

    .header-inner,
    .hero-inner,
    .section-inner,
    .footer-inner {

        width:
            calc(100% - 32px);

    }


    /* HEADER */

    .header-inner {

        min-height: 78px;

    }


    .brand-mark {

        padding-right: 15px;

        font-size: 27px;

    }


    .brand-name {

        padding-left: 15px;

        font-size: 9px;

    }


    /*
       Desktop navigation hidden on mobile.
       A mobile menu can be added later.
    */

    .main-nav {

        display: none;

    }


    /* HERO */

    .hero {

        padding-top: 16px;

    }


    .hero-visual {

        height:
            calc(100svh - 110px);

        min-height: 530px;

        max-height: 680px;

    }


    .hero-image {

        /*
           Can change this to:
           center / left / right
           depending on the final image.
        */

        object-position: center;

    }


    .hero-overlay {

        background:

            linear-gradient(
                0deg,
                rgba(6, 15, 13, 0.92) 0%,
                rgba(6, 15, 13, 0.70) 38%,
                rgba(6, 15, 13, 0.20) 72%,
                rgba(6, 15, 13, 0.03) 100%
            );

    }


    .hero-content {

        left: 26px;
        right: 26px;
        bottom: 32px;

        max-width: none;

    }


    .hero-eyebrow {

        margin-bottom: 16px;

        font-size: 8px;

    }


    .hero-content h1 {

        margin-bottom: 20px;

        font-size: clamp(
            47px,
            14vw,
            62px
        );

        line-height: 0.94;

    }


    .hero-description {

        max-width: 400px;

        font-size: 14px;

        line-height: 1.6;

    }


    /* NEWS */

    .news {

        padding: 78px 0 85px;

    }


    .news-header {

        margin-bottom: 45px;

        flex-direction: column;

        align-items: flex-start;

        gap: 27px;

    }


    .news-header h2 {

        font-size: 42px;

    }


    .news-item {

        padding: 29px 0;

        grid-template-columns: 1fr;

        gap: 13px;

    }


    .news-content h3 {

        font-size: 21px;

    }


    .news-arrow {

        display: none;

    }


    /* FOOTER */

    .site-footer {

        padding: 52px 0;

    }


    .footer-inner {

        grid-template-columns: 1fr;

        gap: 35px;

    }


    .footer-meta {

        grid-column: auto;

        text-align: left;

    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 390px) {


    .brand-name {

        display: none;

    }


    .brand-mark {

        padding-right: 0;

    }


    .hero-content h1 {

        font-size: 45px;

    }


    .news-header h2 {

        font-size: 37px;

    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {


    html {

        scroll-behavior: auto;

    }


    *,
    *::before,
    *::after {

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;

    }
   

}


/* ==========================================
   PEOPLE PAGE
========================================== */

.people-page {
  background: var(--paper);
}

.people-heading {
  padding: 90px 0 65px;
}

.people-heading h1 {
  font-size: clamp(65px, 9vw, 130px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.07em;
}

.accent-dot {
  color: var(--teal);
}

.people-intro {
  max-width: 590px;
  margin-top: 28px;
  color: var(--gray);
  font-size: 17px;
  line-height: 1.7;
}

/* SECTION */

.people-section {
  padding: 40px 0 100px;
}

.people-section-header {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-bottom: 45px;
}

.people-section-header > span {
  display: block;
  color: var(--gray);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.people-section-header h2 {
  margin-top: 18px;
  font-size: clamp(36px, 4vw, 54px);
  font-weight: 400;
  letter-spacing: -0.045em;
}

/* PI */

.pi-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 50px;
    align-items: center;
}

/* 兩位教授左右並排 */
.pi-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 70px;
    align-items: start;
}

/* 並排時每位教授改成「照片在上、文字在下」 */
.pi-row .pi-layout {
    grid-template-columns: 1fr;
    row-gap: 30px;
    align-items: start;
}

.pi-row .pi-photo {
    width: 200px;
}

.pi-row .pi-info h2 {
    font-size: clamp(32px, 3vw, 46px);
}

@supports (grid-template-rows: subgrid) {
    .pi-row {
        row-gap: 0;
    }

    .pi-row .pi-layout {
        grid-row: span 6;
        grid-template-rows: subgrid;
        row-gap: 0;
    }

    .pi-row .pi-photo {
        margin-bottom: 30px;
    }

    .pi-row .pi-info {
        grid-row: span 5;
        display: grid;
        grid-template-rows: subgrid;
        row-gap: 0;
    }
}

.pi-photo {
    width: 220px;
    max-width: 100%;
    aspect-ratio: 1 / 1;          /* 圓形頭像：正方形外框 */
    border-radius: 50%;           /* 圓形頭像：變成正圓 */
    background: #e1e2dc;
    overflow: hidden;
}

.pi-photo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;            /* 填滿圓形、不變形 */
    object-position: center top;  /* 從上方對齊，避免切到頭 */
}

.person-label {
  color: var(--teal);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-bottom: 20px;
}

.pi-info h2 {
  font-size: clamp(38px, 4.3vw, 64px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.person-role {
  margin-top: 18px;
  font-size: 19px;
}

.person-affiliation {
  margin-top: 12px;
  color: var(--gray);
  font-size: 14px;
  line-height: 1.7;
}

.person-bio {
  margin-top: 35px;
  max-width: 590px;
  font-size: 15px;
  line-height: 1.85;
}

.person-links {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  margin-top: 35px;
}

.person-links a {
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 5px;
}

/* MEMBERS */

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

.member-photo {
  width: min(100%, 200px);       /* 圓形頭像：最大 200px */
  aspect-ratio: 1 / 1;           /* 圓形頭像：正方形外框 */
  border-radius: 50%;            /* 圓形頭像：變成正圓 */
  background: #e1e2dc;
  overflow: hidden;
}

.member-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease;
}

.member-card:hover img {
  transform: scale(1.035);
}

.member-card h3 {
  margin-top: 20px;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.member-role {
  margin-top: 5px;
  font-size: 13px;
  color: var(--teal);
}

.member-interest {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray);
}

/* ALUMNI */

.alumni-list {
  border-top: 1px solid var(--line);
}

.alumni-row {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.alumni-row span:last-child {
  color: var(--gray);
  font-size: 13px;
}

/* RESPONSIVE */


@media (max-width: 650px) {
  .people-heading {
    padding: 60px 0 45px;
  }

  .people-section {
    padding: 30px 0 75px;
  }

  .pi-layout {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .pi-photo {
    max-width: 180px;
  }

  /* 手機版改回上下排列 */
  .pi-row {
    grid-template-columns: 1fr;
    row-gap: 60px;
  }

  .pi-row .pi-photo {
    width: 180px;
  }

  /* 手機版上下排列，不需要逐行對齊 */
  .pi-row .pi-layout,
  .pi-row .pi-info {
    grid-row: auto;
    grid-template-rows: none;
  }

  .pi-row .pi-info {
    display: block;
  }

  .members-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
  }

  .member-card h3 {
    font-size: 19px;
  }

  .alumni-row {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 390px) {
  .members-grid {
    grid-template-columns: 1fr;
  }
}


/* Unified navigation: accessible on small screens */
.main-nav a[aria-current="page"]::after{transform:scaleX(1);transform-origin:left}
@media(max-width:650px){.header-inner{flex-wrap:wrap;gap:10px;padding:16px 0}.main-nav{display:flex;width:100%;gap:clamp(12px,4vw,26px);flex-wrap:wrap}.main-nav a{font-size:12px;padding:6px 0}.site-header .header-inner{min-height:90px}}
@media(max-width:390px){.brand-name{display:block}.header-inner{gap:10px}}