* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    color: #1d1d1d;
}

body {
    font-family: "Noto Sans JP", sans-serif;
    font-weight: normal;
}

img {
    width: auto;
    height: auto;
    display: block;
}

/* header */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

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

.site-name .site-title {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.2;
    display: inline-block;
}

.site-title__abbr {
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
}

.site-title__letter {
    display: inline-block;
}

.site-title__gap {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    margin-right: 0;
    overflow: hidden;
    white-space: nowrap;
    transform: translateX(-6px);
    transition: max-width 0.45s ease, opacity 0.45s ease, transform 0.45s ease, margin-right 0.45s ease;
    will-change: max-width, opacity, transform;
}

.site-name a:hover .site-title__gap,
.site-name a:focus-visible .site-title__gap {
    max-width: 120px;
    opacity: 1;
    transform: translateX(0);
}

.site-name a:hover .site-title__gap--word,
.site-name a:focus-visible .site-title__gap--word {
    margin-right: 0.45ch;
}

@media (prefers-reduced-motion: reduce) {
    .site-title__gap {
        transition: none;
        transform: none;
    }
}

header ul {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    gap: 24px;
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.11);
    padding: 10px 40px;
    border-radius: 50px;
}

header ul a {
    position: relative;
    display: inline-block;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* Animated underline */
/* header ul a::after {
    content: "";
    position: absolute;
    left: 10px;   
    right: 10px;  
    bottom: 4px;
    height: 2px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms ease;
} */

header ul a:hover,
header ul a:focus-visible {
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: 20px;
}

header ul a:hover::after,
header ul a:focus-visible::after {
    transform: scaleX(1);
}

/* Active page link */
header ul a[aria-current="page"] {
    color: black;
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    font-weight: bold;
    
}
header ul a[aria-current="page"]::after {
    /* transform: scaleX(1); */
}

header ul li {
    color: inherit;
    display: flex;
    align-items: center;
}

header ul li a {
    display: inline-block;
    padding: 0px 10px;
}

.menu-toggle {
    display: none;
}


main {
    margin-top: 0;
}


.inner {
    width: 80%;
    max-width: 1132px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 120px;
}

.home {
    margin-top: 50px;
}

h1 {
    font-size: clamp(25px, 4.2vw, 60px);
    font-weight: 700;
    text-align: center;
    color: #fff;
    margin-top: 0;
    padding: clamp(56px, 7vw, 120px) 0 clamp(56px, 7vw, 100px) clamp(0px, 2vw, 24px);
    aspect-ratio: 8296/3210;
    background-image: url("./images/home/homepage.jpg");
    background-size: cover;
    background-position: bottom;
    background-repeat: no-repeat;
}

@media (max-width: 768px) {
    h1 {
        aspect-ratio: 8296/3710;
        padding: clamp(80px, 7vw, 120px) 0 clamp(56px, 7vw, 100px) clamp(0px, 2vw, 24px);
    }
}

h2 {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    margin: 28px 0 18px;
    position: relative;
    padding-bottom: 8px;
}

h2:first-of-type {
    margin-top: 0;
}

h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 2px;
    background: #e5e7eb;
    border-radius: 1px;
}

section {
    margin-bottom: 50px;
}

.visitor-histogram {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 3px;
    align-items: stretch;
    height: 200px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    overflow: visible;
    position: relative;
}

.visitor-histogram-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    margin: 10px 0 12px;
    font-size: 12px;
    color: #374151;
}

.visitor-histogram-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.visitor-histogram-legend__swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.08);
}

.visitor-histogram__item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.visitor-histogram__barwrap {
    flex: 1;
    display: flex;
    align-items: flex-end;
    overflow: visible;
}

.visitor-histogram__bar {
    width: 100%;
    min-height: 2px;
    background: #2e7d32;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: filter 0.15s ease;
    z-index: 1;
    display: flex;
    flex-direction: column-reverse;
    overflow: visible;
    background: transparent;
}

.visitor-histogram__seg {
    width: 100%;
    min-height: 1px;
}

