@import url('https://fonts.googleapis.com/css2?family=LINE+Seed+JP:wght@400;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;700;800&display=swap');

:root {
    --bg: #f1f1ef;
    --bg-soft: rgba(255, 255, 255, 0.46);
    --bg-hover: rgba(255, 255, 255, 0.82);
    --ink: #111111;
    --ink-bright: #000000;
    --ink-soft: #252525;
    --ink-faint: #5c5c5c;
    --line: rgba(0, 0, 0, 0.12);
    --line-strong: rgba(0, 0, 0, 0.28);
    --mat: #e5e5e2;

    --serif: 'LINE Seed JP', sans-serif;
    --body: 'LINE Seed JP', sans-serif;

    --t: 0.25s ease;
    --maxw: 1600px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 17px;
    scroll-padding-top: 7rem;
    background: #f7f7f5;
}

body {
    position: relative;
    isolation: isolate;
    background: transparent;
    color: var(--ink);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    inset: -3rem;
    z-index: -1;
    background: var(--bg-image, url('assets/art/backgrounds/pdia-f946ecc9-50e9-4f46-9b6c-9f757559b043.jpg')) center top / cover no-repeat;
    filter: contrast(0.5);
    opacity: 0.44;
}

::selection {
    background: rgba(0, 0, 0, 0.16);
    color: var(--ink-bright);
}

/* Readable selection on the dark masthead (the base rule above would render
   black text on the near-black card). */
.masthead ::selection {
    background: rgba(255, 255, 255, 0.85);
    color: #151514;
}

.masthead ::-moz-selection {
    background: rgba(255, 255, 255, 0.85);
    color: #151514;
}

a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: color var(--t), border-color var(--t);
}

a:hover {
    color: var(--ink-bright);
    border-color: var(--line-strong);
}

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1.6rem;
}

/* labels / kickers */
.kicker {
    font-family: var(--body);
    font-size: 0.74rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* ---------- Framed artwork accents ---------- */
figure.art {
    margin: 0;
}

.frame {
    padding: 9px;
    background: var(--mat);
    border: 1px solid var(--line-strong);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
}

.frame img {
    display: block;
    width: 100%;
    height: auto;
    filter: saturate(0.9) brightness(0.96) contrast(1.02);
}

figure.art figcaption {
    margin-top: 0.7rem;
    font-style: italic;
    font-size: 0.82rem;
    color: var(--ink-faint);
    text-align: center;
    border: 0;
}

/* ---------- Bento Grid Layout ---------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

/* Base Bento Card Style */
.bento-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--line);
    padding: 1.6rem 1.8rem !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

/* Card Column Spans on Desktop */
.bento-grid .masthead {
    grid-column: span 1;
    background: radial-gradient(circle at 80% 20%, #2c2c29 0%, #151514 100%);
    color: #e5e5e2;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
    position: relative;
    overflow: hidden;
}

.bento-grid #profile {
    grid-column: span 2;
}

.bento-grid #works {
    grid-column: span 3;
}

.bento-grid #experience {
    grid-column: span 2;
}

.bento-grid #education {
    grid-column: span 1;
}

.bento-grid #skills {
    grid-column: span 2;
}

.bento-grid #research-focus {
    grid-column: span 1;
}

/* Inner Section Reset */
.bento-grid section {
    padding: 0;
}

/* Name tile: name and role at the top, university and town at the foot */
.masthead {
    justify-content: space-between;
    gap: 1.8rem;
}

.masthead h1 {
    font-family: 'Lexend', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.masthead .role {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: #a0a09e;
    font-weight: 700;
}

.masthead-foot {
    display: grid;
    gap: 0.25rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #a0a09e;
}

/* Intro tile: two paragraphs and a fact row, in the light card style */
.profile-intro {
    justify-content: center;
    gap: 0.95rem;
}

.profile-intro .intro {
    color: var(--ink-soft);
    max-width: 62ch;
    font-size: 0.88rem;
    line-height: 1.6;
}

.profile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.profile-row b {
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-right: 0.5rem;
}

/* Works Grid Layout */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-top: 1.4rem;
}

@media (max-width: 1024px) and (min-width: 700px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-grid .masthead {
        grid-column: span 2;
    }

    .bento-grid #works {
        grid-column: span 2;
    }

    .bento-grid #experience {
        grid-column: span 2;
    }

    .bento-grid #education {
        grid-column: span 2;
    }

    .bento-grid #skills {
        grid-column: span 2;
    }

    .bento-grid #research-focus {
        grid-column: span 2;
    }

    .bento-grid #profile {
        grid-column: span 2;
    }
}