.visitor-histogram__item:hover .visitor-histogram__bar {
    filter: brightness(1.05);
}

.visitor-histogram__item:hover {
    z-index: 3;
}

.visitor-histogram__label {
    margin-top: 6px;
    height: 14px;
    font-size: 11px;
    text-align: center;
    color: #6b7280;
    white-space: nowrap;
}

.visitor-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    display: none;
    max-width: min(320px, calc(100vw - 24px));
    background: #111827;
    font-size: 12px;
    line-height: 1.2;
    padding: 10px 10px;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
    z-index: 9999;
    pointer-events: none;
}

.visitor-tooltip,
.visitor-tooltip * {
    color: #fff;
}

.visitor-tooltip__title {
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
}

.visitor-tooltip__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0;
    white-space: nowrap;
}
.cv-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 28px;
}

.cv-download {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    min-height: 42px;
    padding: 11px 16px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cv-download::before {
    content: "PDF";
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    margin-right: 8px;
    padding: 3px 4px;
}

.cv-download:hover,
.cv-download:focus-visible {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.publication-main .inner {
    margin-top: 92px;
}


/* same */
.bg {
    background: #f6f6f6;
    font-size: 16px;
    display: flex;
    width: 100%;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.bg .info {
    display: block;
}

.bg a {
    width: 100%;
    display: flex;
    text-decoration: none;
    padding: 10px 100px;
    align-items: center;
    gap: 16px; /* space between date and info */
}

.bg:not(:has(a)) {
    padding: 10px 100px;
    gap: 16px; /* space between date and info when not a link */
}

.bg_title {
    display: block;
    padding-bottom: 4px;
    font-weight: 600;
    text-decoration: none;
}

.bg:has(a)::before {
    content: "";
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 14px;
    height: 14px;
    background-image: url("./ic_blank_white.svg");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
}

.bg p.date {
    width: 30%;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    white-space: normal;        /* allow line breaks for long ranges */
    overflow-wrap: anywhere;    /* break anywhere if needed */
}

.bg p.info {
    width: 70%;
}

/* For non-linked rows, ensure the second paragraph shares the info column width */
.bg > p:not(.date) {
    width: 70%;
}

/* Subtle lift on hover/focus for linked rows */
.bg:has(a):hover,
.bg:has(a):focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

/* Slightly emphasize the external icon on hover */
.bg:has(a):hover::before, .bg:has(a):focus-within::before {
    opacity: 1;
}


/* home */


/* publication */

.container {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 20px 28px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.mg-b { margin-bottom: 20px; }

.container .article {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 10px;
    align-items: start;
    padding-left: 4px;
    position: relative;
}

@media (min-width: 769px) {
    .container .article {
        grid-template-columns: var(--date-col, max-content) minmax(0, 1fr) var(--ctrl-col, max-content);
        column-gap: 18px;
        align-items: end;
    }

    .container .article.pd-b {
        padding-bottom: 0;
    }

    .container .article > div:first-child {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
    }

    .container .article > div:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    .container .article .button,
    .container .article > .paper-link {
        grid-column: 3;
        grid-row: 1;
        align-self: end;
        justify-self: end;
    }
}

/* Keep the date pill pinned to the top-left */
.container .article > div:first-child { align-self: start; }

.pd-b { padding-bottom: 12px; }

.publication-date {
    display: inline-block;
    background: #e5e7eb;
    color: #111827;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 12px;
    line-height: 1.8;
    font-variant-numeric: tabular-nums;
}

.article.pub-role-first .publication-date {
    background: #dbeafe;
    color: #1d4ed8;
}

.article.pub-role-other .publication-date {
    background: #f3e8ff;
    color: #6b21a8;
}

.pub-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    align-items: center;
    margin: 18px 0 56px;
    color: #4b5563;
    font-size: 13px;
}

.pub-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pub-legend__swatch {
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    border: 1px solid rgba(17, 24, 39, 0.12);
}

.pub-legend__swatch--first { background: #dbeafe; }
.pub-legend__swatch--other { background: #f3e8ff; }

.title {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 8px;
}

/* Spotlight badge shown next to paper titles */
.title .spotlight {
    display: inline-block;
    vertical-align: middle;     /* center against title text */
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;             /* avoid extra line height */
    color: #854d0e;             /* text: yellowish-brown */
    background: #fef9c3;        /* bg: yellow-100 */
    border: 1px solid #facc15;  /* border: yellow-400 */
    border-radius: 9999px;      /* pill */
    white-space: nowrap;
}

.container a { text-decoration: none; }
.container a:hover .title { text-decoration: underline; }

.authors, .journal {
    font-size: 15px;
    line-height: 1.7;
    color: #4b5563;
}

.authors { margin-bottom: 4px; }

/* Emphasize own name in author lists */
.authors .author-self {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Abstract toggle cluster sits in controls column, bottom-aligned */
.container .article .button {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 0;
    justify-self: end;
    align-self: start;
}

@media (min-width: 769px) {
    .container .article .button,
    .container .article > .paper-link {
        align-self: end;
    }
}

/* Scope button styling to publication toggles to avoid global impact */
.container .button button {
    font-size: 12px;
    line-height: 1;
    padding: 6px 10px;
    height: auto;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.container .button button:hover { 
    background: #f3f4f6; 
    border-color: #d1d5db; 
}

.plus {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.plus:hover { background: #f8fafc; }

.plus::before {
    content: "";
    width: 1px;
    height: 10px;
    background: #64748b;
    transition: transform 0.2s ease;
    transform-origin: center;
}

.plus.hide-before::before { transform: rotate(90deg); }

.plus::after {
    content: "";
    width: 10px;
    height: 1px;
    background: #64748b;
    position: absolute;
}

/* Paper icon for entries without abstract: controls column, bottom-aligned */
.container .article > .paper-link {
    position: static;
    justify-self: end;
    align-self: start;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.container .article > .paper-link:hover { background: #f8fafc; border-color: #d1d5db; }
.container .article > .paper-link img { width: 14px; height: 14px; display: block; }

/* Paper icon link inline next to the + toggle */
.container .article .button .paper-link {
    position: static;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.container .article .button .paper-link:hover { background: #f8fafc; border-color: #d1d5db; }
.container .article .button .paper-link img { width: 14px; height: 14px; display: block; }

.container .abstract {
    position: relative;
    font-size: 16px;
    line-height: 1.8;
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.35s ease, padding-top 0.35s ease, margin-top 0.35s ease;
    display: block;
}

/* Abstract label on the left */
/* Left label rendered as an icon */

/* Left label as a pill like the year tag */
.container .abstract::before {
    content: "Abstract";
    display: inline-block;
    background: #e5e7eb;
    color: #111827;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    line-height: 1.8;
    white-space: nowrap;
    margin-bottom: 10px;
}

.container .abstract p { margin: 0; }

.container .abstract.show {
    margin-top: 12px;
    padding-top: 14px;
    max-height: 1000px;
    opacity: 1;
    border-top: 1px solid #e5e7eb;
}

/* experience */

ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.date {
    width: 250px;
}

.skill_list {
    margin: 50px 0;
}

.skill_bg {
    background: #fff;
    width: 100%;
    display: flex;
    padding: 12px 16px;
    min-height: 56px;
    align-items: center;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    gap: 16px;
    position: relative; /* for background gauge */
    overflow: hidden;
}


.icon {
    width: 20%;
    display: flex;
    justify-content: center;
    margin-right: 0;
}

.skill {
    width: 20%;
}

.years {
    width: 20%;
}

.description {
    width: 40%;
}

/* Skills: light, tidy typography */
.skill_bg p { margin: 0; }
.skill p { font-weight: 600; }
.years p {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
    color: #374151;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
}
.icon img { width: 28px; height: 28px; object-fit: contain; }

.skill_bg:hover { border-color: #cbd5e1; }

/* Background proficiency gauge for each skill item */
.skill_bg::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 0; /* show only on hover */
    background: linear-gradient(90deg, rgba(37,99,235,0.12), rgba(148,163,184,0.12));
    transition: width 600ms ease;
    z-index: 0;
}

.skill_bg:hover::before,
.skill_bg:focus-within::before {
    width: calc(var(--skill-level, 0) * 100%);
}

/* keep content above the background gauge */
.skill_bg > * { position: relative; z-index: 1; }

/* Inline meter label for clarity */
.skill-meter {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #334155;
    background: rgba(255,255,255,0.8);
    padding: 2px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    opacity: 0;
    transition: opacity 200ms ease;
}
.skill_bg:hover .skill-meter,
.skill_bg:focus-within .skill-meter { opacity: 1; }

/* Small note under Skill heading */
.skill-note { 
    margin-top: -6px; 
    margin-bottom: 12px; 
    color: #64748b; 
    font-size: 14px; 
}

/* Skill proficiency gauge */
.skill-gauge {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}
.skill-gauge .skill-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #94a3b8, #2563eb);
    transition: width 600ms ease;
}
.skill-meter {
    font-size: 12px;
    color: #64748b;
}

/* education */

.education-table {
    table-layout: fixed;
    border-collapse: collapse;
    width: 100%;
    align-items: center;
    margin-bottom: 40px;
}


.education-table ul {
    /* Align lists to start where titles start: icon width (56px) + gap (handled by list padding) */
    margin-left: 56px;
    padding-left: 12px;
    text-align: left;
    display: block;
}

.education-table li {
    list-style: disc;
    margin-bottom: 5px;
}

td {
    padding: 5%;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: transform, box-shadow;
}

td p:first-child {
    margin-bottom: 25px;
}

.education-table td:first-child {
    border-right: solid 0.2px #000;
}

/* Make whole education entries clickable without changing look */
.education-table td .edu-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* .education-table td .edu-link:hover {
    background: #f9fafb;
    border-radius: 8px;
} */

.education-table td .edu-link:focus-visible {
    outline: 2px solid #0077cc;
    outline-offset: 4px;
    border-radius: 8px;
}

/* Education detail popup in the opposite cell */
.education-table .edu-detail {
    vertical-align: middle;
}

.education-table .edu-pop {
    display: none;
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    color: #374151;
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    font-size: 14px;
    line-height: 1.6;
    transform: translateY(6px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.education-table .edu-pop p {
    margin-top: 0;
    margin-bottom: 0;
}

/* Right-side detail: tail points left */
.education-table tr > td:last-child .edu-pop::after,
.education-table tr > td:last-child .edu-pop::before {
    content: "";
    position: absolute;
    top: 18px;
    left: -10px;
    border-style: solid;
    border-width: 10px 10px 10px 0;
}
.education-table tr > td:last-child .edu-pop::after {
    border-color: transparent #fff transparent transparent;
    left: -9px;
}
.education-table tr > td:last-child .edu-pop::before {
    border-color: transparent #e5e7eb transparent transparent;
}

/* Left-side detail: tail points right */
.education-table tr > td:first-child .edu-pop::after,
.education-table tr > td:first-child .edu-pop::before {
    content: "";
    position: absolute;
    top: 18px;
    right: -10px;
    border-style: solid;
    border-width: 10px 0 10px 10px;
}
.education-table tr > td:first-child .edu-pop::after {
    border-color: transparent transparent transparent #fff;
    right: -9px;
}
.education-table tr > td:first-child .edu-pop::before {
    border-color: transparent transparent transparent #e5e7eb;
}

/* Show details when the row is hovered/focused or when the row is the active (cap-aligned) one */
.education-table tr:has(.edu-link:hover) .edu-detail .edu-pop,
.education-table tr:has(.edu-link:focus) .edu-detail .edu-pop,
.education-table tr:has(.edu-link:focus-visible) .edu-detail .edu-pop,
.education-table tr:has(td.is-highlighted) .edu-detail .edu-pop {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* While scrolling, suppress hover/focus bubbles; keep only the cap-aligned bubble */
.is-scrolling .education-table .edu-pop { 
    display: none !important; 
}
.is-scrolling .education-table tr:has(td.is-highlighted) .edu-detail .edu-pop { 
    display: block !important; 
    opacity: 1; 
    transform: translateY(0); 
}

/* Pop-up emphasis for the education item next to the centered icon */
.education-table td.is-highlighted {
    transform: translateZ(0) scale(1.1);
    border-radius: 12px;
    background-clip: padding-box;
    z-index: 3;
    position: relative;
}

.education-table td.is-highlighted::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 10px;
    pointer-events: none;
}

.education-table tr > td:first-child.is-highlighted {
    transform-origin: right center;
}

.education-table tr > td:last-child.is-highlighted {
    transform-origin: left center;
}

/* University block (rewritten) */
/* Make the whole link a grid so logo, text, and tags share columns */
.education-table .edu-link {
    display: grid;
    grid-template-columns: 56px 1fr; /* logo | text */
    column-gap: 12px;
    align-items: start;
}

/* Title + icon sit side-by-side without relying on display:contents */
.uni-head {
    grid-column: 1 / -1; /* span both columns */
    display: flex;
    align-items: center;
    gap: 12px;
}

.uni-logo {
    width: 56px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
}

.uni-name { display: flex; flex-direction: column; gap: 2px; grid-column: 2; }
.edu-title { font-size: 18px; font-weight: 600; line-height: 1.25; color: #111827; }
.edu-subtitle { color: #6b7280; font-size: 14px; line-height: 1.5; }

.edu-meta { margin-bottom: 12px; grid-column: 1 / -1; }
.edu-dates { color: #6b7280; font-variant-numeric: tabular-nums; }

.edu-tags {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    grid-column: 2; /* align directly under titles */
    margin-left: 0; /* override generic ul indent */
    padding-left: 0; /* override generic ul indent */
}
.edu-tags li {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 12.5px;
    line-height: 1;
}

/* Degree pill: subtle accent to differentiate */
.edu-tags li.degree {
    background: #eef2ff;       /* indigo-50 */
    border-color: #c7d2fe;     /* indigo-200 */
    color: #1e3a8a;            /* indigo-800 */
}

.line {
    width: 0.2px;
    background: #707070;
    height: 600px;
    margin: 20px auto;
    z-index: 1;
}

.education {
    position: relative;
}

.graduation-cap {
    z-index: 10;
    position: fixed;
    top: 250px;
    left: 50%;
    transform: translateX(-50%);
}

/* Spacer row to extend page height only */
.education-table .spacer-row td {
    padding: 0;
    border: none;
    height: 250px; /* adjust to taste */
}

.education-table .spacer-row td .edu-spacer {
    display: block;
    width: 100%;
    height: 100%;
    border-right: solid 0.2px #000; /* draw the middle divider */
    box-sizing: border-box;
}


@media screen and (max-width: 768px) {
    .education-table .spacer-row td { height: 140px; }
}

/* footer */

footer {
    background: #e6e6e6; /* slightly darker, closer to previous */
    border-top: 1px solid #d1d5db;
}

.footer-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding: 40px 0; /* give footer a bit more height */
}

.footer-column {
    position: relative;
    display: flex;
    flex-direction: column;
}

.footer-container .footer-logo {
    position: static;
    margin-top: auto;
}

.sns {
    display: flex;
    gap: 20px;
    height: 22px;
    margin-bottom: 20px;
}

.sns a img { transition: opacity 0.15s ease; }
.sns a:hover img { opacity: 0.8; }

.contact img {
    margin: 16px auto 8px auto; /* raise the contact section */
}

.contact p {
    text-align: center;
    margin-top: 0;
}

.page-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 56px;
    height: 56px;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    position: static;
    margin-left: auto;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.page-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.page-top:active {
    transform: translateY(-1px) scale(0.98);
}

/* Place the back-to-top to the right on desktop */
.footer-column:has(.page-top) { align-items: flex-end; }

.is-active {
    opacity: 1;
    visibility: visible;
}


@media screen and (max-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        padding: 12px 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .site-name span {
        font-size: 20px;
    }

    header ul {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        padding: 12px;
        background-color: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }

    header.show-menu ul {
        display: flex;
    }

    .menu-toggle {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 20px;
        cursor: pointer;
        width: 36px;
        height: 36px;
        margin-left: auto;   /* push to right */
        order: 2;
        z-index: 1100;
    }

    header ul li {
        width: 100%;
    }

    /* Ensure header order: site name, toggle, then nav */
    .site-name { order: 1; }
    .menu-toggle { order: 2; }
    #site-nav { 
        order: 3; width: 100%; 
    }

    .site-nav {
        box-shadow: 0px 6px 20px #000;
    }

    .inner {
        width: 90%;
    }

    .bg a {
        padding: 20px;
        gap: 12px; /* maintain spacing on mobile */
    }

    .bg:not(:has(a)) {
        padding: 20px;
        gap: 12px;
    }

    .container .article {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding-left: 0;
    }

    .footer-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 30px 5%;
        gap: 24px;
    }

    .footer-column {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 0;
    }

    .footer-column.contact {
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        text-align: center;
    }

    .contact img {
        margin: 20px 0 10px 0;
    }

    .contact p {
        text-align: center;
        margin: 0;
    }

    .footer-container .footer-logo {
        position: static;
        text-align: center;
    }

    .footer-logo .sns {
        justify-content: center;
    }

    .page-top {
        position: static;
        margin: 0 auto;
    }

    .footer-column.contact {
        order: 1;
    }

    .footer-column:has(.page-top) {
        order: 2;
    }

    .footer-column:has(.footer-logo) {
        order: 3;
    }
    /* Keep logo and titles side-by-side on mobile too */
    .education-table .edu-link { grid-template-columns: 56px 1fr; column-gap: 10px; }
    .uni-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
    /* Hide detail popups and spacer-only rows on mobile */
    .education-table .edu-detail,
    .education-table .spacer-row { display: none !important; }
    /* Allow long year ranges to wrap nicely on small screens */
    .edu-dates { white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.4; }
    /* Ensure hamburger button placement remains tidy */
    .menu-toggle { margin-left: auto; z-index: 1100; align-self: center; }
    .uni-logo { max-height: 36px; width: auto; }
    .uni-name { align-items: flex-start; text-align: left; }
    .edu-tags { grid-column: 2; margin-left: 0; padding-left: 0; justify-content: flex-start; }

    .icon {
        width: 20%;
        display: flex;
        justify-content: center;
        margin-right: 5%;
    }

    .skill {
        width: 40%;
    }

    .years {
        width: 40%;
    }

    .description {
        display: none;
        position: absolute;
        background: #fff;
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
        z-index: 10;
        top: 100%;
        right: 0;
        width: max-content;
        max-width: 80%;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    .skill_bg:hover .description {
        display: block;
    }

    .skill_bg {
        position: relative;
    }


    .education-table,
    .education-table tbody,
    .education-table tr,
    .education-table td {
        display: block;
        width: 100%;
        border-right: none;
    }

    .education-table td:first-child {
        border-right: none;
    }

    .graduation-cap {
        display: none;
    }

    .education-table td:empty {
        padding: 0;
        height: 0;
    }

    .education-table tr:not(:last-child) {
        border-bottom: dashed 0.2px #000;
    }
    /* publication: stack entry layout on mobile */
    .container { padding: 16px 16px; }
    .container .article { 
        grid-template-columns: minmax(0, 1fr);
        padding-left: 0; 
    }
    .publication-date { align-self: start; }
    .button { margin-left: 0; }

}
.footer-column.contact { 
    align-self: start; /* position contact column a bit higher */
}

/* Mail icon hover gimmick: subtle "open" effect */
.footer-column.contact a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Remove legacy mail hover/triangle; inline SVG handles any animation */