@media (max-width: 699px) {
    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
        padding-top: 2rem;
        padding-bottom: 3rem;
    }

    .bento-grid>* {
        grid-column: span 1 !important;
    }

    .masthead {
        padding: 1.6rem 1.6rem !important;
        gap: 1.2rem;
    }

    .masthead h1 {
        font-size: 1.6rem;
        overflow-wrap: anywhere;
    }

    .profile-intro .intro {
        font-size: 0.82rem;
    }

    .works-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Sections ---------- */
section {
    padding: 0;
}

.works-section {
    min-width: 0;
    padding-top: 1.5rem;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.section-head h2 {
    font-family: var(--serif);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--ink-bright);
}

.section-head .kicker {
    margin-left: auto;
}

@media (max-width: 620px) {
    .section-head {
        flex-wrap: wrap;
        gap: 0.35rem 1rem;
    }

    .section-head .kicker {
        width: 100%;
        margin-left: 0;
    }
}

/* ---------- Works ---------- */
.work {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.6);
    padding: 1.3rem 1.4rem;
    display: flex;
    flex-direction: column;
    transition: border-color var(--t), background var(--t), transform var(--t), box-shadow var(--t);
}

.work:hover {
    border-color: var(--line-strong);
    background: var(--bg-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.work .laurel {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-bright);
    margin-bottom: 0.45rem;
}

.work .laurel::before {
    content: '· ';
    color: var(--ink-faint);
}

.work h3 {
    font-family: var(--serif);
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--ink-bright);
}

.work .tools {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0.35rem 0 0.55rem;
}

.work p {
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 0.65rem;
}

.work .links {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
}

.work .links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding: 0.3rem 0;
    background: none;
    border: none;
    border-radius: 0;
    transition: color var(--t);
}

.work .links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1.5px;
    background: var(--ink-bright);
    transition: width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work .links a i {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--ink-faint);
    transition: color var(--t), transform 0.3s ease;
}

.work .links a:hover {
    color: var(--ink-bright);
}

.work .links a:hover::after {
    width: 100%;
}

.work .links a:hover i {
    color: var(--ink-bright);
    transform: translateX(1px);
}

.work .note {
    font-style: italic;
    color: var(--ink-faint);
    font-size: 0.78rem;
}

/* ---------- Timeline (experience / education) ---------- */
.entry {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.2rem 1.4rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.entry:last-child {
    border-bottom: none;
}

.entry .role-t {
    font-family: var(--serif);
    font-weight: 800;
    font-size: 1rem;
    color: var(--ink-bright);
}

.entry .role-t .soft {
    color: var(--ink-faint);
    font-weight: 500;
}

.entry .org {
    color: var(--ink-soft);
    font-size: 0.82rem;
}

.entry .meta {
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    text-align: right;
    white-space: nowrap;
    padding-top: 0.35rem;
}

.entry .desc {
    grid-column: 1 / -1;
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.55;
    margin-top: 0.45rem;
}

#experience .entry {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--line);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
}

#experience .entry:last-child {
    border-bottom: 1px solid var(--line);
}

#education .entry {
    background: var(--mat);
    border: 1px solid var(--line-strong);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
}

#education .entry:last-child {
    border-bottom: 1px solid var(--line-strong);
}

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

    .entry .meta {
        text-align: left;
    }
}

/* ---------- Skills ---------- */

.skill-row {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 0.6rem 2rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
}

.skill-row:last-child {
    border-bottom: none;
}

.skill-row dt {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.skill-row dd {
    color: var(--ink);
    font-size: 0.82rem;
}

@media (max-width: 560px) {
    .skill-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

/* ---------- Footer ---------- */
footer {
    padding: 4rem 0 3rem;
    border-top: 1px solid var(--line);
}

.footer-sig {
    font-family: var(--serif);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--ink-bright);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.6rem;
    margin: 1.2rem 0 1.8rem;
}

.footer-links a,
.footer-links span {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--ink-bright);
}

.footer-qr {
    display: block;
    margin: 0 auto 1.8rem;
    background: #fff;
    border-radius: 4px;
}

.footer-meta {
    text-align: center;
    color: var(--ink-faint);
    font-size: 0.72rem;
    line-height: 1.8;
}

.footer-meta a {
    color: var(--ink-faint);
}
